diff options
author | hogelog | 2008-12-19 08:19:45 +0000 |
---|---|---|
committer | hogelog | 2008-12-19 08:19:45 +0000 |
commit | d500b6c018dca9ffce51b6fd670ac8105a33f318 (patch) | |
tree | e280ec6de45d1b07f849a647f3dd42f46c1e786f /char-hints-mod2.js | |
parent | 66ff47d50645e7389ac45b124a6b8debafe7c08e (diff) | |
download | vimperator-plugins-d500b6c018dca9ffce51b6fd670ac8105a33f318.tar.bz2 |
* fix endless recursion bug.
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@27067 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'char-hints-mod2.js')
-rw-r--r-- | char-hints-mod2.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/char-hints-mod2.js b/char-hints-mod2.js index 9fc58dd..0d285b2 100644 --- a/char-hints-mod2.js +++ b/char-hints-mod2.js @@ -127,7 +127,7 @@ set charhintshow=uppercase|lowercase: return chars;
} //}}}
- function showCharHints(win) //{{{
+ function showCharHints() //{{{
{
function showHints(win)
{
@@ -136,21 +136,22 @@ set charhintshow=uppercase|lowercase: let num = elem.getAttribute("number");
let hintchar = num2chars(parseInt(num, 10));
elem.setAttribute("hintchar", showCase(hintchar));
- pageHints.push(elem);
+ if(isValidHint(hintchar))
+ validHints.push(elem);
}
- Array.forEach(win.frames, showCharHints);
+ Array.forEach(win.frames, showHints);
}
- pageHints = [];
+ validHints = [];
showHints(window.content);
} //}}}
- function isValidHint(elem) //{{{
+ function isValidHint(hint) //{{{
{
- return inputCase(elem.getAttribute("hintchar")).indexOf(hintInput) == 0;
+ return inputCase(hint).indexOf(hintInput) == 0;
} //}}}
var hintInput = "";
- var pageHints = [];
+ var validHints = [];
var charhints = plugins.charhints = {
show: function (minor, filter, win) //{{{
{
@@ -174,7 +175,6 @@ set charhintshow=uppercase|lowercase: }
}
if(hintInput.length>0) {
- let validHints = pageHints.filter(isValidHint);
let numstr = String(chars2num(hintInput));
// no setTimeout, don't run nice
setTimeout(function () {
|