Mike Lischke
2014-05-19 10:02:32 UTC
Hi,
in my application I use markers to denote certain lines in my editor content. Since documents can be very large (and many markers can exist, think of a million markers) I try to handle changes as effective as possible. For this I keep a list of markers I have already set and on changes I diff that with what my parser wants to have now to determine which markers should be removed and which added (instead of removing all markers and add new ones, which can result in many useless remove/re-add actions).
This obviously depends heavily on my list being exactly in sync what the editor control has. And this is where my problems occur. In certain circumstances Scintilla modifies markers on its own. Sometimes notifying me (e.g. when a line with a marker is removed) sometimes not (if a new line is inserted before lines with markers). So my list constantly gets out of sync, rendering my entire optimization useless.
This is why I'm looking for better ideas. I was thinking about instead of using my own list I query Scintilla if a line contains a specific marker already. Though this has at least 2 disadvantages:
1) Potentially many roundtrips to Scintilla, making this a slow solution.
2) No solution to remove markers, unless I really iterate over all lines.
Any better idea is welcome,
Mike
in my application I use markers to denote certain lines in my editor content. Since documents can be very large (and many markers can exist, think of a million markers) I try to handle changes as effective as possible. For this I keep a list of markers I have already set and on changes I diff that with what my parser wants to have now to determine which markers should be removed and which added (instead of removing all markers and add new ones, which can result in many useless remove/re-add actions).
This obviously depends heavily on my list being exactly in sync what the editor control has. And this is where my problems occur. In certain circumstances Scintilla modifies markers on its own. Sometimes notifying me (e.g. when a line with a marker is removed) sometimes not (if a new line is inserted before lines with markers). So my list constantly gets out of sync, rendering my entire optimization useless.
This is why I'm looking for better ideas. I was thinking about instead of using my own list I query Scintilla if a line contains a specific marker already. Though this has at least 2 disadvantages:
1) Potentially many roundtrips to Scintilla, making this a slow solution.
2) No solution to remove markers, unless I really iterate over all lines.
Any better idea is welcome,
Mike
--
www.soft-gems.net
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/d/optout.
www.soft-gems.net
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/d/optout.