-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Add setting for tab closing order #66635
Add setting for tab closing order #66635
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SimonEggert good version. I wonder though, do we need 2 different settings "Left to Right" and "Right to Left"? Wouldn't a boolean setting be easier to just disable the MRU behaviour?
@@ -385,6 +385,7 @@ export class TabsTitleControl extends TitleControl { | |||
oldOptions.labelFormat !== newOptions.labelFormat || | |||
oldOptions.tabCloseButton !== newOptions.tabCloseButton || | |||
oldOptions.tabSizing !== newOptions.tabSizing || | |||
oldOptions.tabClosingOrder !== newOptions.tabClosingOrder || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SimonEggert all the changes in this file seem unneeded. We neither need to redraw the tab nor change classes when this setting changes, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, my bad!
@@ -332,7 +332,26 @@ export class EditorGroup extends Disposable { | |||
|
|||
// More than one editor | |||
if (this.mru.length > 1) { | |||
this.setActive(this.mru[1]); // active editor is always first in MRU, so pick second editor after as new active | |||
const tabClosingOrder = this.configurationService.getValue('workbench.editor.tabClosingOrder'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SimonEggert I would prefer if this setting was put as variable similar to private editorOpenPositioning
so that we do not have to compute it each time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the hint, I already thought there was a better way to do this.
@@ -332,7 +332,26 @@ export class EditorGroup extends Disposable { | |||
|
|||
// More than one editor | |||
if (this.mru.length > 1) { | |||
this.setActive(this.mru[1]); // active editor is always first in MRU, so pick second editor after as new active | |||
const tabClosingOrder = this.configurationService.getValue('workbench.editor.tabClosingOrder'); | |||
if (tabClosingOrder === 'rtl') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SimonEggert instead of repeating this.setActive...
so many times, can we just store the editor as variable and then call this method last with the right one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I adjusted the code to avoid multiple this.setActive
-calls.
…le method-calls, only calculate setting when config changes, adjust tests
@bpasero Thank you for your feedback and tips. I tried my best to implement the changes you requested, so feel free to take a look and let me know what you think. |
Thanks 👍 |
So is this feature implemented? How it's called? |
thanks ;) |
This remark apparently made OP completely remove much desired Logically, this should have been three state option controlling what happens after tab is closed.
Issue #67730 (Close with ctrl+w from right to left and not vice-versa) called for last mentioned option, but was mistakenly marked as duplicate of #57554 (Allow to close tabs from left to right [rather than MRU]) what was resolved by this PR. So option for right to left closing order is still missing but would be really nice. |
Feel free to open a new issue for it. |
Closes #57554, closes #43459
This is my first contribution to the open source world! 🎉