Kate Project Plugin

It is not a secret that removing Kate’s project manager in KDE 3.5 was not the right thing to do. It seems a lot of people used it and we got many complaints about this decision. That also shows that it is hard go get feedback about what users are really using. If a feature is done well, noone will ever talk about it. This is paradox, as we thought the project manager was not well integrated :) (I still think that)

Ok, let’s come to the interesting part: Three developers wrote a new Kate Project Manager Plugin and published an initial release on sourceforge.net and on kde-apps.org. It works quite well already and reading the comments on kde-apps.org gives me the impression that there are more features to come with the next release. — If you are interested maybe you want to join the project…

PS: I have the secret hope the plugin will be ported to KDE4 using Qt’s model/view architecture, so that it has good support for multiple mainwindows :)

Triple clicks

Text editors and line edits support the so-called triple clicks according to [1]. The document says

  • Triple Click: Select the targeted row. [...]

It is unclear whether the “targeted row” includes the trailing linebreak. Kate Part selects the targeted line including the linebreak. You get the following behavior:

  • If you move the selected row with the mouse, you usually have the linebreaks right. The same applies for copy/cut & paste. If you are used to it, it really is a nice feature.

While this behavior is pretty straightforward, it is not widely in use. If you look at text edit widgets like in firefox, konqueror, Qt, KWord or OOo you will notice that they do not include the trailing newline character.

Question now is: Should we change it for KDE 4 in Kate Part just to be compliant with the others? As Kate Part is an editor component mainly used for programming, my favourite option is to include it, i.e. to keep the current behavior.

(update) I just stumbled over http://bugs.kde.org/show_bug.cgi?id=91041 =)

[1] http://developer.kde.org/documentation/standards/kde/style/mouse/selection.html

Kate Part in upcoming KDE 3.5.4

The last week was highly productive for Kate Part, as the following bugs were fixed:

  • 89042 while pressing “del” key kate crashes (crash, bt)
  • 103648 Codefolding Crash – Reproducable
  • 118584 scroll position not upgrading (dynamic word wrap)
  • 119435 kate crash when a file is saved
  • 123315 kwrite/kate crashes randomly after save
  • 124102 changing syntax highlighting when code is folded crashes katepart
  • 127928 kate crashes deleting a block of text
  • 128690 Dynamic word wrap makes text input slow
  • 129853 Horizontal scrollbar and view not synced, if dynamic and static word wrap are off
  • and some minor issues

That are 6 crash fixes. Kate Part in KDE 3.5.4 will be more stable than ever :) That’s especially cool for KDevelop, Quanta+, Kile – well and Kate.
Special thanks to Andreas Kling for initiating the bug squashing sessions! You are like a blackbox: The input is a bug and your output is the fix ;)

Kate Modes & Filetypes

Modes allow the user to override the default configuration for documents of specified mimetypes or file extensions. When the editor loads a document and the mimetype or file extensions match for one of the defined filetypes, KatePart will read the configuration from the mode and apply the modelines defined. If more filetypes match, the one with the highest priority will be used.

To create a filetype, go into the settings dialog available in Kate via Settings > Configure Kate > Open/Save > Modes/Filetypes, then press the New button and fill in the properties. To remove an existing filetype, select it from the dropdown list and press the Delete button. To edit an existing mode, select it from the dropdown list.

Some Available Properties

  • Name
    This is a user friendly name that will be displayed in the menu Tools > Mode.
  • Section
    A submenu of Tools > Mode in which to place this filetype. If the section does not already exist, it will automatically be created.
  • Variables
    This is where the actual configuration goes. Variables set here will overwrite the default configuration values. Be aware that this line must begin with kate: and end with a semicolon. For a full list of available variables refer to modelines.
  • File Extensions
    A semicolon separated list of filename globs used to determine if a document matches this filetype.
  • Mimetypes
    A semicolon separated list of mime types used to determine if a document matches this filetype.
  • Priority
    If a document matches several filetypes, the one with the highest priority will be chosen.

Example

As an example we will create a new mode configuration for C++ and Java files. It should use the C Style indenter and indent with 4 spaces (no tabs). The configuration could look like this:

Name: C++ and Java settings
Section: Sources
Variables: kate: space-indent on; indent-width 4; mixed-indent off; indent-mode cstyle;
File Extensions: *.cpp;*.java
Mimetypes: text/x-c++hdr;text/x-c++src;text/x-java
Priority: 10