mirror of
https://github.com/walles/moar.git
synced 2024-11-11 00:27:04 +03:00
7fcf99b006
Fixes #16 diff --git m/pager.go m/pager.go index b7cce09..16e91e7 100644 --- m/pager.go +++ m/pager.go @@ -611,6 +611,7 @@ func (p *Pager) StartPaging(logger *log.Logger, screen tcell.Screen) { } p.screen = screen + screen.EnableMouse() screen.Show() p._Redraw(logger, "") @@ -672,6 +673,17 @@ func (p *Pager) StartPaging(logger *log.Logger, screen tcell.Screen) { p._OnKey(logger, ev.Key()) } + case *tcell.EventMouse: + switch ev.Buttons() { + case tcell.WheelUp: + // Clipping is done in _AddLines() + p.firstLineOneBased-- + + case tcell.WheelDown: + // Clipping is done in _AddLines() + p.firstLineOneBased++ + } + case *tcell.EventResize: // We'll be implicitly redrawn just by taking another lap in the loop Change-Id: I3c9971077de9a720b90d6d91960f7f33a3a089e3 |
||
---|---|---|
.. | ||
ansiTokenizer_test.go | ||
ansiTokenizer.go | ||
matchRanges_test.go | ||
matchRanges.go | ||
pager_test.go | ||
pager.go | ||
reader_test.go | ||
reader.go |