fix(tui): don't add space after directory completion for @ file attachments
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
- Fixed viewport tracking and cursor positioning for overlays and content shrink scenarios
|
- Fixed viewport tracking and cursor positioning for overlays and content shrink scenarios
|
||||||
- Fixed autocomplete to allow searches with `/` characters (e.g., `folder1/folder2`) ([#882](https://github.com/badlogic/pi-mono/pull/882) by [@richardgill](https://github.com/richardgill))
|
- Fixed autocomplete to allow searches with `/` characters (e.g., `folder1/folder2`) ([#882](https://github.com/badlogic/pi-mono/pull/882) by [@richardgill](https://github.com/richardgill))
|
||||||
- Fixed autolinked emails displaying redundant `(mailto:...)` suffix ([#888](https://github.com/badlogic/pi-mono/pull/888) by [@terrorobe](https://github.com/terrorobe))
|
- Fixed autolinked emails displaying redundant `(mailto:...)` suffix ([#888](https://github.com/badlogic/pi-mono/pull/888) by [@terrorobe](https://github.com/terrorobe))
|
||||||
|
- Fixed `@` file autocomplete adding space after directories, breaking continued autocomplete into subdirectories
|
||||||
|
|
||||||
## [0.49.2] - 2026-01-19
|
## [0.49.2] - 2026-01-19
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
- Autolinked emails no longer display redundant `(mailto:...)` suffix in markdown output ([#888](https://github.com/badlogic/pi-mono/pull/888) by [@terrorobe](https://github.com/terrorobe))
|
- Autolinked emails no longer display redundant `(mailto:...)` suffix in markdown output ([#888](https://github.com/badlogic/pi-mono/pull/888) by [@terrorobe](https://github.com/terrorobe))
|
||||||
- Fixed viewport tracking and cursor positioning for overlays and content shrink scenarios
|
- Fixed viewport tracking and cursor positioning for overlays and content shrink scenarios
|
||||||
- Autocomplete now allows searches with `/` characters (e.g., `folder1/folder2`) ([#882](https://github.com/badlogic/pi-mono/pull/882) by [@richardgill](https://github.com/richardgill))
|
- Autocomplete now allows searches with `/` characters (e.g., `folder1/folder2`) ([#882](https://github.com/badlogic/pi-mono/pull/882) by [@richardgill](https://github.com/richardgill))
|
||||||
|
- Directory completions for `@` file attachments no longer add trailing space, allowing continued autocomplete into subdirectories
|
||||||
|
|
||||||
## [0.49.2] - 2026-01-19
|
## [0.49.2] - 2026-01-19
|
||||||
|
|
||||||
|
|||||||
@@ -240,14 +240,17 @@ export class CombinedAutocompleteProvider implements AutocompleteProvider {
|
|||||||
// Check if we're completing a file attachment (prefix starts with "@")
|
// Check if we're completing a file attachment (prefix starts with "@")
|
||||||
if (prefix.startsWith("@")) {
|
if (prefix.startsWith("@")) {
|
||||||
// This is a file attachment completion
|
// 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];
|
const newLines = [...lines];
|
||||||
newLines[cursorLine] = newLine;
|
newLines[cursorLine] = newLine;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
lines: newLines,
|
lines: newLines,
|
||||||
cursorLine,
|
cursorLine,
|
||||||
cursorCol: beforePrefix.length + item.value.length + 1, // +1 for space
|
cursorCol: beforePrefix.length + item.value.length + suffix.length,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user