This repository was archived by the owner on Sep 6, 2021. It is now read-only.
Fix CTRL+Space handling while the CodeHintList is open, fixes #13481#13560
Merged
Fix CTRL+Space handling while the CodeHintList is open, fixes #13481#13560
Conversation
Signed-off-by: Pete Nykanen <pete.a.nykanen@gmail.com>
swmitra
approved these changes
Jul 13, 2017
Collaborator
swmitra
left a comment
There was a problem hiding this comment.
Looks good to me barring the NITs and relevancy of the inner condition check 👍
| * @param {bool} isFakeCallUp - True if faked call up (for example calling CTRL+Space while hints are open) | ||
| */ | ||
| CodeHintList.prototype._keydownHook = function (event) { | ||
| CodeHintList.prototype._keydownHook = function (event, isFakeCallUp) { |
Collaborator
There was a problem hiding this comment.
NIT: isFakeKeyDown might me more suitable in this case?
|
|
||
| // (page) up, (page) down, enter and tab key are handled by the list | ||
| if (event.type === "keydown" && this.isHandlingKeyCode(event)) { | ||
| if (event.type === "keydown" && this.isHandlingKeyCode(event) || isFakeCallUp) { |
Collaborator
There was a problem hiding this comment.
Could be combined like this to make our intention more explicit ?
if ((event.type === "keydown" || isFakeKeyDown) && this.isHandlingKeyCode(event))| _rotateSelection.call(this, -1); | ||
| } else if (keyCode === KeyEvent.DOM_VK_DOWN || | ||
| (event.ctrlKey && keyCode === KeyEvent.DOM_VK_SPACE)) { | ||
| (event.ctrlKey && keyCode === KeyEvent.DOM_VK_SPACE) || isFakeCallUp) { |
Collaborator
There was a problem hiding this comment.
Do we need to touch this condition? In case of a fake key down for Ctrl+Space (event.ctrlKey && keyCode === KeyEvent.DOM_VK_SPACE) will return true anyways.
Signed-off-by: Pete Nykanen <pete.a.nykanen@gmail.com>
Collaborator
Author
swmitra
approved these changes
Jul 14, 2017
Collaborator
|
@petetnt Good work. This was a nagging issue and used to clutter the console completely with errors. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes regression in filed as #13481 by instead of relying on
modifying original event we add a boolean flag telling
_keydownHooktheevent is actually faked and should be treated as such.
Signed-off-by: Pete Nykanen pete.a.nykanen@gmail.com