Skip to content

Commit a36cc6f

Browse files
committed
Projects: Fix clearing the switcher when fzf can't find any match
1 parent e6140b1 commit a36cc6f

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

spyder/plugins/projects/widgets/main_widget.py

+10-8
Original file line numberDiff line numberDiff line change
@@ -1027,16 +1027,18 @@ def _process_fzf_output(self, worker, output, error):
10271027
if output is None or error:
10281028
return
10291029

1030+
# Get list of paths from fzf output
10301031
relative_path_list = output.decode('utf-8').strip().split("\n")
1031-
if relative_path_list == ['']:
1032-
return
10331032

1034-
# List of tuples with the absolute path
1035-
project_path = self.get_active_project_path()
1036-
result_list = [
1037-
osp.normpath(os.path.join(project_path, path))
1038-
for path in relative_path_list
1039-
]
1033+
# List of results with absolute path
1034+
if relative_path_list != ['']:
1035+
project_path = self.get_active_project_path()
1036+
result_list = [
1037+
osp.normpath(os.path.join(project_path, path))
1038+
for path in relative_path_list
1039+
]
1040+
else:
1041+
result_list = []
10401042

10411043
# Filter files that can be opened in the editor
10421044
result_list = [

0 commit comments

Comments
 (0)