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