Disable cursor blinking in Komodo (edit) with a JavaScript macro

From Svendsen Tech PowerShell Wiki
Jump to: navigation, search

How To Disable Cursor Blinking In Komodo And Komodo Edit

If, like me, you are annoyed by blinking cursors, and have noticed there is no "disable cursor blinking" option in Komodo or Komodo Edit, you will be happy to stumble upon this little tech note.

Back in the days, I came across a JavaScript snippet that effectively disables cursor blinking in Komodo, and can be added as a macro. I don't remember where, so I can't give due credit. It's about time I make it easily available.

As of version 7 (I think), Komodo Edit respects the system setting in Windows for cursor blinking.




JavaScript Code To Add As A Macro

if (ko.views.manager.currentView && ko.views.manager.currentView.document) {
    ko.views.manager.currentView.scimoz.caretPeriod = 0;
}

How To Add The Macro

Komodo Edit 4.x and 5.x

  • Go to the menu choice Toolbox -> Add -> New Macro:

Komodo-edit-disable-cursor-blinking-menu-choice.png

Komodo Edit 6.x

  • Click the button in the red square to show the right-side pane

Komodo-edit-v6-disable-cursor-blinking-show-hide-right-pane.png


  • Right-click an empty area, select "Add" and "New Macro"

Komodo-edit-v6-disable-cursor-blinking-toolbox-right-click-new-macro.png

Pasting the Code and Setting a Trigger

  • Paste the text from the code above into the window and make sure "JavaScript" is selected. Then set it to trigger on file open.

Komodo-edit-disable-cursor-blinking-properties-macro.png Komodo-edit-disable-cursor-blinking-properties-triggers.png

Caveats

If you have a session with, say, 10 files open, you will notice that the cursor blinks in all the documents except the last one opened. So you will need to run the macro on demand for these files. I keep the Toolbox to the right where I just double-click the macro. You can also bind it to a keyboard shortcut.