Hi all,
 I have written a vim function that look like this:
(PSEUDO-vim-code)

function Sth()
    org = getline('.')
    new = org
    new[5] = '+'
    new[9] = '*'

    setline('.', new)
    matchadd(...) " highlight current line; 6th and 10th char
    sleep 5 " some other commands

    setline('.', org)
    matchdelete(...)
endfunction

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?

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

I will apriciate any suggestions.

Best Regards
 Bartek

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