Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workbench.action.focusRightEditor splits the view when 2 views are open #1891

Closed
Tyriar opened this issue Jan 8, 2016 · 9 comments
Closed
Assignees

Comments

@Tyriar
Copy link
Member

Tyriar commented Jan 8, 2016

Steps to reproduce

  1. Open a file
  2. Split the editor ctrl+</kbd>
  3. Command palette ctrl+shift+p
  4. Type "focus right"
  5. enter

Expected

The second text editor on the right is focused.

Actual

A third text editor is split (from the second text editor) and focused.

Notes

  • workbench.action.focusRightEditor does nothing when there is only a single editor.
  • workbench.action.focusRightEditor appears to function correctly when there are 3 text editors, just not 2.
@bpasero
Copy link
Member

bpasero commented Jan 11, 2016

This action is the thing that runs on Cmd+3 (Ctrl+3) and is used to bring up a third editor or focus it if 2 are open. This works as designed.

@bpasero bpasero closed this as completed Jan 11, 2016
@Tyriar
Copy link
Member Author

Tyriar commented Jan 11, 2016

@bpasero focusThirdEditor is the one that is bound to ctrl+3, it does seem to act exactly the same as focusRightEditor though.

Given that ctrl+3 already acts like this, this keybinding doesn't seem to provide much utility at all? A user could use ctrl+1/2/3 to focus all 3 editors or ctrl+shift+alt+left or right to only focus the left most or right most?

@bpasero
Copy link
Member

bpasero commented Jan 11, 2016

@Tyriar sorry I confused the actions, "Focus into Next Editor on the Right" is distinct from Cmd+3. For me it works like this:

  • 0 editor open: opens a first editor
  • 1 editor open: opens a second editor and focus it
  • 2 editor open: opens a third editor and focus it
  • 3 editors open: nothing

What puzzles me is why no editor opens for you when 1 is open?

Btw in your example the second editor already has focus when you call the split action. That is why a third editor opens. If you give focus to the first editor and then invoke the action, it works as expected.

@Tyriar
Copy link
Member Author

Tyriar commented Jan 11, 2016

@bpasero It appears I got a little confused too, I just looked again and I think I was indeed running focusThirdEditor because I was running it through the command palette. While this issue seems fine now, my confusion was due to 2 problems:

  • focusRightEditor conflicts with Ubuntu's default OS hotkeys, this is captured in Default keybindings that conflict with default Ubuntu OS keybindings #509
  • I was using the command palette with the search string "focus right" which was only matching "Focus into Right Hand Editor", even if I waited "Focus into Next Editor on the Right" was not matching. I think this is a legitimate bug with the command palette's fuzzy search. Not sure if an issue exists yet.

@bpasero
Copy link
Member

bpasero commented Jan 11, 2016

Yes, that explains it. Fuzzy find is not enabled in anything but the file picker (opt in).

@Tyriar
Copy link
Member Author

Tyriar commented Jan 11, 2016

@bpasero it did do a fuzzy match though on "Focus into Right Hand Editor"

@bpasero
Copy link
Member

bpasero commented Jan 11, 2016

That is actually a conicidence from our camel case matcher :)

@Tyriar
Copy link
Member Author

Tyriar commented Jan 11, 2016

Ah, well no issue apart from #509 then :) thanks for looking into it.

@bpasero
Copy link
Member

bpasero commented Jan 11, 2016

👍

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants