fix(links): preserve missing-path and labelled-wrap behaviour

This commit is contained in:
Devvyn committed 2026-10-29 01:32:17 +08:00
1 parent 168c15ae08
commit 3847e377d8
6 files changed
+59 -24

No files matched your search

+1 -1
View File
@@ -2637,7 +2637,7 @@ function terminalPathLine(buffer, row, cols, maxRows) {
const after = next.text.slice(0, closing).trimStart();
const spaced = spacedFilePathOnLine(`${before} ${after}`, { parenthesised: true });
if (!before.includes(')') && !/[/-]$/.test(before) && !after.includes('/') && spaced?.link) {
alternatives.push({ path: before + after, spacedPath: spaced.path });
alternatives.push({ path: before.slice(spaced.index) + after, spacedPath: spaced.path });
}
}
}
+1
View File
@@ -2347,6 +2347,7 @@ Object.assign(CodemanApp.prototype, {
if (original.status !== 404) return activateFilePath(target, false, sessionId);
const path = self._resolveLinkedFilePath(alternative.spacedPath, sessionId);
const registered = await self._registerExternalPreview(path, sessionId);
if (registered.status === 404) return activateFilePath(target, false, sessionId);
if (!registered.attachmentId) {
self.showToast(registered.error || 'Cannot open this file', 'error');
return;