Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

"Ctrl + Space" should move to the next entry when the code hint menu popped up. #8142

Closed
metalbrick opened this issue Jun 17, 2014 · 16 comments

Comments

@metalbrick
Copy link

Otherwise the shortcut is kind of useless.

@metalbrick metalbrick changed the title Ctrl + Space shuold move to the next entry when the code hint menu poped up. "Ctrl + Space" shuold move to the next entry when the code hint menu poped up. Jun 17, 2014
@redmunds redmunds changed the title "Ctrl + Space" shuold move to the next entry when the code hint menu poped up. "Ctrl + Space" should move to the next entry when the code hint menu popped up. Jun 17, 2014
@redmunds
Copy link
Contributor

@metalbrick Ctrl+Space just pops up the code hints in the case where you need to force them open. You can then navigate to next/previous entries using up/down arrows on keyboard and also PageUp/PageDown keys.

@metalbrick
Copy link
Author

@redmunds sure the up/down would do the works, but when I was familiar or obsessed with Vim, I was kinda not willing to use arrow keys when coding, I just arbitrarily presumed there're someones are with me; And since the shortcut "ctrl-space" won't be conflict with anything other commands, I would like to suggest that it should implemented with this future, actually I think that might be a very simple UX fix.

@peterflynn
Copy link
Member

@metalbrick Does Vim have something like code hints, where Ctrl+Space works that way? I'm not familiar with any other editor where Ctrl+Space does what you're asking...

@metalbrick
Copy link
Author

@peterflynn Vim has "Ctrl+N" that did the same work, Sublime text has the features that I described with "Ctrl+space".

@redmunds
Copy link
Contributor

Making a starter bug

@ghost
Copy link

ghost commented Jul 18, 2014

I would like to fix this bug. Where to start with?

@redmunds
Copy link
Contributor

@ramsundhar20 Start by looking at editor/CodeHintManager.js and editor/CodeHintList.js

@ghost
Copy link

ghost commented Jul 18, 2014

Hai,

I went through the code in CodeHintList.js, I updated the below line at line number 398

"} else if ((keyCode === KeyEvent.DOM_VK_DOWN)||(event.ctrlKey && (keyCode == KeyEvent.DOM_VK_SPACE))) {"

Is this enough? or some more changes needed. I want to verify the fix who can I build brackets and check it?

@redmunds
Copy link
Contributor

@ramsundhar20 That sounds about right. Take a look at How to Hack on Brackets that explains how to get started contributing code.

@ghost
Copy link

ghost commented Jul 21, 2014

The above fix doesn't work. I am working on the proper fix. I will commit it after I verified it. Thank you.

@ghost
Copy link

ghost commented Jul 22, 2014

I made list to toggle using just ctrl, which would be more comfortable than ctrl+space

@seantw
Copy link

seantw commented Nov 1, 2014

ctrl-space is hotkey in Windows to toggles Asian IMEs

@metalbrick
Copy link
Author

@seantw Not in Win8 any more.

@bmax
Copy link
Contributor

bmax commented Feb 27, 2016

Hello,

I am new to OSS and thought this would be a fair bug to start. I hope it is still good to look into even though it is 2 years old.

I think I have the basic idea of how to do this but I am stuck on
CodeHintList.prototype._keydownHook = function (event) { function in CodeHintList.js, the problem is that event isn't picking up both commands ctrl+space, it's only picking up ctrl OR space.

running console.log(event); in the beginning of the _keydownHook function only shows keycode 17 (ctrl) or keycode 32 (space). Any help on figuring out how to detect both keydown events at the same time?

Here is my suggested solution: #12251

@redmunds
Copy link
Contributor

@bmax As mentioned in this previous comment, on the event for the space char also verify that the ctrl key is down something like: event.ctrlKey && (event.keyCode == KeyEvent.DOM_VK_SPACE)

petetnt pushed a commit that referenced this issue Aug 26, 2016
…n the code hint menu is open (#12251)

* Can now move up with ctrl+space.

* Changes made suggested by PR

* Found a cleaner way to do the alreadyOpen Bool. Still having trouble with the javascript '.' character hints

* Remove unneeded var

* Fix issues with CodeHints starting with dots

* Fix wrong parameter

* Changes made suggested by PR

* Fix issues with CodeHints starting with dots

* Fix issues with CodeHints starting with dots

* Fix issues with CodeHints starting with dots

* Remove unneeded var

* All tests pass.
@petetnt
Copy link
Collaborator

petetnt commented Aug 26, 2016

Fixed in #12251 / 63962ce

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants