From 11d5c77e4a1ecc5f36935919caa3a79a78e52126 Mon Sep 17 00:00:00 2001 From: Axel Kappel <69117984+Kl4rry@users.noreply.github.com> Date: Mon, 9 Dec 2024 21:09:31 +0100 Subject: [PATCH] fix scroll resetting when opening file --- crates/ferrite-core/src/engine.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/ferrite-core/src/engine.rs b/crates/ferrite-core/src/engine.rs index 9eb9122..c592ae7 100644 --- a/crates/ferrite-core/src/engine.rs +++ b/crates/ferrite-core/src/engine.rs @@ -1151,6 +1151,15 @@ impl Engine { Some((id, buffer)) => { buffer.update_interact(None); let view_id = buffer.create_view(); + if let Some(buffer_data) = self + .workspace + .buffer_extra_data + .iter() + .find(|b| b.path == real_path) + { + buffer.load_view_data(view_id, buffer_data); + buffer.load_buffer_data(buffer_data); + } let replaced = self .workspace .panes