monospace font; fixed completion bug

This commit is contained in:
diamondburned 2020-10-20 15:45:28 -07:00
parent 479e99f5bb
commit f8cc290461
2 changed files with 3 additions and 2 deletions

View File

@ -63,6 +63,7 @@ func NewView(ctrl Controller) *InputView {
text.SetProperty("bottom-margin", 4)
text.SetProperty("left-margin", 8)
text.SetProperty("right-margin", 8)
text.SetProperty("monospace", true)
text.Show()
primitives.AddClass(text, "message-input")

View File

@ -75,7 +75,6 @@ func NewCompleter(input *gtk.TextView) *Completer {
l.Connect("row-activated", func(l *gtk.ListBox, r *gtk.ListBoxRow) {
SwapWord(ibuf, c.entries[r.GetIndex()].Raw, c.cursor)
c.onChange() // signal change
c.Clear()
c.Popdown()
input.GrabFocus()
})
@ -86,7 +85,6 @@ func NewCompleter(input *gtk.TextView) *Completer {
// SetCompleter sets the current completer. If completer is nil, then the
// completer is disabled.
func (c *Completer) SetCompleter(completer cchat.Completer) {
c.Clear()
c.Popdown()
c.completer = completer
}
@ -106,6 +104,7 @@ func (c *Completer) Popdown() {
if !c.popdown {
c.Popover.Popdown()
c.popdown = true
c.Clear()
}
}
@ -146,6 +145,7 @@ func (c *Completer) onChange() {
if blank {
c.words = nil
c.index = -1
c.Popdown()
log.Println("RESET INDEX TO -1")
return
}