From 87ee2bdabbf1bb7ffe25b4f9d4d92aaeee2f96b8 Mon Sep 17 00:00:00 2001 From: snaka Date: Sat, 4 Jul 2009 00:58:49 +0000 Subject: Added the code that considered for the backward compatibility. git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@34287 d0d07461-0603-4401-acd4-de1884942a52 --- auto_word_select_mode.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'auto_word_select_mode.js') diff --git a/auto_word_select_mode.js b/auto_word_select_mode.js index 4b7ee73..59d7298 100644 --- a/auto_word_select_mode.js +++ b/auto_word_select_mode.js @@ -309,8 +309,12 @@ mappings.add( let [keys, hasCount, caretModeMethod, caretModeArg] = params; let extraInfo = {}; - if (hasCount) + if (hasCount) { + if (Mappings.flags) + extraInfo.flags = Mappings.flags.COUNT; // for backward compatibility + else extraInfo.count = true; + } mappings.add([modes.AUTO_WORD_SELECT], keys, "", function (count) { @@ -320,6 +324,11 @@ mappings.add( let controller = buffer.selectionController; while (count--) controller[caretModeMethod](caretModeArg, false); + + if (selectable()) { + liberator.dump(selectable()); + selectWord(); + } }, extraInfo ); @@ -358,16 +367,8 @@ function selectable() { } // }}} -//// for debuging -//liberator.registerObserver("modeChange", function(oldModes, newModes, stack) { -// liberator.dump(getModeName(oldModes[0]) +" + "+ getModeName(oldModes[1]) -// + " -> " + -// getModeName(newModes[0]) +" + "+ getModeName(newModes[1])); -// liberator.dumpStack(); -//}); -//function getModeName(id) modes.getMode(id) ? modes.getMode(id).name : ""; - -liberator.echo("loading ..."); +liberator.dump("loading ..."); +setTimeout(function() commandline.close(), 1000); })(); // vim:sw=2 ts=2 et si fdm=marker: -- cgit v1.2.3