Commit Graph

21514 Commits

Author SHA1 Message Date
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
Marco Hinz
e038625b87
fix(mac): use same $LANG fallback mechanism as Vim
In a locale "en_US", "en" is the language and "US" is the region.

Before this change, we were too clever for our own good and tried to handle the
region as well. But if the macOS primary language is set to "English" and the
region to "Norway", we would end up with "en_NO", which is a locale that does
not exist.

Now we only take the language into account. Taking the example from above would
yield "en_US", which is a sensible fallback.

If the region is important to you, set $LANG and the more specific LC_*
variables in your shell config or alternatively use `:help :language`.

References https://github.com/neovim/neovim/issues/18292
2022-04-28 23:36:12 +02: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
bfredl
f3e99e691d
Merge pull request #18260 from dundargoc/refactor/enable-conversion-warning
refactor: enable -Wconversion warning for funcs.c and userfuncs.c
2022-04-26 19:57:02 +02:00
ii14
55135cea61
fix(lsp): fix unnecessary buffers being added on empty diagnostics (#18275)
Some language servers send empty `textDocument/publishDiagnostics`
messages after indexing the project with URIs corresponding to unopened buffers.
This commit guards against opening buffers corresponding to empty diagnostics.
2022-04-26 10:00:28 -07:00
Dundar Goc
909dbbbd4b refactor: enable -Wconversion warning for funcs.c and userfuncs.c
Work on https://github.com/neovim/neovim/issues/567
2022-04-26 10:43:37 +02:00
zeertzjq
a75efc237d
Merge pull request #18267 from zeertzjq/test-eq-arg-order
test: correct order of arguments to eq() and neq()
2022-04-26 12:20:19 +08:00
zeertzjq
519e4c4472 test: correct order of arguments to eq() and neq() 2022-04-26 11:38:58 +08:00
Gregory Anders
5d159a7faa
feat(tui): query terminal for CSI u support (#18181)
On startup query the terminal for CSI u support and enable it using
the escape sequence from kitty's progressive enhancement protocol [1].

[1]: https://sw.kovidgoyal.net/kitty/keyboard-protocol/
2022-04-25 20:49:45 -06:00
zeertzjq
d7a7315957
Merge pull request #18249 from zeertzjq/vim-8.2.4760
vim-patch:8.2.{4760,4765}: matchfuzzy() limit
2022-04-26 08:38:21 +08:00
zeertzjq
13e54f7130 vim-patch:8.2.4765: function matchfuzzy() sorts too many items
Problem:    Function matchfuzzy() sorts too many items.
Solution:   Only put matches in the array. (Yegappan Lakshmanan,
            closes vim/vim#10208)
047a7019b2
2022-04-26 08:06:33 +08:00
zeertzjq
e6974114fb vim-patch:8.2.4760: using matchfuzzy() on a long list can take a while
Problem:    Using matchfuzzy() on a long list can take a while.
Solution:   Add a limit to the number of matches. (Yasuhiro Matsumoto,
            closes vim/vim#10189)
9029a6e993
2022-04-26 08:06:32 +08:00
Christian Clason
af82eab946
vim-patch:8.2.4826: .cshtml files are not recognized (#18259)
Problem:    .cshtml files are not recognized.
Solution:   Use html filetype for .cshtml files. (Julien Voisin, closes vim/vim#10212)
1f435dafff
2022-04-25 20:02:36 +02:00
bfredl
35aa072647
Merge pull request #18257 from dundargoc/refactor/enable-conversion-warning/tag
refactor: enable Wconversion warning for tag
2022-04-25 18:59:20 +02:00
Dundar Goc
4d092af32d refactor: enable Wconversion warning for tag
Work on https://github.com/neovim/neovim/issues/567
2022-04-25 18:12:27 +02:00
bfredl
f765c30b38
Merge pull request #18255 from bfredl/workaround_version
fix(ci): workaround bug in msgpackparse() on windows caused by api level bump
2022-04-25 17:29:54 +02:00
Gregory Anders
2dddc86a42
fix: show autocmd output when F is in shortmess (#18251)
The default value of including F in 'shortmess' has the unfortunate side
effect of hiding output from autocommands. This is a common source of
confusion and often leads people to think their autocommands are not
working when they are. There is a small snippet in the docs for
'shortmess' indicating that the F flag suppresses autocmd output, but
it's not easy to find if you don't already know to look for it.

This commit removes that behavior of the F flag to make it only suppress
file info when opening a new file.
2022-04-25 08:44:18 -06:00
bfredl
10693a9e8a fix(ci): workaround bug in msgpackparse() on windows caused by api level bump 2022-04-25 16:30:20 +02:00
Dundar Goc
4aae0eebb2 refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
2022-04-25 13:32:01 +02:00
dundargoc
440b65c338
revert: "man.vim: Ensure 'modifiable' in man#init_pager" #17791
This reverts commit 526798a941.

This will make man filetype not modifiable by default, as it is the
superior behavior in my opinion. More importantly, also make it possible
for a user to modify man filetypes by adding `set modifiable` in
`~/.config/nvim/ftplugin/man.vim` or its equivalent.

ref #11450
closes #17595

Co-authored-by: Javier López <graulopezjavier@gmail.com>
2022-04-25 01:57:14 -07:00
zeertzjq
89df042a89
Merge pull request #18234 from zeertzjq/cursearch-reduce-redraw
perf: only redraw for CurSearch when it is currently in use
2022-04-25 10:53:54 +08:00
dundargoc
0648100fed
refactor: convert macros to all-caps (#17895)
Closes https://github.com/neovim/neovim/issues/6297
2022-04-24 20:18:43 -06:00
dundargoc
7813fa2f8c
refactor: enable Wconversion warning for diff (#18094)
Work on https://github.com/neovim/neovim/issues/567
2022-04-24 20:13:59 -06:00
Gregory Anders
cf2d77763f
Merge pull request #18110 from dundargoc/refactor/remove-char_u
refactor: replace char_u variables and functions with char
2022-04-24 20:13:23 -06:00
dundargoc
c582194135
refactor: add pure attribute to pure functions (#18165)
This will allow the compilers that support the pure attribute to make
further optimizations.
2022-04-24 20:12:47 -06:00
zeertzjq
38ee2a41df perf: only redraw for CurSearch when it is currently in use
The check in redraw_for_cursorline() is not needed because VALID_VIRTCOL
is always cleared when the cursor moves to another line, so the check in
redraw_for_cursorcolumn() is enough.
2022-04-25 09:57:26 +08:00