@lvce-editor/explorer-view 7.17.0 → 7.18.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.
|
@@ -2350,7 +2350,7 @@ const newFolder$1 = () => {
|
|
|
2350
2350
|
const openContainingFolder$1 = () => {
|
|
2351
2351
|
return i18nString(OpenContainingFolder);
|
|
2352
2352
|
};
|
|
2353
|
-
const openInIntegratedTerminal = () => {
|
|
2353
|
+
const openInIntegratedTerminal$1 = () => {
|
|
2354
2354
|
return i18nString(OpenInIntegratedTerminal);
|
|
2355
2355
|
};
|
|
2356
2356
|
const cut = () => {
|
|
@@ -2814,10 +2814,9 @@ const compareWithSelected = async state => {
|
|
|
2814
2814
|
const getFocusedDirent$1 = state => {
|
|
2815
2815
|
const {
|
|
2816
2816
|
focusedIndex,
|
|
2817
|
-
items
|
|
2818
|
-
minLineY
|
|
2817
|
+
items
|
|
2819
2818
|
} = state;
|
|
2820
|
-
const dirent = items[focusedIndex
|
|
2819
|
+
const dirent = items[focusedIndex];
|
|
2821
2820
|
return dirent;
|
|
2822
2821
|
};
|
|
2823
2822
|
|
|
@@ -2973,7 +2972,7 @@ const getFileIcons = async (dirents, fileIconCache) => {
|
|
|
2973
2972
|
};
|
|
2974
2973
|
};
|
|
2975
2974
|
|
|
2976
|
-
const directoryTypes = new Set([DirectoryExpanded, DirectoryExpanding, EditingDirectoryExpanded]);
|
|
2975
|
+
const directoryTypes$1 = new Set([DirectoryExpanded, DirectoryExpanding, EditingDirectoryExpanded]);
|
|
2977
2976
|
const getParentPath = (path, pathSeparator) => {
|
|
2978
2977
|
const index = path.lastIndexOf(pathSeparator);
|
|
2979
2978
|
if (index === -1) {
|
|
@@ -2984,7 +2983,7 @@ const getParentPath = (path, pathSeparator) => {
|
|
|
2984
2983
|
const getGitIgnoreCandidateDirs = (root, items, pathSeparator) => {
|
|
2985
2984
|
const dirs = new Set([root]);
|
|
2986
2985
|
for (const item of items) {
|
|
2987
|
-
if (directoryTypes.has(item.type)) {
|
|
2986
|
+
if (directoryTypes$1.has(item.type)) {
|
|
2988
2987
|
dirs.add(item.path);
|
|
2989
2988
|
}
|
|
2990
2989
|
const parent = getParentPath(item.path, pathSeparator);
|
|
@@ -4305,10 +4304,10 @@ const menuEntryOpenContainingFolder = {
|
|
|
4305
4304
|
label: openContainingFolder$1()
|
|
4306
4305
|
};
|
|
4307
4306
|
const menuEntryOpenInIntegratedTerminal = {
|
|
4308
|
-
command:
|
|
4307
|
+
command: 'Explorer.openInIntegratedTerminal',
|
|
4309
4308
|
flags: None$2,
|
|
4310
4309
|
id: 'openInIntegratedTerminal',
|
|
4311
|
-
label: openInIntegratedTerminal()
|
|
4310
|
+
label: openInIntegratedTerminal$1()
|
|
4312
4311
|
};
|
|
4313
4312
|
const menuEntryCut = {
|
|
4314
4313
|
command: 'Explorer.handleCut',
|
|
@@ -6727,6 +6726,30 @@ const openContainingFolder = async state => {
|
|
|
6727
6726
|
return state;
|
|
6728
6727
|
};
|
|
6729
6728
|
|
|
6729
|
+
const directoryTypes = new Set([Directory, DirectoryExpanded, DirectoryExpanding, SymLinkFolder]);
|
|
6730
|
+
const getIntegratedTerminalCwd = state => {
|
|
6731
|
+
const {
|
|
6732
|
+
focusedIndex,
|
|
6733
|
+
items,
|
|
6734
|
+
pathSeparator,
|
|
6735
|
+
root
|
|
6736
|
+
} = state;
|
|
6737
|
+
if (focusedIndex < 0 || focusedIndex >= items.length) {
|
|
6738
|
+
return root;
|
|
6739
|
+
}
|
|
6740
|
+
const item = items[focusedIndex];
|
|
6741
|
+
if (directoryTypes.has(item.type)) {
|
|
6742
|
+
return item.path;
|
|
6743
|
+
}
|
|
6744
|
+
return dirname(pathSeparator, item.path);
|
|
6745
|
+
};
|
|
6746
|
+
|
|
6747
|
+
const openInIntegratedTerminal = async state => {
|
|
6748
|
+
const cwd = getIntegratedTerminalCwd(state);
|
|
6749
|
+
await invoke$2('Layout.openIntegratedTerminal', cwd);
|
|
6750
|
+
return state;
|
|
6751
|
+
};
|
|
6752
|
+
|
|
6730
6753
|
const confirmDelete = async paths => {
|
|
6731
6754
|
// TODO use i18n string
|
|
6732
6755
|
const message = paths.length === 1 ? `Are you sure you want to delete "${paths[0]}"?` : `Are you sure you want to delete ${paths.length} items?`;
|
|
@@ -7997,6 +8020,7 @@ const commandMap = {
|
|
|
7997
8020
|
'Explorer.newFile': wrapListItemCommand(newFile),
|
|
7998
8021
|
'Explorer.newFolder': wrapListItemCommand(newFolder),
|
|
7999
8022
|
'Explorer.openContainingFolder': wrapListItemCommand(openContainingFolder),
|
|
8023
|
+
'Explorer.openInIntegratedTerminal': wrapListItemCommand(openInIntegratedTerminal),
|
|
8000
8024
|
'Explorer.refresh': wrapListItemCommand(refresh),
|
|
8001
8025
|
'Explorer.removeDirent': wrapListItemCommand(removeDirent),
|
|
8002
8026
|
'Explorer.renameDirent': wrapListItemCommand(renameDirent),
|