(s1, s2 SLoc)
| 271 | } |
| 272 | |
| 273 | func (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, |
no test coverage detected