Get old Find & Replace window back?

31 ビュー (過去 30 日間)
Jakob Weis
Jakob Weis 2022 年 4 月 7 日
コメント済み: Sergio Silva 2024 年 8 月 27 日
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 件のコメント
Glen Tallarek
Glen Tallarek 2023 年 4 月 3 日
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 2023 年 4 月 24 日
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

サインインしてコメントする。

採用された回答

Steven Lord
Steven Lord 2022 年 4 月 7 日
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 件のコメント
Michael Miller
Michael Miller 2023 年 4 月 7 日
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 2023 年 4 月 7 日
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

サインインしてコメントする。

その他の回答 (1 件)

Sergio Silva
Sergio Silva 2023 年 3 月 17 日
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 件のコメント
MathWorks Desktop Team
MathWorks Desktop Team 2024 年 8 月 26 日
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 2024 年 8 月 27 日
Thanks for your reply. I'll check it out when R2024a is available at my institution. Best, Sergio

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by