Finish autocomplete

This commit is contained in:
Zachary Yedidia
2019-01-24 18:09:57 -05:00
parent ad487807a5
commit 0e4faf108d
6 changed files with 91 additions and 60 deletions

View File

@@ -52,14 +52,19 @@ type SharedBuffer struct {
Type BufType
isModified bool
// Whether or not suggestions can be autocompleted must be shared because
// it changes based on how the buffer has changed
HasSuggestions bool
}
func (b *SharedBuffer) insert(pos Loc, value []byte) {
b.isModified = true
b.HasSuggestions = false
b.LineArray.insert(pos, value)
}
func (b *SharedBuffer) remove(start, end Loc) []byte {
b.isModified = true
b.HasSuggestions = false
return b.LineArray.remove(start, end)
}
@@ -94,7 +99,9 @@ type Buffer struct {
// Settings customized by the user
Settings map[string]interface{}
Suggestions []string
Suggestions []string
Completions []string
CurSuggestion int
Messages []*Message
}