@@ -4,6 +4,7 @@ function! s:_vital_loaded(V) abort
44 let s: Buffer = a: V .import (' Vim.Buffer' )
55 let s: Prelude = a: V .import (' Prelude' )
66 let s: Set = a: V .import (' Data.Set' )
7+ let s: Input = a: V .import (' Over.Input' )
78endfunction
89
910function ! s: _vital_depends () abort
@@ -13,6 +14,7 @@ function! s:_vital_depends() abort
1314 \ ' Vim.Buffer' ,
1415 \ ' Prelude' ,
1516 \ ' Data.Set' ,
17+ \ ' Over.Input' ,
1618 \ ]
1719endfunction
1820
@@ -45,16 +47,16 @@ endfunction
4547
4648function ! s: move_f (... ) abort
4749 echo ' Target: '
48- let c = s: getchar ()
50+ let c = s: Input . getchar ()
4951 return s: move (c , get (a: , 1 , {}))
5052endfunction
5153
5254function ! s: move_f2 () abort
5355 echo ' Target: '
54- let c = s: getchar ()
56+ let c = s: Input . getchar ()
5557 redraw
5658 echo ' Target: ' . c
57- let c2 = s: getchar ()
59+ let c2 = s: Input . getchar ()
5860 return s: move (s: Prelude .escape_pattern (c . c2), get (a: , 1 , {}))
5961endfunction
6062
@@ -219,7 +221,7 @@ function! s:overwin.choose_prompt(hint_dict) abort
219221 call hinter.show_hint ()
220222 redraw
221223 echo ' Target key: '
222- let c = s: getchar ()
224+ let c = s: Input . getchar ()
223225 if self .config.use_upper
224226 let c = toupper (c )
225227 endif
@@ -734,18 +736,6 @@ function! s:is_in_fold(lnum) abort
734736 return foldclosed (a: lnum ) != -1
735737endfunction
736738
737- function ! s: getchar (... ) abort
738- let mode = get (a: , 1 , 0 )
739- while 1
740- let char = call (' getchar' , a: 000 )
741- " Workaround for the <expr> mappings
742- if string (char) !~# " \x80\xfd `"
743- return mode == 1 ? ! ! char
744- \ : type (char) == type (0 ) ? nr2char (char) : char
745- endif
746- endwhile
747- endfunction
748-
749739" @param {funcref} func
750740" @param {arglist} list<S>
751741" @param {dict?} dict for :h call()
0 commit comments