All posts by Christoph Cullmann

Dr.-Ing. Christoph Cullmann is a Senior Software Engineer at AbsInt Angewandte Informatik GmbH. His work is focused on static analysis of both binary and source programs and the WCET analysis of embedded systems. In his spare time, he works on the KDE project and maintains the Kate editor application and component.

Text Folding Reloaded

If we look at the incoming bug reports, a lot still seem to be located in our code folding implementation.

The problem of the current code folding code, even after the GSoC rewrite of large parts, is that it is inter weaved with the syntax highlighting engine.

During highlighting, we try to build up some tree containing all folding start/ends. To accommodate languages that have indentation based folding like Python, we started to fake such starts/ends which are normally tokens like { or }. As these tree can be unbalanced and contain overlapping regions, the implementation is quiet complex.

Additionally, as the folding relies heavily on the syntax highlighting, which is done per document, it is impossible to have different folding per view.

After looking again at the code to solve some issues, it got more and more clear to me, that we need to restart that from scratch.

Instead of feeding the highlighting info into a tree, I started to implement text folding that just allows you to mark regions as folding ranges manually. Then internally a non-overlapping tree of ranges is created that uses our moving cursors to keep track of changes in the document. Each view will have an instance of such a tree, which allows to have folding per view.

These folds are only created on demand, e.g. if you decide to fold some region via selection + “fold” command. This already works quiet well in my Kate repository clone. The missing part is now the integration with the highlighting, that should use this well defined API to only create a folding region in the moment the user wants to fold it. In addition some API for the highlighters is needed to indicate that for some line there is the fold action. After that is done, I might consider to replace the current implementation with the novel one, which is btw. much easier to unit test (which is already done for most API primitives).

Btw., the work is done in this repository, if somebody wants to contribute, patches are welcome .P

Kate Git Statistics

Now the statistics of the kate.git are online for public viewing.
They will be updated daily, located on: http://kate-editor.org/stats/

Unfortunately, the statistics of the last years are not that “representative”, as the moves of Kate around in SVN and to Git biased the statistics, as I did a lot of the commits for syncing and moving and so on.

Still it is amazing how MANY people did contribute during Kate’s history! (see Kate Authors)

A big THANK YOU to all contributors that appear there (and all the people that provided patches others merged in, did the testing, bug reporting, translations, …).

(And thanks to the authors of git_stats.)

Bug Hunting – Please help poor Kate ;)

The Kate/KDevelop sprint in Vienna was a really productive time.

Thanks to Joseph Wenninger for organizing it and the KDE e.V. for the additional funding!

The Kate team was able to really wade through a lot of bugs & wishes and fix/invalidate a lot of them.

After some more days of work, this really is visible in our nice bug chart ;)

Kate, KatePart & KWrite are now down to a bug level as low as years ago ;)

Still, there is a lot to do.

If you have some spare time and Qt/KDE knowledge, please help us to have an even better KDE 4.10 release and look at the remaining bugs.

We have the following ~60 bugs and ~330 wishes still around. They vary from small stuff to “a lot” of work. If you want to help out, just pick the bug you want to work on and assign it ;)