Don't autocomplete in the middle of a word

Fixes #1490
This commit is contained in:
Zachary Yedidia
2020-02-09 16:46:53 -05:00
parent af48e4b79b
commit 63046ae909

View 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