mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 04:27:58 +01:00
Whitespace fixes.
This commit is contained in:
@@ -187,7 +187,7 @@ const AutoCommands = Module("autocommands", {
|
|||||||
autocommands.remove(event, regex); // remove all
|
autocommands.remove(event, regex); // remove all
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
autocommands.list(event, regex); // list all
|
autocommands.list(event, regex); // list all
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
bang: true,
|
bang: true,
|
||||||
|
|||||||
@@ -325,7 +325,7 @@ const Bookmarks = Module("bookmarks", {
|
|||||||
let url = args.length == 0 ? buffer.URL : args[0];
|
let url = args.length == 0 ? buffer.URL : args[0];
|
||||||
let title = args["-title"] || (args.length == 0 ? buffer.title : null);
|
let title = args["-title"] || (args.length == 0 ? buffer.title : null);
|
||||||
let keyword = args["-keyword"] || null;
|
let keyword = args["-keyword"] || null;
|
||||||
let tags = args["-tags"] || [];
|
let tags = args["-tags"] || [];
|
||||||
|
|
||||||
if (bookmarks.add(false, title, url, keyword, tags, args.bang)) {
|
if (bookmarks.add(false, title, url, keyword, tags, args.bang)) {
|
||||||
let extra = (title == url) ? "" : " (" + title + ")";
|
let extra = (title == url) ? "" : " (" + title + ")";
|
||||||
|
|||||||
@@ -1349,7 +1349,7 @@ const Buffer = Module("buffer", {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
text: [i + ": " + (tab.label || "(Untitled)"), i + ": " + url],
|
text: [i + ": " + (tab.label || "(Untitled)"), i + ": " + url],
|
||||||
url: url,
|
url: url,
|
||||||
indicator: indicator,
|
indicator: indicator,
|
||||||
icon: tab.image || DEFAULT_FAVICON
|
icon: tab.image || DEFAULT_FAVICON
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ const CommandLine = Module("commandline", {
|
|||||||
// we need to save the mode which were in before opening the command line
|
// we need to save the mode which were in before opening the command line
|
||||||
// this is then used if we focus the command line again without the "official"
|
// this is then used if we focus the command line again without the "official"
|
||||||
// way of calling "open"
|
// way of calling "open"
|
||||||
this._currentExtendedMode = null; // the extended mode which we last openend the command line for
|
this._currentExtendedMode = null; // the extended mode which we last openend the command line for
|
||||||
this._currentPrompt = null;
|
this._currentPrompt = null;
|
||||||
this._currentCommand = null;
|
this._currentCommand = null;
|
||||||
|
|
||||||
@@ -640,7 +640,7 @@ const CommandLine = Module("commandline", {
|
|||||||
|
|
||||||
// user pressed <Enter> to carry out a command
|
// user pressed <Enter> to carry out a command
|
||||||
// user pressing <Esc> is handled in the global onEscape
|
// user pressing <Esc> is handled in the global onEscape
|
||||||
// FIXME: <Esc> should trigger "cancel" event
|
// FIXME: <Esc> should trigger "cancel" event
|
||||||
if (events.isAcceptKey(key)) {
|
if (events.isAcceptKey(key)) {
|
||||||
let mode = this._currentExtendedMode; // save it here, as modes.pop() resets it
|
let mode = this._currentExtendedMode; // save it here, as modes.pop() resets it
|
||||||
this._keepCommand = !userContext.hidden_option_no_command_afterimage;
|
this._keepCommand = !userContext.hidden_option_no_command_afterimage;
|
||||||
@@ -1592,9 +1592,9 @@ const ItemList = Class("ItemList", {
|
|||||||
this._gradient = template.gradient("GradientLeft", "GradientRight");
|
this._gradient = template.gradient("GradientLeft", "GradientRight");
|
||||||
|
|
||||||
this._items = null;
|
this._items = null;
|
||||||
this._startIndex = -1; // The index of the first displayed item
|
this._startIndex = -1; // The index of the first displayed item
|
||||||
this._endIndex = -1; // The index one *after* the last displayed item
|
this._endIndex = -1; // The index one *after* the last displayed item
|
||||||
this._selIndex = -1; // The index of the currently selected element
|
this._selIndex = -1; // The index of the currently selected element
|
||||||
this._div = null;
|
this._div = null;
|
||||||
this._divNodes = {};
|
this._divNodes = {};
|
||||||
this._minHeight = 0;
|
this._minHeight = 0;
|
||||||
|
|||||||
@@ -570,9 +570,9 @@ const Commands = Module("commands", {
|
|||||||
if (!argCount)
|
if (!argCount)
|
||||||
argCount = "*";
|
argCount = "*";
|
||||||
|
|
||||||
var args = []; // parsed options
|
var args = []; // parsed options
|
||||||
args.__iterator__ = function () array.iteritems(this);
|
args.__iterator__ = function () array.iteritems(this);
|
||||||
args.string = str; // for access to the unparsed string
|
args.string = str; // for access to the unparsed string
|
||||||
args.literalArg = "";
|
args.literalArg = "";
|
||||||
|
|
||||||
// FIXME!
|
// FIXME!
|
||||||
@@ -712,7 +712,7 @@ const Commands = Module("commands", {
|
|||||||
matchOpts(sub);
|
matchOpts(sub);
|
||||||
|
|
||||||
if (complete) {
|
if (complete) {
|
||||||
if (argCount == "0" || args.length > 0 && (/[1?]/.test(argCount)))
|
if (argCount == "0" || args.length > 0 && (/[1?]/.test(argCount)))
|
||||||
complete.highlight(i, sub.length, "SPELLCHECK");
|
complete.highlight(i, sub.length, "SPELLCHECK");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -776,7 +776,7 @@ const Commands = Module("commands", {
|
|||||||
fail("E471: Argument required");
|
fail("E471: Argument required");
|
||||||
}
|
}
|
||||||
else if (args.length == 1 && (argCount == "0") ||
|
else if (args.length == 1 && (argCount == "0") ||
|
||||||
args.length > 1 && /^[01?]$/.test(argCount))
|
args.length > 1 && /^[01?]$/.test(argCount))
|
||||||
fail("E488: Trailing characters");
|
fail("E488: Trailing characters");
|
||||||
|
|
||||||
return args;
|
return args;
|
||||||
|
|||||||
@@ -1002,8 +1002,8 @@ const Dactyl = Module("dactyl", {
|
|||||||
* failure.
|
* failure.
|
||||||
*
|
*
|
||||||
* @param {boolean} condition The condition to test.
|
* @param {boolean} condition The condition to test.
|
||||||
* @param {string} message The message to present to the
|
* @param {string} message The message to present to the
|
||||||
* user on failure.
|
* user on failure.
|
||||||
*/
|
*/
|
||||||
assert: function (condition, message) {
|
assert: function (condition, message) {
|
||||||
if (!condition)
|
if (!condition)
|
||||||
|
|||||||
@@ -67,10 +67,10 @@ const Events = Module("events", {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this._input = {
|
this._input = {
|
||||||
buffer: "", // partial command storage
|
buffer: "", // partial command storage
|
||||||
pendingMotionMap: null, // e.g. "d{motion}" if we wait for a motion of the "d" command
|
pendingMotionMap: null, // e.g. "d{motion}" if we wait for a motion of the "d" command
|
||||||
pendingArgMap: null, // pending map storage for commands like m{a-z}
|
pendingArgMap: null, // pending map storage for commands like m{a-z}
|
||||||
count: null // parsed count from the input buffer
|
count: null // parsed count from the input buffer
|
||||||
};
|
};
|
||||||
|
|
||||||
// load all macros
|
// load all macros
|
||||||
@@ -283,7 +283,7 @@ const Events = Module("events", {
|
|||||||
let wasFeeding = this.feedingKeys;
|
let wasFeeding = this.feedingKeys;
|
||||||
this.feedingKeys = true;
|
this.feedingKeys = true;
|
||||||
this.duringFeed = this.duringFeed || [];
|
this.duringFeed = this.duringFeed || [];
|
||||||
let wasQuiet = commandline.quiet;
|
let wasQuiet = commandline.quiet;
|
||||||
if (quiet)
|
if (quiet)
|
||||||
commandline.quiet = quiet;
|
commandline.quiet = quiet;
|
||||||
|
|
||||||
@@ -338,9 +338,9 @@ const Events = Module("events", {
|
|||||||
* The pseudo-event object (such as may be retrieved from events.fromString)
|
* The pseudo-event object (such as may be retrieved from events.fromString)
|
||||||
* should have any properties you want the event to have.
|
* should have any properties you want the event to have.
|
||||||
*
|
*
|
||||||
* @param {Document} doc The DOM document to associate this event with
|
* @param {Document} doc The DOM document to associate this event with
|
||||||
* @param {Type} type The type of event (keypress, click, etc.)
|
* @param {Type} type The type of event (keypress, click, etc.)
|
||||||
* @param {Object} opts The pseudo-event.
|
* @param {Object} opts The pseudo-event.
|
||||||
*/
|
*/
|
||||||
create: function (doc, type, opts) {
|
create: function (doc, type, opts) {
|
||||||
var DEFAULTS = {
|
var DEFAULTS = {
|
||||||
@@ -428,7 +428,7 @@ const Events = Module("events", {
|
|||||||
modifier = modifier.toUpperCase();
|
modifier = modifier.toUpperCase();
|
||||||
keyname = keyname.toLowerCase();
|
keyname = keyname.toLowerCase();
|
||||||
|
|
||||||
if (keyname && !(keyname.length == 1 && modifier.length == 0 || // disallow <> and <a>
|
if (keyname && !(keyname.length == 1 && modifier.length == 0 || // disallow <> and <a>
|
||||||
!(keyname.length == 1 || this._key_code[keyname] || keyname == "nop" || /mouse$/.test(keyname)))) { // disallow <misteak>
|
!(keyname.length == 1 || this._key_code[keyname] || keyname == "nop" || /mouse$/.test(keyname)))) { // disallow <misteak>
|
||||||
evt_obj.ctrlKey = /C-/.test(modifier);
|
evt_obj.ctrlKey = /C-/.test(modifier);
|
||||||
evt_obj.altKey = /A-/.test(modifier);
|
evt_obj.altKey = /A-/.test(modifier);
|
||||||
@@ -555,7 +555,7 @@ const Events = Module("events", {
|
|||||||
// or if the shift has been forced for a non-alphabetical character by the user while :map-ping
|
// or if the shift has been forced for a non-alphabetical character by the user while :map-ping
|
||||||
if ((key != key.toLowerCase() && (event.ctrlKey || event.altKey || event.metaKey)) || event.dactylShift)
|
if ((key != key.toLowerCase() && (event.ctrlKey || event.altKey || event.metaKey)) || event.dactylShift)
|
||||||
modifier += "S-";
|
modifier += "S-";
|
||||||
else if (modifier.length == 0)
|
else if (modifier.length == 0)
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,17 +13,17 @@ const Hints = Module("hints", {
|
|||||||
init: function () {
|
init: function () {
|
||||||
|
|
||||||
this._hintMode = null;
|
this._hintMode = null;
|
||||||
this._submode = ""; // used for extended mode, can be "o", "t", "y", etc.
|
this._submode = ""; // used for extended mode, can be "o", "t", "y", etc.
|
||||||
this._hintString = ""; // the typed string part of the hint is in this string
|
this._hintString = ""; // the typed string part of the hint is in this string
|
||||||
this._hintNumber = 0; // only the numerical part of the hint
|
this._hintNumber = 0; // only the numerical part of the hint
|
||||||
this._usedTabKey = false; // when we used <Tab> to select an element
|
this._usedTabKey = false; // when we used <Tab> to select an element
|
||||||
this.prevInput = ""; // record previous user input type, "text" || "number"
|
this.prevInput = ""; // record previous user input type, "text" || "number"
|
||||||
this._extendedhintCount = null; // for the count argument of Mode#action (extended hint only)
|
this._extendedhintCount = null; // for the count argument of Mode#action (extended hint only)
|
||||||
|
|
||||||
this._pageHints = [];
|
this._pageHints = [];
|
||||||
this._validHints = []; // store the indices of the "hints" array with valid elements
|
this._validHints = []; // store the indices of the "hints" array with valid elements
|
||||||
|
|
||||||
this._activeTimeout = null; // needed for hinttimeout > 0
|
this._activeTimeout = null; // needed for hinttimeout > 0
|
||||||
this._canUpdate = false;
|
this._canUpdate = false;
|
||||||
|
|
||||||
// keep track of the documents which we generated the hints for
|
// keep track of the documents which we generated the hints for
|
||||||
@@ -153,10 +153,10 @@ const Hints = Module("hints", {
|
|||||||
*
|
*
|
||||||
* Only called by {@link #_generate}.
|
* Only called by {@link #_generate}.
|
||||||
*
|
*
|
||||||
* @param {Object} elem The <area> element.
|
* @param {Object} elem The <area> element.
|
||||||
* @param {number} leftPos The left offset of the image.
|
* @param {number} leftPos The left offset of the image.
|
||||||
* @param {number} topPos The top offset of the image.
|
* @param {number} topPos The top offset of the image.
|
||||||
* @returns [leftPos, topPos] The updated offsets.
|
* @returns [leftPos, topPos] The updated offsets.
|
||||||
*/
|
*/
|
||||||
_getAreaOffset: function (elem, leftPos, topPos) {
|
_getAreaOffset: function (elem, leftPos, topPos) {
|
||||||
try {
|
try {
|
||||||
@@ -834,7 +834,7 @@ const Hints = Module("hints", {
|
|||||||
case mappings.getMapLeader():
|
case mappings.getMapLeader():
|
||||||
hints.escNumbers = !hints.escNumbers;
|
hints.escNumbers = !hints.escNumbers;
|
||||||
if (hints.escNumbers && this._usedTabKey) // this._hintNumber not used normally, but someone may wants to toggle
|
if (hints.escNumbers && this._usedTabKey) // this._hintNumber not used normally, but someone may wants to toggle
|
||||||
this._hintNumber = 0; // <tab>s ? this._reset. Prevent to show numbers not entered.
|
this._hintNumber = 0; // <tab>s ? this._reset. Prevent to show numbers not entered.
|
||||||
|
|
||||||
this._updateStatusline();
|
this._updateStatusline();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ const JavaScript = Module("javascript", {
|
|||||||
|
|
||||||
// Todo: Fix these one-letter variable names.
|
// Todo: Fix these one-letter variable names.
|
||||||
this._i = 0;
|
this._i = 0;
|
||||||
this._c = ""; // Current index and character, respectively.
|
this._c = ""; // Current index and character, respectively.
|
||||||
|
|
||||||
// Reuse the old stack.
|
// Reuse the old stack.
|
||||||
if (this._str && filter.substr(0, this._str.length) == this._str) {
|
if (this._str && filter.substr(0, this._str.length) == this._str) {
|
||||||
@@ -180,7 +180,7 @@ const JavaScript = Module("javascript", {
|
|||||||
// A "." or a "[" dereferences the last "statement" and effectively
|
// A "." or a "[" dereferences the last "statement" and effectively
|
||||||
// joins it to this logical statement.
|
// joins it to this logical statement.
|
||||||
if ((this._c == "." || this._c == "[") && /[\w$\])"']/.test(this._lastNonwhite)
|
if ((this._c == "." || this._c == "[") && /[\w$\])"']/.test(this._lastNonwhite)
|
||||||
|| this._lastNonwhite == "." && /[a-zA-Z_$]/.test(this._c))
|
|| this._lastNonwhite == "." && /[a-zA-Z_$]/.test(this._c))
|
||||||
this._top.statements.pop();
|
this._top.statements.pop();
|
||||||
|
|
||||||
switch (this._c) {
|
switch (this._c) {
|
||||||
|
|||||||
@@ -555,7 +555,7 @@ const Mappings = Module("mappings", {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
addMapCommands("", [modes.NORMAL, modes.VISUAL], "");
|
addMapCommands("", [modes.NORMAL, modes.VISUAL], "");
|
||||||
|
|
||||||
for (let mode in modes.mainModes)
|
for (let mode in modes.mainModes)
|
||||||
if (mode.char && !commands.get(mode.char + "map", true))
|
if (mode.char && !commands.get(mode.char + "map", true))
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ const Modes = Module("modes", {
|
|||||||
get passAllKeys() this._passAllKeys,
|
get passAllKeys() this._passAllKeys,
|
||||||
set passAllKeys(value) { this._passAllKeys = value; this.show(); },
|
set passAllKeys(value) { this._passAllKeys = value; this.show(); },
|
||||||
|
|
||||||
get isRecording() this._isRecording,
|
get isRecording() this._isRecording,
|
||||||
set isRecording(value) { this._isRecording = value; this.show(); },
|
set isRecording(value) { this._isRecording = value; this.show(); },
|
||||||
|
|
||||||
get isReplaying() this._isReplaying,
|
get isReplaying() this._isReplaying,
|
||||||
|
|||||||
@@ -963,7 +963,7 @@ const Options = Module("options", {
|
|||||||
|
|
||||||
_loadPreference: function (name, forcedDefault, defaultBranch) {
|
_loadPreference: function (name, forcedDefault, defaultBranch) {
|
||||||
let defaultValue = null; // XXX
|
let defaultValue = null; // XXX
|
||||||
if (forcedDefault != null) // this argument sets defaults for non-user settable options (like extensions.history.comp_history)
|
if (forcedDefault != null) // this argument sets defaults for non-user settable options (like extensions.history.comp_history)
|
||||||
defaultValue = forcedDefault;
|
defaultValue = forcedDefault;
|
||||||
|
|
||||||
let branch = defaultBranch ? services.get("pref").getDefaultBranch("") : services.get("pref");
|
let branch = defaultBranch ? services.get("pref").getDefaultBranch("") : services.get("pref");
|
||||||
|
|||||||
@@ -359,7 +359,7 @@ const File = Class("File", {
|
|||||||
|
|
||||||
let array = [e for (e in this.iterDirectory())];
|
let array = [e for (e in this.iterDirectory())];
|
||||||
if (sort)
|
if (sort)
|
||||||
array.sort(function (a, b) b.isDirectory() - a.isDirectory() || String.localeCompare(a.path, b.path));
|
array.sort(function (a, b) b.isDirectory() - a.isDirectory() || String.localeCompare(a.path, b.path));
|
||||||
return array;
|
return array;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user