@lvce-editor/main-area-worker 9.39.0 → 9.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mainAreaWorkerMain.js +21 -16
- package/package.json +1 -1
|
@@ -7678,12 +7678,12 @@ const renderEventListeners = () => {
|
|
|
7678
7678
|
}];
|
|
7679
7679
|
};
|
|
7680
7680
|
|
|
7681
|
+
const textEditorEntry = {
|
|
7682
|
+
id: 'editor',
|
|
7683
|
+
label: 'Text Editor',
|
|
7684
|
+
type: 'editor'
|
|
7685
|
+
};
|
|
7681
7686
|
const getViewProviderEntries = async uri => {
|
|
7682
|
-
const textEditorEntry = {
|
|
7683
|
-
id: 'editor',
|
|
7684
|
-
label: 'Text Editor',
|
|
7685
|
-
type: 'editor'
|
|
7686
|
-
};
|
|
7687
7687
|
try {
|
|
7688
7688
|
const providers = await invoke('WebView.getEditorProviders');
|
|
7689
7689
|
const matchingProviders = providers.filter(provider => provider?.id && provider.selector?.some(selector => uri.endsWith(selector)));
|
|
@@ -7699,7 +7699,7 @@ const getViewProviderEntries = async uri => {
|
|
|
7699
7699
|
return [textEditorEntry];
|
|
7700
7700
|
}
|
|
7701
7701
|
};
|
|
7702
|
-
const reopenEditorWith = async context => {
|
|
7702
|
+
const reopenEditorWith = async (context, preferredEditorId) => {
|
|
7703
7703
|
const initialState = context.getState();
|
|
7704
7704
|
const {
|
|
7705
7705
|
activeGroupId,
|
|
@@ -7710,16 +7710,21 @@ const reopenEditorWith = async context => {
|
|
|
7710
7710
|
if (!initialTab?.uri) {
|
|
7711
7711
|
return;
|
|
7712
7712
|
}
|
|
7713
|
-
|
|
7714
|
-
|
|
7715
|
-
|
|
7716
|
-
|
|
7717
|
-
|
|
7718
|
-
|
|
7719
|
-
|
|
7720
|
-
|
|
7721
|
-
|
|
7722
|
-
|
|
7713
|
+
let selected;
|
|
7714
|
+
if (preferredEditorId === textEditorEntry.id) {
|
|
7715
|
+
selected = textEditorEntry;
|
|
7716
|
+
} else {
|
|
7717
|
+
const entries = await getViewProviderEntries(initialTab.uri);
|
|
7718
|
+
const items = entries.map(entry => ({
|
|
7719
|
+
description: '',
|
|
7720
|
+
label: entry.label,
|
|
7721
|
+
value: entry
|
|
7722
|
+
}));
|
|
7723
|
+
selected = await invoke('ExtensionHostQuickPick.showQuickPick', {
|
|
7724
|
+
items,
|
|
7725
|
+
placeholder: 'Select Editor'
|
|
7726
|
+
});
|
|
7727
|
+
}
|
|
7723
7728
|
if (!selected) {
|
|
7724
7729
|
return;
|
|
7725
7730
|
}
|