fix(api): monitor, replay

This commit is contained in:
ttk
2024-09-06 19:45:01 +08:00
parent 5a63cc375a
commit a30bd94541
6 changed files with 75 additions and 96 deletions

View File

@@ -672,7 +672,8 @@ func (m Model) View() string {
v += styleText(m.echoTransform(string(value[pos+1:]))) // text after cursor
v += m.completionView(0) // suggested completion
} else {
if m.canAcceptSuggestion() {
if m.canAcceptSuggestion() && len(m.matchedSuggestions) <= 1 {
suggestion := m.matchedSuggestions[m.currentSuggestionIndex]
if len(value) < len(suggestion) {
m.Cursor.TextStyle = m.CompletionStyle