-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Restore focus to the last focused side in a diff editor #69922
Comments
The diff editor is considered to be a single editor by our workbench and when I suggest the quick open checks where focus is before it is invoked and then restores focus when it is dismissed. |
I acknowledge the problem but would not want to change the default here simply because the left hand editor very often is not writable and this could cause frustration. Having an option for the |
@bpasero Please check my suggestion:
i.e. record |
@alexandrudima quick open was never tracking Thus, to make this work properly, you would need to change |
This is a more general problem. We could track the focus for the entire workbench and when QuickOpen closes, we would just return to the previous active element. The current solution appears to be to always return focus to the editor, which is not always correct, but has worked surprisingly well so far. |
@bpasero My recommendation is to read |
@alexandrudima we can do that, just worried that this is changing a pattern people might have gotten used to. Today we give the editor some extra treatment by always moving focus into it when any quick picker closes. We also have to make 100% sure that the command that executes from quick open does not require the editor to be focused. I remember in the past we had some issues with that where focus was not back in the editor but the command assumed that. @chrmarti btw you are doing the same for I do not see myself doing a lot of changes for old quick open given I want quick open to move over to your widget (via #69955) |
/duplicate #44722 |
Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines. Happy Coding! |
Issue Type: Bug
Similar to #22403
Instead of focus returning to the left side, it is shifted to the right. When the quick open hides, it's trying to focus back on the old editor
https://github.com/Microsoft/vscode/blob/d315d18deec4b9ece7f3cbb9d74a6916bb9718e8/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts#L281
but the diff editor always focuses the modified side:
https://github.com/Microsoft/vscode/blob/d315d18deec4b9ece7f3cbb9d74a6916bb9718e8/src/vs/editor/browser/widget/diffEditorWidget.ts#L758
I'm trying to write a command for starting a new comment thread, so I need to be able to get the focused editor. But the focus is always changed before the command runs, so there's no way to tell which editor to use
VS Code version: Code - Insiders 1.32.0-insider (507312a, 2019-03-06T11:10:01.691Z)
OS version: Darwin x64 18.2.0
The text was updated successfully, but these errors were encountered: