mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-21 05:02:14 +00:00
A couple of autocomplete improvements (#1024)
* fix(tui): keep file suggestions open when typing in Tab-triggered mode Previously, pressing Tab on an empty prompt or after a space would show file suggestions, but typing a letter would dismiss them because the text didn't look like a path pattern. Now the editor tracks whether autocomplete was triggered via Tab (force mode) or naturally (regular mode), and uses the appropriate suggestion method when updating. * fix(tui): hide autocomplete when backspacing slash command to empty Previously, typing / showed slash command suggestions, but pressing Backspace to delete it showed file suggestions instead of hiding all suggestions.
This commit is contained in:
parent
d57a26c88b
commit
b54d689ec1
3 changed files with 152 additions and 56 deletions
|
|
@ -312,9 +312,9 @@ export class CombinedAutocompleteProvider implements AutocompleteProvider {
|
|||
return pathPrefix;
|
||||
}
|
||||
|
||||
// Return empty string only if we're at the beginning of the line or after a space
|
||||
// (not after quotes or other delimiters that don't suggest file paths)
|
||||
if (pathPrefix === "" && (text === "" || text.endsWith(" "))) {
|
||||
// Return empty string only after a space (not for completely empty text)
|
||||
// Empty text should not trigger file suggestions - that's for forced Tab completion
|
||||
if (pathPrefix === "" && text.endsWith(" ")) {
|
||||
return pathPrefix;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue