Commit Graph

21243 Commits

Author SHA1 Message Date
zeertzjq
4e4e185405 vim-patch:8.2.0358: insufficient testing for indent.c
Problem:    Insufficient testing for indent.c.
Solution:   Add indent tests. (Yegappan Lakshmanan, closes vim/vim#5736)
bd7206e02c

Cherry-pick Test_ex_mode() changes from Vim patches 8.2.{0342,0347}.
Reorder test_expand_func.vim to match upstream.

(cherry picked from commit c72857d396)
2022-05-14 12:50:35 +00:00
zeertzjq
aba7cb0613 Merge pull request #18552 from neovim/backport-18545-to-release-0.7
[Backport release-0.7] vim-patch:8.2.4943: changing 'switchbuf' may have no effect
2022-05-13 08:39:37 +08:00
Sean Dewar
56d05076f8 vim-patch:8.2.4943: changing 'switchbuf' may have no effect
Problem:    Changing 'switchbuf' may have no effect.
Solution:   Handle 'switchbuf' in didset_string_options(). (Sean Dewar,
            closes vim/vim#10406)
39c46b4378

Guess it doesn't hurt to cherry-pick didset_string_options from v8.1.2045
(but in option.c, for now).

(cherry picked from commit 809790b9f6)
2022-05-12 23:41:54 +00:00
zeertzjq
496e786cad Merge pull request #18534 from neovim/backport-18480-to-release-0.7
[Backport release-0.7] fix(runtime/genvimvim): omit s[ubstitute] from vimCommand
2022-05-12 10:09:48 +08:00
Sean Dewar
0377973769 fix(runtime/genvimvim): omit s[ubstitute] from vimCommand
It's special cased by the vimSubst syntax group, and isn't present in Vim's
vimCommand group.

For example, this fixes `call s:Foo()` highlighting `:` as Error in Nvim, as the
`s` is parsed as vimCommand rather than as vimUserFunc since
`contains=vimCommand` was added to vimUserFunc (and vimFunc) in a rt update.

Interestingly, `g:`, `l:`, etc. have the same issues due to :global, :list, etc.
Vim also has that problem, so it should ideally be fixed upstream.

We could also omit g[lobal] from vimCommand and rely on vimGlobal instead, but
it doesn't work in some cases, like when there's a `:` before the command. Also,
Vim matches only `g` in vimCommand for some reason, which doesn't produce any
highlight for `:global/foo/bar` (with Nvim you at least get some highlights on
the `global` bit despite the leading `:`).

Also, remove special handling of :py3 in syntax/vim.vim, as the generator seems
to have no problems finding it.

(cherry picked from commit 53780d9fd0)
2022-05-12 00:09:01 +00:00
github-actions[bot]
35075dcc22 [Backport release-0.7] fix(lsp): fix unnecessary buffers being added on empty diagnostics (#18469)
* fix(lsp): fix unnecessary buffers being added on empty diagnostics

Some language servers send empty `textDocument/publishDiagnostics`
messages after indexing the project, sometimes resulting in creation
of a lot of unnecessary buffers. As a workaround, skip empty messages
for nonexistent buffers before resolving the filename to a bufnr.

(cherry picked from commit 26eb6785eb)

* Add test

(cherry picked from commit d2e9dab377)

Co-authored-by: ii14 <ii14@users.noreply.github.com>
2022-05-08 11:27:30 +02:00
github-actions[bot]
9e040acfa3 fix(lsp): unify progress message handling (#18468)
The LSP progress handler would put non-progress messages (such as from
clangd or pyls; not part of the LSP spec) directly into
`client.messages`, while `vim.lsp.util.get_progress_messages()` would
try to fetch them from `client.messages.messages` instead (and come up
empty everytime). This would result in these messages never being
cleaned up by `get_progress_messages()`.

This commit fixes that by treating those messages like show-once
progress messages (by setting `done=true` immediately).

(cherry picked from commit 2087960c76)

Co-authored-by: Patrice Peterson <patrice.peterson@mailbox.org>
2022-05-08 11:27:22 +02:00
zeertzjq
28c08fdbe3 Merge pull request #18473 from neovim/backport-18472-to-release-0.7
[Backport release-0.7] vim-patch:8.2.4908: no text formatting for // comment after a statement
2022-05-08 08:17:36 +08:00
zeertzjq
37b82b513c vim-patch:8.2.4908: no text formatting for // comment after a statement
Problem:    No text formatting for // comment after a statement.
Solution:   format a comment when the 'c' flag is in 'formatoptions'.
48a8a83303
(cherry picked from commit a74c08d524)
2022-05-07 23:51:48 +00:00
github-actions[bot]
8a23b8ed29 vim-patch:8.2.4907: some users do not want a line comment always inserted (#18464)
Problem:    Some users do not want a line comment always inserted.
Solution:   Add the '/' flag to 'formatoptions' to not repeat the comment
            leader after a statement when using "o".
2bf875f881
(cherry picked from commit d4b9aa4f8e)

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2022-05-07 17:39:28 +02:00
zeertzjq
7990fa4a17 Merge pull request #18446 from neovim/backport-18445-to-release-0.7
[Backport release-0.7] vim-patch:8.2.4881: "P" in Visual mode still changes some registers
2022-05-06 19:55:21 +08:00
zeertzjq
ca3ef915ce vim-patch:8.2.4881: "P" in Visual mode still changes some registers
Problem:    "P" in Visual mode still changes some registers.
Solution:   Make "P" in Visual mode not change any register. (Shougo
            Matsushita, closes vim/vim#10349)
509142ab7a
(cherry picked from commit 28c74ef687)
2022-05-06 11:27:01 +00:00
github-actions[bot]
0b8faccade feat(api): add group_name to nvim_get_autocmds (#18440)
(cherry picked from commit 96289f2416)

Co-authored-by: Famiu Haque <famiuhaque@protonmail.com>
2022-05-05 21:00:33 +02:00
github-actions[bot]
b7a5278249 feat(api): add group_name to nvim_get_autocmds (#18440)
(cherry picked from commit 96289f2416)

Co-authored-by: Famiu Haque <famiuhaque@protonmail.com>
2022-05-05 20:59:45 +02:00
github-actions[bot]
e28799f2d8 fix: display global statusline correctly with ext_messages (#18436)
(cherry picked from commit b5957c3c32)

Co-authored-by: shirasaka <shirasaka@n-create.co.jp>
2022-05-05 19:00:35 +02:00
zeertzjq
c4690565c7 Merge pull request #18422 from neovim/backport-18420-to-release-0.7
[Backport release-0.7] vim-patch:8.2.4868: when closing help window autocmds triggered for wrong window
2022-05-05 08:29:47 +08:00
zeertzjq
15b8036f90 vim-patch:8.2.4868: when closing help window autocmds triggered for wrong window
Problem:    When closing help window autocmds triggered for the wrong window.
Solution:   Figure out the new current window earlier. (closes vim/vim#10348)
2a2707d033
(cherry picked from commit 71580dfef4)
2022-05-04 23:27:22 +00:00
zeertzjq
7f08e3282f Merge pull request #18421 from neovim/backport-18418-to-release-0.7
[Backport release-0.7] vim-patch:8.2.4865: :startinsert right after :stopinsert may not work
2022-05-05 07:21:55 +08:00
zeertzjq
3b4881afc2 vim-patch:8.2.4865: :startinsert right after :stopinsert may not work
Problem:    :startinsert right after :stopinsert does not work when popup menu
            is still visible.
Solution:   Use ins_compl_active() instead of pum_visible(). (closes vim/vim#10352)
cd5dbad184
(cherry picked from commit 97d86c45af)
2022-05-04 22:58:56 +00:00
github-actions[bot]
1e28068d0d fix: ensure has() does not change v:shell_error (#18415)
(cherry picked from commit 0f21816b5f)

Co-authored-by: Andrey Mishchenko <mishchea@gmail.com>
2022-05-04 08:17:59 -07:00
github-actions[bot]
203b088d75 [Backport release-0.7] build(deps): bump LuaJIT to HEAD - 91bc6b8ad (#18411)
* build(deps): bump LuaJIT to HEAD - 91bc6b8ad

(cherry picked from commit a0c10f6b67)

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2022-05-04 10:21:42 +02:00
github-actions[bot]
f179729789 refactor(lua): replace hard-coded gsub with vim.pesc() (#18410)
(cherry picked from commit b4c7f763f9)

Co-authored-by: James McCoy <jamessan@jamessan.com>
2022-05-04 08:57:41 +02:00
github-actions[bot]
e502e8106a fix(treesitter): bump match limit up (#18400)
This avoids ignoring too many match results, and avoid highlighting
being blank in some files.

(cherry picked from commit e453b6391e)

Co-authored-by: Thomas Vigouroux <thomas.vigouroux@protonmail.com>
2022-05-03 22:58:02 +02:00
zeertzjq
7567d2195a Merge pull request #18390 from neovim/backport-18382-to-release-0.7
[Backport release-0.7] fix(lsp): add missing bufnr argument to util.apply_text_edits
2022-05-03 22:33:01 +08:00
zeertzjq
a10a904b8f Merge pull request #18391 from neovim/backport-18384-to-release-0.7
[Backport release-0.7] ci(MinGW): run pacman -Syu twice
2022-05-03 22:31:00 +08:00
zeertzjq
3868c8db6f ci(MinGW): run pacman -Syu twice
(cherry picked from commit d4994a4e0f)
2022-05-03 14:29:41 +00:00
Jose Alvarez
d165289055 fix(lsp): add missing bufnr argument
(cherry picked from commit 80cea05de0)
2022-05-03 14:29:08 +00:00
James McCoy
f3587babfd Merge pull request #18367 from neovim/backport-18353-to-release-0.7 2022-05-02 11:23:25 -04:00
James McCoy
631393a712 fix(filetype.lua): escape expansion of ~ when used as a pattern
(cherry picked from commit 88595fbb21)
2022-05-02 15:02:23 +00:00
github-actions[bot]
08cd391047 [Backport release-0.7] fix(shared): avoid indexing unindexable values in vim.tbl_get() (#18360)
* fix(shared): avoid indexing unindexable values in vim.tbl_get()

(cherry picked from commit 95ec38dc8d)

* test: add more unindexable types

(cherry picked from commit 7dccdefce4)

Co-authored-by: William Boman <william@redwill.se>
2022-05-02 13:40:49 +02:00
github-actions[bot]
508c8a597e fix(ftdetect): source plugins in autogroup (#18362)
(cherry picked from commit 244b371a18)

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2022-05-02 13:17:05 +02:00
James McCoy
ffd46b7688 Merge pull request #18351 from neovim/backport-18294-to-release-0.7
[Backport release-0.7] fix(mac): use same $LANG fallback mechanism as Vim
2022-05-02 00:17:36 -04:00
Marco Hinz
2a6198319f 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

(cherry picked from commit e038625b87)
2022-05-01 23:15:48 +00:00
zeertzjq
8d4fbcb5b1 Merge pull request #18324 from neovim/backport-18318-to-release-0.7
[Backport release-0.7] fix(tui): disable extended keys before exiting alternate screen
2022-04-30 22:22:35 +08:00
zeertzjq
b80ef0de2f fix(tui): disable extended keys before exiting alternate screen
(cherry picked from commit 2660622865)
2022-04-30 14:18:44 +00:00
zeertzjq
14a5b6b8d4 Merge pull request #18312 from neovim/backport-18310-to-release-0.7
[Backport release-0.7] fix(input): only disable mapped CTRL-C interrupts when getting input
2022-04-30 14:01:51 +08:00
zeertzjq
89260ea5d6 fix(input): only disable mapped CTRL-C interrupts when getting input
(cherry picked from commit f3330023a5)
2022-04-30 05:20:40 +00:00
github-actions[bot]
ef43e7d1f6 fix: suppress "is a directory" messages with shortmess 'F' (#18298)
When 'F' is in 'shortmess', don't show messages when editing a
directory. This fixes a regression introduced by 0956283.

(cherry picked from commit c9f90ee687)

Co-authored-by: Gregory Anders <greg@gpanders.com>
2022-04-28 15:35:03 -06:00
github-actions[bot]
9e5cef945a feat(tui): query terminal for CSI u support (#18264)
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/

(cherry picked from commit 797a25252c)

Co-authored-by: Gregory Anders <greg@gpanders.com>
2022-04-25 21:22:23 -06:00
github-actions[bot]
aff05c5730 fix: show autocmd output when F is in shortmess (#18256)
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.

(cherry picked from commit 09562839c3)

Co-authored-by: Gregory Anders <greg@gpanders.com>
2022-04-25 09:14:53 -06:00
zeertzjq
fa7d8c333f Merge pull request #18229 from zeertzjq/backport-18227-to-release-0.7
[Backport release-0.7] fix(lua): don't mutate opts parameter of vim.keymap.del (#18227)
2022-04-23 08:41:47 +08:00
Andrey Mishchenko
d916d2f876 fix(lua): don't mutate opts parameter of vim.keymap.del (#18227)
`vim.keymap.del` takes an `opts` parameter that lets caller refer to and
delete buffer-local mappings. For some reason the implementation of
`vim.keymap.del` mutates the table that is passed in, setting
`opts.buffer` to `nil`. This is wrong and also undocumented.

(cherry picked from commit 51f33ae5c0)
2022-04-23 08:03:06 +08:00
github-actions[bot]
f7e2ad7915 [Backport release-0.7] fix(treesitter): create new parser if language is not the same as cached parser (#18220)
* fix(treesitter): create new parser if language is not the same as cached parser

Fixes #18148

(cherry picked from commit 8e35894fc2)

* test: create new parser in vim.treesitter.get_parser() when filetype changes

(cherry picked from commit 30e7b3f0a2)

Co-authored-by: Chinmay Dalal <dalal.chinmay.0101@gmail.com>
2022-04-22 16:47:00 +02:00
github-actions[bot]
7f8faac39e fix(diagnostic): use nvim_exec_autocmds to trigger DiagnosticChanged (#18205)
Use nvim_exec_autocmds to issue the DiagnosticChanged autocommand,
rather than nvim_buf_call, which has some side effects when drawing
statuslines.

(cherry picked from commit 4a64ce140f)

Co-authored-by: Gregory Anders <greg@gpanders.com>
2022-04-21 07:07:03 -06:00
zeertzjq
0302c351e7 Merge pull request #18208 from neovim/backport-18182-to-release-0.7
[Backport release-0.7] vim-patch:8.1.1756,8.2.{2472,2474,2475,2476,2477,4791,4802}: autocommand fixes
2022-04-21 20:03:12 +08:00
zeertzjq
0298652c30 vim-patch:8.2.4802: test is not cleaned up
Problem:    Test is not cleaned up.
Solution:   Make test clean up after itself.  Avoid NUL. (closes vim/vim#10233)
7851c69a12

Adapt test_autocmd_vimgrep() to Nvim.

(cherry picked from commit 5e9afca1c1)
2022-04-21 11:43:40 +00:00
Charlie Groves
1a84384487 test: add a Lua functional test for NoName buffer event order
(cherry picked from commit e69cb86750)
2022-04-21 11:43:40 +00:00
zeertzjq
91a326f474 vim-patch:8.2.4791: events triggered in different order when reusing buffer
Problem:    Autocmd events triggered in different order when reusing an empty
            buffer.
Solution:   Call buff_freeall() earlier. (Charlie Groves, closes vim/vim#10198)
fef4485ef5

Test failure becomes very strange.

(cherry picked from commit f531fb97ff)
2022-04-21 11:43:40 +00:00
zeertzjq
e8e8827868 vim-patch:8.2.2477: autocommand tests hang on MS-Windows
Problem:    Autocommand tests hang on MS-Windows.
Solution:   Skip a couple of tests.  Fix file name.
dd07c02232
(cherry picked from commit 69fc23ed98)
2022-04-21 11:43:40 +00:00
zeertzjq
82782ba593 vim-patch:8.2.2476: using freed memory when splitting window while closing buffer
Problem:    Using freed memory when using an autocommand to split a window
            while a buffer is being closed.
Solution:   Disallow splitting when the buffer has b_locked_split set.
983d83ff1c

Put the error message in window.c.
Cherry-pick a memory leak fix from Vim patch 8.2.0399.
Test still fails.

(cherry picked from commit 1664e3d4bc)
2022-04-21 11:43:40 +00:00