aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-03-24 07:56:29 +0000
committerBlaž Hrastnik2021-03-24 07:56:29 +0000
commit4b176cadedfe47fe542e9c6e2defd34b3af984df (patch)
tree149d63b2bf6bcd5c9cab0114e01cbea127e99cc5
parent915fd9ebafe4f5ee86421697725176edbb961c43 (diff)
Reset first_line when changing files.
-rw-r--r--helix-view/src/editor.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index a2c3c101..33e380a0 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -90,8 +90,9 @@ impl Editor {
use crate::tree::Layout;
match action {
Action::Replace => {
- self.view_mut().doc = id;
- // TODO: reset selection?
+ let view = self.view_mut();
+ view.doc = id;
+ view.first_line = 0;
return Ok(id);
}
Action::HorizontalSplit => {