From a36cc6f7ca4d4beffc4c9774fab278316b8852f8 Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Sat, 26 Aug 2023 11:21:55 -0500 Subject: [PATCH] Projects: Fix clearing the switcher when fzf can't find any match --- spyder/plugins/projects/widgets/main_widget.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/spyder/plugins/projects/widgets/main_widget.py b/spyder/plugins/projects/widgets/main_widget.py index 0bd73cb15e9..da82b654782 100644 --- a/spyder/plugins/projects/widgets/main_widget.py +++ b/spyder/plugins/projects/widgets/main_widget.py @@ -1027,16 +1027,18 @@ def _process_fzf_output(self, worker, output, error): if output is None or error: return + # Get list of paths from fzf output relative_path_list = output.decode('utf-8').strip().split("\n") - if relative_path_list == ['']: - return - # List of tuples with the absolute path - project_path = self.get_active_project_path() - result_list = [ - osp.normpath(os.path.join(project_path, path)) - for path in relative_path_list - ] + # List of results with absolute path + if relative_path_list != ['']: + project_path = self.get_active_project_path() + result_list = [ + osp.normpath(os.path.join(project_path, path)) + for path in relative_path_list + ] + else: + result_list = [] # Filter files that can be opened in the editor result_list = [