Commit Graph

21337 Commits

Author SHA1 Message Date
zeertzjq
02e9a402ca test: add test for <Cmd> mapping with character containing K_SPECIAL byte 2022-04-30 06:06:11 +08:00
Mathias Fußenegger
9a1920e223
feat(lsp): show feedback on empty hover response (#18308)
Without any feedback it gives the impression that the language server is
not working properly, which isn't the case.
2022-04-29 23:04:00 +02:00
bfredl
6d4180a0d2
Merge pull request #18162 from dundargoc/refactor/unctustify
refactor/uncrustify
2022-04-29 19:33:05 +02:00
zeertzjq
d5dc3dad80
Merge pull request #18305 from zeertzjq/mapping-rhs
feat(mappings): do not simplify the rhs of a mapping
2022-04-29 22:10:25 +08:00
zeertzjq
7ac5359143 feat(mappings): do not simplify the rhs of a mapping 2022-04-29 21:12:48 +08:00
zeertzjq
98f62a2cfa feat(mappings): allow special keys and modifiers in <Cmd> mapping 2022-04-29 21:12:48 +08:00
Dundar Goc
eef8de4df0 refactor(uncrustify): change rules to better align with the style guide
Add space around arithmetic operators '+' and '-'.
Remove space between back-to-back parentheses, i.e. ')(' vs. ') ('.
Remove space between '((' or '))' of control statements.
Add space between ')' and '{' of control statements.
Remove space between function name and '(' on function declaration.
Collapse empty blocks between '{' and '}'.
Remove newline at the end of the file.
Remove newline between 'enum' and '{'.
Remove newline between '}' and ')' in a function invocation.
Remove newline between '}' and 'while' of 'do' statement.
2022-04-29 14:13:06 +02:00
Dundar Goc
0b3ae64480 refactor(uncrustify): format all c code under /src/nvim/ 2022-04-29 13:52:43 +02:00
Dundar Goc
995c186368 refactor(uncrustify): disable formatting in problematic code sections 2022-04-29 13:52:12 +02:00
zeertzjq
8c548c9e54
Merge pull request #18301 from zeertzjq/fix-lua-unmap-crash
fix(mappings): fix double-free when unmapping simplifiable Lua mapping
2022-04-29 18:09:25 +08:00
zeertzjq
c8e45366b9 fix(mappings): fix double-free when unmapping simplifiable Lua mapping 2022-04-29 17:39:24 +08:00
zeertzjq
35a7b0f9b9
Merge pull request #17932 from zeertzjq/vim-8.1.2145
vim-patch:8.1.{2145,2159,2165,2167,2333,2346,2350},8.2.{0839,0851,0855,0867,0916,0919,2084,2728,3595,4504,4819,4824,4827,4828,4829,4833,4837}
2022-04-29 17:13:28 +08:00
Michael Lingelbach
c671822d4d
ci: remove mjlbach from reviewers (#18297) 2022-04-29 10:48:12 +02:00
zeertzjq
3601cef137 feat(mappings): do not replace existing mapping for simplified form 2022-04-29 15:51:04 +08:00
zeertzjq
4adf2123dd vim-patch:8.2.4837: modifiers not simplified when timed out
Problem:    Modifiers not simplified when timed out or using feedkeys() with
            'n" flag.
Solution:   Adjust how mapped flag and timeout are used. (closes vim/vim#10305)
68a573ce2b
2022-04-29 15:51:04 +08:00
zeertzjq
1d97781dc5 vim-patch:8.2.4833: failure of mapping not checked for
Problem:    Failure of mapping not checked for.
Solution:   Check return value of ins_typebuf(). (closes vim/vim#10299)
12e21e387b
2022-04-29 15:51:04 +08:00
zeertzjq
bf065d9bb6 vim-patch:8.2.4829: a key may be simplified to NUL
Problem:    A key may be simplified to NUL.
Solution:   Use K_ZERO instead.  Use macros instead of hard coded values.
            (closes vim/vim#10290)
17c95d9608
2022-04-29 15:51:04 +08:00
zeertzjq
f2b512ad75 vim-patch:8.2.4828: fix for unmapping simplified key not fully tested
Problem:    Fix for unmapping simplified key not fully tested.
Solution:   Add a test case. (closes vim/vim#10292)
abeb09b2c5
2022-04-29 15:51:04 +08:00
zeertzjq
11b5a376bc vim-patch:8.2.4827: typo in variable name
Problem:    Typo in variable name. (Gabriel Dupras)
Solution:   Rename the variable.
87f74106f9
2022-04-29 15:51:04 +08:00
zeertzjq
e38cddc989 vim-patch:8.2.4824: expression is evaluated multiple times
Problem:    Expression is evaluated multiple times.
Solution:   Evaluate expression once and store the result. (closes vim/vim#10278)
23d5770ef5
2022-04-29 15:51:04 +08:00
zeertzjq
c14d89f306 vim-patch:8.2.4819: unmapping simplified keys also deletes other mapping
Problem:    Unmapping simplified keys also deletes other mapping.
Solution:   Only unmap a mapping with m_simplified set. (closes vim/vim#10270)
a4e3332650
2022-04-29 15:51:04 +08:00
zeertzjq
04a437b280 vim-patch:8.2.4504: when there is a partially matching map full map may not work
Problem:    When there is a partially matching map and modifyOtherKeys is
            active a full map may not work.
Solution:   Only simplify modifiers when there is no matching mapping.
            (closes vim/vim#8792)
196c3850db

Omit test as it sends terminal codes. Use a Lua test instead.
2022-04-29 15:51:04 +08:00
zeertzjq
096923e990 vim-patch:8.2.3595: check for signed overflow might not work everywhere
Problem:    Check for signed overflow might not work everywhere.
Solution:   Limit to 32 bit int. (closes vim/vim#9043, closes vim/vim#9067)
0d5a12ea04
2022-04-29 15:51:04 +08:00
zeertzjq
4531ddaa62 vim-patch:8.2.2728: special key names don't work if 'isident' is cleared
Problem:    Special key names don't work if 'isident' is cleared.
Solution:   Add vim_isNormalIDc() and use it for special key names.
            (closes vim/vim#2389)
e3d1f4c982

Code is N/A as Nvim already has ascii_isident(), so just port the test.
2022-04-29 15:51:04 +08:00
zeertzjq
78a7e2d55c vim-patch:8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Problem:    CTRL-R CTRL-R doesn't work with modifyOtherKeys.
Solution:   Allow key codes when fetching argument for CTRL-R. (closes vim/vim#5266)
            Also fix CTRL-G in Insert mode.
38571a04b4

Omit test as it sends terminal codes. Use a Lua test instead.
2022-04-29 15:51:04 +08:00
zeertzjq
3090648584 test: revert test and doc changes from #6724, add a test for #6716
Multi-char 'pastetoggle' now works without breaking character-find.
2022-04-29 15:51:04 +08:00
zeertzjq
9660ddd512 vim-patch:8.2.0919: merging modifier for modifyOtherKeys is done twice
Problem:    Merging modifier for modifyOtherKeys is done twice.
Solution:   Remove the merging done in vgetc().
673fc3e23f

Omit ex_getln.c change as it was removed in patch 8.2.2084, so
no_reduce_keys is still not needed in Nvim.
2022-04-29 15:51:04 +08:00
zeertzjq
32da3e56cd vim-patch:8.2.0916: mapping with partly modifyOtherKeys code does not work
Problem:    Mapping with partly modifyOtherKeys code does not work.
Solution:   If there is no mapping with a separate modifier include the
            modifier in the key and then try mapping again. (closes vim/vim#6200)
975a880a13

Cherry-pick applicable part of put_string_in_typebuf().
Revert related changes from 10a5825.
Use KEYLEN_PART_KEY for incomplete modifier sequence.
Omit test as it sends terminal codes. Use a Lua test instead.
2022-04-29 15:51:04 +08:00
zeertzjq
f6afc7c324 revert: "refactor: Remove allow_keys global (#6346)" 2022-04-29 15:51:04 +08:00
zeertzjq
d531ef6813 vim-patch:8.2.0867: using \{xxx} for encoding a modifier is not nice
Problem:    Using \{xxx} for encoding a modifier is not nice.
Solution:   Use \<*xxx> instead, since it's the same as \<xxx> but producing a
            different code.
fccd93f091

Use this notation in langmap_spec.
2022-04-29 15:51:04 +08:00
zeertzjq
abe91e1efe vim-patch:8.2.0855: GUI tests fail because the test doesn't use a modifier
Problem:    GUI tests fail because the test doesn't use a modifier.
Solution:   Add "\{xxx}" to be able to encode a modifier.
ebe9d34aa0

Change macros to enums to use them in unit tests.
2022-04-29 15:51:04 +08:00
zeertzjq
6832b626ea vim-patch:8.2.0851: can't distinguish <M-a> from accented "a" in the GUI
Problem:    Can't distinguish <M-a> from accented "a" in the GUI.
Solution:   Use another way to make mapping <C-bslash> work. (closes vim/vim#6163)
f4ae6b245a
2022-04-29 15:51:04 +08:00
zeertzjq
66747f18de vim-patch:8.2.0839: dropping modifier when putting a character back in typeahead
Problem:    Dropping modifier when putting a character back in typeahead.
Solution:   Add modifier to ins_char_typebuf(). (closes vim/vim#6158)
b42c0d5427

Vim's test doesn't seem to work properly as the hit-enter prompt seems
to be delayed. Add a Lua screen test.
2022-04-29 15:51:04 +08:00
zeertzjq
82a13a78bb vim-patch:partial:8.2.0815: maparg() does not provide enough information for mapset()
Problem:    maparg() does not provide enough information for mapset().
Solution:   Add "lhsraw" and "lhsrawalt" items.  Drop "simplified"
9c65253fe7

This only includes the "lhs" value part.
2022-04-29 15:51:04 +08:00
zeertzjq
212349c100 feat(edit): insert an unsimplified key using CTRL-SHIFT-V
This marks the following Vim patches as ported:

vim-patch:8.1.2333: with modifyOtherKeys CTRL-^ doesn't work

Problem:    With modifyOtherKeys CTRL-^ doesn't work.
Solution:   Handle the exception.
828ffd5963

vim-patch:8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys

Problem:    Other text for CTRL-V in Insert mode with modifyOtherKeys.
Solution:   Convert the Escape sequence back to key as if modifyOtherKeys is
            not set, and use CTRL-SHIFT-V to get the Escape sequence itself.
            (closes vim/vim#5254)
fc4ea2a72d

vim-patch:8.2.2084: CTRL-V U doesn't work to enter a Unicode character

Problem:    CTRL-V U doesn't work to enter a Unicode character when
            modifyOtherKeys is effective. (Ken Takata)
Solution:   Add a flag to get_literal() for the shift key. (closes vim/vim#7413)
0684e36a7e

Omit getcmdkeycmd() change as it depends on Vim patch 8.2.2062, which
may introduce a potential breakage.
2022-04-29 15:51:03 +08:00
zeertzjq
44269c73a3 vim-patch:8.1.2167: mapping test fails on MS-Windows
Problem:    Mapping test fails on MS-Windows.
Solution:   Remove all the existing Insert-mode mappings.
2559a47823
2022-04-29 15:51:03 +08:00
zeertzjq
b5837e55e6 vim-patch:8.1.2165: mapping test fails on Mac
Problem:    Mapping test fails on Mac.
Solution:   Remove the default Mac mapping.
4f2f61a014
2022-04-29 15:51:03 +08:00
zeertzjq
c3634a0261 vim-patch:8.1.2159: some mappings are listed twice
Problem:    Some mappings are listed twice.
Solution:   Skip mappings duplicated for modifyOtherKeys. (closes vim/vim#5064)
fafb4b18cd
2022-04-29 15:51:03 +08:00
zeertzjq
7029b4b44a feat(input): delay all simplifications
Avoid unsimplfied Ctrl-C in input buffer when it is not mapped.
2022-04-29 15:51:03 +08:00
zeertzjq
68ddbdd03b test(old): revert changes from ed88ca7503
Copy test_regex_char_classes.vim from upstream to avoid future encoding
problems.
2022-04-29 15:51:03 +08:00
zeertzjq
dde4f09f51 vim-patch:8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Problem:    Cannot map <C-H> when modifyOtherKeys is enabled.
Solution:   Add the <C-H> mapping twice, both with modifier and as 0x08.  Use
            only the first one when modifyOtherKeys has been detected.
459fd785e4

Add REPTERM_NO_SPECIAL instead of REPTERM_SPECIAL because the meaning of
"special" is different between Vim and Nvim.
Omit seenModifyOtherKeys as Nvim supports attaching multiple UIs.
Omit tests as they send terminal codes.
Keep the behavior of API functions.
2022-04-29 15:51:03 +08:00
Gregory Anders
188537efb3
fix: suppress "is a directory" messages with shortmess 'F' (#18296)
When 'F' is in 'shortmess', don't show messages when editing a
directory. This fixes a regression introduced by 0956283.
2022-04-28 15:27:34 -06:00
Christian Clason
521e91e1c4
vim-patch:ce001a337e28 (#18287)
Update runtime files
ce001a337e

also add `vimStdPlugin` keywords missing from previous updates
2022-04-27 17:48:35 +02:00
bfredl
ee85d8d756
Merge pull request #18254 from dundargoc/refactor/remove-char_u
refactor: replace char_u variables and functions with char
2022-04-27 13:37:56 +02:00
dundargoc
8e20c04fa0
refactor: enable -Wconversion warning for ex_docmd.c (#18277)
* refactor: enable -Wconversion warning for ex_docmd.c

Work on https://github.com/neovim/neovim/issues/567
2022-04-27 13:35:56 +02:00
kylo252
0d41c4dee1
refactor(build): remove unused includes #17078
Remove unused includes in src/nvim/buffer.c|h using the IWYU library.
Yet another step towards #6371 and #549
2022-04-26 21:38:12 -07:00
erw7
5f3018fa1a
refactor(terminal)!: drop winpty, require Windows 10 #18253
Problem:
winpty is only needed for Windows 8.1. Removing it reduces our build and code
complexity.

Solution:
- Remove winpty.
- Require Windows 10.

closes #18252
2022-04-26 21:17:06 -07:00
Andrey Mishchenko
3933592338
fix: has() should preserve v:shell_error #18280
fixes #18278
2022-04-26 20:58:25 -07:00
Philip Linell
d98e5357af
feat(checkhealth): check for slow shell #17829
Problem:
I had some issues where multiple plugins (vim-fzf and fugitive) was slow
because of my `.zshenv`.

Solution:
Check shell performance in :checkhealth.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-04-26 20:55:57 -07:00
kylo252
39d149752f
fix(build): missing definitions for sizeof macros #16393
Verified with -Wundef

Fixes #16392
2022-04-26 19:41:11 -07:00