Skip to content

Fixing: setting register 2 to a value #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions plugin/yankring.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1182,27 +1182,19 @@ endfunction
" Manages the Vim's numbered registers
function! s:YRSetNumberedReg()

let i = 0
let i = 1

while i <= 10
if i > s:yr_count
break
endif

call setreg( (i)
\ , s:YRGetValElemNbr((i),'v')
\ , s:YRGetValElemNbr((i),'t')
call setreg( (i-1)
\ , s:YRGetValElemNbr((i-1),'v')
\ , s:YRGetValElemNbr((i-1),'t')
\ )
let i += 1
endwhile

" There are a few actions that Vim automatically takes
" when modifying the numbered registers.
" Modifying register 1 - changes the named register.
" It is impossible to set register 2 to a value, since Vim will change it.

" This will at least preserve the default register
let @" = @0
endfunction


Expand Down