Given that most people will not have a need for this and the fact that people can do this with a macro, it will not likely make it as a Komodo preference option.
You can do this currently by:
In your Komodo toolbox, create a JavaScript macro named "collapse all folds" with the following contents:
// Focus is to ensure we are performing the command on the editor window!
ko.views.manager.currentView.scintilla.focus(); // Collapse all the folding.
ko.commands.doCommand("cmd_foldCollapseAll");
// Focus is to ensure we are performing the command on the editor window!
ko.views.manager.currentView.scintilla.focus();
// Collapse all the folding.
ko.commands.doCommand("cmd_foldCollapseAll");
In the macro "Triggers" tab section, make the macro trigger on the "after file open" event.
Now, everytime you open a Komodo file your macro will fire, collapsing all the fold marks.
I am getting the following error when I run the above.
Error while running in macro collapse all folds:
TypeError: ko.views.manager has no properties
exception[message] = ko.views.manager has no properties
exception[fileName] = chrome://komodo/content/project/peMacro.js
exception[lineNumber] = 426
exception[stack] = ()@chrome://komodo/content/project/peMacro.js:426
macro_evalAsJavascript("// Focus is to ensure we are performing the command on the editor window!\nko.views.manager.currentView.scintilla.focus();\n// Collapse all the folding.\nko.commands.doCommand(\"cmd_foldCollapseAll\");",[object XPCWrappedNative_NoHelper])@chrome://komodo/content/project/peMacro.js:426
_executeMacro([object XPCWrappedNative_NoHelper],true)@chrome://komodo/content/project/peMacro.js:180
macro_executeMacroById("8f841c5b-4448-4a1a-b104-6cb5f9083cfd",true)@chrome://komodo/content/project/peMacro.js:154
@chrome://komodo/content/project/peMacro.js:138
exception[name] = TypeError
Yes, sorry about that. For Komodo 4.1 and earlier you'll need to use this macro:
// Focus is to ensure we are performing the command on the editor window!
gViewMgr.currentView.scintilla.focus(); // Collapse all the folding.
ko.commands.doCommand("cmd_foldCollapseAll");
// Focus is to ensure we are performing the command on the editor window!
gViewMgr.currentView.scintilla.focus();
// Collapse all the folding.
ko.commands.doCommand("cmd_foldCollapseAll");
Given that most people will not have a need for this and the fact that people can do this with a macro, it will not likely make it as a Komodo preference option.
You can do this currently by:
ko.views.manager.currentView.scintilla.focus();
// Collapse all the folding.
ko.commands.doCommand("cmd_foldCollapseAll");
// Focus is to ensure we are performing the command on the editor window! ko.views.manager.currentView.scintilla.focus(); // Collapse all the folding. ko.commands.doCommand("cmd_foldCollapseAll");Now, everytime you open a Komodo file your macro will fire, collapsing all the fold marks.
Cheers,
Todd
I am getting the following error when I run the above.
Error while running in macro collapse all folds: TypeError: ko.views.manager has no properties exception[message] = ko.views.manager has no properties exception[fileName] = chrome://komodo/content/project/peMacro.js exception[lineNumber] = 426 exception[stack] = ()@chrome://komodo/content/project/peMacro.js:426 macro_evalAsJavascript("// Focus is to ensure we are performing the command on the editor window!\nko.views.manager.currentView.scintilla.focus();\n// Collapse all the folding.\nko.commands.doCommand(\"cmd_foldCollapseAll\");",[object XPCWrappedNative_NoHelper])@chrome://komodo/content/project/peMacro.js:426 _executeMacro([object XPCWrappedNative_NoHelper],true)@chrome://komodo/content/project/peMacro.js:180 macro_executeMacroById("8f841c5b-4448-4a1a-b104-6cb5f9083cfd",true)@chrome://komodo/content/project/peMacro.js:154 @chrome://komodo/content/project/peMacro.js:138 exception[name] = TypeErrorYes, sorry about that. For Komodo 4.1 and earlier you'll need to use this macro:
gViewMgr.currentView.scintilla.focus();
// Collapse all the folding.
ko.commands.doCommand("cmd_foldCollapseAll");
// Focus is to ensure we are performing the command on the editor window! gViewMgr.currentView.scintilla.focus(); // Collapse all the folding. ko.commands.doCommand("cmd_foldCollapseAll");Cheers,
Todd