Hi Bram, 2014/8/11(Mon) 1:13:05 UTC+9 Bram Moolenaar: > 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. Thanks.
BTW, Why getchar() catch up K_CURSORHOLD only in specify <expr>? What difference of NORMAL state and NORMAL_BUSY state? -- Best regards, Hirohito Higashi -- -- 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.
