使用插入所选函数、添加括号并自动触发调用提示的宏。两个弹出窗口不能同时显示,因此将宏分配给键盘快捷键,并在该快捷键和撤消快捷键之间交替添加/删除括号并显示/隐藏函数列表:
komodo.assertMacroVersion(2);
if (komodo.view && komodo.view.scintilla) { komodo.view.scintilla.focus(); }
var editor = ko.views.manager.currentView.scimoz;
var cursor_character = editor.getCharAt(editor.currentPos - 1); //get cursor position
editor.autoCComplete(); //autocomplete selected function in list
editor.copyText(1,"("); //add left parentheses to buffer
if(cursor_character > 96 && cursor_character < 123)
{
editor.paste(); //add left parentheses to editor after a function name
}
ko.commands.doCommand("cmd_triggerPrecedingCompletion"); //trigger calltip or function list
参考