Hello,
I've been trying to get notifications from Vim on when the contents of
buffer(s) change. I've encountered the following problems:
1. Trying to use autocmd you don't always have the right events you can
use as hooks to be notified of changes. For example, you can hook a
callback to InsertEnter/Leave or CursorMove, but what if substitution
takes place?
2. Using the netbeans protocol: this in general gets more of what I'm
looking for but has several drawbacks and problems:
a. I only found a way to assign buffer ids to buffer that
correspond to file names. How do you assign a buffer id to an unnamed
buffer? (e.g. a when you just open vim) I couldn't find a way to be
notified of any changes to such buffers.
b. insert/remove notifications are a bit odd as they only give
offsets in a string and not a row & col. Also, getText seems to only
give the whole buffer as a string. There's no way of just requesting the
text for a line.
c. This method seems a bit inefficient as everything goes over a
socket which means that effectively two copies of a buffer could
potentially exist in memory (one by vim, one by the server).
Does anyone have any suggestions on how to achieve what I need? I'd
simply like to know where (probably only rows) changes to the content
occur, in what buffer as they occur (either in insert mode, for example,
or by substitution or any other way).
Thanks a lot.
--
You received this message from the "vim_dev" 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