MCPcopy
hub / github.com/micro-editor/micro / scrollDown

Method scrollDown

internal/display/softwrap.go:248–264  ·  view source on GitHub ↗
(s SLoc, n int)

Source from the content-addressed store, hash-verified

246}
247
248func (w *BufWindow) scrollDown(s SLoc, n int) SLoc {
249 for n > 0 {
250 rc := w.getRowCount(s.Line)
251 if n < rc-s.Row {
252 s.Row += n
253 n = 0
254 } else if s.Line < w.Buf.LinesNum()-1 {
255 s.Line++
256 n -= rc - s.Row
257 s.Row = 0
258 } else {
259 s.Row = rc - 1
260 break
261 }
262 }
263 return s
264}
265
266func (w *BufWindow) scroll(s SLoc, n int) SLoc {
267 if n < 0 {

Callers 1

scrollMethod · 0.95

Calls 2

getRowCountMethod · 0.95
LinesNumMethod · 0.65

Tested by

no test coverage detected