mirror of
https://github.com/NeuralNomadsAI/CodeNomad.git
synced 2026-07-10 00:14:27 +00:00
fix(ui): always strip @ for SHIFT+ENTER paths regardless of file attachment
This commit is contained in:
parent
95c747923c
commit
f58267dd30
1 changed files with 2 additions and 7 deletions
|
|
@ -22,18 +22,13 @@ export function resolvePastedPlaceholders(prompt: string, attachments: Attachmen
|
|||
|
||||
let result = prompt
|
||||
|
||||
// For each path attachment, find and replace @path with path in the prompt
|
||||
// This is more precise than regex and won't affect regular @mentions
|
||||
// For each path attachment (SHIFT+ENTER), find and replace @path with path in the prompt
|
||||
// We ALWAYS strip @ for SHIFT+ENTER paths, even if there's also a file attachment
|
||||
for (const path of pathAttachments) {
|
||||
// Try both with and without trailing slash
|
||||
const variants = [path, path + "/"]
|
||||
|
||||
for (const variant of variants) {
|
||||
// Skip if this path is also a file attachment (should keep @)
|
||||
if (fileAttachments.has(variant) || fileAttachments.has(variant.replace(/\/$/, ""))) {
|
||||
continue
|
||||
}
|
||||
|
||||
// Replace @path with path (exact match)
|
||||
const searchPattern = "@" + variant
|
||||
result = result.split(searchPattern).join(variant)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue