Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mortalYoung opened this issue Dec 26, 2023 · 0 comments · Fixed by #882
Closed

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

mortalYoung opened this issue Dec 26, 2023 · 0 comments · Fixed by #882
Labels
bug Something isn't working

Comments

@mortalYoung
Copy link
Collaborator

          貌似 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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant