New KateTextBuffer

Christoph Cullmann cullmann at
Thu Feb 25 20:55:10 UTC 2010

Christoph Cullmann wrote:
> Milian Wolff wrote:
>>> I first plan to write it and test it and then convert Kate part's
>>> internal smartcursors to it.
>>> Then at least katepart doesn*t use this ....
>>> Then eventually this will become a "really smart"cursor interface for
>>> KTextEditor.
>>> And that would be the end of the smart land, but that is future, first
>>> need to have something.
>>> As I think, even with unit tests for the buffer, which I intend to write
>>> from the beginning on,
>>> this will break kate part in small not-working pieces at least for 1-2
>>> weeks, all this work will be done in
>>> git and only if I get back a stable katepart this will be synced to
>>> kdelibs for KDE 4.5.
>> Don't forget the profiling, but I bet you're design will probably be more 
>> efficient anyways.
> I hope so, this time this all will be done once right from start,
> with tests, with documentation and with design :P
>> And did I get you correctly, that one will never get any kind of notification 
>> about the smart cursors?
> Yes, there won't be any notifications. Cursors will just move, Ranges, too.
> As soon as a range is empty, it will be marked invalid.
>> As long as you don't delete cursors inside kate, but let the owner == creator 
>> handle that, listening to textChanged et alii could probably be enough.
> Yes, there will be no deletion of cursors or ranges in any sense. Ranges
> will only become invalid,
> if they shrink to zero, but be never deleted. Cursors just move around.
> (as otherwise strange things can happen)
>> Maybe you could write David a mail and ask him about his requirements?
> I CC kdevelop-devel with this mail.
> I will develop the new buffer/cursors/ranges + textlines in the kate git
> repository, comments are welcome.
>> Night - Milian (who still kinda fears that you will make us KDevelop 
>> developers lots of work :P)
> Night ;)
> First I will make me a lot of work, I guess this rework will take some
> time. First I will implement it
> in some playground, with tests, then think about how to change kate's
> code to use it. (while still letting smartranges/cursors
> live)
> The new buffer should allow me, too:
> 1. Easier to implement undo/redo on top
> 2. Easier way to implement vim like swap files
> 3. Revision handling by default
I am happy hacking away on

with the new textbuffer and cursors/ranges.

Will move all upstream kate development there soon, if I get the history

Please review the stuff created there, if it could fit your needs.

As mentioned above, the current idea is:

1. Intelligent cursors will move, no notifications
2. Intelligent ranges will move, as well, no notifications and they will
get invalid if ever empty.
3. No cursors nor ranges will ever be deleted by the part, beside if the
buffer gets deleted (== document will be deleted),
they will just stay around and be marked invalid
4. No threading support, you must create cursors/ranges in the main
thread (like qt-creator does it)
5. Ranges will allow custom highlighting like atm, but no animations and
so on, at least not with the initial version


-------------------------------------- Christoph Cullmann ---------
AbsInt Angewandte Informatik GmbH      Email: cullmann at
Science Park 1                         Tel:   +49-681-38360-22
66123 Saarbrücken                      Fax:   +49-681-38360-20
GERMANY                                WWW:
Geschäftsführung: Dr.-Ing. Christian Ferdinand
Eingetragen im Handelsregister des Amtsgerichts Saarbrücken, HRB 11234

More information about the KDevelop-devel mailing list