Fix #237
This commit is contained in:
parent
d00540912c
commit
799491e007
@ -471,16 +471,28 @@ function! s:SetLines(lines, key) " {{{
|
||||
endfunction " }}}
|
||||
|
||||
" -- Get characters from user input ------
|
||||
function! s:GetChar() " {{{
|
||||
let char = getchar()
|
||||
if char == 27 || char == 3
|
||||
" Escape or <C-c> key pressed
|
||||
redraw
|
||||
call s:Message('Cancelled')
|
||||
return ''
|
||||
endif
|
||||
return nr2char(char)
|
||||
endfunction " }}}
|
||||
function! s:GetChar(...) abort "{{{
|
||||
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
|
||||
if char == 27 || char == 3
|
||||
" Escape or <C-c> key pressed
|
||||
redraw
|
||||
call s:Message('Cancelled')
|
||||
return ''
|
||||
endif
|
||||
" Workaround for the <expr> mappings
|
||||
if string(char) !=# "\x80\xfd`"
|
||||
return mode == 1 ? !!char
|
||||
\ : type(char) == type(0) ? nr2char(char) : char
|
||||
endif
|
||||
endwhile
|
||||
endfunction "}}}
|
||||
|
||||
" -- Find Motion Helper ------------------
|
||||
function! s:findMotion(num_strokes, direction) "{{{
|
||||
|
Loading…
Reference in New Issue
Block a user