File tree Expand file tree Collapse file tree 1 file changed +22
-10
lines changed
Expand file tree Collapse file tree 1 file changed +22
-10
lines changed Original file line number Diff line number Diff line change @@ -471,16 +471,28 @@ function! s:SetLines(lines, key) " {{{
471471endfunction " }}}
472472
473473" -- Get characters from user input ------
474- function ! s: GetChar () " {{{
475- let char = getchar ()
476- if char == 27 || char == 3
477- " Escape or <C-c> key pressed
478- redraw
479- call s: Message (' Cancelled' )
480- return ' '
481- endif
482- return nr2char (char)
483- endfunction " }}}
474+ function ! s: GetChar (... ) abort " {{{
475+ let mode = get (a: , 1 , 0 )
476+ while 1
477+ " Workaround for https://github.com/osyo-manga/vital-over/issues/53
478+ try
479+ let char = call (' getchar' , a: 000 )
480+ catch /^Vim:Interrupt$/
481+ let char = 3 " <C-c>
482+ endtry
483+ if char == 27 || char == 3
484+ " Escape or <C-c> key pressed
485+ redraw
486+ call s: Message (' Cancelled' )
487+ return ' '
488+ endif
489+ " Workaround for the <expr> mappings
490+ if string (char) !=# " \x80\xfd `"
491+ return mode == 1 ? ! ! char
492+ \ : type (char) == type (0 ) ? nr2char (char) : char
493+ endif
494+ endwhile
495+ endfunction " }}}
484496
485497" -- Find Motion Helper ------------------
486498function ! s: findMotion (num_strokes, direction) " {{{
You can’t perform that action at this time.
0 commit comments