And now we're getting into the bulk of the development effort. This month, most of the work on the text editor focused on getting navigation smoother and fixing some of the missing bugs with Unicode. I also did a lot of work on reworking the cache for line layouts and handling updates from outside of the GUI thread.

The cache was the nastiest thing. When I originally wrote it, I had a windowing system to only load 100-500 lines a time while keeping useful information about the remaining lines. For performance reasons, though, I needed to be able to move a cached line up and down as the user edits… and I couldn't figure out the window system. So, I switched to a simple List implementation and it worked out nicely. My primary concern was memory pressure, but loading 1.9k lines into memory only takes 141 MiB. I'll have to rework it now, but I'm well underneath the 1.0 GiB limit I have for a 600k word novel (my baseline).

Overall, this improves performance while editing (including inserting and deleting lines) in the middle of the document.

Signatures

  • Exposed the margin rendererer collection as a property. +Changed

Unicode

  • Additional work to handle Unicode characters with navigation and mouse clicking. +Changed
  • Moved the UTF-8 processing into MfGames.GtkExt

Improvements

  • Significantly improved performance with larger documents. +New
  • Up/Down key navigation now works with left padding of styles. +New
  • Added some locking around the cached renderer to allow it to handle getting events from other threads more gracefully, in specific the line changed events. +Changed
  • Added a background line cacher to speed up scrolling performance and line calculations. +New
  • If the popup menu callback removes all items, then the popup isn't shown. +Changed
  • If there is a selection while typing, the selection is replaced with text. +New
  • Some additional work on ensuring that changes to the GUI are done on the proper thread. +New

Dependencies

  • MfGames.GtkExt 0.2.0

Sources

2013-08-27