diff --git a/autoload/EasyMotion/command_line.vim b/autoload/EasyMotion/command_line.vim index e0a24d9..46a2c88 100644 --- a/autoload/EasyMotion/command_line.vim +++ b/autoload/EasyMotion/command_line.vim @@ -1,7 +1,7 @@ "============================================================================= " FILE: autoload/EasyMotion/command_line.vim " AUTHOR: haya14busa -" Last Change: 14 Jan 2014. +" Last Change: 17 Jan 2014. " License: MIT license {{{ " Permission is hereby granted, free of charge, to any person obtaining " a copy of this software and associated documentation files (the @@ -42,12 +42,12 @@ endfunction " }}} function! EasyMotion#command_line#GetInput(num_strokes, ...) "{{{ let previous_input = a:0 == 1 ? a:1 : '' - let input = '' " repeat a:num_strokes times - let prompt_num = a:num_strokes < 50 ? a:num_strokes : '' + let prompt_num = a:num_strokes != -1 ? a:num_strokes : '' let prompt = prompt_num . g:EasyMotion_prompt - while EasyMotion#helper#strchars(input) < a:num_strokes + while EasyMotion#helper#strchars(input) < a:num_strokes || + \ a:num_strokes == -1 if g:EasyMotion_show_prompt call s:InputPrompt(prompt, input) endif diff --git a/plugin/EasyMotion.vim b/plugin/EasyMotion.vim index 5fd3e40..83b507e 100644 --- a/plugin/EasyMotion.vim +++ b/plugin/EasyMotion.vim @@ -139,16 +139,16 @@ call s:find_motion_map_helper({ \ 'tl2' : {'fnc': 'TL', 'cnt': 2, 'direction': 0}, \ 'Tl2' : {'fnc': 'TL', 'cnt': 2, 'direction': 1}, \ - \ 'fn' : {'fnc': 'S' , 'cnt': 50, 'direction': 0}, - \ 'Fn' : {'fnc': 'S' , 'cnt': 50, 'direction': 1}, - \ 'sn' : {'fnc': 'S' , 'cnt': 50, 'direction': 2}, - \ 'tn' : {'fnc': 'T' , 'cnt': 50, 'direction': 0}, - \ 'Tn' : {'fnc': 'T' , 'cnt': 50, 'direction': 1}, - \ 'fln' : {'fnc': 'SL', 'cnt': 50, 'direction': 0}, - \ 'Fln' : {'fnc': 'SL', 'cnt': 50, 'direction': 1}, - \ 'sln' : {'fnc': 'SL', 'cnt': 50, 'direction': 2}, - \ 'tln' : {'fnc': 'TL', 'cnt': 50, 'direction': 0}, - \ 'Tln' : {'fnc': 'TL', 'cnt': 50, 'direction': 1}, + \ 'fn' : {'fnc': 'S' , 'cnt': -1, 'direction': 0}, + \ 'Fn' : {'fnc': 'S' , 'cnt': -1, 'direction': 1}, + \ 'sn' : {'fnc': 'S' , 'cnt': -1, 'direction': 2}, + \ 'tn' : {'fnc': 'T' , 'cnt': -1, 'direction': 0}, + \ 'Tn' : {'fnc': 'T' , 'cnt': -1, 'direction': 1}, + \ 'fln' : {'fnc': 'SL', 'cnt': -1, 'direction': 0}, + \ 'Fln' : {'fnc': 'SL', 'cnt': -1, 'direction': 1}, + \ 'sln' : {'fnc': 'SL', 'cnt': -1, 'direction': 2}, + \ 'tln' : {'fnc': 'TL', 'cnt': -1, 'direction': 0}, + \ 'Tln' : {'fnc': 'TL', 'cnt': -1, 'direction': 1}, \ }) "}}} diff --git a/t/easymotion_spec.vim b/t/easymotion_spec.vim index d14f3d1..3069394 100644 --- a/t/easymotion_spec.vim +++ b/t/easymotion_spec.vim @@ -122,45 +122,45 @@ describe 'Default settings' " Multi Char Find Motion: {{{ " sn - Expect maparg('(easymotion-sn)', 'n') ==# ':call EasyMotion#S(50,0,2)' - Expect maparg('(easymotion-sn)', 'o') ==# ':call EasyMotion#S(50,0,2)' - Expect maparg('(easymotion-sn)', 'v') ==# ':call EasyMotion#S(50,1,2)' + Expect maparg('(easymotion-sn)', 'n') ==# ':call EasyMotion#S(-1,0,2)' + Expect maparg('(easymotion-sn)', 'o') ==# ':call EasyMotion#S(-1,0,2)' + Expect maparg('(easymotion-sn)', 'v') ==# ':call EasyMotion#S(-1,1,2)' " fn - Expect maparg('(easymotion-fn)', 'n') ==# ':call EasyMotion#S(50,0,0)' - Expect maparg('(easymotion-fn)', 'o') ==# ':call EasyMotion#S(50,0,0)' - Expect maparg('(easymotion-fn)', 'v') ==# ':call EasyMotion#S(50,1,0)' + Expect maparg('(easymotion-fn)', 'n') ==# ':call EasyMotion#S(-1,0,0)' + Expect maparg('(easymotion-fn)', 'o') ==# ':call EasyMotion#S(-1,0,0)' + Expect maparg('(easymotion-fn)', 'v') ==# ':call EasyMotion#S(-1,1,0)' " Fn - Expect maparg('(easymotion-Fn)', 'n') ==# ':call EasyMotion#S(50,0,1)' - Expect maparg('(easymotion-Fn)', 'o') ==# ':call EasyMotion#S(50,0,1)' - Expect maparg('(easymotion-Fn)', 'v') ==# ':call EasyMotion#S(50,1,1)' + Expect maparg('(easymotion-Fn)', 'n') ==# ':call EasyMotion#S(-1,0,1)' + Expect maparg('(easymotion-Fn)', 'o') ==# ':call EasyMotion#S(-1,0,1)' + Expect maparg('(easymotion-Fn)', 'v') ==# ':call EasyMotion#S(-1,1,1)' " tn - Expect maparg('(easymotion-tn)', 'n') ==# ':call EasyMotion#T(50,0,0)' - Expect maparg('(easymotion-tn)', 'o') ==# ':call EasyMotion#T(50,0,0)' - Expect maparg('(easymotion-tn)', 'v') ==# ':call EasyMotion#T(50,1,0)' + Expect maparg('(easymotion-tn)', 'n') ==# ':call EasyMotion#T(-1,0,0)' + Expect maparg('(easymotion-tn)', 'o') ==# ':call EasyMotion#T(-1,0,0)' + Expect maparg('(easymotion-tn)', 'v') ==# ':call EasyMotion#T(-1,1,0)' " Tn - Expect maparg('(easymotion-Tn)', 'n') ==# ':call EasyMotion#T(50,0,1)' - Expect maparg('(easymotion-Tn)', 'o') ==# ':call EasyMotion#T(50,0,1)' - Expect maparg('(easymotion-Tn)', 'v') ==# ':call EasyMotion#T(50,1,1)' + Expect maparg('(easymotion-Tn)', 'n') ==# ':call EasyMotion#T(-1,0,1)' + Expect maparg('(easymotion-Tn)', 'o') ==# ':call EasyMotion#T(-1,0,1)' + Expect maparg('(easymotion-Tn)', 'v') ==# ':call EasyMotion#T(-1,1,1)' " sln - Expect maparg('(easymotion-sln)', 'n') ==# ':call EasyMotion#SL(50,0,2)' - Expect maparg('(easymotion-sln)', 'o') ==# ':call EasyMotion#SL(50,0,2)' - Expect maparg('(easymotion-sln)', 'v') ==# ':call EasyMotion#SL(50,1,2)' + Expect maparg('(easymotion-sln)', 'n') ==# ':call EasyMotion#SL(-1,0,2)' + Expect maparg('(easymotion-sln)', 'o') ==# ':call EasyMotion#SL(-1,0,2)' + Expect maparg('(easymotion-sln)', 'v') ==# ':call EasyMotion#SL(-1,1,2)' " fln - Expect maparg('(easymotion-fln)', 'n') ==# ':call EasyMotion#SL(50,0,0)' - Expect maparg('(easymotion-fln)', 'o') ==# ':call EasyMotion#SL(50,0,0)' - Expect maparg('(easymotion-fln)', 'v') ==# ':call EasyMotion#SL(50,1,0)' + Expect maparg('(easymotion-fln)', 'n') ==# ':call EasyMotion#SL(-1,0,0)' + Expect maparg('(easymotion-fln)', 'o') ==# ':call EasyMotion#SL(-1,0,0)' + Expect maparg('(easymotion-fln)', 'v') ==# ':call EasyMotion#SL(-1,1,0)' " Fln - Expect maparg('(easymotion-Fln)', 'n') ==# ':call EasyMotion#SL(50,0,1)' - Expect maparg('(easymotion-Fln)', 'o') ==# ':call EasyMotion#SL(50,0,1)' - Expect maparg('(easymotion-Fln)', 'v') ==# ':call EasyMotion#SL(50,1,1)' + Expect maparg('(easymotion-Fln)', 'n') ==# ':call EasyMotion#SL(-1,0,1)' + Expect maparg('(easymotion-Fln)', 'o') ==# ':call EasyMotion#SL(-1,0,1)' + Expect maparg('(easymotion-Fln)', 'v') ==# ':call EasyMotion#SL(-1,1,1)' " tln - Expect maparg('(easymotion-tln)', 'n') ==# ':call EasyMotion#TL(50,0,0)' - Expect maparg('(easymotion-tln)', 'o') ==# ':call EasyMotion#TL(50,0,0)' - Expect maparg('(easymotion-tln)', 'v') ==# ':call EasyMotion#TL(50,1,0)' + Expect maparg('(easymotion-tln)', 'n') ==# ':call EasyMotion#TL(-1,0,0)' + Expect maparg('(easymotion-tln)', 'o') ==# ':call EasyMotion#TL(-1,0,0)' + Expect maparg('(easymotion-tln)', 'v') ==# ':call EasyMotion#TL(-1,1,0)' " Tln - Expect maparg('(easymotion-Tln)', 'n') ==# ':call EasyMotion#TL(50,0,1)' - Expect maparg('(easymotion-Tln)', 'o') ==# ':call EasyMotion#TL(50,0,1)' - Expect maparg('(easymotion-Tln)', 'v') ==# ':call EasyMotion#TL(50,1,1)' + Expect maparg('(easymotion-Tln)', 'n') ==# ':call EasyMotion#TL(-1,0,1)' + Expect maparg('(easymotion-Tln)', 'o') ==# ':call EasyMotion#TL(-1,0,1)' + Expect maparg('(easymotion-Tln)', 'v') ==# ':call EasyMotion#TL(-1,1,1)' "}}} end