Monday, June 11, 2012

Re: Clearing the status bar or messages

On Tue, June 12, 2012 03:42, David Fishburn wrote:
> Vim 7.3.514, Windows 7
>
> With a status cmdheight of 1, if you do the following, you get the
> dreaded "hit enter" prompt.
>
> :echo 'a' | echo 'b'
>
> a
> b
> Press ENTER or type command to continue
>
> This is happening in one of my plugins, I am prompting the user for
> input and using getchar().
> Then I show them the value they typed in.
>
> So,
> let msg = "Choose a letter:"
> echomsg msg
> let c = getchar()
> let c = nr2char(c)
> echomsg msg.c
>
> I will want to display their selection, but with the "Choose a letter:"
> displayed, I would simply like to add a new line to the output, rather
> than causing a new line to be displayed leading to the "hit enter" prompt.
>
> Is there anyway I can clear the prompt, to prevent this?

I think, this should work:
let msg = "Choose a letter:"
echon msg
let c = getchar()
let c = nr2char(c)
echon c

The drawback is, the message is then not saved in the message history
and I don't know any other way besides using echomsg.

regards,
Christian

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: