haya14busa 2016-01-21 18:55:22 +09:00
parent fc7d1d9a5d
commit fc056f37fd
2 changed files with 9 additions and 17 deletions

View File

@ -141,7 +141,9 @@ endfunction " }}}
function! EasyMotion#OverwinF(num_strokes) " {{{ function! EasyMotion#OverwinF(num_strokes) " {{{
let re = s:findMotion(a:num_strokes, s:DIRECTION.bidirection) let re = s:findMotion(a:num_strokes, s:DIRECTION.bidirection)
call EasyMotion#reset() call EasyMotion#reset()
return EasyMotion#overwin#move(re) if re isnot# ''
return EasyMotion#overwin#move(re)
endif
endfunction "}}} endfunction "}}}
function! EasyMotion#T(num_strokes, visualmode, direction) " {{{ function! EasyMotion#T(num_strokes, visualmode, direction) " {{{
if a:direction == 1 if a:direction == 1

View File

@ -4,6 +4,7 @@ function! s:_vital_loaded(V) abort
let s:Buffer = a:V.import('Vim.Buffer') let s:Buffer = a:V.import('Vim.Buffer')
let s:Prelude = a:V.import('Prelude') let s:Prelude = a:V.import('Prelude')
let s:Set = a:V.import('Data.Set') let s:Set = a:V.import('Data.Set')
let s:Input = a:V.import('Over.Input')
endfunction endfunction
function! s:_vital_depends() abort function! s:_vital_depends() abort
@ -13,6 +14,7 @@ function! s:_vital_depends() abort
\ 'Vim.Buffer', \ 'Vim.Buffer',
\ 'Prelude', \ 'Prelude',
\ 'Data.Set', \ 'Data.Set',
\ 'Over.Input',
\ ] \ ]
endfunction endfunction
@ -45,16 +47,16 @@ endfunction
function! s:move_f(...) abort function! s:move_f(...) abort
echo 'Target: ' echo 'Target: '
let c = s:getchar() let c = s:Input.getchar()
return s:move(c, get(a:, 1, {})) return s:move(c, get(a:, 1, {}))
endfunction endfunction
function! s:move_f2() abort function! s:move_f2() abort
echo 'Target: ' echo 'Target: '
let c = s:getchar() let c = s:Input.getchar()
redraw redraw
echo 'Target: ' . c echo 'Target: ' . c
let c2 = s:getchar() let c2 = s:Input.getchar()
return s:move(s:Prelude.escape_pattern(c . c2), get(a:, 1, {})) return s:move(s:Prelude.escape_pattern(c . c2), get(a:, 1, {}))
endfunction endfunction
@ -219,7 +221,7 @@ function! s:overwin.choose_prompt(hint_dict) abort
call hinter.show_hint() call hinter.show_hint()
redraw redraw
echo 'Target key: ' echo 'Target key: '
let c = s:getchar() let c = s:Input.getchar()
if self.config.use_upper if self.config.use_upper
let c = toupper(c) let c = toupper(c)
endif endif
@ -734,18 +736,6 @@ function! s:is_in_fold(lnum) abort
return foldclosed(a:lnum) != -1 return foldclosed(a:lnum) != -1
endfunction endfunction
function! s:getchar(...) abort
let mode = get(a:, 1, 0)
while 1
let char = call('getchar', a:000)
" Workaround for the <expr> mappings
if string(char) !~# "\x80\xfd`"
return mode == 1 ? !!char
\ : type(char) == type(0) ? nr2char(char) : char
endif
endwhile
endfunction
" @param {funcref} func " @param {funcref} func
" @param {arglist} list<S> " @param {arglist} list<S>
" @param {dict?} dict for :h call() " @param {dict?} dict for :h call()