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

Open editors in the active editor group if now viewcolumn is specified #34459

Closed
bpasero opened this issue Sep 15, 2017 · 5 comments
Closed

Open editors in the active editor group if now viewcolumn is specified #34459

bpasero opened this issue Sep 15, 2017 · 5 comments
Assignees
Labels
api workbench-editors Managing of editor widgets in workbench window
Milestone

Comments

@bpasero
Copy link
Member

bpasero commented Sep 15, 2017

Steps to Reproduce:

  1. open a diff editor (from git) in the second or third view column
  2. trigger the editor title action "Open File"
  3. 🐛 the file opens in the first view column

I think the Git extension is doing the right thing for this command by setting the view column to be the one of the active editor, which in this case is the diff editor. However, it looks like the view column is always undefined for diff editors at least.

Tracing this down the stack, it looks like MainThreadDocumentsAndEditors#_onDelta is called with the left hand side of the diff editor as well as the right hand side (both instance of CodeEditor). As such, the method _findEditorPosition will not function properly because it compares the CodeEditor to the DiffEditorWidget which is opened.

@jrieken
Copy link
Member

jrieken commented Sep 15, 2017

However, it looks like the view column is always undefined for diff editors at least.

Yes, that how it is defined because otherwise both editors will have the same view column which is a little bogus. The viewColumn is just a weak hint, also because it will be undefined for other editors, embedded, output etc. Unsure what to do here, unsure if two editors should have the same view column...

@jrieken jrieken added under-discussion Issue is under discussion for relevance, priority, approach api labels Sep 15, 2017
@bpasero
Copy link
Member Author

bpasero commented Sep 15, 2017

Interestingly this would be not much of an issue if the viewColumn by default would not be set to ViewColumn.ONE from the extension host. If undefined, the workbench is always picking the column that is currently active. But I guess that would be a breaking change, at least from the docs:

image

@jrieken
Copy link
Member

jrieken commented Sep 15, 2017

Yeah, I think we can always tweak that. And more than you want that: #27409 I am just not yet sure about the implementations...

@bpasero
Copy link
Member Author

bpasero commented Sep 15, 2017

@jrieken yeah it looks like #27408 is the git diff issue I was seeing.

@bpasero bpasero changed the title window.activeTextEditor.viewColumn is undefined for diff editors Open editors in the active editor group if now viewcolumn is specified Jun 2, 2018
@bpasero bpasero assigned bpasero and unassigned jrieken Jun 2, 2018
@bpasero bpasero added workbench-editors Managing of editor widgets in workbench window and removed under-discussion Issue is under discussion for relevance, priority, approach labels Jun 2, 2018
@bpasero
Copy link
Member Author

bpasero commented Jun 2, 2018

I pushed a change to open an editor in the currently active editor group if no group is provided. I think this plays much better with the new grid system. As for other impact the grid should have on extensions API I have opened #51001

@bpasero bpasero closed this as completed Jun 2, 2018
@bpasero bpasero added this to the June 2018 milestone Jun 2, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Jul 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api workbench-editors Managing of editor widgets in workbench window
Projects
None yet
Development

No branches or pull requests

2 participants