In what way is the new R2021b Editor UI "improved"?

I find the "new and improved" Editor UI in R2021b to be extremely irritating, in no way better than R2021a. How did this get past SQA? Following is a list of miscellaneous nuisances that I've run into:
The text search/replace box obscures the top text line in my file, which is a problem if the search text is obscured.
It isn't obvious how to revert to previous search strings in the search box.
I want to rename a variable in my m-file, and before doing so I want to ensure that the new name, "num_subset", does not already exist in the file. However, there are many occurrences of the substring "num" in my file, and as soon as I start typing in the search box it jumps to the next occurrence of "num" before I've finished typing. So now I have to go back and find the place where I was working.
In an auto-indented code section such as a while ... end block, if you insert more than one consecutive blank line in the code the auto-indenting is lost on all but one of the blank lines.
In an auto-indented block of code, if you put the cursor between two characters and press ENTER, the Editor will put in a line break with the new line indented, as expected. However, if you select (click-and-drag over) a character and press ENTER, the Editor will delete the character and replace it with a line break, as expected, but the new line will not be auto-indented.
After doing a text search you can do subsequent searches for the same text string using F3 without re-opening the search box. However, if you switch to another file (in the tabbed Editor window) F3 does not work; you have to re-open the search box. It worked in R2021a.
The search always wraps, but I usually don't want it to wrap. There appears to be no way to disable wrapping. In R2020a the search box had an option for enabling/disabling wrapping.
The behavior of Smart Indent has changed in 2020b. In 2020a all lines in a code block would be auto-indented. In 2020b the indenting of all blank lines is removed. So if you start typing in a blank line you have to either manually put in leading tabs or re-select Smart Indent.

12 commentaires

Scaler
Scaler le 8 Fév 2022
I agree with the view here. Most of the changes listed above have caused me frustration and reduced my productivity.
In addition:
  • The lag is a real problem. Sometimes I hit tab multiple times just waiting for the editor to respond.
  • I used to double-click on an identifier and check the notice at the bottom of the editor (e.g., '3 usages of "thisMakesMeCry" found`) to make sure I was seeing all uses of that identifier. The new editor still displays that message, but only for some identifier that I selected who knows when--not the one currently selected or the one last searched for. It is totally broken.
  • Have some versioned code written with a previous editor? Don't you dare smart-indent that file! Since the definition of "smart" apparently changed (I won't say to what!), so will all your blank lines.
This! Completely agree on everything.
Especially the search function, it has become so ridiculous.
With this fancy "immediate" search behavior you get thrown all over the place and waste time finding your way back to the point in the code you actually wanted to search around.
The new behavior of smart indentation is not even consistent with the the indentation that R2021b itself does when hitting return on an indented line of code.
I hope they will completely refactor MATLAB soon. You can tell from the GUI behavior that this software has become a pile of fixes and workarounds that is simply unmanageable.
I've submitted multiple Service Requests regarding the search function. I wouldn't call it a "pile of fixes and workarounds" because the old UI worked fine. It had a standard search box that waited until the user pressed Search or ENTER before starting the search. If you wanted to repeat the same search in 10 files, you could just click the UI tabs for each file and press F3; you wouldn't have to reopen the search box and re-enter the search text in each file. It seems like MathWorks turned over UI development to amateur and inexperienced coders who decided to redo everything without any management oversight.
goc3
goc3 le 2 Mai 2022
These regressions are quite unfortunate. Hopefully they will fix them. (Though, they seem to have persisted into 2022a...)
The problem is that they consider some of these changes to be improvements or the way the editor should function. For example, I submitted a service request regarding the change to smart indenting removing all tab space in blank lines (which I find to be infuriating) and was told that that is the new intended functionality!!
This new search box, introduced in 2021B, should be reverted back to 2021A.
Where are previous search terms?
Where does it say "match case"?
Where does it say "whole word"?
Why is arcane & ad hoc symbology better than English descriptors and check boxes?
_____________________________________________________________________
The large Run button in 2021A Editor has been demoted and moved right to an inferior position in 2021B. Run has been replaced with another arbitrary flavor of conditional Run that should never have achieved prominence nor displaced the primary Run function.
_____________________________________________________________________
Which textbooks on ergonomic design were consulted prior to introducing these atrocities?
These are a major steps backward and certainly misguided in development of the Editor GUI.
I fully agree and want to add the font issue. The new editor has a different interpretation of Monospaced than the Command Window.
OMG I hear you guys. I've been using Matlab for decades, and this is this editor is the worst UI decision they have ever made. Everything about it drives me nuts: The non-detachable search box, the immediate jumpiness of searches, the moronic function argument suggestions ("thank you, I know how to use sprintf()"), the fugly section highlighting, the 99% wrong argument suggestions .... WHY WHY WHY?
Why can't I turn off all this crud?
Why does no-one at Mathworks realize the there are experienced programmers out there who HATE all the junk flashing on/off while trying to concentrate on something complicated?
Why isn't this editor be the old editor with new options?
Why can't I use the old editor?
Felipe Jiménez Hernández
Felipe Jiménez Hernández le 15 Fév 2023
Modifié(e) : John Kelly le 21 Fév 2023
Please give us the old editor. This one is not worth even fixing.
Jan
Jan le 15 Fév 2023
A businesslike wording is preferred in the forum. I ask you to support this. Thanks.
Image Analyst
Image Analyst le 19 Fév 2023
Modifié(e) : Image Analyst le 19 Fév 2023
"unbusiness-like" language that includes profanity can and will be deleted by any of the numerous moderators of this forum. But OK, point taken: you don't like the new editor style.
Tips for Creating Helpful Answers
Be honest and considerate with all responses to all contributors.
Tips for Making Comments Helpful
Be aware that responses containing profanity, vulgarity, or an offensive tone will be removed.
Jan
Jan le 19 Fév 2023
Modifié(e) : John Kelly le 21 Fév 2023
Consider the Guidelines of this forum, which include:
Regardless of these guidelines, if moderators or administrators tell you not to do something, don't do it. They reserve the right to change or delete any content if they feel it is inappropriate.

Connectez-vous pour commenter.

 Réponse acceptée

Francesca Marini
Francesca Marini le 17 Mar 2023
Modifié(e) : Francesca Marini le 17 Mar 2023

4 votes

Hi, this is Francesca Marini, I’m the MATLAB product manager for the desktop and editor side.
Let me first thank you all for your feedback, this is absolutely valuable to us to understand how to continuously improve MATLAB and do the best we can to meet your needs. I encourage you to keep doing so and letting us know your thoughts.
I’ve carefully read all your comments and I’ll try to respond to each of the points you listed.
Find and replace dialog box:
  • From MATLAB R2022b, the find and replace dialog box will no longer obscure the code as when it overlaps the find result, the editor will move downward.
  • You can use the down arrow to show a list of previous searches in R2021b. Starting in MATLAB R2023a, there is a visual hint indicating that you can do so:
  • Starting in MATLAB R2023a, it will be once again possible to use F3 without re-opening the find and replace dialog box when switching to another file.
  • Allowing control of whether the cursor should jump to find matches while typing as well as to enable and disable wrapping are some of our top priority issues and we are working on a solution. For now, starting in MATLAB R2023a, you can use the "Find in selection" option to perform search and replace in selection instead of the entire script to narrow down the scope of the search. https://www.mathworks.com/help/matlab/matlab_prog/find-and-replace-text-in-files.html
Smart Indenting of empty lines.
Automatic completion and code suggestions.
Interpretation of Monospaced fonts.
  • By default, the code font is set to monospaced to choose a fixed-width font. When the font is set to monospaced, the actual displayed font in the Editor is different than the font displayed in the Command Window and Command History. This is because monospaced is a logical font, not a physical font, and the tools are replacing monospaced by different physical fonts as the editor is using JavaScript rather than Java technology. In future releases of MATLAB this will no longer be an issue because all tools will use the same physical font. In the meantime, to avoid this discrepancy, specify the font name as a physical font, for example, Courier New. https://www.mathworks.com/help/matlab/matlab_env/change-fonts.html
Performance Issue and UI design.
  • We have been making improvements to performance and the UI design over the past few releases. My suggestion is to update MATLAB to the latest release (when possible) to get the latest updates. We also encourage you to submit detailed requests to our support team so that we can investigate any issues you are encountering.
We understand that sometimes a new release may introduce changes that may impact the workflow and we’re doing our best to improve the transition between releases and make it as smooth as possible.
I hope this was helpful!

5 commentaires

About the font issue: Thanks for the technical background. I had already tried your proposed workaround back then (and tried it again now in R2022b): By setting a physical font like Courier New the characters look the same in both the Command Window and the Editor, but the line spacing is still different and also the characters look a little bolder in the Editor. See this screenshot collage showing a comparison using "Consolas, plain, 10pt". I hope these discrepancies will be resolved, too.
Comparison using Consolas font
Felipe Jiménez Hernández
Modifié(e) : Felipe Jiménez Hernández le 1 Juin 2023
Dear Francesca,
No.
The new editor is so broken that you should just revert to the old one. That's all.
Or at least give that option.
I don't want to be moderated, so I'll just say that the new editor is terrible.
Terrible terrible terrible terrible terrible terrible terrible terrible terrible terrible terrible terrible terrible terrible.
And once I'm here, now how do I split the editor window into two subwindows, each for one part of the same mfile?
Thank you in advance.
And once I'm here, now how do I split the editor window into two subwindows, each for one part of the same mfile?
If you have the document open in MATLAB Editor and in focus (selected), switch to the View tab in the Toolstrip. One of the sections is "Split Document" that lets you select whether you want to see the document split top and bottom, split left and right, or stop splitting.
Thank you, Steven, it worked fine.
But I cannot split into less than about 6 lines each. Why? Is there a way to revert to the old editor?

Connectez-vous pour commenter.

Plus de réponses (3)

Giles
Giles le 13 Avr 2023

1 vote

At the very least there should be an option to re-enable the old editor.
The old editor was perfect. The new editor might become perfect in time, but we're going to have to wait years for all the problems to be worked out--and even then no guarantees. And even if it does get there in time, we're just going to end up with something resembling the old editor. I don't understand why this was done at all.
You can add the problem that it used to be easy to block-select one or more lines by clicking and dragging in the left margin. In the new editor the area where you can do that is now so thin it becomes tricky/painful to use.
Agree that auto-jumping the search while typing is a terrible idea. Might be nice if you're searching a document or the web. Not nice for coding. I don't get how that made it into version 1.

1 commentaire

I have skipped upgrading to the latest versions just for this. You must be f* s* to worsen a product so terribly out of nowhere. For most users, a friendly programming environment is much more important than any improvements they can make under the hood.

Connectez-vous pour commenter.

Jan
Jan le 15 Fév 2023

0 votes

I still miss the editor option existing inMatlab 6.5, which allowed to provide the selected text as input to functions defined by the user. This could be defined directly in the menu of the editor. Sigh.
The introduction of the ribbon style in R2012b was a hard stroke already (see: https://www.mathworks.com/matlabcentral/answers/48070-experiences-with-release-2012b )

2 commentaires

I still miss the editor option existing inMatlab 6.5, which allowed to provide the selected text as input to functions defined by the user.
I'm not 100% sure what you're describing, but I've done something like this with shortcuts or favorites in MATLAB. Open a document in the MATLAB Editor and select some text, then run this code (almost certainly won't work in MATLAB Answers.)
s = matlab.desktop.editor.getActive().SelectedText
You might want to safeguard this a bit before using this in your code by checking that matlab.desktop.editor.getActive returns a non-empty output. You could also use this in conjunction with the clipboard command to copy the SelectedText to the clipboard.
Jan
Jan le 16 Fév 2023
@Steven Lord: Thanks for this useful suggestion.
As far as I remember, the mentioned feature was in the "Tools" menu of Matlab 6.5, where a list of functions could be defined and triggered by hot keys. The input was the current selection and maybe this selection was replaced, if the function had outputs.
Unfortunately my virtual machine with WinXP crashed and I cannot find the old documentation currently. Actually FEX: EditorMacro could fill this gap, but I have some doubt concerning the stability of this tool.

Connectez-vous pour commenter.

Felipe Jiménez Hernández
Modifié(e) : Felipe Jiménez Hernández le 29 Sep 2025

0 votes

Each time I open the editor, the ribbon is open and I have to hide it. Is there a way to hide it forever by default?
(I have it undocked so I can swap to/from it with Alt-Tab.)

Catégories

En savoir plus sur Entering Commands dans Centre d'aide et File Exchange

Produits

Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by