mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-21 10:00:39 +00:00
fix(tui): don't add space after directory completion for @ file attachments
This commit is contained in:
parent
4ed9527213
commit
b7cef51f3f
3 changed files with 7 additions and 2 deletions
|
|
@ -240,14 +240,17 @@ export class CombinedAutocompleteProvider implements AutocompleteProvider {
|
|||
// Check if we're completing a file attachment (prefix starts with "@")
|
||||
if (prefix.startsWith("@")) {
|
||||
// This is a file attachment completion
|
||||
const newLine = `${beforePrefix + item.value} ${afterCursor}`;
|
||||
// Don't add space after directories so user can continue autocompleting
|
||||
const isDirectory = item.value.endsWith("/");
|
||||
const suffix = isDirectory ? "" : " ";
|
||||
const newLine = `${beforePrefix + item.value}${suffix}${afterCursor}`;
|
||||
const newLines = [...lines];
|
||||
newLines[cursorLine] = newLine;
|
||||
|
||||
return {
|
||||
lines: newLines,
|
||||
cursorLine,
|
||||
cursorCol: beforePrefix.length + item.value.length + 1, // +1 for space
|
||||
cursorCol: beforePrefix.length + item.value.length + suffix.length,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue