Skip to content
Browse files

[util/simple-hint] don't close hint dialog when a modifier key is pre…

…ssed

Closes #853
  • Loading branch information...
1 parent 553ce94 commit 6cffb097643a561b2349f4f111c8367bba67f7f1 @marijnh marijnh committed Sep 28, 2012
Showing with 2 additions and 1 deletion.
  1. +1 −0 lib/codemirror.js
  2. +1 −1 lib/util/simple-hint.js
View
1 lib/codemirror.js
@@ -2204,6 +2204,7 @@ window.CodeMirror = (function() {
var name = keyNames[e_prop(event, "keyCode")];
return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod";
}
+ CodeMirror.isModifierKey = isModifierKey;
CodeMirror.fromTextArea = function(textarea, options) {
if (!options) options = {};
View
2 lib/util/simple-hint.js
@@ -71,7 +71,7 @@
if (code == 13) {CodeMirror.e_stop(event); pick();}
// Escape
else if (code == 27) {CodeMirror.e_stop(event); close(); editor.focus();}
- else if (code != 38 && code != 40 && code != 33 && code != 34) {
+ else if (code != 38 && code != 40 && code != 33 && code != 34 && !CodeMirror.isModifierKey(event)) {
close(); editor.focus();
// Pass the event to the CodeMirror instance so that it can handle things like backspace properly.
editor.triggerOnKeyDown(event);

0 comments on commit 6cffb09

Please sign in to comment.
Something went wrong with that request. Please try again.