My work on GtkSourceView so far

During the GNOME 3.7 development cycle I’ve been busy working on GtkSourceView, a library used by gedit, Anjuta DevStudio, LaTeXila, and other applications.

The main change is that the completion system has been revamped, mainly under the hood.

Completion: user-visible changes

The only user-visible changes are the bug fixes and the new calltip window sizing, also used for displaying extra pieces of information for proposals. In GtkSourceView 2 there was a function for tuning the calltip sizing, but this function has been removed when porting GtkSourceView to GTK+ 3. Now the sizing works correctly without any tuning function, the window simply fits the natural size of its child widget.

Now the user-comprehensible explanation:

Before

Before

After

After

You see that the main completion window is still quite big when there are only a few proposals. For now it’s not possible to change that, but a more compact completion window should be possible in the future.

Completion: developer-visible changes

The completion system is now better documented. A few functions have been deprecated. The code has been simplified (two classes have been almost completely rewritten). There are also some performance improvements, but it was not really an issue previously. Some statistics on the number of lines:

Before:

$ wc -l gtksourcecompletion*.{c,h} | tail -1
8012 total

After:

$ wc -l gtksourcecompletion*.{c,h} | tail -1
6728 total

Perfection is achieved not when there is nothing more to add, but rather when there is nothing more to take away. (Antoine de Saint-Exupéry)

Other enhancements to GtkSourceView

Paolo and I wrote more unit tests, and code coverage support has been added, to have statistics with nice colors.

Lots of compilation warnings have been fixed, especially for the API documentation. For example, the links to GLib or GTK+ symbols work now in the documentation. Compilation warnings are generally easy to fix, it’s a good way to get involved in a project I think, if there are no easy bugs to fix.

That’s all folks. Thanks to Paolo, Ignacio and Jesse for their advices and reviews!

3 Responses to “My work on GtkSourceView so far”

  1. […] GtkSourceView has seen lots of work on the completion framework thanks to the Sebastien Wilmet, his blog has all the interesting details. […]

    [WORDPRESS HASHCASH] Snoopy failed to fetch results for the comment blog url (https://blogs.gnome.org/pbor/2013/03/20/3-8-clocks-gedit-more/) with error ” and so is spam.

  2. Andreas says:

    Just a quick question: Has it ever come up to include font size or font type to signal keywords in the Text ?

    I’m always envious of those Emacs-Users unter Latex, where if you write \section{Intro} the part between {} is printed with a fontsize+5 and bold…

    • swilmet says:

      GtkTextTag has the :font property, so what you are describing should be possible, but it is not used by GtkSourceView.