This is the command invoked repeatedly to make the changes:
:%s/^\(.*\)|\%(\*\(\d\+\)\)\?$\n\1|\%(\*\(\d\+\)\)\?$/\=submatch(1)..'|*'..(max([str2nr(submatch(2)),1])+max([str2nr(submatch(3)),1]))/g
Problem: Cursor ends up below the window after a put.
Solution: Mark w_crow and w_botline invalid when changing the cursor line.
(closesvim/vim#12465)
8509014add
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Lines put in non-current window are not displayed. (Marius
Gedminas)
Solution: Don't increment the topline when inserting just above it.
(closesvim/vim#12212)
e7f05a8780
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Check for overflow in put count does not work well.
Solution: Improve the overflow check. (Ozaki Kiichi, closesvim/vim#9102)
fa53722367
Add some casts as Nvim uses size_t variables in some places.
We could technically adjust the logic to check for overflow outside of size_t's
range, but it's much easier to just port the patch exactly (also means we can
use the same tests).
v:sizeoflong is N/A, so convert the 64-bit tests to Lua and use the FFI to check
long's size.