Category Archives: Users

News from the Holy Kate Land

Since we now all know that Kate is holy (thanks to rms. By accident, he obviously confused Kate with emacs, though) let’s have a look at what’s going on. In the last months Kate development is quite active, so here is a quick update:

  • new: on-the-fly spell checking thanks to Michel Ludwig. Highlights include e.g. spell checking in comments of source code or latex parts. Also, constructs like sch\”on work in latex.
  • extended scripting support in the command line, more on that later
  • more and more mature vi input mode
  • lots of bug fixing. quite impressive bug squashing by Pascal L├ętourneau for more than 4 months now
  • lots of refactoring and code cleanups thanks to Bernhard!
  • “Find in Files” appears by default again in the tool view,
  • “File Browser” uses UrlNavigator, huge code cleanup
  • convenience updates of syntax highlighting
  • delayed highlighting of code folding ranges to prevent flickering on mouse move
  • new command line commands: ‘toggle-header’ in the Open Header plugin. ‘grep’ and ‘find-in-files’
  • haskell and lilypond indenter
  • much, much more, see commits for details.

Thanks to all contributors involved in Kate development. Keep it up :)

Improved PHP support in Kate

Not only KDevelop gets better and better PHP support — the Kate PHP syntax file also got a few new features and fixes over the last weeks. The good thing is of course that all users of KWrite, Kate, Quanta, KDevelop and other editors leveraging the Katepart benefit from these changes.

Improved HereDocs

screenshot of improved highlighting in PHP heredocs
screenshot of improved highlighting in PHP heredocs

I went over PHP related bugs on today and spotted one that was fairly easy to fix:

vim-like syntax highlighting support for heredocs in php.xml

With some magic (IncludeRules just rocks) I got it working fairly easy. You can see the results to the right.

Additionally I added code folding to heredocs, since often these strings include lots of text and hiding it often makes sense.

Better support for overlapping syntax regions

code folding with overlapping syntax regions
code folding with overlapping syntax regions

Another long standing bug (accommodate overlapping syntax regions (especially for php)) got fixed by James Sleeman.

Finally PHP templates with code such as

  1. <?php if ( true ) : ?>
  2. <!-- some html stuff -->
  3. <?php elseif ( false ) { ?>
  4. <!-- some other html stuff -->
  5. <?php } ?>

can be folded properly. This kind of spaghetti code is used quite often in simple templates and having the posibility to fold it properly is a huge win in my opinion. Thanks to James Sleeman again!

Followup on Kate’s on-the-fly spellchecking

As there was a lot of feedback in the last blog, I’ll answer some of the questions here.

> Where can I get this patch?
The relevant subversion revisions are r992778, r992779, r992780, r992784.

> Will it be available in 4.3, or only in 4.4?
As KDE 4.3 will be released end of the month, this feature will be available in KDE 4.4 and not earlier.

> Please, please tell me that it’s powered by Sonnet, one of the most awaited KDE4 pillar by me…
Yes, it uses Sonnet :)
The old spellcheck dialog however still uses the old spellchecking code without Sonnet. Any volunteers to port this? Also, the on-the-fly spellchecking needs to be more configurable in Kate’s config dialog, e.g. selecting the correct language.

> Thanks so much, this was the feature I was mostly longing for in kate.
Yes, it is one of the oldest reports with 1245 votes!

> What languages are supported support?
On-the-fly spellchecking works if the specific itemDatas are marked with spellChecking=”true” or “1″ in the xml highlighting definition files. UPDATE: On-the-fly spellchecking is enabled for all itemDatas by default in the xml highlighting defintion files. To disable it, you have to add spellChecking=”false” or “0″ to an itemData, e.g. at the end of the cpp.xml file:

<itemData name="Normal Text" spellChecking="0" />
<itemData name="String" />
<itemData name="String Char" spellChecking="0" />
<itemData name="Comment" />
<itemData name="Symbol" spellChecking="0" />

So we have to go through all .xml files and change the relevant parts in the itemDatas section. And that’s where we need your help, as we don’t know all the languages :) …and if you want to test this feature, you first have to enable it in Tools > On-the-fly spellchecking.
PS: Is there a better name? Maybe Inline spellchecking? Any linguistic experts around? :)

On-the-fly spellchecking in Kate

Christoph just added an awesome and long awaited feature: on-the-fly spellchecking. ‘Kate’s xml highlighting files now have an additional attribute in the itemData section: spellChecking=”true/false”. C++ comments and strings can be spellchecked now :) Same for all other languages such as Latex. Really big thanks to Michel Ludwig for the patch, good work! Screenshot for latex highlighting: