From e73ab4280b363072324038f09a600aedcfc4b14f Mon Sep 17 00:00:00 2001 From: John Foerch Date: Fri, 5 Feb 2010 14:23:49 -0500 Subject: [PATCH] get_current_keymaps: comment doc and efficiency change Instead of computing the length of window.buffers.current.override_keymaps just check whether element 0 exists. --- modules/input.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/input.js b/modules/input.js index 1df2292..49bceee 100644 --- a/modules/input.js +++ b/modules/input.js @@ -109,10 +109,15 @@ define_window_local_hook("keypress_hook", RUN_HOOK_UNTIL_SUCCESS, "that is desired."); +/** + * get_current_keymaps returns the keymap stack for the current focus + * context of the given window. This is the top-level keymap stack, not + * the stack that represents any on-going key sequence. + */ function get_current_keymaps (window) { if (window.input.current.override_keymap) return [window.input.current.override_keymap]; - if (window.buffers.current.override_keymaps.length > 0) + if (window.buffers.current.override_keymaps[0] !== undefined) return window.buffers.current.override_keymaps; return window.buffers.current.keymaps; } -- 2.11.4.GIT