cursor no longer responsible for editor mode stuff

macos-click-through
exoticus 5 years ago
parent 46cd882891
commit 494853331d

@ -43,7 +43,6 @@ pub struct Cursor {
pub blinkoff: Option<u64>, pub blinkoff: Option<u64>,
pub style: Option<Arc<Style>>, pub style: Option<Arc<Style>>,
pub enabled: bool, pub enabled: bool,
pub mode_list: Vec<CursorMode>,
} }
impl Cursor { impl Cursor {
@ -57,7 +56,6 @@ impl Cursor {
blinkon: None, blinkon: None,
blinkoff: None, blinkoff: None,
enabled: true, enabled: true,
mode_list: Vec::new(),
} }
} }
@ -85,16 +83,16 @@ impl Cursor {
} }
} }
pub fn change_mode(&mut self, mode_index: u64, styles: &HashMap<u64, Arc<Style>>) { pub fn change_mode(&mut self, cursor_mode: &CursorMode, styles: &HashMap<u64, Arc<Style>>) {
if let Some(CursorMode { let CursorMode {
shape, shape,
style_id, style_id,
cell_percentage, cell_percentage,
blinkwait, blinkwait,
blinkon, blinkon,
blinkoff, blinkoff,
}) = self.mode_list.get(mode_index as usize) } = cursor_mode;
{
if let Some(shape) = shape { if let Some(shape) = shape {
self.shape = shape.clone(); self.shape = shape.clone();
} }
@ -108,5 +106,4 @@ impl Cursor {
self.blinkon = *blinkon; self.blinkon = *blinkon;
self.blinkoff = *blinkoff; self.blinkoff = *blinkoff;
} }
}
} }

Loading…
Cancel
Save