Skip to content

Commit

Permalink
fix empty input
Browse files Browse the repository at this point in the history
  • Loading branch information
haya14busa committed Jan 21, 2016
1 parent fc7d1d9 commit fc056f3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
4 changes: 3 additions & 1 deletion autoload/EasyMotion.vim
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ endfunction " }}}
function! EasyMotion#OverwinF(num_strokes) " {{{
let re = s:findMotion(a:num_strokes, s:DIRECTION.bidirection)
call EasyMotion#reset()
return EasyMotion#overwin#move(re)
if re isnot# ''
return EasyMotion#overwin#move(re)
endif
endfunction "}}}
function! EasyMotion#T(num_strokes, visualmode, direction) " {{{
if a:direction == 1
Expand Down
22 changes: 6 additions & 16 deletions autoload/vital/_easymotion/HitAHint/Motion.vim
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ function! s:_vital_loaded(V) abort
let s:Buffer = a:V.import('Vim.Buffer')
let s:Prelude = a:V.import('Prelude')
let s:Set = a:V.import('Data.Set')
let s:Input = a:V.import('Over.Input')
endfunction

function! s:_vital_depends() abort
Expand All @@ -13,6 +14,7 @@ function! s:_vital_depends() abort
\ 'Vim.Buffer',
\ 'Prelude',
\ 'Data.Set',
\ 'Over.Input',
\ ]
endfunction

Expand Down Expand Up @@ -45,16 +47,16 @@ endfunction

function! s:move_f(...) abort
echo 'Target: '
let c = s:getchar()
let c = s:Input.getchar()
return s:move(c, get(a:, 1, {}))
endfunction

function! s:move_f2() abort
echo 'Target: '
let c = s:getchar()
let c = s:Input.getchar()
redraw
echo 'Target: ' . c
let c2 = s:getchar()
let c2 = s:Input.getchar()
return s:move(s:Prelude.escape_pattern(c . c2), get(a:, 1, {}))
endfunction

Expand Down Expand Up @@ -219,7 +221,7 @@ function! s:overwin.choose_prompt(hint_dict) abort
call hinter.show_hint()
redraw
echo 'Target key: '
let c = s:getchar()
let c = s:Input.getchar()
if self.config.use_upper
let c = toupper(c)
endif
Expand Down Expand Up @@ -734,18 +736,6 @@ function! s:is_in_fold(lnum) abort
return foldclosed(a:lnum) != -1
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 {arglist} list<S>
" @param {dict?} dict for :h call()
Expand Down

0 comments on commit fc056f3

Please sign in to comment.