vim-easymotion/autoload/vital/_easymotion/Over/Input.vim
2016-03-22 21:55:42 +09:00

52 lines
1.4 KiB
VimL

scriptencoding utf-8
let s:save_cpo = &cpo
set cpo&vim
function! s:getchar(...)
let mode = get(a:, 1, 0)
while 1
" Workaround for https://github.com/osyo-manga/vital-over/issues/53
try
let char = call("getchar", a:000)
catch /^Vim:Interrupt$/
let char = 3 " <C-c>
endtry
" Workaround for the <expr> mappings
if string(char) !=# "\x80\xfd`"
return mode == 1 ? !!char
\ : type(char) == type(0) ? nr2char(char) : char
endif
endwhile
endfunction
let &cpo = s:save_cpo
unlet s:save_cpo
" ___Revitalizer___
" NOTE: below code is generated by :Revitalize.
" Do not mofidify the code nor append new lines
if v:version > 703 || v:version == 703 && has('patch1170')
function! s:___revitalizer_function___(fstr) abort
return function(a:fstr)
endfunction
else
function! s:___revitalizer_SID() abort
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze____revitalizer_SID$')
endfunction
let s:___revitalizer_sid = '<SNR>' . s:___revitalizer_SID() . '_'
function! s:___revitalizer_function___(fstr) abort
return function(substitute(a:fstr, 's:', s:___revitalizer_sid, 'g'))
endfunction
endif
let s:___revitalizer_functions___ = {'getchar': s:___revitalizer_function___('s:getchar')}
unlet! s:___revitalizer_sid
delfunction s:___revitalizer_function___
function! vital#_easymotion#Over#Input#import() abort
return s:___revitalizer_functions___
endfunction
" ___Revitalizer___