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

Method diff

internal/display/softwrap.go:273–286  ·  view source on GitHub ↗
(s1, s2 SLoc)

Source from the content-addressed store, hash-verified

271}
272
273func (w *BufWindow) diff(s1, s2 SLoc) int {
274 n := 0
275 for s1.LessThan(s2) {
276 if s1.Line < s2.Line {
277 n += w.getRowCount(s1.Line) - s1.Row
278 s1.Line++
279 s1.Row = 0
280 } else {
281 n += s2.Row - s1.Row
282 s1.Row = s2.Row
283 }
284 }
285 return n
286}
287
288// Scroll returns the location which is n visual lines below the location s
289// i.e. the result of scrolling n lines down. n can be negative,

Callers 1

DiffMethod · 0.95

Calls 2

getRowCountMethod · 0.95
LessThanMethod · 0.45

Tested by

no test coverage detected