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:
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user