1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 11:27:58 +01:00

Get rid of QUICK/EXTENDED hint modes, since they dont make sense anymore.

This commit is contained in:
Kris Maglione
2008-10-29 01:27:11 +00:00
parent ab30527ccf
commit a3b5c6c78e
3 changed files with 24 additions and 33 deletions

View File

@@ -625,15 +625,15 @@ function Hints() //{{{
mappings.add(myModes, ["f"], mappings.add(myModes, ["f"],
"Start QuickHint mode", "Start QuickHint mode",
function () { hints.show(modes.QUICK_HINT, "o") }); function () { hints.show("o") });
mappings.add(myModes, ["F"], mappings.add(myModes, ["F"],
"Start QuickHint mode, but open link in a new tab", "Start QuickHint mode, but open link in a new tab",
function () { hints.show(modes.QUICK_HINT, "t") }); function () { hints.show("t") });
mappings.add(myModes, [";"], mappings.add(myModes, [";"],
"Start an extended hint mode", "Start an extended hint mode",
function (arg) { hints.show(modes.EXTENDED_HINT, arg) }, function (arg) { hints.show(arg) },
{ flags: Mappings.flags.ARGUMENT }); { flags: Mappings.flags.ARGUMENT });
/////////////////////////////////////////////////////////////////////////////}}} /////////////////////////////////////////////////////////////////////////////}}}
@@ -642,7 +642,7 @@ function Hints() //{{{
return { return {
show: function (mode, minor, filter, win) show: function (minor, filter, win)
{ {
let prompt = hintDescriptions[minor]; let prompt = hintDescriptions[minor];
if (!prompt) if (!prompt)
@@ -651,7 +651,7 @@ function Hints() //{{{
return; return;
} }
commandline.input(prompt, null, { onChange: onInput }); commandline.input(prompt, null, { onChange: onInput });
modes.extended = modes.HINTS | mode; modes.extended = modes.HINTS;
submode = minor || "o"; // open is the default mode submode = minor || "o"; // open is the default mode
hintString = filter || ""; hintString = filter || "";

View File

@@ -50,10 +50,6 @@ const modes = (function () //{{{
return "-- PASS THROUGH --"; return "-- PASS THROUGH --";
var ext = ""; var ext = "";
if (extended & modes.QUICK_HINT)
ext += " (quick)";
if (extended & modes.EXTENDED_HINT)
ext += " (extended)";
if (extended & modes.MENU) // TODO: desirable? if (extended & modes.MENU) // TODO: desirable?
ext += " (menu)"; ext += " (menu)";
@@ -72,12 +68,9 @@ const modes = (function () //{{{
return "-- INSERT" + ext; return "-- INSERT" + ext;
case modes.VISUAL: case modes.VISUAL:
return (extended & modes.LINE) ? "-- VISUAL LINE" + ext : "-- VISUAL" + ext; return (extended & modes.LINE) ? "-- VISUAL LINE" + ext : "-- VISUAL" + ext;
// under modes.COMMAND_LINE, this block will never be reached case modes.COMMAND_LINE:
case modes.COMMAND_LINE: // since modes.HINTS is actually not a main mode // under modes.COMMAND_LINE, this block will never be reached
if (extended & modes.HINTS) return macromode;
return "-- HINTS" + ext;
else
return macromode;
case modes.CARET: case modes.CARET:
return "-- CARET" + ext; return "-- CARET" + ext;
case modes.TEXTAREA: case modes.TEXTAREA:
@@ -130,9 +123,9 @@ const modes = (function () //{{{
break; break;
case modes.COMMAND_LINE: case modes.COMMAND_LINE:
// clean up for HINT mode // clean up for HINT mode
if (modes.extended & modes.HINTS) if (modes.extended & modes.HINTS)
hints.hide(); hints.hide();
commandline.close(); commandline.close();
break; break;
} }
@@ -160,25 +153,23 @@ const modes = (function () //{{{
NORMAL: 1 << 0, NORMAL: 1 << 0,
INSERT: 1 << 1, INSERT: 1 << 1,
VISUAL: 1 << 2, VISUAL: 1 << 2,
HINTS: 1 << 3, COMMAND_LINE: 1 << 3,
COMMAND_LINE: 1 << 4, CARET: 1 << 4, // text cursor is visible
CARET: 1 << 5, // text cursor is visible TEXTAREA: 1 << 5, // text cursor is in a HTMLTextAreaElement
TEXTAREA: 1 << 6, // text cursor is in a HTMLTextAreaElement MESSAGE: 1 << 6, // for now only used in Muttator when the message has focus
MESSAGE: 1 << 7, // for now only used in Muttator when the message has focus COMPOSE: 1 << 7,
COMPOSE: 1 << 8, CUSTOM: 1 << 8,
CUSTOM: 1 << 9,
// extended modes, can include multiple modes, and even main modes // extended modes, can include multiple modes, and even main modes
EX: 1 << 10, EX: 1 << 9,
HINTS: 1 << 10,
INPUT_MULTILINE: 1 << 11, INPUT_MULTILINE: 1 << 11,
OUTPUT_MULTILINE: 1 << 12, OUTPUT_MULTILINE: 1 << 12,
SEARCH_FORWARD: 1 << 13, SEARCH_FORWARD: 1 << 13,
SEARCH_BACKWARD: 1 << 14, SEARCH_BACKWARD: 1 << 14,
QUICK_HINT: 1 << 15, MENU: 1 << 15, // a popupmenu is active
EXTENDED_HINT: 1 << 16, LINE: 1 << 16, // linewise visual mode
MENU: 1 << 17, // a popupmenu is active RECORDING: 1 << 17,
LINE: 1 << 18, // linewise visual mode PROMPT: 1 << 18,
RECORDING: 1 << 19,
PROMPT: 1 << 20,
__iterator__: function () util.Array.iterator(this.all), __iterator__: function () util.Array.iterator(this.all),

View File

@@ -990,7 +990,7 @@ function CommandLine() //{{{
{ {
statusline.updateInputBuffer(""); statusline.updateInputBuffer("");
startHints = false; startHints = false;
hints.show(modes.EXTENDED_HINT, key, undefined, win); hints.show(key, undefined, win);
return; return;
} }