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:
@@ -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.),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user