Repository: spyder-ide/spyder

Issue:
Exclude patterns in Find are not saved
<!--- **PLEASE READ:** When submitting here, please ensure you've completed the following checklist and checked the boxes to confirm. Issue reports without it may be closed. Thanks! --->

### Issue Report Checklist

* [x] Searched the [issues page](https://github.com/spyder-ide/spyder/issues?q=is%3Aissue) for similar reports
* [ ] Read the relevant sections of the [Spyder Troubleshooting Guide](https://github.com/spyder-ide/spyder/wiki/Troubleshooting-Guide-and-FAQ) and followed its advice
* [x] Reproduced the issue after updating with ``conda update spyder`` (or ``pip``, if not using Anaconda)
* [ ] Could not reproduce inside ``jupyter qtconsole`` (if console-related)
* [ ] Tried basic troubleshooting (if a bug/error)
    * [x] Restarted Spyder
    * [ ] Reset preferences with ``spyder --reset``
    * [ ] Reinstalled the latest version of [Anaconda](https://www.anaconda.com/download/)
    * [ ] Tried the other applicable steps from the Troubleshooting Guide
* [ ] Completed the **Problem Description**, **Steps to Reproduce** and **Version** sections below


## Problem Description

"Find in files" advanced options are not saved.

### What steps reproduce the problem?

1. Open "Find in files"
2. Do a search with for example excluding ".venv/*, .git/*"
3. Restart Spyder
4. exclude ".venv/*, .git/*" options have disappeared

### What is the expected output? What do you see instead?
The "exclude" advanced options should be saved.
This is OK with Spyder v4.2.5 .
This does not work with Spyder v5.0.0 .
This does not work with Spyder v5.0.1 .


### Paste Traceback/Error Below (if applicable)
<!--- Copy from error dialog or View > Panes > Internal Console --->

```python-traceback

PASTE TRACEBACK HERE

```

## Versions
<!--- You can get this information from Help > About Spyder...
or (if Spyder won't launch) the "conda list" command
from the Anaconda Prompt/Terminal/command line. --->

* Spyder version: 5.0.1
* Python version: 3.9.0
* Qt version: unknown
* PyQt version: unknown
* Operating System name/version: Xubuntu 20.10 VENV

### Dependencies
<!--- Please go to the menu entry Help > Dependencies,
press the Copy to clipboard button and paste below --->

```
PASTE DEPENDENCIES HERE
```



Discussion:

Resolving patch:
diff --git a/spyder/plugins/findinfiles/widgets.py b/spyder/plugins/findinfiles/widgets.py
--- a/spyder/plugins/findinfiles/widgets.py
+++ b/spyder/plugins/findinfiles/widgets.py
@@ -1142,7 +1142,7 @@ def _update_options(self):
         hist_limit = self.get_conf('hist_limit')
         search_texts = [str(self.search_text_edit.itemText(index))
                         for index in range(self.search_text_edit.count())]
-        excludes = [str(self.search_text_edit.itemText(index))
+        excludes = [str(self.exclude_pattern_edit.itemText(index))
                     for index in range(self.exclude_pattern_edit.count())]
         path_history = self.path_selection_combo.get_external_paths()
 
@@ -1340,7 +1340,7 @@ def set_max_results(self, value=None):
             dialog.setInputMode(QInputDialog.IntInput)
             dialog.setIntRange(1, 10000)
             dialog.setIntStep(1)
-            dialog.setIntValue(self.get_option('max_results'))
+            dialog.setIntValue(self.get_conf('max_results'))
 
             # Connect slot
             dialog.intValueSelected.connect(


Test patch: