A Komodo Python macro that can be used to select the current word under the cursor position.
JavaScript version here: Recipe 577007.
1 2 3 4 5 6 7 | import komodo
scimoz = komodo.editor
word_start = scimoz.wordStartPosition(scimoz.currentPos, True)
word_end = scimoz.wordEndPosition(scimoz.currentPos, True)
scimoz.anchor = word_start
scimoz.currentPos = word_end
|
This works as well
import komodo word = komodo.getWordUnderCursor()
Im having a more difficult time finding how to get the selected text...
Use "scimoz.selText" to get the selected text. More scimoz functions can be found at: http://docs.activestate.com/komodo/5.2/macroapi.html#macroapi_scimoz