Search code examples
komodokomodoedit

Any way to easily close all built-up search tabs at once in Komodo Edit 9.3?


The Komodo Edit 9.3 update notes include a line that says:

"Multiple Find Result Tabs: Every search now opens in its own result tab, you are no longer limited to 2 tabs. Find results now also show a new input field that allow you to search again with the same input but a different search pattern."

It's nice having more than two sets of search results at a time, but is there any easy way to clear all of the current search result tabs at once? I find myself having to either close the tabs as soon as I'm done with them or having to click over and over to close all of the ones that have gathered over time. Hopefully there's an easy "close all" way that I missed! I've searched around a bit and didn't find any help. Thanks!


Solution

  • This is currently not possible through native functionality in Komodo. An enhancement request has been opened here: https://github.com/Komodo/KomodoEdit/issues/849

    You could however use a userscript to add this functionality yourself:

    var items = ko.widgets._widgets.listitems();
    for (let item of items)
    {
        let [name, widget] = item;
        if (name.indexOf("findresults") !== 0) continue;
        let tab = widget.browser.parentNode.tab;
        tab.dispatchEvent(new Event("close-tab"));
    }
    

    Taken from: http://forum.komodoide.com/t/komodo-9-3-pre-release-what-do-you-like-what-dont-you-like/2118/29?u=nathanr