Make cursor_moved private

This commit is contained in:
Jeremy Soller 2022-10-31 11:26:05 -06:00
parent 92cad6fe13
commit 7d26e332f0
No known key found for this signature in database
GPG key ID: 87F211AF2BE4C2FE
2 changed files with 2 additions and 6 deletions

View file

@ -30,7 +30,7 @@ fn main() {
buffer.set_text(" Hi, Rust! 🦀", attrs); buffer.set_text(" Hi, Rust! 🦀", attrs);
// Perform shaping as desired // Perform shaping as desired
buffer.shape_until_cursor(); buffer.shape_until_scroll();
// Default text color (0xFF, 0xFF, 0xFF is white) // Default text color (0xFF, 0xFF, 0xFF is white)
let text_color = Color::rgb(0xFF, 0xFF, 0xFF); let text_color = Color::rgb(0xFF, 0xFF, 0xFF);

View file

@ -50,11 +50,7 @@ pub struct Editor<'a> {
cursor: Cursor, cursor: Cursor,
cursor_x_opt: Option<i32>, cursor_x_opt: Option<i32>,
select_opt: Option<Cursor>, select_opt: Option<Cursor>,
/// True if the cursor has been moved. Set to false after processing cursor_moved: bool,
///
/// Usually, if this is true, you should run [Self::shape_until_cursor] before redrawing.
/// Otherwise, you should run [Self::shape_until_scroll]
pub cursor_moved: bool,
} }
impl<'a> Editor<'a> { impl<'a> Editor<'a> {