~delthas/senpai-dev

autocomplete immediately when there is only one completion v1 REJECTED

gildarts: 1
 autocomplete immediately when there is only one completion

 1 files changed, 5 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~delthas/senpai-dev/patches/53058/mbox | git am -3
Learn more about email & git

[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