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

16 views (last 30 days)
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.
Jan on 19 Feb 2023
Edited: John Kelly on 21 Feb 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.

Sign in to comment.

Accepted Answer

Francesca Marini
Francesca Marini on 17 Mar 2023
Edited: Francesca Marini on 17 Mar 2023
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.
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.
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!

Sign in to comment.

More Answers (2)

Giles on 13 Apr 2023
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 Comment
Felipe Jiménez Hernández
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.

Sign in to comment.

Jan on 15 Feb 2023
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: )
Jan on 16 Feb 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.

Sign in to comment.


Find more on Entering Commands in Help Center and File Exchange




Community Treasure Hunt

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

Start Hunting!