diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-05-24 16:30:03 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-05-24 16:30:03 +1200 |
commit | e7657df12f0514989ae14b32c23b5cd1f70e4aec (patch) | |
tree | 8586867900683b4ecbab43b1b8a39b79cd890941 /autoload/replace_operator.vim | |
parent | Merge branch 'hotfix/v1.0.2' (diff) | |
parent | Bump VERSION (diff) | |
download | vim-replace-operator-e7657df12f0514989ae14b32c23b5cd1f70e4aec.tar.gz vim-replace-operator-e7657df12f0514989ae14b32c23b5cd1f70e4aec.zip |
Merge branch 'release/v1.1.0'v1.1.0
* release/v1.1.0:
Remove unneeded variable scoping
Diffstat (limited to 'autoload/replace_operator.vim')
-rw-r--r-- | autoload/replace_operator.vim | 20 |
1 files changed, 10 insertions, 10 deletions
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 = "`[\<C-V>`]" + let select = "`[\<C-V>`]" 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 |