In Komodo Edit 6.1 , there is a nice feature to find and highlight all the functions (navigation->Find all functions ctrl+F8). It searches based on a Regex to find all the functions, which is this :

^[  ]*?(def\s+[^\(]+\([^\)]*?\):|class\s+[^:]*?:)

But there is a minor problem with it, if there are some blank spaces between the ")" and ":" , which technically is correct but this Regex won't match. I want to modify it to :

^[  ]*?(def\s+[^\(]+\([^\)]*?\) *:|class\s+[^:]*?:)

There is only one additional "{space}*" before first ":"

But I don't know where to find the default value for this configuration. I even tried about:config but it wasn't there too.

Thanks for your help.

有帮助吗?

解决方案

Use Ctrl+F immediately after Ctrl+F8 to view and modify the regex. Save it as a macro and bind the macro to a keyboard shortcut:

 komodo.assertMacroVersion(2);
 if (komodo.view && komodo.view.scintilla) { komodo.view.scintilla.focus(); } // bug 67103

 Find_ReplaceAllInMacro(window, 2, '(^[ |\t]*?(?:([\w|\.|_]*?)\s*=\s*function|function\s*([\w|\_]*?)|([\w|\_]*?)\s*:\s*function).*?$)', '\\1', true, 2, 0, false, false);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top