Yesterday I sent out patch 8.1.1321 which adds listener_add().
This makes it possible to find out about text changes and possibly
update text properties or anything else.

The current implementation is quite low-level.  That makes it possible
to see exactly what text changed.  Also for something like a global
substitute.  I wonder if there is use for a much simpler callback, which
would only report the range of lines with any change.  That should be
fine to decide where to update highlighting.  But for a global subsitute
that changes two lines far apart, the whole area between them would be
reported.

Something like this:

        func Listener(start, end)
          " Update highlighting from line a:start to line a:end
        endfunc
        call listener_addsimple('Listener')

Another thing is that the line numbers in the changes are valid for when
the change is made.  If later changes insert/delete lines above it, then
those line numbers will need to be adjusted.  It would be possible to
add a function that does this, if there is interest.

-- 
./configure
Checking whether build environment is sane ...
build environment is grinning and holding a spatula.  Guess not.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201905121202.x4CC2WUQ029394%40masaka.moolenaar.net.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui