Make Motion::Home and Motion::End operate on unwrapped lines, fixes #468
This commit is contained in:
parent
d7dc22dd20
commit
82fadd954c
1 changed files with 3 additions and 22 deletions
|
|
@ -1173,17 +1173,7 @@ impl Buffer {
|
|||
)?;
|
||||
}
|
||||
Motion::Home => {
|
||||
let mut layout_cursor = self.layout_cursor(font_system, cursor)?;
|
||||
layout_cursor.glyph = 0;
|
||||
#[allow(unused_assignments)]
|
||||
{
|
||||
(cursor, cursor_x_opt) = self.cursor_motion(
|
||||
font_system,
|
||||
cursor,
|
||||
cursor_x_opt,
|
||||
Motion::LayoutCursor(layout_cursor),
|
||||
)?;
|
||||
}
|
||||
cursor.index = 0;
|
||||
cursor_x_opt = None;
|
||||
}
|
||||
Motion::SoftHome => {
|
||||
|
|
@ -1196,17 +1186,8 @@ impl Buffer {
|
|||
cursor_x_opt = None;
|
||||
}
|
||||
Motion::End => {
|
||||
let mut layout_cursor = self.layout_cursor(font_system, cursor)?;
|
||||
layout_cursor.glyph = usize::MAX;
|
||||
#[allow(unused_assignments)]
|
||||
{
|
||||
(cursor, cursor_x_opt) = self.cursor_motion(
|
||||
font_system,
|
||||
cursor,
|
||||
cursor_x_opt,
|
||||
Motion::LayoutCursor(layout_cursor),
|
||||
)?;
|
||||
}
|
||||
let line = self.lines.get(cursor.line)?;
|
||||
cursor.index = line.text().len();
|
||||
cursor_x_opt = None;
|
||||
}
|
||||
Motion::ParagraphStart => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue