Komodo 5 in under construction but developers can start to appreciate the new features working with alphas and SVN sources…
Another weapon is available to Komodo extension developer, version 5 make easier to be informed when the document attached to a view changes.
A couple of new events (remember notifications are no more supported for view operations) are finally available
- view_document_attached
- view_document_detaching
Both events put into event.originalTarget the view involved and the view.document object is never null.
Obviously can be null the view.document.file property, for example when user chooses File|New File… from menu.
The code shown below creates a new document and attaches it to the current view, developer doesn’t need to notify using its own code but it is sufficient to listen the standard view_document_attached
var uri = "..";
var newDoc = Components
.classes["@activestate.com/koDocumentService;1"]
.getService(Components.interfaces.koIDocumentService)
.createDocumentFromURI(uri);
newDoc.load();
// At this time Komodo 5 fires the view_document_attached event
ko.views.manager.currentView.document = newDoc;
view_opened bug fix
The well known 4.4.x notification/event view_opened has been fixed on Komodo 5 to have the document property correctly set.
Prior Komodo 5 the view sent during notification had (amazingly!) the document set to null
The view_opened and view_document_attached are strictly related, when a file is opened the view receives both events.
Klint will use view_document_attached to disable syntax checking based on file path regular expressions (eg disable syntax checker for all “.*log” files)
Amazon wish list