Welcome, guest | Sign In | My Account | Store | Cart

A Komodo JavaScript macro that can be used to select the current word under the cursor position.

Python version here: Recipe 577006.

JavaScript, 6 lines
1
2
3
4
5
6
// Highlight the word under the cursor.
var scimoz = ko.views.manager.currentView.scimoz;
var start = scimoz.wordStartPosition(scimoz.currentPos, true);
var end = scimoz.wordEndPosition(scimoz.currentPos, true);
scimoz.anchor = start;
scimoz.currentPos = end;