Skip to content

Commit

Permalink
Shape if needed to process left/right commands
Browse files Browse the repository at this point in the history
  • Loading branch information
jackpot51 committed Nov 14, 2023
1 parent abf5827 commit 56f71ef
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/edit/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit 56f71ef

Please sign in to comment.