diff --git a/src/editor.rs b/src/editor.rs index 856862ea..5f878f67 100644 --- a/src/editor.rs +++ b/src/editor.rs @@ -1,4 +1,5 @@ use std::collections::HashMap; + use skulpin::skia_safe::{colors, Color4f}; use neovim_lib::{Neovim, NeovimApi}; @@ -31,10 +32,10 @@ pub struct Style { #[derive(new)] pub struct GridLineCell { - pub grid: u16, + pub grid: usize, pub text: String, - pub row: u16, - pub col_start: u16, + pub row: usize, + pub col_start: usize, pub style_id: Option } @@ -43,27 +44,36 @@ pub type GridCell = Option<(char, Style)>; #[derive(new, Debug, Clone)] pub struct DrawCommand { pub text: String, - pub row: u16, - pub col_start: u16, + pub row: usize, + pub col_start: usize, pub style: Style } +#[derive(Clone)] +pub enum CursorType { + Block, + Horizontal, + Vertical +} + pub struct Editor { pub nvim: Neovim, pub grid: Vec>, - pub cursor_pos: (u16, u16), - pub size: (u16, u16), + pub cursor_pos: (usize, usize), + pub cursor_type: CursorType, + pub size: (usize, usize), pub default_colors: Colors, pub defined_styles: HashMap, pub previous_style: Option