diff options
Diffstat (limited to 'autoload/replace_operator.vim')
-rw-r--r-- | autoload/replace_operator.vim | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/autoload/replace_operator.vim b/autoload/replace_operator.vim index ff442b6..6b8ce96 100644 --- a/autoload/replace_operator.vim +++ b/autoload/replace_operator.vim @@ -1,9 +1,6 @@ " Replace the operated text with the contents of a register function! replace_operator#Operatorfunc(type) abort - " Save the active register into a local variable - let l:register = v:register - " 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 @@ -33,8 +30,8 @@ function! replace_operator#Operatorfunc(type) abort " 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' - if l:register !=# '"' - let l:paste = '"'.l:register.l:paste + if s:register !=# '"' + let l:paste = '"'.s:register.l:paste endif silent execute 'normal! '.l:select.l:paste @@ -48,6 +45,7 @@ endfunction " Helper function for normal mode map function! replace_operator#Map(register) abort + let s:register = a:register set operatorfunc=replace_operator#Operatorfunc return 'g@' endfunction |