diff options
author | anekos | 2011-07-27 01:09:26 +0900 |
---|---|---|
committer | anekos | 2011-07-27 01:09:26 +0900 |
commit | 3577b648963b907ffd4fc31d006f4672fc7a8544 (patch) | |
tree | d0bb5d8ffe6a70b6a9543199c1b7326f9720a9cf /x-hint.js | |
parent | a890d5778c26ddafd9389c0625c860acaafe95d0 (diff) | |
download | vimperator-plugins-3577b648963b907ffd4fc31d006f4672fc7a8544.tar.bz2 |
エラー発生時にタグを戻す
Diffstat (limited to 'x-hint.js')
-rw-r--r-- | x-hint.js | 22 |
1 files changed, 16 insertions, 6 deletions
@@ -59,7 +59,7 @@ let PLUGIN_INFO = // INFO {{{ let INFO = <> - <plugin name="X-Hint" version="1.1.2" + <plugin name="X-Hint" version="1.1.3" href="http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/x-hint.js" summary="Show the hints with given XPath." lang="en-US" @@ -91,7 +91,7 @@ let INFO = </description> </item> </plugin> - <plugin name="X-Hint" version="1.1.2" + <plugin name="X-Hint" version="1.1.3" href="http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/x-hint.js" summary="Show the hints with given XPath." lang="ja" @@ -135,6 +135,12 @@ let INFO = function xpath () (last.xpath || '//a') + function restore () { + if (last.hintMode) + last.hintMode.tags = last.hintTags; + last = {}; + } + plugins.libly.$U.around( hints, 'show', @@ -146,7 +152,13 @@ let INFO = // override last.hintMode.tags = xpath; } - return next(); + try { + return next(); + } catch (e) { + restore(); + liberator.log('x-hint: restore tags for error'); + liberator.log(e); + } }, true ); @@ -155,9 +167,7 @@ let INFO = hints, 'hide', function (next, [minor, filter, win]) { - if (last.hintMode) - last.hintMode.tags = last.hintTags; - last = {}; + restore(); return next(); }, true |