From 6345b7840961222b30f91316f953b7cfa51a19e2 Mon Sep 17 00:00:00 2001
From: FlorianNAdam <64063379+FlorianNAdam@users.noreply.github.com>
Date: Mon, 15 Jul 2024 15:48:37 +0200
Subject: [PATCH] Keep editor from switching to normal mode when loading a
 Document (#11176)

---
 helix-view/src/editor.rs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index 3eeb4830..50b6c931 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -1544,7 +1544,9 @@ impl Editor {
             return;
         }
 
-        self.enter_normal_mode();
+        if !matches!(action, Action::Load) {
+            self.enter_normal_mode();
+        }
 
         match action {
             Action::Replace => {