summaryrefslogtreecommitdiff
path: root/qutebrowser/mainwindow
diff options
context:
space:
mode:
authorJason Rosenzweig <mail4jasonr@gmail.com>2021-06-03 23:52:07 +0800
committerJason Rosenzweig <mail4jasonr@gmail.com>2021-06-03 23:52:07 +0800
commitf31637c586a4a443800dfcbb3db2e523dd2e1680 (patch)
tree2ad64f06ffe431d4e3b093b60d143751b905a886 /qutebrowser/mainwindow
parentf675e13efa845491ae30b64419d00dca02c54f5b (diff)
downloadqutebrowser-f31637c586a4a443800dfcbb3db2e523dd2e1680.tar.gz
qutebrowser-f31637c586a4a443800dfcbb3db2e523dd2e1680.zip
Even better formatting. No need to run tests on this one, just going to try and fix the test failing issue
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 56908325a..936484d90 100644
--- a/qutebrowser/mainwindow/prompt.py
+++ b/qutebrowser/mainwindow/prompt.py
@@ -631,11 +631,10 @@ class FilenamePrompt(_BasePrompt):
self._to_complete = ''
def _directories_hide_show_model(self, path):
- """Iterate over all directories in the current root path
- to see if the input is a substring"""
+ """Get rid of non-matching directories."""
try:
- numRows = self._file_model.rowCount(self._root_index)
- for row in range(numRows):
+ num_rows = self._file_model.rowCount(self._root_index)
+ for row in range(num_rows):
index = self._file_model.index(row, 0, self._file_model.index(path))
hidden = self._to_complete not in index.data()
self._file_view.setRowHidden(index.row(), index.parent(), hidden)
@@ -676,7 +675,7 @@ class FilenamePrompt(_BasePrompt):
self._root_index = self._file_model.setRootPath(path)
self._file_view.setRootIndex(self._root_index)
-
+
self._directories_hide_show_model(path)
self._file_view.setModel(self._file_model)