Commit Graph

29946 Commits

Author SHA1 Message Date
zeertzjq
b5a2d52a36 vim-patch:e2c4e07: runtime(doc): Update :help :command-complete list
closes: vim/vim#15602

e2c4e07795

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
(cherry picked from commit 751ab0e4ca)
2024-08-31 22:56:45 +00:00
zeertzjq
797f524337 vim-patch:7c8bbc6: runtime(doc): use mkdir -p to save a command
closes: vim/vim#15599

7c8bbc6d28

Co-authored-by: Ughur Alakbarov <58857108+ugur-a@users.noreply.github.com>
(cherry picked from commit 5f81c36934)
2024-08-31 22:56:45 +00:00
zeertzjq
8aea03f7b2
Merge pull request #30205 from neovim/backport-30204-to-release-0.10
vim-patch:9.1.0707: [security]: invalid cursor position may cause a crash
2024-09-01 05:29:20 +08:00
zeertzjq
974447bfc3 vim-patch:9.1.0707: [security]: invalid cursor position may cause a crash (#30204)
Problem:  [security]: invalid cursor position may cause a crash
          (after v9.1.0038)
Solution: Set cursor to the last character in a line, if it would
          otherwise point to beyond the line; no tests added, as it
          is unclear how to reproduce this.

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-4ghr-c62x-cqfh

396fd1ec29

Co-authored-by: Christian Brabandt <cb@256bit.org>
(cherry picked from commit 6f167fcae9)
2024-08-31 21:08:30 +00:00
zeertzjq
6ed530baa5
Merge pull request #30182 from neovim/backport-30180-to-release-0.10
fix(man): check if buffer is valid before restoring 'tagfunc'
2024-08-29 20:21:47 +08:00
zeertzjq
d000c56373 fix(man): check if buffer is valid before restoring 'tagfunc' (#30180)
(cherry picked from commit 7588ff2d89)
2024-08-29 11:54:09 +00:00
zeertzjq
2a32ec784c
Merge pull request #30178 from neovim/backport-30176-to-release-0.10
docs(eval): wrong return type of getcharsearch
2024-08-29 18:30:46 +08:00
glepnir
c7e943a181 docs(eval): fix wrong return type of getcharsearch() (#30176)
(cherry picked from commit 6c2186a998)
2024-08-29 10:02:42 +00:00
zeertzjq
d874ba319d
Merge pull request #30163 from neovim/backport-30161-to-release-0.10
fix(regexp): fix typo in E888 error message
2024-08-28 11:00:30 +08:00
Eisuke Kawashima
b18538527e fix(regexp): fix typo in E888 error message (#30161)
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
(cherry picked from commit 3bcd5624be)
2024-08-28 02:40:19 +00:00
Riley Bruins
a6b2233c3e fix(treesitter): escape things like " in omnifunc results
(cherry picked from commit f8e1ebd6f6)
2024-08-27 09:52:11 +02:00
Maria José Solano
d593b20017 fix(lsp): return call hierarchy item, not the index (#30145)
(cherry picked from commit d9ccd828b0)
2024-08-26 18:19:40 +02:00
zeertzjq
7834d80b81
Merge pull request #30137 from neovim/backport-30134-to-release-0.10
vim-patch:9.1.0694: matchparen is slow on a long line
2024-08-25 06:30:50 +08:00
zeertzjq
1ed493cc96 vim-patch:9.1.0694: matchparen is slow on a long line (#30134)
Problem:  The matchparen plugin is slow on a long line.
Solution: Don't use a regexp to get char at and before cursor.
          (zeertzjq)

Example:

```vim
  call setline(1, repeat(' foobar', 100000))
  runtime plugin/matchparen.vim
  normal! $hhhhhhhh
```

closes: vim/vim#15568

81e7513c86
(cherry picked from commit cf44121f7f)
2024-08-24 22:08:04 +00:00
zeertzjq
dca6c4e92c
Merge pull request #30097 from neovim/backport-30096-to-release-0.10
fix(decor): don't use separate DecorSignHighlight for url
2024-08-20 09:26:46 +08:00
zeertzjq
40671f18f7 fix(decor): don't use separate DecorSignHighlight for url (#30096)
(cherry picked from commit a8fbe1d409)
2024-08-20 00:20:41 +00:00
neovim-backports[bot]
316fa168a1
fix(terminal): interrupt/got_int hangs terminal (#30094)
fix(terminal): interrupt/got_int hangs terminal (#30056)

Upon `terminal_enter`, `mapped_ctrl_c` is set in order to avoid `CTRL-C`
interrupts (which is proxied to the terminal process instead), `os_inchar`
will then test `mapped_ctrl_c` against `State` and set `ctrl_c_interrupts=false`
which prevents `process_ctrl_c` from setting `got_int=true` in a terminal
state.

However, if `got_int` is set outside of `process_ctrl_c`, e.g. via
`interrupt()`, this will hang the neovim process as `terminal_execute` will
enter an endless loop as `got_int` will never be cleared causing `safe_vgetc`
to always return `Ctrl_C`.

A minimal example reproducing this bug:
```vim
:autocmd TermEnter * call timer_start(500, {-> interrupt()})
:terminal
:startinsert
```

To fix, we make sure `got_int` is cleared inside `terminal_execute` when
it detects `Ctrl_C`.

Closes #20726

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: ibhagwan <59988195+ibhagwan@users.noreply.github.com>
2024-08-20 06:48:13 +08:00
zeertzjq
be831a725d fix(api): error properly with invalid field in nvim_open_win (#30078)
(cherry picked from commit cce1eb0806)
2024-08-18 01:33:50 +02:00
zeertzjq
1fd86be15c
Merge pull request #30063 from neovim/backport-30052-to-release-0.10
fix(man): avoid setting v:errmsg
2024-08-15 22:28:10 +08:00
zeertzjq
7284400a34 fix(man): avoid setting v:errmsg (#30052)
(cherry picked from commit ee5aaba215)
2024-08-15 14:02:55 +00:00
zeertzjq
3ca127063b
Merge pull request #30054 from neovim/backport-29476-to-release-0.10
vim-patch:ecd642a: runtime(doc): clarify, that register 1-9 will always be shifted
2024-08-15 11:50:38 +08:00
zeertzjq
ca6f8ee267 vim-patch:ecd642a: runtime(doc): clarify, that register 1-9 will always be shifted (#29476)
related: vim/vim#15077

ecd642af43

Co-authored-by: Christian Brabandt <cb@256bit.org>
(cherry picked from commit 1922f7e32b)
2024-08-15 03:24:31 +00:00
zeertzjq
e4492677ee
Merge pull request #30031 from neovim/backport-29895-to-release-0.10
fix(win-msi): set installer scope to machine
2024-08-13 07:08:26 +08:00
Alexander Mnich
1f58e27600 fix(win-msi): set installer scope to machine #29895
Problem:
The windows installer did not have the AllUsers property which leads to
the installer being misidentified as per user installer.
Currently the installer already requires administrative privileges and
installs into the system-wide ProgramFiles directory, but the start menu
entry and uninstaller registration are created only for the current user.
Issue: #29885

https://cmake.org/cmake/help/latest/cpack_gen/wix.html#variable:CPACK_WIX_INSTALL_SCOPE

Solution:
With setting CPACK_WIX_INSTALL_SCOPE to "perMachine" the generated msi
installer includes the Property ALLUSERS=1.
Additionally the start menu entries and uninstaller registration will be
created for all users.

(cherry picked from commit 88f07d6ca4)
2024-08-12 22:48:24 +00:00
zeertzjq
b0bac2a339
Merge pull request #30021 from neovim/backport-30020-to-release-0.10
vim-patch:9.1.0667: Some other options reset curswant unnecessarily when set
2024-08-10 16:28:03 +08:00
zeertzjq
9f8a5cd022 vim-patch:9.1.0667: Some other options reset curswant unnecessarily when set (#30020)
Problem:  Some other options reset curswant unnecessarily when set.
          (Andrew Haust)
Solution: Don't reset curswant when setting 'comments', 'commentstring'
          or 'define' (zeertzjq)

fixes: vim/vim#15462
closes: vim/vim#15467

b026a293b1
(cherry picked from commit 0ec43cb4b5)
2024-08-10 08:05:47 +00:00
zeertzjq
4552a9629a
Merge pull request #30019 from neovim/backport-30018-to-release-0.10
vim-patch:9.1.0666: assert_equal() doesn't show multibyte string correctly
2024-08-10 06:59:18 +08:00
zeertzjq
eec37b6e6b vim-patch:9.1.0666: assert_equal() doesn't show multibyte string correctly (#30018)
Problem:  assert_equal() doesn't show multibyte string correctly
Solution: Properly advance over a multibyte char.
          (zeertzjq)

closes: vim/vim#15456

9c4b2462bb
(cherry picked from commit 4e8efe002e)
2024-08-09 22:36:10 +00:00
Grzegorz Rozdzialik
339067ab7e fix(lsp): avoid reusing diagnostics from different servers in actions (#30002)
Problem: When preparing the parameters for a code actions LSP request,
the code set `context.diagnostics` when processing the first LSP client,
and then reused those `context.diagnostics` for subsequent LSP clients.

This meant that the second and next LSP clients got diagnostics that
did not originate from them, and they did not get the diagnostics that
they sent.

Solution: Avoid setting `context.diagnostics` (which is referenced by
all clients). Instead, set `params.context.diagnostics` directly, which
is specific to a single client.

Fixes #30001
Caused by #29501

(cherry picked from commit 7031949be0)
2024-08-07 18:09:27 +02:00
Gregory Anders
ee57bb5a8e fix(tui): reset active attr ID when OSC 8 sequence is terminated (#29960)
When the cursor is moved we terminate any active OSC 8 sequences to
prevent the sequence from inadvertently spanning regions it is not meant
to span. However, if we do not also reset the TUI's active attr id
(print_attr_id) then the TUI does not "know" that it's current attribute
set has changed. When cursor_goto is called to wrap a line, the TUI does
not recompute the attributes so the OSC 8 sequence is not restarted
again.

When we terminate an OSC 8 sequence before moving the cursor, also reset
the active attr id so that the attributes are recomputed for URLs.

(cherry picked from commit f32557ca67)
2024-08-03 16:02:48 +02:00
zeertzjq
dd0f6afa00
Merge pull request #29968 from neovim/backport-29967-to-release-0.10
vim-patch:9.1.{0648,0653}
2024-08-03 09:10:04 +08:00
zeertzjq
2e1f656eb7 vim-patch:9.1.0653: Patch v9.1.0648 not completely right
Problem:  Patch v9.1.0648 not completely right
          (zeertzjq)
Solution: Remove always true condition

closes: vim/vim#15415

a0b5bc1285

Co-authored-by: Christian Brabandt <cb@256bit.org>
(cherry picked from commit 4c886d0e73)
2024-08-03 00:46:14 +00:00
zeertzjq
05e72488b9 vim-patch:9.1.0648: [security] double-free in dialog_changed()
Problem:  [security] double-free in dialog_changed()
          (SuyueGuo)
Solution: Only clear pointer b_sfname pointer, if it is different
          than the b_ffname pointer.  Don't try to free b_fname,
          set it to NULL instead.

fixes: vim/vim#15403

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-46pw-v7qw-xc2f

b29f4abcd4

Co-authored-by: Christian Brabandt <cb@256bit.org>
(cherry picked from commit 6967c08840)
2024-08-03 00:46:14 +00:00
zeertzjq
187c93d7e5
Merge pull request #29965 from neovim/backport-29964-to-release-0.10
refactor: move some functions out of eval.c
2024-08-03 08:05:29 +08:00
zeertzjq
6aba2f3944 refactor: move some functions out of eval.c (#29964)
- common_function() has always been in evalfunc.c in Vim
- return_register() has always been in evalfunc.c in Vim
- get_user_input() was moved to ex_getln.c in Vim 8.1.1957
- tv_get_lnum_buf() was moved to typval.c in Vim 8.2.0847

(cherry picked from commit 383f693472)
2024-08-02 23:43:10 +00:00
Riley Bruins
21157459fe fix(diagnostics): don't apply extmarks to invalid lines #29321
Problem:
If there are errors in the last line of a buffer, something like `Gdk` or
`G2k3J` will produce an error (at least with `lua_ls`):

    Error executing vim.schedule lua callback:
    .../neovim/share/nvim/runtime/lua/vim/diagnostic.lua:1446: Invalid 'line': out of range

Solution:
Only set extmarks if the target buffer line still exists

(cherry picked from commit e5e81262af)
2024-08-02 16:04:35 +02:00
Mathias Fußenegger
5955ef0ba8 fix(lsp): don't send foreign diagnostics to servers in buf.code_action (#29501)
`buf.code_action` always included diagnostics on a given line from all
clients. Servers should only receive diagnostics they published, and in
the exact same format they sent it.

Should fix https://github.com/neovim/neovim/issues/29500

(cherry picked from commit 720b309c78)
2024-08-02 12:59:41 +02:00
zeertzjq
3af1495af0
Merge pull request #29947 from neovim/backport-29945-to-release-0.10
vim-patch:9.0.{2149,2158},9.1.0647
2024-08-02 08:39:30 +08:00
zeertzjq
1fda01fa55 vim-patch:9.1.0647: [security] use-after-free in tagstack_clear_entry
Problem:  [security] use-after-free in tagstack_clear_entry
          (Suyue Guo )
Solution: Instead of manually calling vim_free() on each of the tagstack
          entries, let's use tagstack_clear_entry(), which will
          also free the stack, but using the VIM_CLEAR macro,
          which prevents a use-after-free by setting those pointers
          to NULL

This addresses CVE-2024-41957

Github advisory:
https://github.com/vim/vim/security/advisories/GHSA-f9cr-gv85-hcr4

8a0bbe7b8a

Co-authored-by: Christian Brabandt <cb@256bit.org>
(cherry picked from commit 6af359ef4c)
2024-08-02 08:16:53 +08:00
zeertzjq
771b3a52c5 vim-patch:9.0.2158: [security]: use-after-free in check_argument_type
Problem:  [security]: use-after-free in check_argument_type
Solution: Reset function type pointer when freeing the function type
          list

function pointer fp->uf_func_type may point to the same memory, that was
allocated for fp->uf_type_list. However, when cleaning up a function
definition (e.g. because it was invalid), fp->uf_type_list will be
freed, but fp->uf_func_type may still point to the same (now) invalid
memory address.

So when freeing the fp->uf_type_list, check if fp->func_type points to
any of those types and if it does, reset the fp->uf_func_type pointer to
the t_func_any (default) type pointer

closes: vim/vim#13652

0f28791b21

Co-authored-by: Christian Brabandt <cb@256bit.org>
(cherry picked from commit a4bec30b7b)
2024-08-01 23:36:57 +00:00
zeertzjq
7550947157 vim-patch:9.0.2149: [security]: use-after-free in exec_instructions()
Problem:  [security]: use-after-free in exec_instructions()
Solution: get tv pointer again

[security]: use-after-free in exec_instructions()

exec_instructions may access freed memory, if the GA_GROWS_FAILS()
re-allocates memory. When this happens, the typval tv may still point to
now already freed memory. So let's get that pointer again and compare it
with tv. If those two pointers differ, tv is now invalid and we have to
refresh the tv pointer.

closes: vim/vim#13621

5dd41d4b63

Co-authored-by: Christian Brabandt <cb@256bit.org>
(cherry picked from commit 9f2d793068)
2024-08-01 23:36:57 +00:00
zeertzjq
c43dd3ef6f
Merge pull request #29908 from neovim/backport-29907-to-release-0.10
vim-patch:9.1.0638: E1510 may happen when formatting a message for smsg()
2024-07-30 06:49:21 +08:00
zeertzjq
a0a95edb2d vim-patch:9.1.0638: E1510 may happen when formatting a message for smsg() (#29907)
Problem:  E1510 may happen when formatting a message
          (after 9.1.0181).
Solution: Only give E1510 when using typval. (zeertzjq)

closes: vim/vim#15391

0dff31576a
(cherry picked from commit d131c48c82)
2024-07-29 22:26:31 +00:00
Christian Clason
c2625b6fad docs(treesitter): don't quote metadata
(cherry picked from commit 5aa1a9532c)
2024-07-28 16:36:22 +02:00
Christian Clason
ad393c1fc1 fix(runtime): sync bundled treesitter queries
(cherry picked from commit 9e80738f30)
2024-07-28 16:36:22 +02:00
Maria José Solano
4ad864dd09 fix(version): return nil with empty string
(cherry picked from commit 8bdfc2ab2b)
2024-07-27 15:30:53 +02:00
neovim-backports[bot]
bce2364f60
fix(tui): set id parameter in OSC 8 sequences (#29847)
The id parameter is used to communicate to the terminal that two URLs
are the same. Without an id, the terminal must rely on heuristics to
determine which cells belong together to make a single hyperlink.

See the relevant section in the spec [1] for more details.

[1]: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda#hover-underlining-and-the-id-parameter

(cherry picked from commit b02c839414)
2024-07-24 15:18:47 -05:00
Abao Zhang
006fd0304c fix(health): fix pyenv root and python exepath detect issue
Fix the following two issues:

- pyenv root detection issue

When `PYENV_ROOT` environment variable is not set, neovim will detect
pyenv's root via `pyenv root` command, but which will be always fail
because `vim.fn.system()` returns result with additional `\n`. Using
`vim.system` instead prevents this problem. to trim it before check
whether it is exists

- python executable path detection issue

Filter unrelated `python-config` in cases where multiple python versions
are installed, e.g. `python-config`, `python3.10-config`,
`python3.11-config` etc.

(cherry picked from commit b4b4cf46a7)
2024-07-24 17:15:09 +02:00
Christian Clason
7e15526dd2 fix(runtime): sync bundled treesitter queries
(cherry picked from commit 862338255d)
2024-07-24 17:02:12 +02:00
bfredl
85ac560947 version bump 2024-07-24 09:23:38 +02:00