On 1 July 2014, Alexey Radkov <[email protected]> wrote:
> 2014-07-01 22:51 GMT+04:00 LCD 47 <[email protected]>:
> > On 1 July 2014, Christian Brabandt <[email protected]> wrote:
> [...]
> > > BTW: what happens to the highlighting after one changes the
> > > buffer? E.g. if I add a matchaddpos() at line 5, column 5 and
> > > afterwards add a line below 3, will then line 6, column 5 be
> > > highlighted or line 5? Both could be useful, I suppose...
> >
> >     As it is now, the highlight stays at line 5, column 5.  I think
> > there was a recent patch to make it move along with the text it
> > highlights (which would be a lot more useful, IMO).
> >
>
> I wonder how could it be implemented (just thought to add this
> functionality to matchaddpos())?
>
> Imagine situation: you add a match at line 5, then delete the whole
> line 5 (rdeletee this match now or store somewhere?), then make undo
> (returning back that line 5). Will the match be restored?

    Yes, I'd say it should be restored.

> If so then we should track all history of buffer change, in other
> words we have to implement semantical binding between match and
> buffer, whereas now its technically bound to a simple number.

    How about adding highlighting adds / removals to the undo list.
That way, when you delete line 5, the highlights on line 5 would be
deleted and the operation written to undo stack, then line 5 would be
deleted, and the operation written to the undo stack.  When you undo
the operation first the line would be restored from the stack, then the
highlights.  No need to track anything.

    /lcd

-- 
-- 
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].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui