[PATCH v1] autocomplete immediately when there is only one completion
Export this patch
- Resolves #142
---
ui/editor.go | 6 +++++ -
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/ui/editor.go b/ui/editor.go
index e1898ea..bb2b99c 100644
--- a/ui/editor.go
+++ b/ui/editor.go
@@ -387,8 +387,12 @@ func (e *Editor) AutoComplete() (ok bool) {
e.autoCache = nil
return false
}
+
e.autoCacheIdx = 0
- return
+
+ if len(e.autoCache) != 1 {
+ return
+ }
}
e.text[e.lineIdx] = e.autoCache[e.autoCacheIdx].Text
base-commit: ce85ab5d205581f97bb30e10951bdefdfdcc152c
--
2.45.1
Hi,
Thanks for your patch!
I just realized I just reimplemented thisĀ on my own yesterday :P
https://git.sr.ht/~delthas/senpai/commit/a2cdd743aaadb2d06d92cf1a89966cc12caebb0d