Steps to Reproduce:
I installed the latest version of VS Code (1.2.1) on El Capitan. When I used the Atom (and ST2?) text editor and invoked the command palette I could cursor up/down the list using ctrl+p/ctrl+n.
For example, if I launch the command palette and search for extension I get the following list:
Extensions: Install Extension
Extensions: Show Extension Recommendations
Extensions: Show Installed Extensions
Extensions: Show Outdated Extensions
If I want to get to 'Show Installed Extensions' I would press ctrl+n twice in Atom. When I try doing this with VS Code nothing happens. In looking at the Default Keyboard Shortcuts there are:
{ "key": "ctrl+p", "command": "cursorUp", "when": "editorTextFocus" },
{ "key": "ctrl+n", "command": "cursorDown", "when": "editorTextFocus" },
Fix: implement Ctrl P and Ctrl N for Up and Down.
Fixed by #7316
@bpasero Adding you since the changes are quick open widget, not in the tree.
@joaomoreno I can create a new patch to make it work as you liked (not needing enter to select). However my opinion on the matter is that it shouldn't work that way, ctrl+p/ctrl+n work universally as up and down arrows on mac (this is true for vscode too apart from quickOpenWidget as only part of my patch was reverted).
Yes, useful to note that ctrl+p/ctrl+n work nicely when navigating the auto-complete popup. I agree with @elemongw that certainly on a mac, ctrl+p/ctrl+n are common aliases for up/down everywhere. I've always taken this as being originally of emacs heritage, so this behaviour is common on linux, too.
I added new commands workbench.action.quickOpenSelectNext and workbench.action.quickOpenSelectPrevious which on macOS are bound to Ctrl+N and Ctrl+P by default and work only when quick open is visible.
The difference to the commands workbench.action.quickOpenNavigateNext and workbench.action.quickOpenNavigatePrevious is that upon releasing the key, the item will be opened.
@bpasero also cmd+p navigates in quick open (instead of changing the quick open topic to open file). Is that a regression from this?
@jrieken no this is actually behaviour we have ever since quick navigation in quick open to make @joaomoreno happy because he uses Cmd+E to bring up quick open and another Cmd+E to quickly open the element.
Can be controlled via
{ "key": "cmd+p", "command": "workbench.action.quickOpenNavigateNext", "when": "inQuickOpen" }
Unsure how this is related to cmd+e? I am talking about cmd+p. Do the following
I removed Cmd+P and Cmd+E to select and execute the command when quick open is visible. The commands are still there if someone wants to keep it. Also fixes https://github.com/Microsoft/vscode/issues/10957
Thank you for this fix @bpasero – my favourite feature in this release!
Most helpful comment
@joaomoreno I can create a new patch to make it work as you liked (not needing enter to select). However my opinion on the matter is that it shouldn't work that way, ctrl+p/ctrl+n work universally as up and down arrows on mac (this is true for vscode too apart from quickOpenWidget as only part of my patch was reverted).