Add mouse support

This commit is contained in:
Zachary Yedidia
2019-01-02 17:39:50 -05:00
parent d7955b967f
commit 102e9ddb86
7 changed files with 275 additions and 12 deletions

View File

@@ -81,6 +81,13 @@ func (i *InfoWindow) Relocate() bool { return false }
func (i *InfoWindow) GetView() *View { return i.View }
func (i *InfoWindow) SetView(v *View) {}
func (i *InfoWindow) GetMouseLoc(vloc buffer.Loc) buffer.Loc {
c := i.Buffer.GetActiveCursor()
l := i.Buffer.LineBytes(0)
n := utf8.RuneCountInString(i.Msg)
return buffer.Loc{c.GetCharPosInLine(l, vloc.X-n), 0}
}
func (i *InfoWindow) Clear() {
for x := 0; x < i.width; x++ {
screen.Screen.SetContent(x, i.y, ' ', nil, config.DefStyle)