Fix vi ScrollToBottom motion

This resolves an issue with the ScrollToBottom motion in vi mode where
it would jump between the first unoccupied cell across wrapped lines and the
first unoccupied cell in the current line.
This commit is contained in:
Christian Duerr 2020-05-16 00:16:21 +00:00 committed by GitHub
parent 058b036fe7
commit 7987002dcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -260,6 +260,9 @@ impl<T: EventListener> Execute<T> for Action {
// Move vi mode cursor.
let term = ctx.terminal_mut();
term.vi_mode_cursor.point.line = term.grid().num_lines() - 1;
// Move to beginning twice, to always jump across linewraps.
term.vi_motion(ViMotion::FirstOccupied);
term.vi_motion(ViMotion::FirstOccupied);
},
Action::ClearHistory => ctx.terminal_mut().clear_screen(ClearMode::Saved),