<commit_before>"use strict";
var INFO = [
        "plugin",
        {
            name: "treestyletabs",
            version: "0.1",
            href: "",
            summary: "TreeStyleTabs integration for Pentadactyl",
            xmlns: "dactyl"
        },
        [
            "author",
            { email: "<EMAIL>" },
            "<NAME>"
        ],
        [
            "license",
            { href: "http://opensource.org/licenses/mit-license.php" },
            "MIT"
        ],
        [
            "project",
            { name: "Pentadactyl", "min-version": "1.0" }
        ],
    ];

// pass true to close, false to open
function fold_collapse_expand_target(tab, collapse, children = false) {
    if (children) {
        let children = TreeStyleTabService.getDescendantTabs(tab);
        for (let x in children) {
            gBrowser.treeStyleTab.collapseExpandSubtree(children[x], collapse);
        }
    }
    gBrowser.treeStyleTab.collapseExpandSubtree(tab, collapse);
}

function fold_collapse_expand(collapse, children = false) {
    fold_collapse_expand_target(
        gBrowser.tabContainer.selectedItem,
        collapse,
        children
        );
}

function fold_collapse_expand_toggle(children = false) {
    fold_collapse_expand(
        !TreeStyleTabService.isSubtreeCollapsed(gBrowser.tabContainer.selectedItem),<commit_msg>Fix 'ga' not properly closing parent fold<commit_after>"use strict";
var INFO = [
        "plugin",
        {
            name: "treestyletabs",
            version: "0.1",
            href: "",
            summary: "TreeStyleTabs integration for Pentadactyl",
            xmlns: "dactyl"
        },
        [
            "author",
            { email: "<EMAIL>" },
            "<NAME>"
        ],
        [
            "license",
            { href: "http://opensource.org/licenses/mit-license.php" },
            "MIT"
        ],
        [
            "project",
            { name: "Pentadactyl", "min-version": "1.0" }
        ],
    ];

// pass true to close, false to open
function fold_collapse_expand_target(tab, collapse, children = false) {
    if (children) {
        let children = TreeStyleTabService.getDescendantTabs(tab);
        for (let x in children) {
            gBrowser.treeStyleTab.collapseExpandSubtree(children[x], collapse);
        }
    }
    gBrowser.treeStyleTab.collapseExpandSubtree(tab, collapse);
}

function fold_collapse_expand(collapse, children = false) {
    let tab = gBrowser.tabContainer.selectedItem;

    if (!TreeStyleTabService.hasChildTabs(tab)) {
        let tab = TreeStyleTabService.getParentTab(tab);
        collapse = TreeStyleTabService.isSubtreeCollapsed(tab);
    }

    fold_collapse_expand_target(
        tab,
        collapse,
        children
        );
}

function fold_collapse_expand_toggle(children = false) {
    fold_collapse_expand(
        !TreeStyleTabService.isSubtreeCollapsed(gBrowser.tabContainer.selectedItem),
{'fraction_non_alphanumeric': 0.11405295315682282, 'fraction_numerical': 0.0027155465037338763, 'mean_word_length': 2.0602284527518173, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3375971', 'n_tokens_mistral': 845, 'n_tokens_neox': 840, 'n_words': 153}