working general mode only with canvas, removing highlight, readonly or edit

This commit is contained in:
filipriec
2025-08-23 23:34:14 +02:00
parent 88a4b2d69c
commit 06cc1663b3
6 changed files with 112 additions and 259 deletions

View File

@@ -5,6 +5,7 @@ use crossterm::{
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
cursor::{SetCursorStyle, EnableBlinking, Show, Hide, MoveTo},
};
use crossterm::ExecutableCommand;
use ratatui::{backend::CrosstermBackend, Terminal};
use std::io::{self, stdout, Write};
use anyhow::Result;
@@ -81,6 +82,12 @@ impl TerminalCore {
)?;
Ok(())
}
/// Move the cursor to a specific (x, y) position on screen.
pub fn set_cursor_position(&mut self, x: u16, y: u16) -> io::Result<()> {
self.terminal.backend_mut().execute(MoveTo(x, y))?;
Ok(())
}
}
impl Drop for TerminalCore {