Fix accidental visual selection on scroll

As part of this fix partial page distance calculations to more closely
match vim.
This commit is contained in:
Conrad Irwin
2023-09-01 11:14:27 -06:00
parent 2bf417fa45
commit 6d7949654b
3 changed files with 61 additions and 5 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ impl ScrollAmount {
.visible_line_count()
// subtract one to leave an anchor line
// round towards zero (so page-up and page-down are symmetric)
.map(|l| ((l - 1.) * count).trunc())
.map(|l| (l * count).trunc() - count.signum())
.unwrap_or(0.),
}
}