Editor: Disabling Collapse of Tabs on Double-Click

When using the docked editor in MATLAB, you can snap different files to different parts of the editor (e.g. have them side by side, above-below and so forth).
The problem is that when you double click on one of the tabs, frequently unintentionally, all of the docked windows collapse into a single view (i.e. they are no longer side by side).
When you are working on multiple files at once and have them neatly arranged, having them all suddenly collapse and loose order is highly frustrating. Is there any way to disable this double-click shortcut?

8 Comments

I'd also love to disable this. Can't find anything in the settings. It's incredibly frustrating, especially when I have many tabs distributed across multiple windows.
This is probably my most desired feature for the time beeing... It is super irritating when it happens and you are working on some complex classes.
It actually took me some time before I understood the collapsing was related to the tab double click event... But even now that I know it, it still happens inadvertently from time to time... It just did now.... Argh...
I agree, I find this immensely irritating. I have only ever done it by accident, never because I wanted to, and so much by accident that I never even isolated what it was I had done to trigger the behaviour!
It would be great to have an answer to this — the answer below doesn't actually disable the double-click behavior.
Similarly to Adam, I have only ever done this by accident and would like to be able to disable the collapse of tab layout in the editor altogether if possible.
I agree that this is a huge irritating problem and creates a lot of work for us. This feature either needs to be removed outright or at least have the option to remove it. When I double click on a file in the file list tab it seems like it should just pop into one of the tabs but instead it ruins your whole layout. Because the actual behavior is so unintuitive it is really hard to learn.
Solution:
Double click on the original tab you accidentally clicked. It will revert it all back.
Side Note:
Had chatgpt figure this out, not sure how it knew since this was the only thread of this.
@Benjamin Tessler Which version of MATLAB have you tried that in? It doesn't work in R2022a.
I actually just made some functions related to this. The getTabs is only for 2025a, I think. But if you have the filenames as a cell array you can use the other functions to reopen the tabs.

Sign in to comment.

Answers (2)

Hello,
I understood that you want to retain the tailored view and don not want to miss it as it takes lot of time to set things back into the place.
I can certainly understand how frustrating it is because even I have faced the same issue in the beginning, but thanks to MATLAB, it gave an option to save our tailored view and can get back to it with a single click.
Here are the steps to get that done. Firstly, set up the MATLAB view you wish to have on your screen like placing different MATLAB windows in different positions.
I would like to add a point here to make a customized view in a simple way.
In the "View" panel, there are good number of options to tailor MATLAB view as required.
Without struggling much in dragging things on the screen to set up the position, instead we can try those options like "Custom" windows or "Left/Right" and "Top/Bottom" and "Tab Position" and "SPLIT DOCUMENT" options. Just in case if you want to have all the files in single editor window without any customization, simply click on "Single" option at the left corner.
So, coming to our original discussion of having the customized view handy, once you tailor the view as per your requirements, got to "Home" and click on "Layout" to see the available options. Among them select the "Save Layout" and give a name to the layout. Now everything is set to go.
From now on, to get back to your favourite view, just click on the laylout option and select the saved one and MATLAB will fall into your favourite customized view.
Hope you will find it helpful!

1 Comment

Thanks. I just tried your suggestion but I am afraid that the positions of the docked windows inside the editor are not included in the saved layouts. Just tried it. Saved my layout as per your suggestion, double-clicked one tab in the editor (all docked tabs got undocked as sadly expected). Reloading my saved layout did unfortunatelly not restore the original tabs location inside the editor...
Being able to save the layout of the tabs in the editor would be a cool feature... But simply being able to diasable the double-click event on the editor tabs would be a good-enough start for me.

Sign in to comment.

Using 2025b, I can just double-click the tab again and it snaps back to whatever layout I had before.

Categories

Find more on Graphics Performance in Help Center and File Exchange

Products

Release

R2019a

Asked:

on 16 Aug 2021

Answered:

on 4 Mar 2026

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!