Author Topic: Recall search configuration  (Read 886 times)

rygaard

  • Community Member
  • Posts: 63
  • Hero Points: 1
Recall search configuration
« on: January 13, 2023, 08:06:42 PM »
First, let me describe the problem this would address:

Sometimes I have to repeatedly perform a particular search, intermixed with performing other searches.  For example, I might need to perform this particular search sequence:
  •    Text = main(
       Look in: <project>
       Match case
       Don't match whole word
       Don't use regular expressions
       Color matching = functions only
  •    Do some editing
  •    Text = myString1:b*+=?*"\);"
       Look in: C:\MyProject
       Don't match case
       Match whole word
       Use regular expressions
       Don't use color matching
  •    Do some editing
  •    Text = main(
       Look in: <project>
       Match case
       Don't match whole word
       Don't use regular expressions
       Color matching = functions only
  •    Do some editing
  •    Text = new:b*MyClass\(:b*:a*\:b*);
       Look in: <project>
       Don't match case
       Don't match whole word
       Use regular expressions
       Don't use color matching
  •    Do some editing
  •    Text = main(
       Look in: <project>
       Match case
       Don't match whole word
       Don't use regular expressions
       Color matching = functions only

This example requires that I select and deselect several options for every search.  However, notice that Steps 1, 5, and 9 are identical, and I would like to recall the entire search configuration from Step 1 for Steps 5 and 9.  Currently, the only thing I can recall from Step 1 is the search text.

This is a proposed solution:  The search history records the entire search configuration, not just the search text.  As I select text from previous searches (whether using the up and down arrow keys or using the drop-down), it sets all of the search options to what was used for that text, not just the text.  For compatibility, also provide a configuration option to disable this feature.

A note on this proposal:  The way that it is currently implemented (V 27.0.0.1), if the text of the search does not change, then that text is not added to the search history.  If this proposal is implemented, then two different searches with the same text but different search options would be entered separately into the search history.

Dennis

  • Senior Community Member
  • Posts: 3955
  • Hero Points: 515
Re: Recall search configuration
« Reply #1 on: January 13, 2023, 08:15:14 PM »
It sounds like what you want is the dialog retrieval feature.  Press F7 or F8 to cycle through previous search settings (in the Find and Replace tool window).

rygaard

  • Community Member
  • Posts: 63
  • Hero Points: 1
Re: Recall search configuration
« Reply #2 on: January 14, 2023, 08:54:38 AM »
Well, that's just cool!

Can I configure Simulink to remember more than just a few previous dialogs?

Dennis

  • Senior Community Member
  • Posts: 3955
  • Hero Points: 515
Re: Recall search configuration
« Reply #3 on: January 16, 2023, 02:13:41 PM »
While not currently on the options dialog, you can customize the number of previous dialogs by setting the interpreter variable "def_maxdialoghist". 

Macro > Set Macro Variable... > def_maxdialoghist = N