From 802db6fe4a95dbc17a3ad425789d9a68dde65e9c Mon Sep 17 00:00:00 2001 From: kirawi <67773714+kirawi@users.noreply.github.com> Date: Fri, 5 Jan 2024 22:03:16 -0500 Subject: [PATCH] fix merge --- helix-core/src/history.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/helix-core/src/history.rs b/helix-core/src/history.rs index 4a6f251041e9..f2bd835cef91 100644 --- a/helix-core/src/history.rs +++ b/helix-core/src/history.rs @@ -293,7 +293,10 @@ impl History { NonZeroUsize::new(other.revisions.len()); other.revisions.push(r); } - self.current += offset; + + if self.current >= n { + self.current += offset; + } self.revisions = other.revisions; Ok(())