Get old Find & Replace window back?

26 views (last 30 days)
As of release R2022a, "Find & Replace" has been moved to a small pop-up menubar at the top right corner of the editor. Annoyingly, the 'Replace' part of the manubar is collapsed by default, which means whenever I want to replace some text in my code, I need to click the little arrow to the left of the menubar. In previous releases, when "Find & Replace" opened in a separate window, navigating to the 'replace' text box was possible with two keyboard shortcuts (CMD-F and tab to move to the Replace text field) and did not require using the mouse. This may sound pedantic, but I find this new "feature" rather disruptive to my workflow.
Is there a way to get the old 'Find and Replace' window back or at least have the Replace part of the new menu bar be expanded by default?
Thanks!
  5 Comments
Glen Tallarek
Glen Tallarek on 3 Apr 2023
When I do a Ctrl-F in a Simulink model to search for some text, the first thing I do when the small interface at the upper-right of the screen opens is to click on the icon that looks like a small spreadsheet. This opens the Search dialog along the whole bottom of the window where the search results will show up. Unfortunately, the field to enter the search string cannot be resized and all the options are stil buried behind the gear icon, but it is the best way I have found to use the new search interface. In my opinion, this change to the search interface was a big step down from the previous interface (and I still feel that way after using it now for a couple years). I cannot figure out how this change is considered an improvement.
Default search interface at upper-right corner of the window:
After clicking the spreadsheet icon to move the interface to the bottom of the window (and have access to a couple more icons):
Francesca Marini
Francesca Marini on 24 Apr 2023
As discussed in this MATLAB Answers post, here some more updates related to Find and Replace bar position, history and wrapping respectively.
  • 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:
  • Enable and disable wrapping is one 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

Sign in to comment.

Accepted Answer

Steven Lord
Steven Lord on 7 Apr 2022
Open the Preferences using the button in the Environment section on the Home tab of the Toolstrip.
Under MATLAB, expand the Keyboard section of the tree and select the item Shortcuts underneath it.
If you search for "Replace" using the search box immediately below the Active Settings dropdown it will tell you the shortcut to open the Replace dialog directly. On my Windows machine it is Ctrl-H so on your Mac I suspect it will be CMD-H but you can check and change it to something else if you so choose.
  16 Comments
Michael Miller
Michael Miller on 7 Apr 2023
Les Beckham: I have installed 2023a but the behavior is still the same. I don't get the file moved down as you do. The Find or Find/Replace pop up obscures the file being edited. I have looked through all preference settings and find nothing relevant. I am running on Linux. Am I missing something or is this an OS dependent issue?
Thank you!
Michael Miller
Michael Miller on 7 Apr 2023
Never mind. I just reread your post to realize that you stated it moves the file only if the searched for string is located underneath the popup. That does work in my Linux version. Thx

Sign in to comment.

More Answers (1)

Sergio Silva
Sergio Silva on 17 Mar 2023
Another question regarding the "Find & Replace" tool. On R2021a, there were options "match case", "whole word" and "wrap around".
On the new tool (R2022b), I can see "match case", "whole word" and "regular expression", but no "wrap around", which I use frequently on R2021a.
Am I missing something? How can I find/replace only up to the end of file with the new tool?
Thanks!
  2 Comments
MathWorks Desktop Team
MathWorks Desktop Team on 26 Aug 2024
Hi Sergio, just FYI, the "wrap around" option was re-added in R2024a as a setting and is available as a UI option in a future release. Take a look at this entry in the release notes for more info. You can also click the "Find in Selection" button to limit search and replace within the selection:
Sergio Silva
Sergio Silva on 27 Aug 2024
Thanks for your reply. I'll check it out when R2024a is available at my institution. Best, Sergio

Sign in to comment.

Categories

Find more on File Operations in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!