ActiveBlog

Komodo 5.0.3 API changes
by Todd Whiteman

Todd Whiteman, December 18, 2008

Just a heads up that the Komodo 5.0.3 release will change the behaviour of some of the common API methods. This should only affect a small minority of Komodo macros and extensions.

The below APIs have now been changed:
ko.open.URI
ko.open.displayPath
These methods were previously operating synchronously in Komodo 5.0.2, but will now operate asynchronous as of Komodo 5.0.3.

These below methods are now deprecated:
ko.views.manager.doFileOpen
ko.views.manager.doNewView
ko.views.manager.newViewFromURI
ko.views.manager.doFileNewFromTemplate

instead, new asynchronous functions have been created in their place:
ko.views.manager.doFileOpenAsync
ko.views.manager.doNewViewAsync
ko.views.manager.newViewFromURIAsync
ko.views.manager.doFileNewFromTemplateAsync

What this means is that if you were using these API methods, and using the return value (a koIView instance) or expected to be able to use "ko.views.manager.currentView" to access the new view after calling these methods, then you'll need to update your code to now use the asynchronous callback handling.

Example:

  // Open an existing file in Komodo 5.0.2 and modify the text.
  var view = ko.open.URI("file:///path/to/file.txt");
  view.scimoz.text = "Some text";

In Komodo 5.0.3 this would need to be updated like so:

  // Open an existing file in Komodo 5.0.3 and modify the text.
  ko.open.URI("file:///path/to/file.txt", null, false,
              function(view) {
                  view.scimoz.text = "Some text";
              }
  );

The reason for the change was to workaround the Komodo editor plugin (Scintilla) not being correctly shutdown/finalized when the editor file was closed (mostly affecting Mac OS X). The full details of the problem are logged in this bug:
http://bugs.activestate.com/show_bug.cgi?id=80683

Cheers,
Todd

Subscribe to ActiveState Blogs by Email

Share this post:

About the Author: RSS

Todd Whiteman is the Development Lead for Komodo IDE. He works adeptly with Mozilla, Python and JavaScript to ensure that Komodo IDE is the IDE of choice for development teams. Todd has been working on Komodo IDE for nearly 6 years, adding components such as the Vi Key Bindings, Distributed Source Code Control, 64-bit Linux builds as well as Remote SSH support into Komodo IDE.