Remove local prefix 'l:' from let assignments.

This commit is contained in:
YggdrasiI 2016-02-09 20:08:00 +01:00
parent d9c33fdd32
commit fccf990d42
2 changed files with 23 additions and 23 deletions

View File

@ -181,8 +181,8 @@ function! EasyMotion#WB(visualmode, direction) " {{{
endfunction " }}} endfunction " }}}
function! EasyMotion#WBW(visualmode, direction) " {{{ function! EasyMotion#WBW(visualmode, direction) " {{{
let s:current.is_operator = mode(1) ==# 'no' ? 1: 0 let s:current.is_operator = mode(1) ==# 'no' ? 1: 0
let l:regex_without_file_ends = '\v(^|\s)\zs\S|^$' let regex_without_file_ends = '\v(^|\s)\zs\S|^$'
let l:regex = l:regex_without_file_ends let regex = l:regex_without_file_ends
\ . (a:direction == 1 ? '' : '|%$') \ . (a:direction == 1 ? '' : '|%$')
\ . (a:direction == 0 ? '' : '|%^') \ . (a:direction == 0 ? '' : '|%^')
call s:EasyMotion(l:regex, a:direction, a:visualmode ? visualmode() : '', 0) call s:EasyMotion(l:regex, a:direction, a:visualmode ? visualmode() : '', 0)
@ -191,8 +191,8 @@ endfunction " }}}
function! EasyMotion#WBK(visualmode, direction) " {{{ function! EasyMotion#WBK(visualmode, direction) " {{{
" vim's iskeyword style word motion " vim's iskeyword style word motion
let s:current.is_operator = mode(1) ==# 'no' ? 1: 0 let s:current.is_operator = mode(1) ==# 'no' ? 1: 0
let l:regex_without_file_ends = '\v<|^\S|\s\zs\S|>\zs\S|^$' let regex_without_file_ends = '\v<|^\S|\s\zs\S|>\zs\S|^$'
let l:regex = l:regex_without_file_ends let regex = l:regex_without_file_ends
\ . (a:direction == 1 ? '' : '|%$') \ . (a:direction == 1 ? '' : '|%$')
\ . (a:direction == 0 ? '' : '|%^') \ . (a:direction == 0 ? '' : '|%^')
call s:EasyMotion(l:regex, a:direction, a:visualmode ? visualmode() : '', 0) call s:EasyMotion(l:regex, a:direction, a:visualmode ? visualmode() : '', 0)
@ -210,8 +210,8 @@ function! EasyMotion#EW(visualmode, direction) " {{{
" Note: The stopping positions for 'E' and 'gE' differs. Thus, the regex " Note: The stopping positions for 'E' and 'gE' differs. Thus, the regex
" for direction==2 cannot be the same in both directions. This will be " for direction==2 cannot be the same in both directions. This will be
" ignored. " ignored.
let l:regex_stub = '\v\S(\s|$)' let regex_stub = '\v\S(\s|$)'
let l:regex = l:regex_stub let regex = l:regex_stub
\ . (a:direction == 0 ? '' : '|^$|%^') \ . (a:direction == 0 ? '' : '|^$|%^')
\ . (a:direction == 1 ? '' : '|%$') \ . (a:direction == 1 ? '' : '|%$')
call s:EasyMotion(l:regex, a:direction, a:visualmode ? visualmode() : '', 0) call s:EasyMotion(l:regex, a:direction, a:visualmode ? visualmode() : '', 0)
@ -224,8 +224,8 @@ function! EasyMotion#EK(visualmode, direction) " {{{
" Note: The stopping positions for 'e' and 'ge' differs. Thus, the regex " Note: The stopping positions for 'e' and 'ge' differs. Thus, the regex
" for direction==2 cannot be the same in both directions. This will be " for direction==2 cannot be the same in both directions. This will be
" ignored. " ignored.
let l:regex_stub = '\v.\ze>|\S\ze\s*$|\S\ze\s|\k\zs>\S\ze|\S<' let regex_stub = '\v.\ze>|\S\ze\s*$|\S\ze\s|\k\zs>\S\ze|\S<'
let l:regex = l:regex_stub let regex = l:regex_stub
\ . (a:direction == 0 ? '' : '|^$|%^') \ . (a:direction == 0 ? '' : '|^$|%^')
\ . (a:direction == 1 ? '' : '|%$') \ . (a:direction == 1 ? '' : '|%$')
call s:EasyMotion(l:regex, a:direction, a:visualmode ? visualmode() : '', 0) call s:EasyMotion(l:regex, a:direction, a:visualmode ? visualmode() : '', 0)

View File

@ -69,10 +69,10 @@ function! s:to_cursor.failure_message_for_should(actual, expected)
Expect a:actual[1] > 0 Expect a:actual[1] > 0
Expect a:expected[1] > 0 Expect a:expected[1] > 0
let l:line1 = getline(a:actual[0]) let line1 = getline(a:actual[0])
let l:line2 = getline(a:expected[0]) let line2 = getline(a:expected[0])
" Change char on cursor to '█'. " Change char on cursor to '█'.
let l:line1 = strpart(l:line1, 0, a:actual[1]-1) let line1 = strpart(l:line1, 0, a:actual[1]-1)
\ . '█' \ . '█'
\ . strpart(l:line1, a:actual[1]) \ . strpart(l:line1, a:actual[1])
let line2 = strpart(l:line2, 0, a:expected[1]-1) let line2 = strpart(l:line2, 0, a:expected[1]-1)
@ -80,13 +80,13 @@ function! s:to_cursor.failure_message_for_should(actual, expected)
\ . strpart(l:line2, a:expected[1]) \ . strpart(l:line2, a:expected[1])
" Separation of both cases with \n would be nice, but " Separation of both cases with \n would be nice, but
" vim-vspec allow oneliners as return string, only. " vim-vspec allow oneliners as return string, only.
let l:msg = 'Line ' . string(a:actual[0]) . ": '" . l:line1 let msg = 'Line ' . string(a:actual[0]) . ": '" . l:line1
\ . "',\x09\x09 Line " . string(a:expected[0]) . ": '" . l:line2 . "'\x0a" \ . "',\x09\x09 Line " . string(a:expected[0]) . ": '" . l:line2 . "'\x0a"
return l:msg return l:msg
endfunction endfunction
function! CompareMovements(movement1, movement2, backward) function! CompareMovements(movement1, movement2, backward)
let l:jumpmarks = [ let jumpmarks = [
\ [a:movement1, []], \ [a:movement1, []],
\ [a:movement2, []], \ [a:movement2, []],
\ ] \ ]
@ -94,27 +94,27 @@ function! CompareMovements(movement1, movement2, backward)
" Loop through current buffer in both variants {{ " Loop through current buffer in both variants {{
for [l:handler, l:list] in l:jumpmarks for [l:handler, l:list] in l:jumpmarks
if a:backward == 1 if a:backward == 1
let l:last_line = line('$') let last_line = line('$')
let l:last_char = len(getline(l:last_line)) let last_char = len(getline(l:last_line))
call cursor(l:last_line, l:last_char) call cursor(l:last_line, l:last_char)
else else
call cursor([1,1]) call cursor([1,1])
endif endif
let l:lastpos = [0,0] let lastpos = [0,0]
" Centralize line. Otherwise, Easymotion functions aborts " Centralize line. Otherwise, Easymotion functions aborts
" at the end of the (virtual) window. " at the end of the (virtual) window.
call TryNormal('zz') call TryNormal('zz')
call TryNormal(l:handler) call TryNormal(l:handler)
let l:curpos = getpos(".")[1:2] let curpos = getpos(".")[1:2]
while l:lastpos != l:curpos while l:lastpos != l:curpos
let l:list += [l:curpos] let list += [l:curpos]
let l:lastpos = l:curpos let lastpos = l:curpos
call TryNormal('zz') call TryNormal('zz')
call TryNormal(l:handler) call TryNormal(l:handler)
let l:curpos = getpos(".")[1:2] let curpos = getpos(".")[1:2]
" Abort after a fixed number of steps. " Abort after a fixed number of steps.
if len(l:list) > s:maximal_number_of_compared_movments if len(l:list) > s:maximal_number_of_compared_movments
break break
@ -131,11 +131,11 @@ function! CompareMovements(movement1, movement2, backward)
endif endif
" Search for first unmatching position. {{ " Search for first unmatching position. {{
let l:index = 0 let index = 0
let l:len = min([len(l:cursor_positions2), len(l:cursor_positions1)]) let len = min([len(l:cursor_positions2), len(l:cursor_positions1)])
while l:index < l:len while l:index < l:len
Expect l:cursor_positions2[l:index] to_cursor l:cursor_positions1[l:index] Expect l:cursor_positions2[l:index] to_cursor l:cursor_positions1[l:index]
let l:index += 1 let index += 1
endwhile endwhile
" Collision with begin or end of file or while loop aborts to early. " Collision with begin or end of file or while loop aborts to early.