History feature in Komodo 5.1.0 alpha 1 by Trent Mick

We released Komodo 5.1.0 alpha 1 today! Get it here:

Please try it out and give us your feedback:

emailhttp://listserv.activestate.com/mailman/listinfo/komodo-beta
bugshttp://bugs.activestate.com/enter_bug.cgi?product=Komodo
forumshttp://community.activestate.com/products/Komodo

This is the first release of Komodo 5.1 on the way to a planned final release around mid-May [Update: mid-March. Subconsciously I keep hoping for more time. :)]. (I'll write about our Komodo 5.1 plans in a separate post). Here I want to talk about Komodo's new "History" feature.

History overview

screenshot of Komodo 5.1's history feature

Komodo's History feature is like your browser's history, but for the editor. Back and Forward buttons in the toolbar. Same default keybindings as in Firefox 1. Simple.

Komodo's history is a bit different than a browser's. In a browser, you have a separate history session for each tab. This doesn't make as much sense for an editor. Komodo's history is per-window 2. That means that the Back button will move you back to the last place you were, be that in the current file or in another file in the same window. This means that jumping back:

  • after a Go To Definition, or
  • after opening a new file, or
  • after jumping to a find result

is as easy as clicking "Back".

More than any new feature in Komodo, the first time we hooked the feature up it felt immediately useful. Of course, this is just an alpha release so there is lots of polishing to do. Read on for some of the other things we hope to do with this.

Future work

Some other things Komodo will be able to support with this:

  • Opening recent files quickly. Chances are good that a file you want to open in your editor is a file you've edited before (and recently). The history database now provides Komodo with the data it needs to support that.
  • Find in recent files. Often I'll want to look at some snippet of code that I remember writing in the last few days, but can't remember what file (or even what project) that was in.
  • Support '' command in Vi-mode. From the Vim help:

    ''  ``                  Move to the position before latest jump.
    
  • Hooking Back and Forward into the MS Intellimouse's (and other mice, I suspect) side buttons -- as is the default in Firefox.

Backend code

For those interested, most of the backend of the history system is here in "editorhistory.py" in the Open Komodo subversion repository.

For JavaScript code (most interesting to Komodo extension developers) there is a new ko.history API with the most relevant methods being:

  • ko.history.note_curr_loc(view): Tell the history system to note the current editor location before jumping somewhere.
  • ko.history.history_back(n): Go back n locations.
  • ko.history.history_forward(n): Go forward n locations.

Komodo's history database shares some ideas with Firefox 3's Places database. In particular the idea of splitting visited locations (URLs in Firefox, editor locations in Komodo) and visits into separate database tables was helpful. They are, of course, both SQLite3 databases.


  1. The keybindings aren't yet there for Mac OS X in alpha 1. They will be there for alpha 2. 

  2. Currently it is shared by multiple Komodo windows, but will be changed to be per window. 

17 comments

  1. Jigar Shah February 4, 2009 4:43 PM

    + Integrate Ubiquity :)

  2. Tony February 5, 2009 1:02 AM

    Hey dude.

    Keep doing amazing stuff.

  3. trentm February 5, 2009 2:33 AM

    @jigar: *absolutely*. Ubiquity, frankly, makes even more sense in an editor/ide than it does in the browser. Anyway, ubiquity is serious cool stuff that I hope to see in Komodo someday. I'm hoping David and the Thunderbird crew port it to T-bird first to show me how to easily port it to other XUL apps.

  4. Bill February 5, 2009 6:46 AM

    I loved this feature the second I used it! Now I don't have to keep leaving bookmarks in large files to bounce back and forth between caller and definition I just need to click on the sub in the sidebar and then use the back arrow to continue programming. Thank you!

  5. Roman February 5, 2009 7:38 AM

    You said, "In particular the idea of splitting visited locations (URLs in Firefox, editor locations in Komodo) and visits into separate database tables was helpful. They are, of course, both SQLite3 databases."

    Did you mean separate tables in the same database or tables in separate databases? If it's the latter, what makes this helpful?

  6. trentm February 5, 2009 1:45 PM

    @roman: I meant that they are separate tables in the same database. Specifically the history_uri and history_visit tables here: http://grok.openkomodo.com/source/xref/openkomodo/trunk/src/history/editorhistory.py#860

  7. Roman February 5, 2009 8:00 PM

    Thanks, Trent.

    By the way, your WordPress reports DB errors often. I've visited this site just several times but have seen this error more than once: "Error establishing a database connection"

  8. Brad Touesnard February 8, 2009 11:24 AM

    This feature was definitely on my wish list. Good work Komodo team!

  9. Nathan February 9, 2009 5:25 AM

    This feature looks awesome! Will it also be available in Komodo Edit? I installed the latest available alpha but it seems to be missing (or I'm going blind).

  10. trentm February 9, 2009 6:43 AM

    @nathan: Yes it is there in Komodo Edit. If it isn't there in the Komodo Edit builds here: http://downloads.activestate.com/Komodo/releases/5.1.0a1/
    then there is a bug (possibly we didn't correctly integrate changes between the Komodo IDE and Edit trees). If you can't find it in Edit, I'd really like to hear back.

  11. Nathan February 9, 2009 10:04 PM

    I just checked again, I downloaded the following version from the link you gave:

    Komodo-Edit-5.1.0-alpha1-2918.msi 04-Feb-2009 09:45 31M

    This version does not have back / forward buttons or anything in the menu's that refers to it.

    Glad to hear that this will be a feature in Komodo Edit :)

  12. Nathan February 9, 2009 10:06 PM

    Perhaps worth a notice; the title of Komodo Edit says: "Komodo Edit 5.0" but when I go to the about dialog it says "Komodo Edit, version 5.1.0-alpha 1, build 2918"

  13. sergiol February 12, 2009 1:13 AM

    History feature will make history!

  14. Kenan Sulayman February 19, 2009 6:16 AM

    Application will crash in the Font's & Color tab of the settings, of there are more than 13K Fonts installed.

  15. Kenan Sulayman February 19, 2009 6:17 AM

    Sorry, I mean: if there are more than 11K Fonts installed

  16. trentm February 19, 2009 6:32 AM

    @kenan: I've added this Komodo bug (http://bugs.activestate.com/show_bug.cgi?id=82038) for this. It would be helpful if you could follow up with some details -- e.g. Komodo version, platform, etc -- on that bug. Thanks!

    You have more that 11k fonts? Wow.

  17. wow power leveling March 21, 2009 12:14 AM

    I loved this feature the second I used it! Now I don't have to keep leaving bookmarks in large files to bounce back and forth between caller and definition I just need to click on the sub in the sidebar and then use the back arrow to continue programming. Thank you!

add a comment

You can use these HTML tags: <a>, <strong>, <em>, <i>, <b>.