diff --git a/src/editor/CodeHintManager.js b/src/editor/CodeHintManager.js index 04434f0d729..b5311d85fd4 100644 --- a/src/editor/CodeHintManager.js +++ b/src/editor/CodeHintManager.js @@ -453,29 +453,18 @@ define(function (require, exports, module) { } else if (_inSession(editor) && hintList.isOpen()) { // Pass event to the hint list, if it's open hintList.handleKeyEvent(event); - } else if (!(event.ctrlKey || event.altKey || event.metaKey) && - (event.keyCode === KeyEvent.DOM_VK_ENTER || - event.keyCode === KeyEvent.DOM_VK_RETURN || - event.keyCode === KeyEvent.DOM_VK_TAB)) { + } + if (!(event.ctrlKey || event.altKey || event.metaKey) && + (event.keyCode === KeyEvent.DOM_VK_ENTER || + event.keyCode === KeyEvent.DOM_VK_RETURN || + event.keyCode === KeyEvent.DOM_VK_TAB)) { lastChar = String.fromCharCode(event.keyCode); } } else if (event.type === "keypress") { // Last inserted character, used later by handleChange lastChar = String.fromCharCode(event.charCode); - } else if (event.type === "keyup") { - if (_inSession(editor)) { - if ((event.keyCode !== 32 && event.ctrlKey) || event.altKey || event.metaKey) { - // End the session if the user presses any key with a modifier (other than Ctrl+Space). - _endSession(); - } else if (event.keyCode === KeyEvent.DOM_VK_LEFT || - event.keyCode === KeyEvent.DOM_VK_RIGHT || - event.keyCode === KeyEvent.DOM_VK_BACK_SPACE) { - // Update the list after a simple navigation. - // We do this in "keyup" because we want the cursor position to be updated before - // we redraw the list. - _updateHintList(); - } - } + } else if (event.type === "keyup" && _inSession(editor)) { + _updateHintList(); } }