Skip to content

Commit

Permalink
Projects: Fix clearing the switcher when fzf can't find any match
Browse files Browse the repository at this point in the history
  • Loading branch information
ccordoba12 committed Aug 26, 2023
1 parent e6140b1 commit a36cc6f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions spyder/plugins/projects/widgets/main_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit a36cc6f

Please sign in to comment.