diff options
| author | Sandy Tao <[email protected]> | 2025-08-04 11:30:59 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-04 18:30:59 +0000 |
| commit | d1bfba1abbd09e4c70220bc9d82f10b6f61c5b28 (patch) | |
| tree | faca83e502578e23bb976319e115e443084045a5 /packages/cli/src/ui/hooks/useSlashCompletion.tsx | |
| parent | b9fe4fc263340c7a614e3e36462284b865e641c7 (diff) | |
feat(core): Add trailing space when completing an at completion suggestion (#5475)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Diffstat (limited to 'packages/cli/src/ui/hooks/useSlashCompletion.tsx')
| -rw-r--r-- | packages/cli/src/ui/hooks/useSlashCompletion.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/cli/src/ui/hooks/useSlashCompletion.tsx b/packages/cli/src/ui/hooks/useSlashCompletion.tsx index c6821358..3b59bd45 100644 --- a/packages/cli/src/ui/hooks/useSlashCompletion.tsx +++ b/packages/cli/src/ui/hooks/useSlashCompletion.tsx @@ -111,7 +111,7 @@ export function useSlashCompletion( useEffect(() => { if (commandIndex === -1 || reverseSearchActive) { - resetCompletionState(); + setTimeout(resetCompletionState, 0); return; } @@ -631,17 +631,17 @@ export function useSlashCompletion( ) { suggestionText = ' ' + suggestionText; } - suggestionText += ' '; } + suggestionText += ' '; + buffer.replaceRangeByOffset( logicalPosToOffset(buffer.lines, cursorRow, completionStart.current), logicalPosToOffset(buffer.lines, cursorRow, completionEnd.current), suggestionText, ); - resetCompletionState(); }, - [cursorRow, resetCompletionState, buffer, suggestions, commandIndex], + [cursorRow, buffer, suggestions, commandIndex], ); return { |
