This commit is contained in:
LZX committed 2026-09-11 23:57:36 +08:00
1 parent b03ece33a2
commit 54c3083c24
29 files changed
+2150 -549

No files matched your search

+4 -4
View File
@@ -29,14 +29,14 @@ class EditorTabItem {
/// 当存在同名文件标签时显示相对项目路径,否则优先显示简短文件名
String getDisplayName(List<EditorTabItem> allTabs, String? rootPath) {
final hasDuplicateName = allTabs.where((tab) => tab.name == name).length > 1;
if (hasDuplicateName) {
if (rootPath != null && rootPath.isNotEmpty) {
if(hasDuplicateName) {
if(rootPath != null && rootPath.isNotEmpty) {
try {
if (p.isWithin(rootPath, path)) {
if(p.isWithin(rootPath, path)) {
final rel = p.relative(path, from: rootPath);
return rel;
}
} catch (_) {}
}catch (_) {}
}
return path;
}