Modify global variable

Change them to s: from g: or add prefix to them
This commit is contained in:
haya14busa 2013-12-20 18:31:20 +09:00
parent 8a897c58f0
commit ab391daf44

View File

@ -204,14 +204,14 @@ set cpo&vim
let orig_pos = [line('.'), col('.')] let orig_pos = [line('.'), col('.')]
call s:EasyMotion('^\(\w\|\s*\zs\|$\)', 2, '', '', 0, 0, 1) call s:EasyMotion('^\(\w\|\s*\zs\|$\)', 2, '', '', 0, 0, 1)
if g:EasyMotion_cancelled if s:EasyMotion_cancelled
keepjumps call cursor(orig_pos[0], orig_pos[1]) keepjumps call cursor(orig_pos[0], orig_pos[1])
return '' return ''
else else
let pos1 = [line('.'), col('.')] let pos1 = [line('.'), col('.')]
keepjumps call cursor(orig_pos[0], orig_pos[1]) keepjumps call cursor(orig_pos[0], orig_pos[1])
call s:EasyMotion('^\(\w\|\s*\zs\|$\)', 2, '', '', pos1[0], 1, 1) call s:EasyMotion('^\(\w\|\s*\zs\|$\)', 2, '', '', pos1[0], 1, 1)
if g:EasyMotion_cancelled if s:EasyMotion_cancelled
keepjumps call cursor(orig_pos[0], orig_pos[1]) keepjumps call cursor(orig_pos[0], orig_pos[1])
return '' return ''
else else
@ -264,14 +264,14 @@ set cpo&vim
let re = re . escape(chars[0], '.$^~') . '\|' . escape(chars[1], '.$^~') let re = re . escape(chars[0], '.$^~') . '\|' . escape(chars[1], '.$^~')
call s:EasyMotion(re, 2, '', '', 0, 0, 0, 0) call s:EasyMotion(re, 2, '', '', 0, 0, 0, 0)
if g:EasyMotion_cancelled if s:EasyMotion_cancelled
keepjumps call cursor(orig_pos[0], orig_pos[1]) keepjumps call cursor(orig_pos[0], orig_pos[1])
return '' return ''
else else
let pos1 = [line('.'), col('.')] let pos1 = [line('.'), col('.')]
keepjumps call cursor(orig_pos[0], orig_pos[1]) keepjumps call cursor(orig_pos[0], orig_pos[1])
call s:EasyMotion(re, 2, '', '', 0, 0, 0, pos1) call s:EasyMotion(re, 2, '', '', 0, 0, 0, pos1)
if g:EasyMotion_cancelled if s:EasyMotion_cancelled
keepjumps call cursor(orig_pos[0], orig_pos[1]) keepjumps call cursor(orig_pos[0], orig_pos[1])
return '' return ''
else else
@ -772,7 +772,7 @@ endfunction "}}}
" }}} " }}}
" Check if the input char is valid {{{ " Check if the input char is valid {{{
if a:allows_repeat && char == '.' if a:allows_repeat && char == '.'
return g:old_target return g:EasyMotion_old_target
else else
if ! has_key(a:groups, char) if ! has_key(a:groups, char)
throw 'Invalid target' throw 'Invalid target'
@ -979,7 +979,7 @@ endfunction "}}}
" Prompt user for target group/character"{{{ " Prompt user for target group/character"{{{
let coords = s:PromptUser(groups, allows_repeat, fixed_column) let coords = s:PromptUser(groups, allows_repeat, fixed_column)
let g:old_target = coords let g:EasyMotion_old_target = coords
"}}} "}}}
" Update selection {{{ " Update selection {{{
@ -1008,7 +1008,7 @@ endfunction "}}}
call setpos("'e", mark_save) call setpos("'e", mark_save)
call s:Message('Jumping to [' . coords[0] . ', ' . coords[1] . ']') call s:Message('Jumping to [' . coords[0] . ', ' . coords[1] . ']')
let g:EasyMotion_cancelled = 0 let s:EasyMotion_cancelled = 0
"}}} "}}}
catch catch
redraw redraw
@ -1024,7 +1024,7 @@ endfunction "}}}
keepjumps call cursor(orig_pos[0], orig_pos[1]) keepjumps call cursor(orig_pos[0], orig_pos[1])
endif endif
" }}} " }}}
let g:EasyMotion_cancelled = 1 let s:EasyMotion_cancelled = 1
finally finally
" Restore properties {{{ " Restore properties {{{
call s:VarReset('&scrolloff') call s:VarReset('&scrolloff')