From 63046ae909c5f0f26e0afe5854a89ffe4444d04b Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Sun, 9 Feb 2020 16:46:53 -0500 Subject: [PATCH] Don't autocomplete in the middle of a word Fixes #1490 --- internal/action/actions.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/action/actions.go b/internal/action/actions.go index 44f0595f..20a71a72 100644 --- a/internal/action/actions.go +++ b/internal/action/actions.go @@ -620,6 +620,11 @@ func (h *BufPane) Autocomplete() bool { return false } + if !util.IsNonAlphaNumeric(h.Cursor.RuneUnder(h.Cursor.X)) { + // don't autocomplete if cursor is on alpha numeric character (middle of a word) + return false + } + if b.HasSuggestions { b.CycleAutocomplete(true) return true