Problem: Integer overflow with large line number.
Solution: Check for overflow. (closesvim/vim#9202)
03725c5795
Put E1247 in globals.h as E1240 is also there.
Do not make getdigits() abort.
Problem: when accessing `nvim_set_hl` from Lua, empty tables are converted
to empty lists, not dictionaries, resulting in an error for
:lua vim.api.nvim_set_hl(0, "Comment", { cterm = {} })
Workaround: add an empty array as a special case when checking
`dict->cterm.type` and just set `cterm_mask_provided`.
(Proper solution: handle this in `gen_api_dispatch.lua`.)
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.
Problem: Overflow check still fails when sizeof(int) == sizeof(long).
Solution: Use a float to check the result.
e551ccfb93
This approach is... interesting...
Tests fail.
Problem: Cannot decide whether to skip test that fails with 64 bit ints.
(closesvim/vim#9072)
Solution: Add v:sizeofint, v:sizeoflong and v:sizeofpointer. Improve the
check for multiply overflow.
69b3072d98
Omit v:sizeof{int,long,pointer} as they're only really used for tests.
Problem: Crash when pasting too many times.
Solution: Limit the size to what fits in an int. (closesvim/vim#8962)
eeed1c7ae0
Note that this overflow check pretty bad.
It also doesn't work well on Windows (where sizeof(int) == sizeof(long)).
This is all temporary; everything here is rewritten in future patches anyway.
e_resulting_text_too_long was already cherry-picked.
totlen is size_t in Nvim, but is int in Vim. This means we'll need some casts.
We could technically adjust the logic in do_put to use the entire range of
size_t in stuff like totlen, but there's not much gain, and it's much easier to
just port the patch like Vim as was done before (also allows us to use the same
tests).
Add tests for:
- Cursor position restored after :map expr
- Cursor position restored after :imap expr
- Error in :cmap expr handled correctly
Cherry-picked from #12837
Problem: An error from an expression mapping messes up the display.
Solution: When the expression results in an empty string return K_IGNORE.
In cmdline mode redraw the command line. (closesvim/vim#9726)
74a0a5b26d
Problem: When an expr mapping moves the cursor it is not restored.
Solution: Position the cursor after an expr mapping. (closesvim/vim#5256)
4ebe0e62d0
Problem: <amatch> is expanded like a file name for DirChangedPre.
Solution: Do not expand <amatch>. (closesvim/vim#9742) Also for the User event.
f6246f51e3
Problem: MS-Windows: cannot use the mouse in the console with VIMDLL.
Solution: use add_char2buf() instead of fix_input_buffer(). (closesvim/vim#9784,
closesvim/vim#9769)
646bb7247a
N/A patches for version.c:
vim-patch:8.2.4392: MS-Windows with VIMDLL: Escaping CSI is wrong
Problem: MS-Windows with VIMDLL: Escaping CSI is wrong.
Solution: Put back #ifdef. (Ken Takata, closesvim/vim#9769)
64d95cfc56
vim-patch:8.2.4394: UTF8 select mode test fails on MS-Windows
Problem: UTF8 select mode test fails on MS-Windows.
Solution: Revert the #ifdef change.
9fdde7992a