Add search UI feedback and hide button to search/replace plugin

- Add visual feedback styling for search states (searching, success, fail)
- Show match count in status label when searching
- Add hide (X) button to hide search panel
- Fix typo: stateus_lbl → status_lbl
- Add _set_find_options_lbl to display active search options
This commit is contained in:
2026-02-19 01:07:44 -06:00
parent 61b8bbc5fa
commit 3e920291a0
4 changed files with 66 additions and 13 deletions

View File

@@ -32,6 +32,8 @@ class SearchMixin:
def _find_all_matches(self, search_text, buffer):
self.update_style(0)
self.matches.clear()
self.current_index = -1

View File

@@ -37,11 +37,14 @@ class SearchReplaceMixin(SearchMixin, ReplaceMixin):
self.highlight_tag = buffer.get_tag_table().lookup("search-highlight")
if not search_text:
self.update_style(-1)
self.clear_highlight(buffer)
self.status_lbl.set_label("Find in current buffer...")
return
self._find_all_matches(search_text, buffer)
self._highlight_all_matches(buffer)
self._update_status_lbl(len(self.matches), search_text)
def _find_entry_activate(self, entry):
self._find_entry_next_match(entry)