Thursday, September 12, 2013

Re: Preserving contents of a register in vimscript

On Thursday, 12 September 2013 10:08:57 UTC+1, ZyX wrote:
> // Use getreg()+getregtype() and setreg() with three arguments.
>
> What you are trying to achieve is not possible without pasting to some
> temporary buffer and reading with getline() then (when restoring) pasting
> again (with setline()) and using normal-mode y command. Just try to yank NUL
> (obtained by e.g. :call setline('.', "a\nb")) and restore it.

Thanks, I hadn't spotted those functions.
Paul

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: