From a3b5c6c78ea0632a49ca8215bc62e39f5d9a5460 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Wed, 29 Oct 2008 01:27:11 +0000 Subject: [PATCH] Get rid of QUICK/EXTENDED hint modes, since they dont make sense anymore. --- content/hints.js | 10 +++++----- content/modes.js | 45 ++++++++++++++++++--------------------------- content/ui.js | 2 +- 3 files changed, 24 insertions(+), 33 deletions(-) diff --git a/content/hints.js b/content/hints.js index 40481a2b..8ba0bf10 100644 --- a/content/hints.js +++ b/content/hints.js @@ -625,15 +625,15 @@ function Hints() //{{{ mappings.add(myModes, ["f"], "Start QuickHint mode", - function () { hints.show(modes.QUICK_HINT, "o") }); + function () { hints.show("o") }); mappings.add(myModes, ["F"], "Start QuickHint mode, but open link in a new tab", - function () { hints.show(modes.QUICK_HINT, "t") }); + function () { hints.show("t") }); mappings.add(myModes, [";"], "Start an extended hint mode", - function (arg) { hints.show(modes.EXTENDED_HINT, arg) }, + function (arg) { hints.show(arg) }, { flags: Mappings.flags.ARGUMENT }); /////////////////////////////////////////////////////////////////////////////}}} @@ -642,7 +642,7 @@ function Hints() //{{{ return { - show: function (mode, minor, filter, win) + show: function (minor, filter, win) { let prompt = hintDescriptions[minor]; if (!prompt) @@ -651,7 +651,7 @@ function Hints() //{{{ return; } commandline.input(prompt, null, { onChange: onInput }); - modes.extended = modes.HINTS | mode; + modes.extended = modes.HINTS; submode = minor || "o"; // open is the default mode hintString = filter || ""; diff --git a/content/modes.js b/content/modes.js index 348b0027..639d253c 100644 --- a/content/modes.js +++ b/content/modes.js @@ -50,10 +50,6 @@ const modes = (function () //{{{ return "-- PASS THROUGH --"; var ext = ""; - if (extended & modes.QUICK_HINT) - ext += " (quick)"; - if (extended & modes.EXTENDED_HINT) - ext += " (extended)"; if (extended & modes.MENU) // TODO: desirable? ext += " (menu)"; @@ -72,12 +68,9 @@ const modes = (function () //{{{ return "-- INSERT" + ext; case modes.VISUAL: return (extended & modes.LINE) ? "-- VISUAL LINE" + ext : "-- VISUAL" + ext; - // under modes.COMMAND_LINE, this block will never be reached - case modes.COMMAND_LINE: // since modes.HINTS is actually not a main mode - if (extended & modes.HINTS) - return "-- HINTS" + ext; - else - return macromode; + case modes.COMMAND_LINE: + // under modes.COMMAND_LINE, this block will never be reached + return macromode; case modes.CARET: return "-- CARET" + ext; case modes.TEXTAREA: @@ -130,9 +123,9 @@ const modes = (function () //{{{ break; case modes.COMMAND_LINE: - // clean up for HINT mode - if (modes.extended & modes.HINTS) - hints.hide(); + // clean up for HINT mode + if (modes.extended & modes.HINTS) + hints.hide(); commandline.close(); break; } @@ -160,25 +153,23 @@ const modes = (function () //{{{ NORMAL: 1 << 0, INSERT: 1 << 1, VISUAL: 1 << 2, - HINTS: 1 << 3, - COMMAND_LINE: 1 << 4, - CARET: 1 << 5, // text cursor is visible - TEXTAREA: 1 << 6, // text cursor is in a HTMLTextAreaElement - MESSAGE: 1 << 7, // for now only used in Muttator when the message has focus - COMPOSE: 1 << 8, - CUSTOM: 1 << 9, + COMMAND_LINE: 1 << 3, + CARET: 1 << 4, // text cursor is visible + TEXTAREA: 1 << 5, // text cursor is in a HTMLTextAreaElement + MESSAGE: 1 << 6, // for now only used in Muttator when the message has focus + COMPOSE: 1 << 7, + CUSTOM: 1 << 8, // extended modes, can include multiple modes, and even main modes - EX: 1 << 10, + EX: 1 << 9, + HINTS: 1 << 10, INPUT_MULTILINE: 1 << 11, OUTPUT_MULTILINE: 1 << 12, SEARCH_FORWARD: 1 << 13, SEARCH_BACKWARD: 1 << 14, - QUICK_HINT: 1 << 15, - EXTENDED_HINT: 1 << 16, - MENU: 1 << 17, // a popupmenu is active - LINE: 1 << 18, // linewise visual mode - RECORDING: 1 << 19, - PROMPT: 1 << 20, + MENU: 1 << 15, // a popupmenu is active + LINE: 1 << 16, // linewise visual mode + RECORDING: 1 << 17, + PROMPT: 1 << 18, __iterator__: function () util.Array.iterator(this.all), diff --git a/content/ui.js b/content/ui.js index 315054e1..dab061e7 100644 --- a/content/ui.js +++ b/content/ui.js @@ -990,7 +990,7 @@ function CommandLine() //{{{ { statusline.updateInputBuffer(""); startHints = false; - hints.show(modes.EXTENDED_HINT, key, undefined, win); + hints.show(key, undefined, win); return; }