]> git.lizzy.rs Git - micro.git/commitdiff
Don't autocomplete in the middle of a word
authorZachary Yedidia <zyedidia@gmail.com>
Sun, 9 Feb 2020 21:46:53 +0000 (16:46 -0500)
committerZachary Yedidia <zyedidia@gmail.com>
Sun, 9 Feb 2020 21:46:53 +0000 (16:46 -0500)
Fixes #1490

internal/action/actions.go

index 44f0595f66d487190f58a4f5883946ffb6646908..20a71a723c756ae1ba19da6480358e2360640425 100644 (file)
@@ -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