<commit_before>"use strict";
// Generated by CoffeeScript 1.8.0
(typeof exports !== "undefined" && exports !== null ? exports : window).Commands = {
  init: function() {
    var command, description, descriptions = this._commandDescriptions;
    for (command in descriptions) {
      description = descriptions[command];
      this.addCommand(command, description[0], description[1]);
    }
  },
  availableCommands: {},
  keyToCommandRegistry: {},
  addCommand: function(command, description, options) {
    if (command in this.availableCommands) {
      console.log(command, "is already defined! Check code for duplicates.");
      return;
    }
    options || (options = {});
    this.availableCommands[command] = {
      description: description || command,
      isBackgroundCommand: options.background ? true : false,
      noRepeat: options.noRepeat
    };
  },
  mapKeyToCommand: function(key, command) {
    var commandDetails;
    if (!this.availableCommands[command]) {
      console.log("Command %c" + command, "color:red;", "doesn't exist!");
      return;
    } else if (window._DEBUG) {
      console.log("Mapping", key, "to", command);
    }
    commandDetails = this.availableCommands[command];
    this.keyToCommandRegistry[key] = {
      command: command,
      isBackgroundCommand: commandDetails.isBackgroundCommand,
      noRepeat: commandDetails.noRepeat
    };
  },
  unmapKey: function(key) {
    delete this.keyToCommandRegistry[key];
  },
  _keyLeftRegex: /<[acm]-/ig,
  _keyRegex: /<([<KEY>,
  normalizeKey: function(key) {
    return key.replace(this._keyLeftRegex, function(match) {
      return match.toLowerCase();
    }).replace(this._keyRegex, function(match, optionalPrefix, keyName) {
      return "<" + (optionalPrefix ? optionalPrefix : "") + keyName.toLowerCase() + ">";
    });
  },
  _spaceSpliter: /\s+/,
  parseCustomKeyMappings: function(customKeyMappings) {
    var key, line, lineCommand, lines, splitLine, vimiumCommand, _i, _len;
    lines = customKeyMappings.split("\n");
    for (_i = 0, _len = lines.length; _i < _len; _i++) {
      line = lines[_i].trim();
      if (line[0] === "\"" || line[0] === "#") {
        continue;
      }
      splitLine = line.split(this._spaceSpliter);
      lineCommand = splitLine[0];
      if (lineCommand === "map") {
        if (splitLine.length !== 3) {
          continue;
        }
        key = this.normalizeKey(splitLine[1]);
        vimiumCommand = splitLine[2];
        this.mapKeyToCommand(key, vimiumCommand);
      } else if (lineCommand === "unmap") {
        if (splitLine.length !== 2) {
          continue;
        }
        key = this.normalizeKey(splitLine[1]);
        if (window._DEBUG) {
          console.log("Unmapping", key);
        }
        this.unmapKey(key);
      } else if (lineCommand === "unmapAll") {
        this.keyToCommandRegistry = {};
      }
    }
  },
  clearKeyMappingsAndSetDefaults: function() {
    var key, defaultmap = this._defaultKeyMappings;
    this.keyToCommandRegistry = {};
    for (key in defaultmap) {
      this.mapKeyToCommand(key, defaultmap[key]);
    }
  },
  commandGroups: {
    pageNavigation: ["scrollDown", "scrollUp", "scrollLeft", "scrollRight", "scrollToTop"
      , "scrollToBottom", "scrollToLeft", "scrollToRight", "scrollPageDown", "scrollPageUp"
      , "scrollFullPageUp", "scrollFullPageDown", "reload", "toggleViewSource", "copyCurrentUrl"
      , "LinkHints.activateModeToCopyLinkUrl", "LinkHints.activateModeToCopyLinkText"
      , "openCopiedUrlInCurrentTab", "openCopiedUrlInNewTab", "goUp", "goToRoot", "enterInsertMode"
      , "focusInput", "LinkHints.activateMode", "LinkHints.activateModeToOpenInNewTab"
      , "LinkHints.activateModeToOpenInNewForegroundTab", "LinkHints.activateModeWithQueue"
      , "LinkHints.activateModeToDownloadLink", "LinkHints.activateModeToOpenIncognito"
      , "LinkHints.activateModeToHover" //
      , "Vomnibar.activate", "Vomnibar.activateInNewTab", "Vomnibar.activateTabSelection"
      , "Vomnibar.activateBookmarks", "Vomnibar.activateBookmarksInNewTab", "Vomnibar.activateHistory"
      , "Vomnibar.activateHistoryInNewTab", "goPrevious", "goNext", "nextFrame"
      , "Marks.activateCreateMode", "Vomnibar.activateEditUrl", "Vomnibar.activateEditUrlInNewTab"
      , "Marks.activateGotoMode"],
    historyNavigation: ["goBack", "goForward", "reloadTab"],
    findCommands: ["enterFindMode", "performFind", "performBackwardsFind", "switchFocus", "simBackspace"],
    tabManipulation: ["nextTab", "previousTab", "firstTab", "lastTab", "createTab", "duplicateTab"
      , "removeTab", "restoreTab", "moveTabToNextWindow", "moveTabToIncognito", "togglePinTab"
      , "closeTabsOnLeft", "closeTabsOnRight", "closeOtherTabs", "moveTabLeft", "moveTabRight" //
      , "enableImageTemp"],
    misc: ["showHelp", "enterVisualMode"]
  },
  advancedCommands: ["scrollToLeft", "scrollToRight", "moveTabToNextWindow", "moveTabToIncognito"
    , "goUp", "goToRoot", "focusInput", "LinkHints.activateModeWithQueue", "enableImageTemp"
    , "LinkHints.activateModeToDownloadLink", "Vomnibar.activateEditUrl"
    , "Vomnibar.activateEditUrlInNewTab", "LinkHints.activateModeToOpenIncognito"
    , "goNext", "goPrevious", "Marks.activateCreateMode", "Marks.activateGotoMode"
    , "moveTabLeft", "moveTabRight", "closeTabsOnLeft", "closeTabsOnRight", "closeOtherTabs"],<commit_msg>small changes: move two commands to historyNavigation<commit_after>"use strict";
// Generated by CoffeeScript 1.8.0
(typeof exports !== "undefined" && exports !== null ? exports : window).Commands = {
  init: function() {
    var command, description, descriptions = this._commandDescriptions;
    for (command in descriptions) {
      description = descriptions[command];
      this.addCommand(command, description[0], description[1]);
    }
  },
  availableCommands: {},
  keyToCommandRegistry: {},
  addCommand: function(command, description, options) {
    if (command in this.availableCommands) {
      console.log(command, "is already defined! Check code for duplicates.");
      return;
    }
    options || (options = {});
    this.availableCommands[command] = {
      description: description || command,
      isBackgroundCommand: options.background ? true : false,
      noRepeat: options.noRepeat
    };
  },
  mapKeyToCommand: function(key, command) {
    var commandDetails;
    if (!this.availableCommands[command]) {
      console.log("Command %c" + command, "color:red;", "doesn't exist!");
      return;
    } else if (window._DEBUG) {
      console.log("Mapping", key, "to", command);
    }
    commandDetails = this.availableCommands[command];
    this.keyToCommandRegistry[key] = {
      command: command,
      isBackgroundCommand: commandDetails.isBackgroundCommand,
      noRepeat: commandDetails.noRepeat
    };
  },
  unmapKey: function(key) {
    delete this.keyToCommandRegistry[key];
  },
  _keyLeftRegex: /<[acm]-/ig,
  _keyRegex: /<([<KEY>g,
  normalizeKey: function(key) {
    return key.replace(this._keyLeftRegex, function(match) {
      return match.toLowerCase();
    }).replace(this._keyRegex, function(match, optionalPrefix, keyName) {
      return "<" + (optionalPrefix ? optionalPrefix : "") + keyName.toLowerCase() + ">";
    });
  },
  _spaceSpliter: /\s+/,
  parseCustomKeyMappings: function(customKeyMappings) {
    var key, line, lineCommand, lines, splitLine, vimiumCommand, _i, _len;
    lines = customKeyMappings.split("\n");
    for (_i = 0, _len = lines.length; _i < _len; _i++) {
      line = lines[_i].trim();
      if (line[0] === "\"" || line[0] === "#") {
        continue;
      }
      splitLine = line.split(this._spaceSpliter);
      lineCommand = splitLine[0];
      if (lineCommand === "map") {
        if (splitLine.length !== 3) {
          continue;
        }
        key = this.normalizeKey(splitLine[1]);
        vimiumCommand = splitLine[2];
        this.mapKeyToCommand(key, vimiumCommand);
      } else if (lineCommand === "unmap") {
        if (splitLine.length !== 2) {
          continue;
        }
        key = this.normalizeKey(splitLine[1]);
        if (window._DEBUG) {
          console.log("Unmapping", key);
        }
        this.unmapKey(key);
      } else if (lineCommand === "unmapAll") {
        this.keyToCommandRegistry = {};
      }
    }
  },
  clearKeyMappingsAndSetDefaults: function() {
    var key, defaultmap = this._defaultKeyMappings;
    this.keyToCommandRegistry = {};
    for (key in defaultmap) {
      this.mapKeyToCommand(key, defaultmap[key]);
    }
  },
  commandGroups: {
    pageNavigation: ["scrollDown", "scrollUp", "scrollLeft", "scrollRight", "scrollToTop"
      , "scrollToBottom", "scrollToLeft", "scrollToRight", "scrollPageDown", "scrollPageUp"
      , "scrollFullPageUp", "scrollFullPageDown", "reload", "toggleViewSource", "copyCurrentUrl"
      , "LinkHints.activateModeToCopyLinkUrl", "LinkHints.activateModeToCopyLinkText"
      , "openCopiedUrlInCurrentTab", "openCopiedUrlInNewTab", "goUp", "goToRoot", "enterInsertMode"
      , "focusInput", "LinkHints.activateMode", "LinkHints.activateModeToOpenInNewTab"
      , "LinkHints.activateModeToOpenInNewForegroundTab", "LinkHints.activateModeWithQueue"
      , "LinkHints.activateModeToDownloadLink", "LinkHints.activateModeToOpenIncognito"
      , "LinkHints.activateModeToHover" //
      , "Vomnibar.activate", "Vomnibar.activateInNewTab", "Vomnibar.activateTabSelection"
      , "Vomnibar.activateBookmarks", "Vomnibar.activateBookmarksInNewTab", "Vomnibar.activateHistory"
      , "Vomnibar.activateHistoryInNewTab", "goPrevious", "goNext", "nextFrame"
      , "Marks.activateCreateMode", "Vomnibar.activateEditUrl", "Vomnibar.activateEditUrlInNewTab"
      , "Marks.activateGotoMode"],
    historyNavigation: ["goBack", "goForward", "reloadTab", "switchFocus", "simBackspace"],
    findCommands: ["enterFindMode", "performFind", "performBackwardsFind"],
    tabManipulation: ["nextTab", "previousTab", "firstTab", "lastTab", "createTab", "duplicateTab"
      , "removeTab", "restoreTab", "moveTabToNextWindow", "moveTabToIncognito", "togglePinTab"
      , "closeTabsOnLeft", "closeTabsOnRight", "closeOtherTabs", "moveTabLeft", "moveTabRight" //
      , "enableImageTemp"],
    misc: ["showHelp", "enterVisualMode"]
  },
  advancedCommands: ["scrollToLeft", "scrollToRight", "moveTabToNextWindow", "moveTabToIncognito"
    , "goUp", "goToRoot", "focusInput", "LinkHints.activateModeWithQueue", "enableImageTemp"
    , "LinkHints.activateModeToDownloadLink", "Vomnibar.activateEditUrl"
    , "Vomnibar.activateEditUrlInNewTab", "LinkHints.activateModeToOpenIncognito"
    , "goNext", "goPrevious", "Marks.activateCreateMode", "Marks.activateGotoMode"
    , "moveTabLeft", "moveTabRight", "closeTabsOnLeft", "closeTabsOnRight", "closeOtherTabs"],
{'fraction_non_alphanumeric': 0.1459279162420087, 'fraction_numerical': 0.0025942740665245993, 'mean_word_length': 4.004172461752434, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '99359', 'n_tokens_mistral': 3391, 'n_tokens_neox': 3372, 'n_words': 589}