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

Added separate commands to close main area widgets (editors) #7101

Merged
merged 1 commit into from
Feb 12, 2020

Conversation

spoenemann
Copy link
Contributor

What it does

Users have been confused by the behavior of the "Close Tab" command invoked with alt+w: gitpod-io/gitpod#1180. Changes in this PR to improve this:

  • New Command "Close Editor" closes the current tab in the main area.
  • The keybinding alt+w (ctrl/cmd+w in Electron) maps to "Close Editor" instead of "Close Tab".
  • Added "Close Editor" to the File menu to align with VS Code.
  • New Command "Close Other Editors" closes all tabs in the main area except the current one.
  • The keybinding ctrl/cmd+alt+t maps to "Close Other Editors" instead of "Close Other Tabs".
  • New Command "Close All Editors" closes all tabs in the main area.
  • The keybinding alt+shift+w (ctrl/cmd+k ctrl/cmd+w in Electron) maps to "Close All Editors" instead of "Close All Tabs".
  • Reverted alt+shift+w closes all main area tabs #4559: "Close All Tabs" always closes the tab bar of the current widget, regardless of the area.

Note that the new commands do not make any difference between editors and non-editor-widgets. While this may seem strange given the names of these commands, I believe it is the best way to achieve a behavior that is as close as possible to VS Code.

What we call the main area corresponds to the editor area in VS Code. The "Close Editor", "Close Other Editors" and "Close All Editors" commands in VS Code actually close tabs in the editor area, regardless of whether it is an editor or other kind of widget (e.g. Markdown preview, Extension details, etc.)

The main differences that remain:

  • In Theia we can drag views such as "Explorer" or "Problems" into the main area. If you do that, they will be affected by the new commands in the same way as editors.
  • In Theia we can drag editors into the left, right or bottom panel. If you do that, they will no longer be affected by the new commands. That means you can close them only by invoking "Close Tab" (via context menu or command palette), or by dragging them back to the main area and then invoking "Close Editor".

How to test

Invoke the commands "Close Tab", "Close Editor", "Close Other Tabs", "Close Other Editors", "Close All Tabs" and "Close All Editors" via command palette, keybinding or menu / context menu.

Review checklist

Reminder for reviewers

@akosyakov akosyakov added shell issues related to the core shell vscode issues related to VSCode compatibility labels Feb 10, 2020
Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

except naming (please have a look), it works well

@spoenemann
Copy link
Contributor Author

I renamed the constants and command labels. What do you think, shall we rename the File menu entry, too, or remove it?

Signed-off-by: Miro Spönemann <miro.spoenemann@typefox.io>
@akosyakov
Copy link
Member

@spoenemann merge it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
shell issues related to the core shell vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants