From f9742f9e0f8506263c96ab51c814f0edef1d747f Mon Sep 17 00:00:00 2001 From: Dongdong Zhou Date: Tue, 2 Apr 2024 22:11:50 +0100 Subject: [PATCH] no modal for local doc --- lapce-app/src/doc.rs | 9 +++++++-- lapce-app/src/editor.rs | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lapce-app/src/doc.rs b/lapce-app/src/doc.rs index 8d944709..0249dec0 100644 --- a/lapce-app/src/doc.rs +++ b/lapce-app/src/doc.rs @@ -344,10 +344,15 @@ pub fn styling(self: &Rc) -> Rc { /// Create an [`Editor`] instance from this [`Doc`]. Note that this needs to be registered /// appropriately to create the [`EditorData`] and such. - pub fn create_editor(self: &Rc, cx: Scope, id: EditorId) -> Editor { + pub fn create_editor( + self: &Rc, + cx: Scope, + id: EditorId, + is_local: bool, + ) -> Editor { let common = &self.common; let config = common.config.get_untracked(); - let modal = config.core.modal; + let modal = config.core.modal && !is_local; let register = common.register; // TODO: we could have these Rcs created once and stored somewhere, maybe on diff --git a/lapce-app/src/editor.rs b/lapce-app/src/editor.rs index a6a9b43b..e9a97567 100644 --- a/lapce-app/src/editor.rs +++ b/lapce-app/src/editor.rs @@ -248,7 +248,7 @@ pub fn new_local_id( ) -> Self { let cx = cx.create_child(); let doc = Rc::new(Doc::new_local(cx, editors, common.clone())); - let editor = doc.create_editor(cx, editor_id); + let editor = doc.create_editor(cx, editor_id, true); Self::new(cx, editor, None, None, None, common) } @@ -262,7 +262,7 @@ pub fn new_doc( confirmed: Option>, common: Rc, ) -> Self { - let editor = doc.create_editor(cx, EditorId::next()); + let editor = doc.create_editor(cx, EditorId::next(), false); Self::new(cx, editor, editor_tab_id, diff_editor_id, confirmed, common) }