Add setting for tab closing order#66635
Add setting for tab closing order#66635bpasero merged 7 commits intomicrosoft:masterfrom SimonEggert:setting-for-closing-tabs
Conversation
bpasero
left a comment
There was a problem hiding this comment.
@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?
| oldOptions.labelFormat !== newOptions.labelFormat || | ||
| oldOptions.tabCloseButton !== newOptions.tabCloseButton || | ||
| oldOptions.tabSizing !== newOptions.tabSizing || | ||
| oldOptions.tabClosingOrder !== newOptions.tabClosingOrder || |
There was a problem hiding this comment.
@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.
You are right, my bad!
| // 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.
@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.
Thanks for the hint, I already thought there was a better way to do this.
| 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.
@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.
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! 🎉