From 56f71ef9736f852fd47163c30ade198e289207cc Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Tue, 14 Nov 2023 13:43:33 -0700 Subject: [PATCH] Shape if needed to process left/right commands --- src/edit/editor.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/edit/editor.rs b/src/edit/editor.rs index 151e6f7ff7..80fb5252d8 100644 --- a/src/edit/editor.rs +++ b/src/edit/editor.rs @@ -445,9 +445,9 @@ impl Edit for Editor { self.cursor_x_opt = None; } Action::Left => { - let rtl_opt = self.buffer.lines[self.cursor.line] - .shape_opt() - .as_ref() + let rtl_opt = self + .buffer + .line_shape(font_system, self.cursor.line) .map(|shape| shape.rtl); if let Some(rtl) = rtl_opt { if rtl { @@ -458,9 +458,9 @@ impl Edit for Editor { } } Action::Right => { - let rtl_opt = self.buffer.lines[self.cursor.line] - .shape_opt() - .as_ref() + let rtl_opt = self + .buffer + .line_shape(font_system, self.cursor.line) .map(|shape| shape.rtl); if let Some(rtl) = rtl_opt { if rtl { @@ -878,9 +878,9 @@ impl Edit for Editor { self.cursor_x_opt = None; } Action::LeftWord => { - let rtl_opt = self.buffer.lines[self.cursor.line] - .shape_opt() - .as_ref() + let rtl_opt = self + .buffer + .line_shape(font_system, self.cursor.line) .map(|shape| shape.rtl); if let Some(rtl) = rtl_opt { if rtl { @@ -891,9 +891,9 @@ impl Edit for Editor { } } Action::RightWord => { - let rtl_opt = self.buffer.lines[self.cursor.line] - .shape_opt() - .as_ref() + let rtl_opt = self + .buffer + .line_shape(font_system, self.cursor.line) .map(|shape| shape.rtl); if let Some(rtl) = rtl_opt { if rtl {