Skip to content

[bug]: updateTab not update tab's value which is not current tab #881

Description

@mortalYoung
          貌似 updateTab 没有去更新非当前 tab 的数据是一个 bug。

临时解决方法:在 updateTab 调用后调用 model.setValue

import { editor, Uri } from '@dtinsight/molecule/esm/monaco';
const tab = molecule.editor.getTabById(tabId, 1) as any
tab.data = newData
molecule.editor.updateTab(tab, 1);
// 以上只能更新当前 tab 的内容

const model = editor.getModel(Uri.parse(tab.id)); // 获取 tab 对应的 model
if (model) {
    model.setValue('test');
}

Originally posted by @mortalYoung in #878 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions