- 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.
In what way is the new R2021b Editor UI "improved"?
122 views (last 30 days)
Show older comments
Kenneth Johnson on 5 Jan 2022
Edited: Francesca Marini on 17 Mar 2023 at 15:15
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.
Francesca Marini on 17 Mar 2023 at 14:32
Edited: Francesca Marini on 17 Mar 2023 at 15:15
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.
- We recognize that this is not the ideal behavior, and we are planning to add preferences for smart indenting of pad empty lines. In the meantime, there is a workaround to revert to the old behavior which is shown in this post: https://www.mathworks.com/matlabcentral/answers/1589089-change-to-code-formatting-behaviour-in-editor-in-r2021b
- We have also received additional feedback about indentation related improvements, including those in this post, that we will implement in future MATLAB releases.
Automatic completion and code suggestions.
- It is possible to enable/disable automatic completion from the setting panel. For more information, see: https://www.mathworks.com/help/matlab/matlab_env/check-syntax-as-you-type.html#bswj2of-1
Interpretation of Monospaced fonts.
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!
More Answers (1)
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: https://www.mathworks.com/matlabcentral/answers/48070-experiences-with-release-2012b )
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.
Find more on Environment and Settings 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!