From 614ab6082ca53cc6a7464022621a32f19b38bc61 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Tue, 3 Mar 2009 00:14:37 +1100 Subject: [PATCH] Fix ;t and ;b extended hint modes in the MOW. --- common/content/ui.js | 79 +++++++++++++++++++++++--------------------- vimperator/TODO | 12 +++---- 2 files changed, 46 insertions(+), 45 deletions(-) diff --git a/common/content/ui.js b/common/content/ui.js index b006d116..cdfee132 100644 --- a/common/content/ui.js +++ b/common/content/ui.js @@ -1412,25 +1412,53 @@ function CommandLine() //{{{ let closeWindow = false; let passEvent = false; - function isScrollable() !win.scrollMaxY == 0; - function atEnd() win.scrollY / win.scrollMaxY >= 1; + let key = events.toString(event); - if (event.type == "click") + // TODO: Wouldn't multiple handlers be cleaner? --djk + if (event.type == "click" && event.target instanceof HTMLAnchorElement) { - if (event.target instanceof HTMLAnchorElement && event.button < 2) + function openLink(where) { event.preventDefault(); - let target = event.button == 0 ? liberator.CURRENT_TAB : liberator.NEW_TAB; + // FIXME: Why is this needed? --djk if (event.target.getAttribute("href") == "#") - liberator.open(event.target.textContent, target); + liberator.open(event.target.textContent, where); else - liberator.open(event.target.href, target); + liberator.open(event.target.href, where); } + + switch (key) + { + case "": + // FIXME: the :ls output no longer wraps the buffer URL in an anchor element + if (event.originalTarget.getAttributeNS(NS.uri, "highlight") == "URL buffer-list") + { + event.preventDefault(); + tabs.select(parseInt(event.originalTarget.parentNode.parentNode.firstChild.textContent, 10) - 1); + } + else + { + openLink(liberator.CURRENT_TAB); + } + break; + case "": + case "": + case "": + openLink(liberator.NEW_BACKGROUND_TAB); + break; + case "": + case "": + case "": + openLink(liberator.NEW_TAB); + break; + case "": + openLink(liberator.NEW_WINDOW); + break; + } + return; } - let key = events.toString(event); - if (startHints) { statusline.updateInputBuffer(""); @@ -1439,6 +1467,9 @@ function CommandLine() //{{{ return; } + function isScrollable() !win.scrollMaxY == 0; + function atEnd() win.scrollY / win.scrollMaxY >= 1; + switch (key) { case "": @@ -1488,34 +1519,6 @@ function CommandLine() //{{{ break; // TODO: on the prompt line should scroll one page - case "": - if (event.originalTarget.getAttributeNS(NS.uri, "highlight") == "URL buffer-list") - { - tabs.select(parseInt(event.originalTarget.parentNode.parentNode.firstChild.textContent, 10) - 1); - closeWindow = true; - break; - } - else if (event.originalTarget.localName.toLowerCase() == "a") - { - liberator.open(event.originalTarget.textContent); - break; - } - case "": // for those not owning a 3-button mouse - case "": - if (event.originalTarget.localName.toLowerCase() == "a") - { - let where = /\btabopen\b/.test(options["activate"]) ? - liberator.NEW_TAB : liberator.NEW_BACKGROUND_TAB; - liberator.open(event.originalTarget.textContent, where); - } - break; - - // let Firefox handle those to select table cells or show a context menu - case "": - case "": - case "": - break; - // page down case "f": if (options["more"] && isScrollable()) @@ -1606,7 +1609,7 @@ function CommandLine() //{{{ if (passEvent) events.onKeyPress(event); } - else // set update the prompt string + else { commandline.updateMorePrompt(showMorePrompt, showMoreHelpPrompt); } diff --git a/vimperator/TODO b/vimperator/TODO index 1a7dc341..be67703e 100644 --- a/vimperator/TODO +++ b/vimperator/TODO @@ -17,7 +17,6 @@ BUGS: - insert abbreviations broken on - :sidebar improvements (:sidebar! Downloads while downloads is open should refocus the sidebar) - ;s saves the page rather than the image -- http://cgiirc.blitzed.org?chan=%23debug is unusable after login in - "g<" fails without a trailing escape because both "g<" and "g" are mapped. Vimp should recognize "" as an atom that should not be matched literally. In fact, typing "g" out literally is @@ -33,14 +32,13 @@ BUGS: => it often overwrites the open command line while editing etc. - and autocmd 'keywords' are not available when adding a bookmark - they're being set after the observer triggers the autocmd event. -- MOW rendering is broken for multiple commands when open E.g. :ls | ls -- completion height is broken, try :a...., when it wraps it's totally off. - and even if it is not totally off, i had it jump by one pixel when wrapping around. - If that's unfixable, i propose reverting the new completion height stuff. +- MOW rendering is broken for multiple commands when open (E.g. :ls | ls) This + appears to be the result of using the Message class when appending multiline + output to an open MOW. - :messages is _very_ slow for message history of several thousand lines -> Unresponsive Script: util.js:79 (sometimes xmlToDom() and elsewhere) -- :hardcopy! seems to be broken for me -- some extended hint commands aren't working in the MOW (;; ;t ;b ;? ;F) +- The MOW shouldn't close when executing hints and ;F isn't working. +- URLs in :ls output are no longer hyperlinks FEATURES: 9 finish :help TODOs