Skip to content

Commit

Permalink
do not chang selection during search
Browse files Browse the repository at this point in the history
  • Loading branch information
semicontinuity committed Aug 23, 2023
1 parent 3d2c522 commit 6d3853f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions fsel/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,9 +731,14 @@ def handle_search_key(self, key):
self.make_focused_column_visible(True)
# self.folder_lists.search()
elif self.focus_idx in match_indices_by_box:
# better to binary-search for nearest match?
# Do not search in the current box.
# It will change selection, and matches in other boxes will be 'lost'.
# And the user, perhaps, searched for them.
# Disappearing matches are frustrating.

# -- better to binary-search for nearest match?
box = self.folder_lists.boxes[self.focus_idx]
box.cur_line = match_indices_by_box[self.focus_idx][0]
# box.cur_line = match_indices_by_box[self.focus_idx][0]
box.make_cur_line_visible()
else:
debug('SelectPathDialog.handle_search_key', focused=False)
Expand Down Expand Up @@ -904,7 +909,7 @@ def settings_file(self, root):


class Colors:
BLUE = 20
BLUE = 18
B_YELLOW = 227
B_GREEN = 120
B_RED = 196
Expand Down

0 comments on commit 6d3853f

Please sign in to comment.