Design Ideas of the Kate::TextBuffer

Storage

  • Basic idea: text stored as lines
  • Lines hold text and additional data (like for highlighting)
  • Advanced Concept: Stores lines in blocks of xxx lines, to have better performance

Cursor Support

  • They will move on editing
  • Cursors can be combined to ranges
  • KateTextCursor will be stored in the buffer blocks

Transactions

  • Each edit action must be encapsuled in a transaction
  • startEdit/endEdit will do this
  • Signals for starting and ending this transactions

Revisions

  • After loading, buffer has revision 0
  • Each edit action which is no nop will lead to increment in revision number
  • Successful saving will reset revision back to 0

Editing Operations (only 4 different editing primitives)

  • Insert Text (inside one line)
  • Remove Text (inside one line)
  • Wrap Line (wrap a line at given position, create a new line with content behind wrap position)
  • Unwrap Line (unites the line with its predecessor)
  • Signals for all of these actions, containing the change (to allow to layer undo/swap file support/…) on top of the buffer

Load/Save & Encodings

  • Loading will try to use given codec, if that doesn’t work, try to detect the codec by the BOM at start of file or use fallback codec, if that again doesn’t work, given codec will be used again, and errors reported
  • Saving will just use the given codec

Unit Tests

  • Each of the above implementation details will be covered by unit tests
  • KateTextBuffer (+KateTextLine and Cursor) must therefor be usable without other components

Kate Partly Moving to Gitorious

We are about to move the applications Kate and KWrite as well as the libraries KTextEditor and Kate Part to gitorious. Christoph is working on the migration right now in order to keep the development history. Things look good so far, so the migration is soon finished.
We have discussed a bit about the migration to gitorious on the Kate Developer Meeting and Christoph came up with this mainly because building only KTextEditor, Kate Part, KWrite and Kate is much faster and easier compared to building the KDE modules kdesupport, kdelibs, kdepimlibs, kdebase, kdesdk.
I myself remember the time where I started KDE development, and it took more than two weeks to have a first successful build of KDE. You have to learn so many things at once, like revision control, lots of so far unknown software, and what not. Talking to other developers verifies this. In other words: Getting into KDE development is not easy and straight forward.
Moving to gitorious removes this barrier for Kate development: You just checkout the Kate repository and that’s all you need. It would be nice if you join Kate development and contribute patches :)
What does that mean for Kate in KDE? Nothing changes. We will merge the changes in Gitorious back to the main KDE development line and vice versa.

Kate Highlighting for QML, JavaScript

Hey everyone!

qmlhlQML Highlighting in Kate

I’ve started my internship at KDAB this week, it’s great fun so far! Though I spent most of my time this week on Bertjans KDevelop plugin, I couldn’t resist on a bit of Kate hacking:

steveire is experimenting with QML so I couldn’t stop but notice that there is no highlighting for it in Kate. Well, there was none ;-) Now you get pretty colors, rejoice!

Note: Since QML is basically JSON with some added sugar, I reused the existing JavaScript highlighter and improved it. Hence you get imrpoved JSON and member highlighting in plain.js as well. Enjoy!

Kate Highlighting for QML, JavaScript

Hey everyone!

qmlhlQML Highlighting in Kate

I’ve started my internship at KDAB this week, it’s great fun so far! Though I spent most of my time this week on Bertjans KDevelop plugin, I couldn’t resist on a bit of Kate hacking:

steveire is experimenting with QML so I couldn’t stop but notice that there is no highlighting for it in Kate. Well, there was none ;-) Now you get pretty colors, rejoice!

Note: Since QML is basically JSON with some added sugar, I reused the existing JavaScript highlighter and improved it. Hence you get imrpoved JSON and member highlighting in plain.js as well. Enjoy!