On 5/14/06, Jared <[EMAIL PROTECTED]> wrote:
On 5/14/2006 1:37 AM, Gerald Lai wrote:
> On Sun, 14 May 2006, Yakov Lerner wrote:
>> Try 2 things
>> (1) add :redraw before the :echo in question
>> (2) if that doesn't help, make message shorter.
>> I noticed that if message is longer than screen width-15,
>> it cases the prompt.
>
> You could also readjust the height of the command-line dynamically:
>
>   let msg = "str"
>   let len = strlen(substitute(msg, ".", "x", "g"))
>   let t_ch = &cmdheight
>   let &cmdheight = len / (&columns - 15) + 1
>   echo msg
>   let &cmdheight = t_ch
>
> See ":help 'cmdheight'" & ":help strlen()".


I tried adding :redraw, but that didn't seem to work.  As for making the
message shorter or the changing the height, I don't think those are
applicable.  The line is not longer than the window width.  In fact, this is
the function:

function Toggle_spell()
   if &spell
      exec "set nospell"
   else
      exec "set spell"
      echo "]s to skip to word, zg to add word, z= to suggest word"
   endif
endfunction
nmap <C-s> :call Toggle_spell()<CR>

I just want to display a message in the status reminding me of the commands
when I enable the spell checker.

Doesn't cause "Hit Enter" prompt for me.
In any case, try to add <silent> to your nmap:

nmap <silent><C-s> :call Toggle_spell()<CR>

Yakov

Reply via email to