From 25f8e9842c02e78dd5166f9584ae2038c636c861 Mon Sep 17 00:00:00 2001
From: anekos
Date: Sun, 1 May 2011 02:49:37 +0900
Subject: Fix: commandline focusing
---
maine_coon.js | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
(limited to 'maine_coon.js')
diff --git a/maine_coon.js b/maine_coon.js
index 33b112a..ad0023f 100644
--- a/maine_coon.js
+++ b/maine_coon.js
@@ -38,7 +38,7 @@ let PLUGIN_INFO =
メインクーン
Make the screen larger
なるべくでかい画面で使えるように
- 2.6.3
+ 2.6.5
anekos
3.0
https://github.com/vimpr/vimperator-plugins/raw/master/maine_coon.js
@@ -330,8 +330,18 @@ let PLUGIN_INFO =
}
})();
+ function makeTimeoutDelay (f, n) {
+ if (typeof n === 'undefined')
+ n = 1;
+
+ if (n > 1)
+ f = makeTimeoutDelay(f, n - 1);
+
+ return function () setTimeout(f, 10);
+ }
+
function focusToCommandline ()
- setTimeout(function () commandlineBox.inputField.focus(), 0);
+ commandlineBox.inputField.focus();
let useEcho = false;
@@ -378,16 +388,16 @@ let PLUGIN_INFO =
}
U.around(commandline, 'input', function (next, args) {
- bottomBar.collapsed = false;
let result = next();
inputting = true;
+ bottomBar.collapsed = false;
focusToCommandline();
return result;
}, true);
U.around(commandline, 'open', function (next, args) {
- bottomBar.collapsed = false;
let result = next();
+ bottomBar.collapsed = false;
focusToCommandline();
return result;
}, true);
--
cgit v1.2.3