vim: Decrease max vim count (#40059)

Release Notes:

- Fixes bug were typing `9999999999999999999j` (19 9's) would go up
instead of down
- Max Vim count is now isize::MAX - 1
This commit is contained in:
AidanV
2025-10-14 12:07:26 -06:00
committed by GitHub
parent 1bd34e0db0
commit 762fa9b3c7
3 changed files with 65 additions and 0 deletions
+2
View File
@@ -1525,6 +1525,7 @@ impl Vim {
post_count
.checked_mul(10)
.and_then(|post_count| post_count.checked_add(number))
.filter(|post_count| *post_count < isize::MAX as usize)
.unwrap_or(post_count),
)
} else {
@@ -1534,6 +1535,7 @@ impl Vim {
pre_count
.checked_mul(10)
.and_then(|pre_count| pre_count.checked_add(number))
.filter(|pre_count| *pre_count < isize::MAX as usize)
.unwrap_or(pre_count),
)
}