From 4f48007927221f9521ab983b6caf5e3b552402f2 Mon Sep 17 00:00:00 2001 From: "n loewen (aider)" Date: Sat, 7 Jun 2025 22:00:10 +0100 Subject: [PATCH] feat: Add mouse coordinates to status bar for debugging --- gtm2.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gtm2.py b/gtm2.py index 4b809ee..9400334 100755 --- a/gtm2.py +++ b/gtm2.py @@ -122,6 +122,8 @@ class AppState: self.selection_start_coord = None self.selection_end_coord = None self.last_bstate = 0 + self.mouse_x = -1 + self.mouse_y = -1 def update_dimensions(self, height, width): self.height = height @@ -337,7 +339,7 @@ def draw_status_bars(stdscr, state): left_percent = 0 left_status = f"{left_percent}%" if state.enable_mouse: - mouse_status = f" [M] b:{state.last_bstate}" + mouse_status = f" [M] {state.mouse_x},{state.mouse_y} b:{state.last_bstate}" if state.dragging_divider: mouse_status += " DIV" elif state.is_selecting: @@ -434,6 +436,7 @@ def handle_mouse_input(stdscr, state): try: _, mx, my, _, bstate = curses.getmouse() state.last_bstate = bstate + state.mouse_x, state.mouse_y = mx, my # If a drag/selection is in progress if state.is_selecting or state.dragging_divider: