1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 17:47:59 +01:00

Use null rather than -1 for specifying a non-existent mode display function.

--HG--
extra : rebase_source : 1709c70c9e792c2f52009728fc7cd53970f8a9ae
This commit is contained in:
Doug Kearns
2010-10-07 01:35:25 +11:00
parent 03fc7f24d8
commit a74f5df6c7

View File

@@ -30,7 +30,7 @@ const Modes = Module("modes", {
this.boundProperties = {};
// main modes, only one should ever be active
this.addMode("NORMAL", { char: "n", display: -1 });
this.addMode("NORMAL", { char: "n", display: null });
this.addMode("INSERT", { char: "i", input: true });
this.addMode("VISUAL", { char: "v", display: function () "VISUAL" + (this._extended & modes.LINE ? " LINE" : "") });
this.addMode("COMMAND_LINE", { char: "c", input: true });
@@ -118,7 +118,8 @@ const Modes = Module("modes", {
this.modeChars[mode.char].push(mode);
}
mode.display = mode.display || function () disp;
if (mode.display !== null)
mode.display = function () disp;
this._modeMap[name] = mode;
this._modeMap[this[name]] = mode;
if (!extended)