diff --git a/common/content/events.js b/common/content/events.js index 8a16f99b..555698a8 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -1529,6 +1529,8 @@ function Events() //{{{ return void killEvent(); } + // All of these special cases for hint mode are driving + // me insane! -Kris if (modes.extended & modes.HINTS) { // under HINT mode, certain keys are redirected to hints.onEvent @@ -1538,6 +1540,7 @@ function Events() //{{{ || (/^[0-9]$/.test(key) && !hints.escNumbers)) { hints.onEvent(event); + input.buffer = null; return void killEvent(); } @@ -1664,7 +1667,8 @@ function Events() //{{{ finally { let motionMap = (input.pendingMotionMap && input.pendingMotionMap.names[0]) || ""; - statusline.updateInputBuffer(motionMap + input.buffer); + if (input.buffer !== null) + statusline.updateInputBuffer(motionMap + input.buffer); } }, diff --git a/common/content/hints.js b/common/content/hints.js index 8c0624e4..72a09081 100644 --- a/common/content/hints.js +++ b/common/content/hints.js @@ -556,6 +556,23 @@ function Hints() //{{{ return true; } + function checkUnique() + { + if (hintNumber > validHints.length) + return void liberator.beep(); + + // if we write a numeric part like 3, but we have 45 hints, only follow + // the hint after a timeout, as the user might have wanted to follow link 34 + if (hintNumber > 0 && hintNumber * 10 <= validHints.length) + { + let timeout = options["hinttimeout"]; + if (timeout > 0) + activeTimeout = setTimeout(function () { processHints(true); }, timeout); + } + else // we have a unique hint + processHints(true); + } + /** * Handle user input. * @@ -942,15 +959,11 @@ function Hints() //{{{ { liberator.beep(); modes.reset(); - return false; } else if (validHints.length == 1) - { processHints(false); - return false; - } - else // still hints visible - return true; + else + checkUnique(); }, /** @@ -1054,22 +1067,10 @@ function Hints() //{{{ } showActiveHint(hintNumber, oldHintNumber || 1); - if (hintNumber == 0 || hintNumber > validHints.length) + if (hintNumber == 0) return void liberator.beep(); - // if we write a numeric part like 3, but we have 45 hints, only follow - // the hint after a timeout, as the user might have wanted to follow link 34 - if (hintNumber > 0 && hintNumber * 10 <= validHints.length) - { - let timeout = options["hinttimeout"]; - if (timeout > 0) - activeTimeout = setTimeout(function () { processHints(true); }, timeout); - - return false; - } - // we have a unique hint - processHints(true); - return; + checkUnique(); } }