There was an error while loading. Please reload this page.
2 parents a94114a + 8d1a1ba commit 8d968a3Copy full SHA for 8d968a3
1 file changed
cmd/vibeaura/chat.go
@@ -308,10 +308,16 @@ func (m *model) applySuggestion() {
308
309
val := m.textarea.Value()
310
words := strings.Fields(val)
311
+
312
+ suggestion := m.suggestions[m.suggestionIdx]
313
+ // Avoid doubling trigger characters (e.g. //help or ##file)
314
+ trimmed := strings.TrimPrefix(suggestion, m.triggerChar)
315
+ replacement := m.triggerChar + trimmed
316
317
if len(words) == 0 {
- m.textarea.SetValue(m.suggestions[m.suggestionIdx] + " ")
318
+ m.textarea.SetValue(replacement + " ")
319
} else {
- words[len(words)-1] = m.triggerChar + m.suggestions[m.suggestionIdx]
320
+ words[len(words)-1] = replacement
321
m.textarea.SetValue(strings.Join(words, " ") + " ")
322
}
323
m.textarea.SetCursor(len(m.textarea.Value()))
0 commit comments