Fixed search failing in some dirs; fixed pathbar autofilling with one found path

This commit is contained in:
2023-09-16 01:18:36 -05:00
parent b5d1bbeccd
commit df688d919e
10 changed files with 132 additions and 80 deletions

View File

@@ -81,14 +81,17 @@ class FileSearchMixin:
self._list_proc = None
def _exec_find_file_query(self, widget=None, eve=None):
query = widget.get_text()
if not query in ("", None):
self.search_query = query
target_dir = shlex.quote( self._fm_state.tab.get_current_directory() )
command = ["python", f"{self.path}/utils/search.py", "-t", "file_search", "-d", f"{target_dir}", "-q", f"{query}"]
target_dir = shlex.quote( self._fm_state.tab.get_current_directory() )
command = ["python", f"{self.path}/utils/search.py", "-t", "file_search", "-d", f"{target_dir}", "-q", f"{query}"]
self._spinner.start()
self._list_proc = subprocess.Popen(command, cwd=self.path, stdin=None, stdout=None, stderr=None)

View File

@@ -87,12 +87,14 @@ class GrepSearchMixin:
if not query.strip() in ("", None):
self.grep_query = query
target_dir = shlex.quote( self._fm_state.tab.get_current_directory() )
command = ["python", f"{self.path}/utils/search.py", "-t", "grep_search", "-d", f"{target_dir}", "-q", f"{query}"]
target_dir = shlex.quote( self._fm_state.tab.get_current_directory() )
command = ["python", f"{self.path}/utils/search.py", "-t", "grep_search", "-d", f"{target_dir}", "-q", f"{query}"]
self._spinner.start()
self._grep_proc = subprocess.Popen(command, cwd=self.path, stdin=None, stdout=None, stderr=None)
def _load_grep_ui(self, data):
Gtk.main_iteration()