From a74f5df6c70d688c39a1e7487c9371e25c16497d Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Thu, 7 Oct 2010 01:35:25 +1100 Subject: [PATCH] Use null rather than -1 for specifying a non-existent mode display function. --HG-- extra : rebase_source : 1709c70c9e792c2f52009728fc7cd53970f8a9ae --- common/content/modes.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/content/modes.js b/common/content/modes.js index 254d3904..5b963da4 100644 --- a/common/content/modes.js +++ b/common/content/modes.js @@ -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)