Hirohito Higashi wrote:

> Hi Bram and list,
> 
> I add a special key name "\<CursorHold>" for  K_CURSORHOLD.
> 
> How to reproduce:
> - Create ~/test.vim of the contents of the following.
> augroup hogehoge
>     autocmd!
>     autocmd CursorHold,CursorHoldI,WinEnter * setlocal cursorline
> augroup END
> function! s:foo()
>     echomsg getchar()
>     return ''
> endfunction
> nnoremap <expr>f <SID>foo()
> 
> - Start Vim.
> $ vim -N -u ~/test.vim
> 
> - Into Insertmode and Escape. (Do not reproduce and do not do this)
> i<Esc>
> 
> - push f key and wait a few seconds.
> 
> 
> Actual behavior:
> Display "<80><fd>`" at command line.
> 
> Investigation result:
> - "<80><fd>`" (0x80 0xfd 0x60) is a special key K_CURSORHOLD.
> - But can't reference this in vim script such like "\<Left>".
> - I want to add a special key name "\<CursorHold>" for  K_CURSORHOLD.
> 
> 
> Patch included Vim and below script works fine. 
> -------- ~/test.vim --------
> augroup hogehoge
>     autocmd!
>     autocmd CursorHold,CursorHoldI,WinEnter * setlocal cursorline
> augroup END
> 
> function! s:foo()
>     let c = 0
>     while c == "\<CursorHold>"
>         let c = getchar()
>     endwhile
>     echomsg c
>     return ''
> endfunction
> 
> nnoremap <expr>f <SID>foo()
> ----------------
> 
> Attached a patch. Please include this.

Thanks, I'll add it in the todo list.

-- 
hundred-and-one symptoms of being an internet addict:
21. Your dog has its own home page.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" 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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui