From 6f72c97794e1a0cf028f816f24b2d5548ac012a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hamal=20Dvo=C5=99=C3=A1k?= <mordae@anilinux.org> Date: Sun, 9 Mar 2025 13:45:56 +0100 Subject: [PATCH] Only use backspace for back --- lazy_player/__init__.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lazy_player/__init__.py b/lazy_player/__init__.py index 3097188..bdf1d39 100644 --- a/lazy_player/__init__.py +++ b/lazy_player/__init__.py @@ -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