fix jiggle when scrolloff is maxed

This commit is contained in:
Gokcehan committed 2016-09-02 22:47:11 +03:00
1 parent 826787450a
commit 188bd97b3b
2 files changed
+6 -2

No files matched your search

+5
View File
@@ -260,6 +260,11 @@ func (nav *Nav) down() {
dir.pos++
edge := min(gOpts.scrolloff, maxind-dir.ind)
// use a smaller value when the height is even and scrolloff is maxed
// in order to stay at the same row as much as possible while up/down
edge = min(edge, nav.height / 2 + nav.height % 2 - 1)
dir.pos = min(dir.pos, nav.height-edge-1)
dir.pos = min(dir.pos, maxind)
}