aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-24 16:23:49 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-24 16:23:49 +1200
commit3c1a73c62f97ff01deb8c7f63ae60c82f04e2ccd (patch)
treec60b33403ebe0b94f1703f1a5e954241b4a7052a
parentMerge branch 'hotfix/v1.0.2' into develop (diff)
downloadvim-replace-operator-3c1a73c62f97ff01deb8c7f63ae60c82f04e2ccd.tar.gz
vim-replace-operator-3c1a73c62f97ff01deb8c7f63ae60c82f04e2ccd.zip
Remove unneeded variable scoping
-rw-r--r--autoload/replace_operator.vim20
-rw-r--r--plugin/replace_operator.vim4
2 files changed, 12 insertions, 12 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
diff --git a/plugin/replace_operator.vim b/plugin/replace_operator.vim
index a8cf835..2fc935c 100644
--- a/plugin/replace_operator.vim
+++ b/plugin/replace_operator.vim
@@ -5,13 +5,13 @@
" Author: Tom Ryder <tom@sanctum.geek.nz>
" License: Same as Vim itself
"
-if exists('g:loaded_replace_operator') || &compatible
+if exists('loaded_replace_operator') || &compatible
finish
endif
if v:version < 700
finish
endif
-let g:loaded_replace_operator = 1
+let loaded_replace_operator = 1
" Set up mapping
nnoremap <expr> <Plug>(ReplaceOperator)