提交 715cdf7c 编写于 作者: M Martin Aeschlimann

Empty links in recent workspaces list. FIxes #74363

上级 fd213369
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import { URI } from 'vs/base/common/uri'; import { URI } from 'vs/base/common/uri';
import { sep, posix, normalize, basename as path_basename, dirname as path_dirname } from 'vs/base/common/path'; import { sep, posix, normalize, win32 } from 'vs/base/common/path';
import { endsWith, startsWithIgnoreCase, rtrim, startsWith } from 'vs/base/common/strings'; import { endsWith, startsWithIgnoreCase, rtrim, startsWith } from 'vs/base/common/strings';
import { Schemas } from 'vs/base/common/network'; import { Schemas } from 'vs/base/common/network';
import { isLinux, isWindows, isMacintosh } from 'vs/base/common/platform'; import { isLinux, isWindows, isMacintosh } from 'vs/base/common/platform';
...@@ -387,8 +387,12 @@ export function unmnemonicLabel(label: string): string { ...@@ -387,8 +387,12 @@ export function unmnemonicLabel(label: string): string {
* Splits a path in name and parent path, supporting both '/' and '\' * Splits a path in name and parent path, supporting both '/' and '\'
*/ */
export function splitName(fullPath: string): { name: string, parentPath: string } { export function splitName(fullPath: string): { name: string, parentPath: string } {
if (fullPath.indexOf('/') !== -1) { const p = fullPath.indexOf('/') !== -1 ? posix : win32;
return { name: posix.basename(fullPath), parentPath: posix.dirname(fullPath) }; const name = p.basename(fullPath);
} const parentPath = p.dirname(fullPath);
return { name: path_basename(fullPath), parentPath: path_dirname(fullPath) }; if (name.length) {
return { name, parentPath };
}
// only the root segment
return { name: parentPath, parentPath: '' };
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册