diff options
author | Kris Maglione <maglione.k@gmail.com> | 2008-12-05 06:20:42 -0500 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2008-12-05 06:22:04 -0500 |
commit | 809da07b115ace7fd8ae804a8f1e031e058ec97d (patch) | |
tree | 614ebbe07000a6f5c63af3d8de61179e55bffc8a /common/content/modes.js | |
parent | 84e84c81fd67f501f3c79b79cdbf36e3dbd3adb6 (diff) | |
download | pentadactyl-809da07b115ace7fd8ae804a8f1e031e058ec97d.tar.gz |
Prevent async completions from resetting selected completion
Diffstat (limited to 'common/content/modes.js')
-rw-r--r-- | common/content/modes.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/common/content/modes.js b/common/content/modes.js index fbf416df..15b23dd7 100644 --- a/common/content/modes.js +++ b/common/content/modes.js @@ -86,10 +86,9 @@ const modes = (function () //{{{ case modes.VISUAL: if (newMode == modes.CARET) { - // clear any selection made - var selection = window.content.getSelection(); try - { // a simple if (selection) does not work + { // clear any selection made; a simple if (selection) does not work + let selection = window.content.getSelection(); selection.collapseToStart(); } catch (e) {} @@ -113,7 +112,7 @@ const modes = (function () //{{{ if (newMode == modes.NORMAL) { // disable caret mode when we want to switch to normal mode - var value = options.getPref("accessibility.browsewithcaret", false); + let value = options.getPref("accessibility.browsewithcaret", false); if (value) options.setPref("accessibility.browsewithcaret", false); @@ -124,7 +123,7 @@ const modes = (function () //{{{ let urlbar = document.getElementById("urlbar"); if (!urlbar || focus != urlbar.inputField) liberator.focusContent(false); - }, 100); + }, 0); } } |