Ensure cursor in view after pipe (#1123)

Fix #1024
This commit is contained in:
Ivan Tham 2021-11-18 17:46:27 +08:00 committed by GitHub
parent e9dc658de4
commit bd56dde6e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5377,6 +5377,10 @@ fn shell(cx: &mut Context, prompt: Cow<'static, str>, behavior: ShellBehavior) {
doc.apply(&transaction, view.id);
doc.append_changes_to_history(view.id);
}
// after replace cursor may be out of bounds, do this to
// make sure cursor is in view and update scroll as well
view.ensure_cursor_in_view(doc, cx.editor.config.scrolloff);
},
);