working general mode only with canvas, removing highlight, readonly or edit
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user