views:

225

answers:

1

Question: Is anyone out there familiar enough with Komodo Edit to shed some light on this macro? I need to figure out how to do buffer text selection in a macro when it is invoked via the tool panel.

Problem: I have a very simple macro in Komodo Edit javascript that works as expected, but only when invoked via a custom keybinding. If the user tries to invoke it from the standard "tool panel" the selectWordLeft invocation does nothing. My guess is the failure is caused by the edit buffer not having focus, but one would have thought that telling the macro to expressly give focus to the buffer would work.

komodo.view.setFocus();
komodo.doCommand('cmd_selectWordLeft'); /// this NO_WORKY

Background: Komodo Edit, version 5.0.2, build 2604, platform win32-x86. Built on Wed Nov 19 18:33:41 2008.

A: 

Answer: Did some more searching and came across this response to another question on a KE forum; which seems to fix the problem.

Instead of deleting the question, here's an answer in case anyone else out there has the same or similar problem.

There are currently some issues with komodo.docommand and some commands. 
To work around this, change this line:

komodo.doCommand("cmd_selectWordLeft");

to this instead:

komodo.editor.wordLeftExtend();
dreftymac