diff options
| author | Mark Jaquith <mark@jaquith.me> | 2026-09-14 15:47:53 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-14 21:47:53 +0200 |
| commit | b0f21ed2cb85613050b794bf6c78a7c367a94e0d (patch) | |
| tree | 25c14e09338f5300bedbc8131aa23fab3d37add9 /src/client/shell/composition.rs | |
| parent | d8b36691d10c6055293ad45324b22af8b8f570e5 (diff) | |
feat: add cursor-based editing to text inputs (#3698)
* feat: add cursor-based editing to text inputs
refs #1803
* fix: preserve dialog actions with associated text
refs #1803
* refactor: simplify text editor outcomes and tests
refs #1803
---------
Co-authored-by: JJ Liebig <jonathan.liebig@gmail.com>
Diffstat (limited to 'src/client/shell/composition.rs')
| -rw-r--r-- | src/client/shell/composition.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/client/shell/composition.rs b/src/client/shell/composition.rs index cee57d96..0a577295 100644 --- a/src/client/shell/composition.rs +++ b/src/client/shell/composition.rs @@ -394,12 +394,14 @@ impl ClientShellState { .saturating_sub(copy_mode.offset_from_bottom) .min(u32::MAX as usize) as u32; let viewport_row = copy_mode.cursor.row.saturating_sub(viewport_top); + let x = hit.inner_rect.x.saturating_add(copy_mode.cursor.col); + let y = hit.inner_rect.y.saturating_add(viewport_row as u16); if viewport_row < u32::from(hit.inner_rect.height) && copy_mode.cursor.col < hit.inner_rect.width + && x < frame.width + && y < frame.height { let mut composed = frame.to_ratatui_buffer()?; - let x = hit.inner_rect.x + copy_mode.cursor.col; - let y = hit.inner_rect.y + viewport_row as u16; occlusion.cover(Rect::new(x, y, 1, 1)); composed[(x, y)].set_style( Style::default() |
