Komodo编辑:通过按键绑定与工具栏运行宏
问题:有没有人足够熟悉 Komodo Edit 来解释这个宏? 我需要弄清楚当通过工具面板调用宏时如何在宏中进行缓冲区文本选择。
问题:我在 Komodo Edit javascript 中有一个非常简单的宏,它可以按预期工作,但仅在通过自定义键绑定调用时才有效。 如果用户尝试从标准“工具面板”调用它,则 selectWordLeft 调用不会执行任何操作。 我的猜测是失败是由编辑缓冲区没有焦点引起的,但人们会认为告诉宏明确地将焦点赋予缓冲区会起作用。
komodo.view.setFocus();
komodo.doCommand('cmd_selectWordLeft'); /// this NO_WORKY
背景: Komodo Edit,版本 5.0.2,内部版本 2604,平台 win32-x86。 建于 2008 年 11 月 19 日星期三 18:33:41。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答案:做了更多搜索,发现了对 KE 论坛上另一个问题的回复; 这似乎解决了问题。
这里不是删除问题,而是提供一个答案,以防其他人遇到相同或类似的问题。
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.