Eric Arnold wrote:

> Here is the test example:
> 
> 
> map <expr> ,tt Tst()
> 
> function! Tst()
>       "exe "normal! :   <CR>"
> 
>       while getchar(1) < 1
>               sleep 100ms
>       endwhile
> 
>       echomsg "Done!"
> endfunction
> 
> 
> 
> It never sees input without the
> 
>       exe "normal! :   <CR>"
> 
> As you might guess, it took me forever to find a workaround.  Anybody know
> about this?

The evaluation of the map expression is done inside the function that
gets a character from the user and takes care of applying mappings.
That function is protected from being called recursively, thus getchar()
doesn't work.

That the use of a normal command makes it work is a bug.  Instead of
incrementing/decrementing a counter for recursive use of the function a
true/false flag is used.  I'll fix that.  Your function with the
workaround will stop working then.

I'll see if I can make it work.

-- 
hundred-and-one symptoms of being an internet addict:
17. You turn on your intercom when leaving the room so you can hear if new
    e-mail arrives.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://www.ICCF.nl         ///

Reply via email to