aboutsummaryrefslogtreecommitdiff
path: root/src/ui/panes.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-05-28 23:12:50 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-05-28 23:12:50 +0300
commit7626a9adc84d6757042670f9816a583dcd717823 (patch)
tree56095c659834727ca73b03627a1f6eddc86ac666 /src/ui/panes.rs
parent28222b20890a1f6cd36fd477de8e9bc6e5537ff5 (diff)
feat: add pane copy mode
refs #231
Diffstat (limited to 'src/ui/panes.rs')
-rw-r--r--src/ui/panes.rs26
1 files changed, 26 insertions, 0 deletions
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<crate::selection::Selection>,
frame: &mut Frame,