fortrangoingonforty/fit / 4a71c53

Browse files

fix unstable local/incoming pane highlighting

Authored by espadonne
SHA
4a71c538482cde56a30300108064edf838029af6
Parents
61afaac
Tree
96ce261

1 changed file

StatusFile+-
M src/tui_layout.f90 10 8
src/tui_layout.f90modified
@@ -119,7 +119,9 @@ contains
119119
         integer :: mid_col, mid_row, max_lines, preview_max_lines
120120
         character(len=:), allocatable, dimension(:) :: incoming_view, local_view, preview_view
121121
         integer :: n_incoming, n_local, n_preview
122
-        integer :: conflict_start, conflict_end
122
+        integer :: incoming_start, incoming_end
123
+        integer :: local_start, local_end
124
+        integer :: preview_start, preview_end
123125
 
124126
         mid_col = term_cols / 2
125127
         mid_row = max(10, int((term_rows - 2) * 0.4))
@@ -130,11 +132,11 @@ contains
130132
         call draw_layout(term_rows, term_cols, pane%active_pane)
131133
 
132134
         ! Get side views - show incoming/local for current conflict, all others resolved
133
-        call get_side_view(conflicts, n_conflicts, current, 1, incoming_view, n_incoming, conflict_start, conflict_end)
134
-        call get_side_view(conflicts, n_conflicts, current, 2, local_view, n_local, conflict_start, conflict_end)
135
+        call get_side_view(conflicts, n_conflicts, current, 1, incoming_view, n_incoming, incoming_start, incoming_end)
136
+        call get_side_view(conflicts, n_conflicts, current, 2, local_view, n_local, local_start, local_end)
135137
 
136138
         ! Get full preview with ALL conflicts resolved
137
-        call get_full_preview(conflicts, n_conflicts, current, preview_view, n_preview, conflict_start, conflict_end)
139
+        call get_full_preview(conflicts, n_conflicts, current, preview_view, n_preview, preview_start, preview_end)
138140
 
139141
         ! Update pane max lines
140142
         pane%max_lines_incoming = n_incoming
@@ -146,17 +148,17 @@ contains
146148
         call clear_pane(3, mid_row - 1, mid_col + 1, term_cols)
147149
         call clear_pane(mid_row + 2, term_rows - 2, 1, term_cols)
148150
 
149
-        ! Draw scrollable panes
151
+        ! Draw scrollable panes - each with its own conflict region
150152
         call draw_scrollable_pane(incoming_view, n_incoming, 2, mid_col - 4, 4, max_lines, &
151
-                                  pane%scroll_incoming, conflict_start, conflict_end, &
153
+                                  pane%scroll_incoming, incoming_start, incoming_end, &
152154
                                   pane%active_pane == PANE_INCOMING, 1)
153155
 
154156
         call draw_scrollable_pane(local_view, n_local, mid_col + 2, term_cols - mid_col - 2, 4, max_lines, &
155
-                                  pane%scroll_local, conflict_start, conflict_end, &
157
+                                  pane%scroll_local, local_start, local_end, &
156158
                                   pane%active_pane == PANE_LOCAL, 2)
157159
 
158160
         call draw_scrollable_pane(preview_view, n_preview, 2, term_cols - 4, mid_row + 2, preview_max_lines, &
159
-                                  pane%scroll_preview, conflict_start, conflict_end, &
161
+                                  pane%scroll_preview, preview_start, preview_end, &
160162
                                   pane%active_pane == PANE_PREVIEW, 3)
161163
 
162164
         ! Draw conflict counter