From 69ee221a63e92d20549f9725e6a26781b77a4628 Mon Sep 17 00:00:00 2001 From: phg Date: Tue, 29 Jul 2025 15:09:54 +0200 Subject: [PATCH] Add handler for entry highlighting in the left pane --- src/hosts/main.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hosts/main.py b/src/hosts/main.py index 19e1aa1..c685d7a 100644 --- a/src/hosts/main.py +++ b/src/hosts/main.py @@ -226,6 +226,12 @@ class HostsManagerApp(App): self.selected_entry_index = event.list_view.index or 0 self.update_entry_details() + def on_list_view_highlighted(self, event: ListView.Highlighted) -> None: + """Handle entry highlighting (cursor movement) in the left pane.""" + if event.list_view.id == "entries-list": + self.selected_entry_index = event.list_view.index or 0 + self.update_entry_details() + def action_reload(self) -> None: """Reload the hosts file.""" self.load_hosts_file()