This commit is contained in:
LZX committed 2026-09-11 16:03:47 +08:00
1 parent 8531403c33
commit b03ece33a2
37 files changed
+6388 -908

No files matched your search

@@ -13,6 +13,7 @@ class FileDirectoryHistoryService {
required String rootPath,
String? lastOpenedFilePath,
List<String>? openDirectoryPaths,
List<String>? openFilePaths,
}) async {
final cleanPath = rootPath.trim();
if(cleanPath.isEmpty) return;
@@ -22,10 +23,12 @@ class FileDirectoryHistoryService {
final existingIndex = history.indexWhere((item) => item.rootPath == cleanPath);
String? resolvedFile = lastOpenedFilePath;
List<String>? resolvedOpenDirs = openDirectoryPaths;
List<String>? resolvedOpenFiles = openFilePaths;
if(existingIndex != -1) {
resolvedFile ??= history[existingIndex].lastOpenedFilePath;
resolvedOpenDirs ??= history[existingIndex].openDirectoryPaths;
resolvedOpenFiles ??= history[existingIndex].openFilePaths;
history.removeAt(existingIndex);
}
@@ -35,6 +38,7 @@ class FileDirectoryHistoryService {
rootPath: cleanPath,
lastOpenedFilePath: resolvedFile,
openDirectoryPaths: resolvedOpenDirs ?? const [],
openFilePaths: resolvedOpenFiles ?? const [],
),
);