On Jul 12, 2:30 pm, bartek <[email protected]> wrote:
>
> The function temporarily changes buffer, but in the end all changes
> are reverted.
> How can I modify the function so that any changes made in it would not
> be reflected in undo list?
>
> btw:
> The function has one more flaw: it doesn't work well when buffer is
> not modifiable.
> Do you have any suggestions how to fix that?
>

Temporarily set modifiable, then do your changes, then restore the
option setting and set "nomodified" if the buffer was not previously
not modified. I don't think you can get around changing the undo list,
though. Maybe you can jump back in the undo list rather than using
setline again, so at least u/CTRL-R won't ever see your temporary
modification.

> Perhaps there is some better way to achieve what I want.
>

Quite possibly. What do you want to achieve?

-- 
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

Reply via email to