Fwd: MovingCursor + Ranges, Features

David Nolden zwabel at googlemail.com
Sat Apr 24 11:12:04 UTC 2010


That revision stuff would be great, we really need that so we can
match the "old" version of the duchain with the new one. It would be
much better though if it was not "translateFromRevision(old, ...)",
but rather "translateBetweenRevisions(from, to, ...)", because the
user might edit the document during our parsing, so we also need to
fix the "target" position to the revision from which we have extracted
the text. Also this needs to be really efficient, as it would be
called on every single highlighted range on the whole document. Since
KTextEditor::Range is a painfully expensive object (due to d-pointer
allocation etc.), it might also make sense to give a reference to the
translation functions, and doing the translation right in the
reference.

One more general thing about the range highlighting comes into my
mind: How do you handle multiple ranges that span the same text
position? Sometimes for example, we highlight a larger piece of the
text using some weak background color, and then highlight a some
sub-ranges of that text using another background color. The colors
should be blended over each other using alpha blending if they have a
valid alpha value. I have added the code to do that to the Smart*
rendering code, see "mergeAttributes(..)" and
"RenderRangeList::generateAttribute" in katerenderrange.cpp. The order
in which the attributes are merged should be well-defined.

Greetings, David




More information about the KDevelop-devel mailing list