From 2b2950e79530d5acaa77b8c1bd85b52970ff8dbe Mon Sep 17 00:00:00 2001 From: Dave Patrick Caberto Date: Wed, 3 Jan 2024 13:49:44 +0800 Subject: [PATCH] don't restore selection when file failed to load --- src/session.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/session.rs b/src/session.rs index b9aae45..f826c17 100644 --- a/src/session.rs +++ b/src/session.rs @@ -90,6 +90,7 @@ impl PageState { if let Err(err) = page.load_file(file).await { tracing::error!("Failed to load file for page: {:?}", err); page.add_message_toast(&gettext("Failed to open file")); + return; } // Only restore selection once we have fully loaded the page's document.