Only use backspace for back

This commit is contained in:
Jan Hamal Dvořák 2025-03-09 13:45:56 +01:00
parent 2fb5265463
commit 6f72c97794

View file

@ -264,13 +264,6 @@ class MainWindow(Gtk.ApplicationWindow):
update_icon()
def _navigate_to(self, path: Path):
# Check if we have history and if target is where we came from
if self.directory_history:
if path == self.directory_history[-1]:
self._navigate_back()
return
# Regular directory navigation
self.directory_history.append(Path(os.getcwd()))
os.chdir(path)
self._populate_file_list()
@ -292,6 +285,9 @@ class MainWindow(Gtk.ApplicationWindow):
file_item = cast(FileItem, item)
if file_item.file_type != FileType.DIRECTORY:
continue
if current_dir == file_item.full_path:
self.list_view.scroll_to(
i, Gtk.ListScrollFlags.SELECT | Gtk.ListScrollFlags.FOCUS, None