aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Tham2021-11-18 09:46:27 +0000
committerGitHub2021-11-18 09:46:27 +0000
commitbd56dde6e28b22b661ad991d0f23b66e089a9700 (patch)
tree150c1cf537ec0cb9cc009aa3b99cb6e00a9b79aa
parente9dc658de42aac74cbb3f02a3b2af2c48bb613fb (diff)
Ensure cursor in view after pipe (#1123)
Fix #1024
-rw-r--r--helix-term/src/commands.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 847e6f09..e1120ef1 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -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);
},
);