mirror of https://github.com/lapce/lapce.git
no modal for local doc
This commit is contained in:
parent
d66b3c7cff
commit
f9742f9e0f
|
@ -344,10 +344,15 @@ pub fn styling(self: &Rc<Doc>) -> Rc<DocStyling> {
|
|||
|
||||
/// 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<Doc>, cx: Scope, id: EditorId) -> Editor {
|
||||
pub fn create_editor(
|
||||
self: &Rc<Doc>,
|
||||
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
|
||||
|
|
|
@ -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<RwSignal<bool>>,
|
||||
common: Rc<CommonData>,
|
||||
) -> 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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue