mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-14 10:39:32 +01:00
fix(links): preserve missing-path and labelled-wrap behaviour
This commit is contained in:
1 parent
168c15ae08
commit
3847e377d8
6 files changed
+59
-24
No files matched your search
@@ -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 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user