Archive for February, 2009

Bookmarking Support Added

Friday, February 20th, 2009

Revision 77 in Subversion has two new features that have been requested over on the forums.  The first, and most interesting one to me at least, is bookmarking.  RTextScrollPane now has methods to toggle whether “bookmarking” is enabled.  When it is, an icon appears beside a bookmarked line.  You can quickly skip to the next and previous bookmarks in a file with F2 and Shift+F2, respectively.  Ctrl+F2 toggles a bookmark on the current line.


Those little blue icons in the margin are the bookmarks.  You can change this icon to whatever you like; it’s just a Swing Icon.

Further, this icon margin can be used to display arbitrary icons for any line in a source file.  This can be used to mark anything, such as debugging breakpoints or compile errors:

An error icon displayed

An error icon displayed

I will be putting up a demo soon showing off this icon margin, along with all the other cool new features getting added to the next RSTA release.

The other feature added is line highlighting.  RSTA now includes a small API to set the background color for individual lines.  One example use of this feature is if you use RSyntaxTextArea in a file diffing tool, and wish to show modified, added and removed lines in various colors.

PHP Highlighting Support

Sunday, February 1st, 2009

Also new in the upcoming release of RSyntaxTextArea will be PHP highlighting support. This has been the most commonly asked-for language for awhile now, and I’m happy it’s finally getting added.

Unfortunately, due to the sheer number of functions in PHP, this support raises the size of the RSTA jar considerably (we’re close to 500 kb now!). But disk space is cheap these days, and besides, if the library size is an issue to you, you can always simply remove the classes for highlighting languages you don’t need. You can cut out all language highlighters except one, if that’s all you need, and the jar could sit at around 200 kb. And that nets you not only syntax highlighting, but also find/replace, auto-indentation, mark occurrences and more.