Implement left/right

This commit is contained in:
Jeremy Soller 2022-10-21 13:50:20 -06:00
parent 66a138379f
commit 8010b8c0ab
No known key found for this signature in database
GPG key ID: 87F211AF2BE4C2FE

View file

@ -413,10 +413,24 @@ impl<'a> TextBuffer<'a> {
}
},
TextAction::Left => {
todo!("left");
let rtl_opt = self.lines[self.cursor.line.get()].shape_opt.as_ref().map(|shape| shape.rtl);
if let Some(rtl) = rtl_opt {
if rtl {
self.action(TextAction::Next);
} else {
self.action(TextAction::Previous);
}
}
},
TextAction::Right => {
todo!("right");
let rtl_opt = self.lines[self.cursor.line.get()].shape_opt.as_ref().map(|shape| shape.rtl);
if let Some(rtl) = rtl_opt {
if rtl {
self.action(TextAction::Previous);
} else {
self.action(TextAction::Next);
}
}
},
TextAction::Up => {
todo!("up");