summaryrefslogtreecommitdiff
path: root/qutebrowser/mainwindow
diff options
context:
space:
mode:
authorJason Rosenzweig <mail4jasonr@gmail.com>2021-06-04 01:03:52 +0800
committerJason Rosenzweig <mail4jasonr@gmail.com>2021-06-04 01:03:52 +0800
commit5610a43177e64a882896fbdd0e1befb66a65facc (patch)
tree127f14542db86e1c2c6e4ea0bc547c11a937187b /qutebrowser/mainwindow
parent3a0d20e5f96bb8188d2b4b29f544c35d94976923 (diff)
downloadqutebrowser-5610a43177e64a882896fbdd0e1befb66a65facc.tar.gz
qutebrowser-5610a43177e64a882896fbdd0e1befb66a65facc.zip
Not working with this commit, but have to commit to merge
Diffstat (limited to 'qutebrowser/mainwindow')
-rw-r--r--qutebrowser/mainwindow/prompt.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/qutebrowser/mainwindow/prompt.py b/qutebrowser/mainwindow/prompt.py
index 40c6fde3a..d4f4336dc 100644
--- a/qutebrowser/mainwindow/prompt.py
+++ b/qutebrowser/mainwindow/prompt.py
@@ -728,7 +728,7 @@ class FilenamePrompt(_BasePrompt):
# The model needs to be sorted so we get the correct first/last index
self._file_model.directoryLoaded.connect(
lambda: self._file_model.sort(0))
-
+
def _get_valid_dirs(self, path):
dirs = []
try:
@@ -738,17 +738,16 @@ class FilenamePrompt(_BasePrompt):
hidden = self._to_complete not in index.data()
if not hidden:
dirs.append(index.data())
- # self._file_view.setRowHidden(index.row(), index.parent(), hidden)
except FileNotFoundError:
log.prompt.debug("Directory doesn't exist, can't \
get valid dirs")
-
+
return dirs
def _do_completion(self, idx, which):
filename = self._file_model.fileName(idx)
valid_dirs = self._get_valid_dirs(self._current_path)
- while not filename in valid_dirs and idx.isValid():
+ while idx.isValid() and not self._file_view.isRowHidden(idx.row(), idx.parent()):
if which == 'prev':
idx = self._file_view.indexAbove(idx)
else:
@@ -798,7 +797,7 @@ class FilenamePrompt(_BasePrompt):
# wrap around if we arrived at beginning/end
if not idx.isValid():
idx = last_index if which == 'prev' else first_index
-
+
idx = self._do_completion(idx, which)
selmodel.setCurrentIndex(