From 3c1a73c62f97ff01deb8c7f63ae60c82f04e2ccd Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 24 May 2019 16:23:49 +1200 Subject: Remove unneeded variable scoping --- autoload/replace_operator.vim | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'autoload/replace_operator.vim') diff --git a/autoload/replace_operator.vim b/autoload/replace_operator.vim index 6b8ce96..7d73b5e 100644 --- a/autoload/replace_operator.vim +++ b/autoload/replace_operator.vim @@ -4,7 +4,7 @@ function! replace_operator#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 = { \ 'unnamed': @@, \ 'clipboard': &clipboard, \ 'selection': &selection @@ -19,27 +19,27 @@ function! replace_operator#Operatorfunc(type) abort " Build normal mode keystrokes to select the operated text in visual mode if a:type ==# 'line' - let l:select = '''[V'']' + let select = '''[V'']' elseif a:type ==# 'block' - let l:select = "`[\`]" + let select = "`[\`]" else - let l:select = '`[v`]' + let select = '`[v`]' endif " Build normal mode keystrokes to paste from the selected register; only add " a register prefix if it's not the default unnamed register, because Vim " before 7.4 gets ""p wrong in visual mode - let l:paste = 'p' + let paste = 'p' if s:register !=# '"' - let l:paste = '"'.s:register.l:paste + let paste = '"'.s:register.paste endif - silent execute 'normal! '.l:select.l:paste + silent execute 'normal! '.select.paste " Restore contents of the unnamed register and the previous values of the " 'clipboard' and 'selection' options - let @@ = l:save['unnamed'] - let &clipboard = l:save['clipboard'] - let &selection = l:save['selection'] + let @@ = save['unnamed'] + let &clipboard = save['clipboard'] + let &selection = save['selection'] endfunction -- cgit v1.2.3