From f40ed2e734fd6e41a3df3975a5b9e6484e91a79e Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Fri, 8 Oct 2010 22:54:34 -0400 Subject: [PATCH] Hint mode improvements. --- common/content/help.xsl | 6 +++++- common/content/hints.js | 26 ++++++++++++++++---------- common/locale/en-US/autocommands.xml | 8 +++----- common/locale/en-US/options.xml | 14 +++++++++----- 4 files changed, 33 insertions(+), 21 deletions(-) diff --git a/common/content/help.xsl b/common/content/help.xsl index e844c9d0..727e21ed 100644 --- a/common/content/help.xsl +++ b/common/content/help.xsl @@ -232,9 +232,13 @@ (default: - + + + + (empty) + diff --git a/common/content/hints.js b/common/content/hints.js index a5638970..762c68c1 100644 --- a/common/content/hints.js +++ b/common/content/hints.js @@ -72,7 +72,14 @@ const Hints = Module("hints", { _reset: function (slight) { if (!slight) { this.__reset(); + this.prevInput = ""; + this.escNumbers = false; + this._usedTabKey = false; this._canUpdate = false; + this._hintNumber = 0; + this._hintString = ""; + statusline.updateInputBuffer(""); + commandline.command = ""; } this._pageHints = []; this._validHints = []; @@ -83,13 +90,8 @@ const Hints = Module("hints", { this._activeTimeout = null; }, __reset: function () { - statusline.updateInputBuffer(""); - this._hintString = ""; - this._hintNumber = 0; - this._usedTabKey = false; - this.prevInput = ""; - this.escNumbers = false; - commandline.command = ""; + if (!this._usedTabKey) + this._hintNumber = 0; }, /** @@ -478,7 +480,8 @@ const Hints = Module("hints", { let top = this._top; if (this._continue) { this.__reset(); - this._showHints(); + if (this._validHints.length <= 1) + this._showHints(); } else { this._removeHints(timeout); @@ -491,7 +494,8 @@ const Hints = Module("hints", { if ((modes.extended & modes.HINTS) && !this._continue) modes.pop(); commandline._lastEcho = null; // Hack. - this._hintMode.action(elem, elem.href || "", this._extendedhintCount, top); + this._hintMode.action(elem, elem.href || elem.src || "", + this._extendedhintCount, top); }, timeout); return true; }, @@ -1078,7 +1082,9 @@ const Hints = Module("hints", { options.add(["extendedhinttags", "eht"], "XPath string of hintable elements activated by ';'", - "regexmap", "[iI]:" + Option.quote(util.makeXPath(["img"])), + "regexmap", "[iI]:" + Option.quote(util.makeXPath(["img"])) + + ",[OTivVWy]:" + Option.quote(util.makeXPath( + ["{a,area}[@href]", "{img,iframe}[@src]"])), { validator: Option.validateXPath }); options.add(["hinttags", "ht"], diff --git a/common/locale/en-US/autocommands.xml b/common/locale/en-US/autocommands.xml index 3de965dc..e2a06c3b 100644 --- a/common/locale/en-US/autocommands.xml +++ b/common/locale/en-US/autocommands.xml @@ -96,13 +96,11 @@ :autocmd LocationChange .* js modes.passAllKeys = /(www|mail)\.google\.com/.test(buffer.URL) -

- Set the filetype to mail when editing email at Gmail: -

+

Set the filetype to mail when editing email at Gmail:

-:autocmd LocationChange .* :set editor=gvim -f -:autocmd LocationChange 'mail\.google\.com' :set editor=gvim -f -c 'set ft=mail' +:autocmd LocationChange !'mail\.google\.com' :set editor=gvim -f +:autocmd LocationChange 'mail\.google\.com' :set editor=gvim -f -c 'set ft=mail' diff --git a/common/locale/en-US/options.xml b/common/locale/en-US/options.xml index e1f6a0f5..fdc60bff 100644 --- a/common/locale/en-US/options.xml +++ b/common/locale/en-US/options.xml @@ -320,7 +320,7 @@ 'activate' 'act' stringlist addons,downloads,extoptions,help, - homepage,quickmark,tabopen,paste + homepage,quickmark,tabopen,paste

A list of items which, when opened in a new tab, are @@ -556,7 +556,11 @@ 'extendedhinttags' 'eht' regexmap - [iI]:'//img | //xhtml:img' + [iI]:'//img | //xhtml:img', + [OTivVWy]:'//a[@href] | //xhtml:a[@href] | + //area[@href] | //xhtml:area[@href] | + //img[@src] | //xhtml:img[@src] | + //iframe[@src] | //xhtml:iframe[@src]'

Defines specialized XPath expressions for arbitrary @@ -891,7 +895,7 @@ 'noloadplugins' 'loadplugins' 'loadplugins' 'lpl' regexlist - \.(js|&dactyl.fileExt;)$ + '\.(js|&dactyl.fileExt;)$'

A regular expression list that defines which plugins are loaded at @@ -1000,7 +1004,7 @@ 'nextpattern' 'nextpattern' stringlist - \bnext,^>$,^(>>|»)$,^(>|»),(>|»)$,\bmore\b + '\bnext',^>$,'^(>>|»)$','^(>|»)','(>|»)$','\bmore\b'

Patterns to use when guessing the next page in a document @@ -1393,7 +1397,7 @@ 'wia' 'wildanchor' 'wildanchor' 'wia' regexlist - !/ex/(back|buffer|ext|forward|help|undo) + !'/ex/(back|buffer|ext|forward|help|undo)'

Regular expression list defining which completion groups show only