From f0f295a6679655dccfab0c1e0e9bb4a87e351db5 Mon Sep 17 00:00:00 2001 From: Filipe Azevedo Date: Sat, 26 Nov 2022 20:40:43 +0000 Subject: [PATCH] reload-all: Only update viewport when view focuses on the doc (#4901) --- helix-term/src/commands/typed.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index 475f14d1d..351692fd2 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); + } } }