Commit Graph

20669 Commits

Author SHA1 Message Date
zeertzjq
62a1290758 vim-patch:8.2.3661: test for put with large count fails
Problem:    Test for put with large count fails.
Solution:   Adjust the counts in the test.
8bc07e800c
2022-02-18 09:48:35 +08:00
zeertzjq
330b3da51e vim-patch:8.2.3660: overflow check uses wrong number
Problem:    Overflow check uses wrong number.
Solution:   Divide by ten.
9b0e82f35e
2022-02-18 09:48:32 +08:00
zeertzjq
3ed800e998 vim-patch:8.2.3659: integer overflow with large line number
Problem:    Integer overflow with large line number.
Solution:   Check for overflow. (closes vim/vim#9202)
03725c5795

Put E1247 in globals.h as E1240 is also there.
Do not make getdigits() abort.
2022-02-18 09:48:00 +08:00
Sean Dewar
592f4a7c08
Merge pull request #17433 from seandewar/vim-8.2.3492
vim-patch:8.2.{3492,3493,3570,3573,3574,3575,3577,3601}: put overflow checking shenanigans
2022-02-18 00:09:11 +00:00
Dundar Göc
1d0e38e42c ci: download reviews.js through checkout instead of wget
This makes testing the workflows much smoother.
2022-02-17 23:30:22 +01:00
James McCoy
df0fae2ff7
Merge pull request #17430 from dundargoc/test/remove-travis 2022-02-17 17:25:58 -05:00
Christian Clason
1fd106ca88
vim-patch:8.2.4411: bicep files are not recognized (#17447)
Problem:    Bicep files are not recognized.
Solution:   Match *.bicep files. (Dundar Goc, closes vim/vim#9791)
8e5ba693ad
2022-02-17 23:05:48 +01:00
James McCoy
d1e3d8abd6
Merge pull request #17427 from dundargoc/ci/lint/remove-unnecessary-steps 2022-02-17 16:54:11 -05:00
Dundar Göc
f3e6cc1a23 test: remove checks to see if current CI job is travis or appveyor 2022-02-17 22:43:48 +01:00
Dundar Göc
58a55e3889 ci(lint): remove unnecessary steps 2022-02-17 22:38:54 +01:00
James McCoy
387f6a9824
Merge pull request #17442 from dundargoc/ci/refactor/move-reviews 2022-02-17 15:56:47 -05:00
bfredl
3b5d456d3c
Merge pull request #17444 from clason/hl-empty-cterm
fix(api): allow empty list for cterm in nvim_set_hl
2022-02-17 19:37:45 +01:00
Christian Clason
e35a2d86fc fix(api): allow empty list for cterm in nvim_set_hl
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`.)
2022-02-17 18:07:11 +01:00
Sean Dewar
41d0e7af20
vim-patch:8.2.3601: check for overflow in put count does not work well
Problem:    Check for overflow in put count does not work well.
Solution:   Improve the overflow check. (Ozaki Kiichi, closes vim/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.
2022-02-17 17:06:16 +00:00
Sean Dewar
8170260bb3
fix(ops): str_to_reg passing NULL to memcpy
Required for the tests introduced in v8.2.3601 to pass ASAN when running
test_alot.vim.

Co-authored-by: erw7 <erw7.github@gmail.com>
2022-02-17 15:00:32 +00:00
Sean Dewar
308c1952aa
vim-patch:8.2.3577: overflow check fails with 32 ints
Problem:    Overflow check fails with 32 ints.
Solution:   Only test with 64 bit ints.
0f0044125c
2022-02-17 14:45:23 +00:00
Sean Dewar
6890f8774b
vim-patch:8.2.3575: overflow check still fails when sizeof(int) == sizeof(long)
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.
2022-02-17 14:45:23 +00:00
Sean Dewar
de8e2c61c1
vim-patch:8.2.3574: divide by zero
Problem:    Divide by zero.
Solution:   Don't check for overflow if multiplicand is zero.
8a1962d135
2022-02-17 14:45:22 +00:00
Sean Dewar
b149665689
vim-patch:8.2.3573: cannot decide whether to skip test that fails with 64 bit
Problem:    Cannot decide whether to skip test that fails with 64 bit ints.
            (closes vim/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.
2022-02-17 14:45:22 +00:00
Sean Dewar
a256b710a2
vim-patch:8.2.3570: Test_very_large_count fails on 32bit systems
Problem:    Test_very_large_count fails on 32bit systems.
Solution:   Bail out when using 32 bit numbers. (closes vim/vim#9072)
ec6e63079d
2022-02-17 14:45:22 +00:00
Sean Dewar
3fba994de8
vim-patch:8.2.3493: large count test fails on MS-Windows
Problem:    Large count test fails on MS-Windows.
Solution:   Skip the test on MS-Windows.
cddd5ac911
2022-02-17 14:45:21 +00:00
Sean Dewar
ac5856b3f5
vim-patch:8.2.3492: crash when pasting too many times
Problem:    Crash when pasting too many times.
Solution:   Limit the size to what fits in an int. (closes vim/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).
2022-02-17 14:45:21 +00:00
Dundar Göc
b877237612 ci(reviews): move reviews.js to .github/scripts 2022-02-17 14:48:14 +01:00
bfredl
f4e24f1eab
Merge pull request #17421 from lewis6991/hl0_clear
fix(highlight): global ns improvements
2022-02-17 14:07:42 +01:00
zeertzjq
9938961fd8 test: add more tests for :*map cursor and redrawing 2022-02-17 10:07:42 +08:00
zeertzjq
a92046e43f vim-patch:8.2.4401: map listing does not clear the rest of the command line
Problem:    Map listing does not clear the rest of the command line.
Solution:   Call msg_clear_eos(). (closes vim/vim#5623, closes vim/vim#5962)
d288eaad84
2022-02-17 08:45:15 +08:00
Jay Sandhu
80a3018a09 test: add some tests for :*map <expr>
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
2022-02-17 08:45:15 +08:00
zeertzjq
2ffe66a5a4 vim-patch:8.2.4338: an error from an expression mapping messes up the display
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. (closes vim/vim#9726)
74a0a5b26d
2022-02-17 08:45:14 +08:00
zeertzjq
c90cf8c77b vim-patch:8.1.2336: when an expr mapping moves the cursor it is not restored
Problem:    When an expr mapping moves the cursor it is not restored.
Solution:   Position the cursor after an expr mapping. (closes vim/vim#5256)
4ebe0e62d0
2022-02-17 08:44:58 +08:00
zeertzjq
3230b31486
Merge pull request #17431 from zeertzjq/vim-8.2.4345
vim-patch:8.2.4345
2022-02-17 06:53:15 +08:00
Lewis Russell
dc24eeb9fe feat(highlight): support color names for cterm 2022-02-16 22:48:34 +00:00
zeertzjq
b94b116236
Merge pull request #17429 from zeertzjq/vim-8.2.4400
vim-patch:8.2.{4392,4394,4400}
2022-02-17 06:33:45 +08:00
zeertzjq
7b048df4dc vim-patch:8.2.4345: <amatch> is expanded like a file name for DirChangedPre
Problem:    <amatch> is expanded like a file name for DirChangedPre.
Solution:   Do not expand <amatch>. (closes vim/vim#9742)  Also for the User event.
f6246f51e3
2022-02-17 06:19:10 +08:00
zeertzjq
4646ea1079
Merge pull request #17363 from zeertzjq/dirchangedpre
feat(events): add DirChangedPre
2022-02-17 06:07:19 +08:00
zeertzjq
9c5228f3e7 vim-patch:8.2.4400: MS-Windows: cannot use the mouse in the console with VIMDLL
Problem:    MS-Windows: cannot use the mouse in the console with VIMDLL.
Solution:   use add_char2buf() instead of fix_input_buffer(). (closes vim/vim#9784,
            closes vim/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, closes vim/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
2022-02-17 06:02:55 +08:00
Lewis Russell
876aaf2003 fix(highlight): allow globals to be cleared
- and reduce heap allocations

Fixes #17420
2022-02-16 20:22:09 +00:00
Stephan Seitz
8ab5ec4aaa
feat(tree-sitter): allow Atom-style capture fallbacks (#14196)
This allows falling back to `@definition` when we have no mapping
`@definition.fancy-specialization`.

This behavior is described in tree-sitter's documentation
(https://tree-sitter.github.io/tree-sitter/syntax-highlighting#theme).

Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/738
2022-02-16 19:38:19 +01:00
bfredl
9fe8d2c9df
Merge pull request #16678 from lewis6991/runtime_file_err
fix(api): re-route nvim_get_runtime_file errors
2022-02-16 10:52:38 +01:00
zeertzjq
0852644bee
Merge pull request #17424 from zeertzjq/map-followup
follow-up PR to #17423
2022-02-16 17:32:37 +08:00
zeertzjq
758f1e5999 refactor: remove NULL check that is always true 2022-02-16 17:01:35 +08:00
zeertzjq
cc81a8253b docs: minor changes related to mapping description 2022-02-16 16:58:32 +08:00
Shadman
9a74c2b04a
feat(mappings): considering map description when filtering (#17423) 2022-02-16 16:39:50 +08:00
zeertzjq
deb33a9775
Merge pull request #17422 from shadmansaleh/enhance/maps
fix: <Nop> not shown in :map commands
2022-02-16 16:01:17 +08:00
shadmansaleh
07a98b1a75 fix: <Nop> not shown in :map commands 2022-02-16 13:12:46 +06:00
shadmansaleh
f5518b78c8 chore: improve lua keymaps internal representation scheme 2022-02-16 11:20:10 +06:00
James McCoy
9ef5696132
Merge pull request #17418 from dundargoc/revert/ci/run-functionaltest-on-draft
revert: "ci: run functionaltest-lua on drafts as well"
2022-02-15 19:02:54 -05:00
Lewis Russell
d512be55a2 fix(api): re-route nvim_get_runtime_file errors
This allows nvim_get_runtime_file to be properly used via pcall
2022-02-15 23:00:28 +00:00
Gregory Anders
238b944e58
fix(api): validate command names in nvim_add_user_command (#17406)
This uses the same validation used when defining commands with
`:command`.
2022-02-15 13:08:40 -07:00
zeertzjq
3449405f38
Merge pull request #17417 from zeertzjq/vim-8.2.4388
vim-patch:8.2.4388: dead code in op_insert()
2022-02-15 21:12:36 +08:00
zeertzjq
a2c3d431d6 vim-patch:8.2.4388: dead code in op_insert()
Problem:    Dead code in op_insert().
Solution:   Remove condition and else block. (closes vim/vim#9782)
7745f14ef3
2022-02-15 21:07:01 +08:00