fix moving of cursor

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2019-06-26 14:59:33 -04:00 committed by Jakub
parent 66e418d3a3
commit c55d3c610b
1 changed files with 3 additions and 2 deletions

View File

@ -30,9 +30,10 @@ func HandlerCursorDispenser(mod int) func(g *gocui.Gui, v *gocui.View) error {
if v == nil {
return nil
}
mx, _ := v.Size()
_, my := v.Size()
cx, cy := v.Cursor()
if cy == 0 || cx == mx {
log.Printf("my: %d, cx: %d, cy: %d", my, cx, cy)
if cy+mod < 0 || cy+mod == my {
return nil
}
if err := v.SetCursor(cx, cy+mod); err != nil {