Komodo编辑:通过按键绑定与工具栏运行宏

发布于 2024-07-11 06:06:37 字数 517 浏览 7 评论 0原文

问题:有没有人足够熟悉 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

厌味 2024-07-18 06:06:37

答案:做了更多搜索,发现了对 KE 论坛上另一个问题的回复; 这似乎解决了问题。

这里不是删除问题,而是提供一个答案,以防其他人遇到相同或类似的问题。

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();

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();
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文