Allow to use Ctrl P/N for up and down navigation in quick open #7876

Closed
kai-iak opened this Issue Jun 20, 2016 · 12 comments

Projects

None yet

9 participants

@kai-iak
kai-iak commented Jun 20, 2016 edited
  • VSCode Version: 1.2.1
  • OS Version: 10.11.5

Steps to Reproduce:

  1. Invoke command palette
  2. Begin typing a query i.e. ext
  3. Attempt to move up/down the list with ctrl+p and ctrl+n

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" },
@bpasero bpasero was assigned by dbaeumer Jun 20, 2016
@bpasero bpasero assigned joaomoreno and unassigned bpasero Jun 21, 2016
@joaomoreno joaomoreno assigned joaomoreno and unassigned joaomoreno Jun 21, 2016
@joaomoreno
Member

Fix: implement Ctrl P and Ctrl N for Up and Down.

@joaomoreno joaomoreno added this to the Backlog milestone Jun 21, 2016
@joaomoreno joaomoreno changed the title from VS Code Command Palette Navigation Not Working on OSX to Implement Ctrl P/N for up and down navigation in tree / quick open Jul 6, 2016
@joaomoreno
Member

Fixed by #7316

@joaomoreno joaomoreno closed this Jul 6, 2016
@aeschli aeschli added duplicate and removed bug labels Sep 2, 2016
@joaomoreno joaomoreno reopened this Sep 9, 2016
@bpasero bpasero was assigned by joaomoreno Sep 9, 2016
@joaomoreno joaomoreno changed the title from Implement Ctrl P/N for up and down navigation in tree / quick open to Implement Ctrl P/N for up and down navigation in quick open Sep 9, 2016
@joaomoreno joaomoreno removed their assignment Sep 9, 2016
@joaomoreno
Member

@bpasero Adding you since the changes are quick open widget, not in the tree.

@bpasero bpasero removed their assignment Sep 9, 2016
@bpasero bpasero changed the title from Implement Ctrl P/N for up and down navigation in quick open to Allow to use Ctrl P/N for up and down navigation in quick open Sep 9, 2016
@elemongw
Contributor

@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).

@wardw
wardw commented Dec 21, 2016

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.

@bpasero
Member
bpasero commented Jan 19, 2017

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 bpasero self-assigned this Jan 19, 2017
@bpasero bpasero modified the milestone: January 2017, Backlog Jan 19, 2017
@bpasero bpasero closed this in 215a0af Jan 19, 2017
@bpasero
Member
bpasero commented Jan 23, 2017 edited
  • To verify:
    On macOS you can use Ctrl+N and Ctrl+P to navigate inside the opened quick open up and down, similar to arrow up and arrow down.
@jrieken jrieken added the verified label Jan 24, 2017
@jrieken
Member
jrieken commented Jan 24, 2017

@bpasero also cmd+p navigates in quick open (instead of changing the quick open topic to open file). Is that a regression from this?

@bpasero
Member
bpasero commented Jan 24, 2017 edited

@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" }
@jrieken
Member
jrieken commented Jan 24, 2017

Unsure how this is related to cmd+e? I am talking about cmd+p. Do the following

  • hit cmd+p, see file picker
  • while file picker shows, hit F1, see command picker
  • while command picker shows, hit cmd+p, some item selected
@bpasero
Member
bpasero commented Jan 25, 2017 edited

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 #10957

@danielmoi

Thank you for this fix @bpasero – my favourite feature in this release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment