From 7626a9adc84d6757042670f9816a583dcd717823 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Thu, 28 May 2026 23:12:50 +0300 Subject: feat: add pane copy mode refs #231 --- src/ui/panes.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/ui/panes.rs') diff --git a/src/ui/panes.rs b/src/ui/panes.rs index c211ec9d..8c7d1f02 100644 --- a/src/ui/panes.rs +++ b/src/ui/panes.rs @@ -313,10 +313,36 @@ pub(super) fn render_panes( rt.scroll_metrics(), &app.palette, ); + render_copy_mode_cursor(app, frame, info); } } } +fn render_copy_mode_cursor(app: &AppState, frame: &mut Frame, info: &PaneInfo) { + if app.mode != Mode::Copy { + return; + } + let Some(copy_mode) = app.copy_mode else { + return; + }; + if copy_mode.pane_id != info.id + || copy_mode.cursor_row >= info.inner_rect.height + || copy_mode.cursor_col >= info.inner_rect.width + { + return; + } + + let x = info.inner_rect.x + copy_mode.cursor_col; + let y = info.inner_rect.y + copy_mode.cursor_row; + let cell = &mut frame.buffer_mut()[(x, y)]; + cell.set_style( + Style::default() + .fg(panel_contrast_fg(&app.palette)) + .bg(app.palette.accent) + .add_modifier(Modifier::BOLD), + ); +} + fn render_selection_highlight( selection: &Option, frame: &mut Frame, -- cgit v1.2.3