diff options
Diffstat (limited to 'autoload/regex_escape.vim')
-rw-r--r-- | autoload/regex_escape.vim | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/autoload/regex_escape.vim b/autoload/regex_escape.vim index 380f48b..6acff6b 100644 --- a/autoload/regex_escape.vim +++ b/autoload/regex_escape.vim @@ -14,7 +14,7 @@ function! regex_escape#Operatorfunc(type) abort " Save the current value of the unnamed register and the current value of " the 'clipboard' and 'selection' options into a dictionary for restoring " after this is all done - let l:save = { + let save = { \ 'register': @@, \ 'clipboard': &clipboard, \ 'selection': &selection @@ -39,15 +39,15 @@ function! regex_escape#Operatorfunc(type) abort " Determine the regex flavor to use; if one is defined for the buffer, use " that; failing that, if one is defined globally in g:regex_escape_flavor, " use that; failing that, just use 'bre' - let l:flavor = get(b:, 'regex_escape_flavor', + let flavor = get(b:, 'regex_escape_flavor', \ get(g:, 'regex_escape_flavor', 'bre')) " Get the corresponding character class - let l:class = s:classes[l:flavor] + let class = s:classes[flavor] " Perform the substitution on the unnamed register's contents, inserting a " backslash before every instance of any character in that class - let @@ = substitute(@@, l:class, '\\&', 'g') + let @@ = substitute(@@, class, '\\&', 'g') " Paste our substituted changes back in over the top of the previously " selected text, by reselecting it before the paste @@ -55,9 +55,9 @@ function! regex_escape#Operatorfunc(type) abort " Restore contents of the unnamed register and the previous values of the " 'clipboard' and 'selection' options. - let @@ = l:save['register'] - let &clipboard = l:save['clipboard'] - let &selection = l:save['selection'] + let @@ = save['register'] + let &clipboard = save['clipboard'] + let &selection = save['selection'] endfunction |