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

@@ -190,8 +190,7 @@ func (i *InfoWindow) Display() {
}
}
if i.HasSuggestions {
i.HasSuggestions = false
if i.HasSuggestions && len(i.Suggestions) > 1 {
statusLineStyle := config.DefStyle.Reverse(true)
if style, ok := config.Colorscheme["statusline"]; ok {
statusLineStyle = style
@@ -201,9 +200,13 @@ func (i *InfoWindow) Display() {
keymenuOffset = len(keydisplay)
}
x := 0
for _, s := range i.Suggestions {
for j, s := range i.Suggestions {
style := statusLineStyle
if i.CurSuggestion == j {
style = style.Reverse(true)
}
for _, r := range s {
screen.Screen.SetContent(x, i.Y-keymenuOffset-1, r, nil, statusLineStyle)
screen.Screen.SetContent(x, i.Y-keymenuOffset-1, r, nil, style)
x++
if x >= i.Width {
return