ui/gesture: add Scroll.State method

And move Click.State to a method.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-08-11 18:15:59 +02:00
parent 5d28f9e690
commit 40091c5918
3 changed files with 57 additions and 21 deletions
+1 -1
View File
@@ -105,7 +105,7 @@ func (e *Editor) Next(cfg ui.Config, queue input.Queue) (EditorEvent, bool) {
Y: int(math.Round(float64(evt.Position.Y))),
})
e.requestFocus = true
if !e.scroller.Active() {
if e.scroller.State() != gesture.StateFlinging {
e.scrollToCaret(cfg)
}
}