mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-04 02:30:04 +08:00
cd6ea298f2
* Add incsearch.vim into bundle dir * Fix java neoformat config close #3573 * Use echom instead in pull.vim
39 lines
1.1 KiB
VimL
39 lines
1.1 KiB
VimL
"=============================================================================
|
|
" FILE: autoload/incsearch/over/modules/bulk_input_char.vim
|
|
" AUTHOR: haya14busa
|
|
" License: MIT license
|
|
"=============================================================================
|
|
scriptencoding utf-8
|
|
let s:save_cpo = &cpo
|
|
set cpo&vim
|
|
|
|
" IncsearchBulkInputChar bulk insert characters and avoid updating for each
|
|
" character input. It's useful while execution macro or pasting text clipboard.
|
|
" CAUTION: cannot test getchar(0) with themis.vim
|
|
let s:bulk_input_char = {
|
|
\ 'name': 'IncsearchBulkInputChar'
|
|
\ }
|
|
|
|
function! s:bulk_input_char.on_char_pre(cmdline) abort
|
|
let stack = []
|
|
let c = 1
|
|
while c
|
|
let c = getchar(0)
|
|
if c != 0
|
|
let stack += [nr2char(c)]
|
|
elseif !empty(stack)
|
|
call a:cmdline.set_input_key_stack(stack)
|
|
endif
|
|
endwhile
|
|
endfunction
|
|
|
|
function! incsearch#over#modules#bulk_input_char#make() abort
|
|
return deepcopy(s:bulk_input_char)
|
|
endfunction
|
|
|
|
|
|
let &cpo = s:save_cpo
|
|
unlet s:save_cpo
|
|
" __END__
|
|
" vim: expandtab softtabstop=2 shiftwidth=2 foldmethod=marker
|