aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipe Azevedo2022-11-26 20:40:43 +0000
committerGitHub2022-11-26 20:40:43 +0000
commitf0f295a6679655dccfab0c1e0e9bb4a87e351db5 (patch)
treed9a6276fa342921bfcea951aa167617e13d23abc
parentfc811726e0e74dd6597f1ebbbd095901b8a78a3e (diff)
reload-all: Only update viewport when view focuses on the doc (#4901)
-rw-r--r--helix-term/src/commands/typed.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs
index 475f14d1..351692fd 100644
--- a/helix-term/src/commands/typed.rs
+++ b/helix-term/src/commands/typed.rs
@@ -1070,8 +1070,9 @@ fn reload_all(
for view_id in view_ids {
let view = view_mut!(cx.editor, view_id);
-
- view.ensure_cursor_in_view(doc, scrolloff);
+ if view.doc.eq(&doc_id) {
+ view.ensure_cursor_in_view(doc, scrolloff);
+ }
}
}