Commit Graph

29872 Commits

Author SHA1 Message Date
Justin M. Keyes
017a054e82
Merge pull request #30393 from justinmk/release
backport: vim.ui.open fixes
2024-09-16 03:27:47 -07:00
Yi Ming
d63d379eec fix(vim.ui.open): prefer xdg-open on WSL #30302
xdg-open is usually not installed in WSL. But if the user deliberately
installs it, presumably they want to prioritize it.
2024-09-16 12:04:01 +02:00
Aaron
fa4bd6994d fix(lua): ignore stdout and stderr for xdg-open
Ref #19724
Fix #29932
2024-09-16 12:03:49 +02:00
zeertzjq
4abd480e8f vim-patch:9.1.0730: Crash with cursor-screenline and narrow window
Problem:  Crash with cursor-screenline and narrow window
          (elig0n)
Solution: Don't set right_col when width2 is 0 (zeertzjq).

fixes: vim/vim#15677
closes: vim/vim#15678

59149f0269
(cherry picked from commit 5191a11d66)
2024-09-14 12:17:48 +00:00
zeertzjq
b4824edac1 vim-patch:9.1.0729: Wrong cursor-screenline when resizing window
Problem:  Wrong cursor-screenline when resizing window
Solution: Invalidate saved left_col and right_col when width1 or width2
          change.

closes: vim/vim#15679

86dc4f8b43
(cherry picked from commit 90585e47fe)
2024-09-14 12:17:48 +00:00
zeertzjq
e464b8c90d
Merge pull request #30380 from zeertzjq/backport
Manual backport of #30377 to release-0.10
2024-09-14 20:04:10 +08:00
zeertzjq
260ac4b3a2 vim-patch:9.1.0728: [security]: heap-use-after-free in garbage collection with location list user data
Problem:  heap-use-after-free in garbage collection with location list
          user data.
Solution: Mark user data as in use when no other window is referencing
          the location list (zeertzjq)

fixes: neovim/neovim#30371
closes: vim/vim#15683

be4bd189d2
2024-09-14 19:35:17 +08:00
dundargoc
d585f3103d ci: skip automerge step if backport failed
(cherry picked from commit 67d6b6f27e)
2024-09-14 00:18:58 +00:00
Mathias Fussenegger
f3675337f0 fix(lsp): handle nil bytes in strings
Problem:

The LSP omnifunc can insert nil bytes, which when read in other places
(like semantic token) could cause an error:

    semantic_tokens.lua:304: Vim:E976: Using a Blob as a String

Solution:

Use `#line` instead of `vim.fn.strlen(line)`. Both return UTF-8 bytes
but the latter can't handle nil bytes.

Completion candidates can currently insert nil bytes, if other parts of
Alternative fix to https://github.com/neovim/neovim/pull/30359

Note that https://github.com/neovim/neovim/pull/30315 will avoid the
insertion of nil bytes from the LSP omnifunc, but the change of this PR
can more easily be backported.

(cherry picked from commit 8512f669f0)
2024-09-13 20:59:13 +00:00
dundargoc
b020b66005 ci: add needs:backport label on backport PRs with conflict
This makes it easy to keep track of which backport PRs have failed and
need manual intervention to fix.

(cherry picked from commit 4c23b83456)
2024-09-13 15:16:35 +00:00
dundargoc
6f34f07a31 ci: enable automerge by default when backporting
This will automatically merge backported PRs without human intervention
if the tests pass.

(cherry picked from commit 057314345a)
2024-09-13 10:57:22 +00:00
zeertzjq
23a9c67f1b
Merge pull request #30344 from tris203/backport-30342-to-release-0.10
fix(health): "test_plug/health/init.lua" completes "test_plug"
2024-09-12 10:31:43 +08:00
Justin M. Keyes
61b0816790
test(health): "test_plug/health/init.lua" completes as "test_plug"
(cherry picked from commit 7b680e0ca9)
2024-09-11 16:07:29 +01:00
monkoose
1e1e4066b1
fix(health): return correct name from 'path2name()'
`path2name()` function doesn't process `'pluginname/health/init.lua'` correctly. Instead of retruning `'pluginname'` it returns `'pluginname.health'`

(cherry picked from commit 237d2aef4d)
2024-09-11 14:36:22 +01:00
LosFarmosCTL
ef05c514aa fix(runtime): add remaining missing commentstrings (#30252)
(cherry picked from commit 9ddfcb64bf)
2024-09-10 09:51:05 +02:00
tris203
e13564b9f4 fix(lsp): handle encoding bounds in str_utfindex_enc
Problem:
str_utfindex_enc could return an error if the index was longer than the
line length. This was handled in each of the calls to it individually

Solution:
* Fix the call at the source level so that if the index is higher than
  the line length, utf length is returned

(cherry picked from commit f279d1ae33)
2024-09-10 09:49:25 +02:00
Tristan Knight
b55435f438 fix(lsp): handle out-of-bounds character positions #30288
Problem:
str_byteindex_enc could return an error if the index was longer than the
lline length. This was handled in each of the calls to it individually

Solution:
* Fix the call at the source level so that if the index is higher than
  the line length, line length is returned as per LSP specification
* Remove pcalls on str_byteindex_enc calls. No longer needed now that
  str_byteindex_enc has a bounds check.
2024-09-08 21:01:58 +02:00
zeertzjq
461ed5e6bd
Merge pull request #30303 from neovim/backport-30300-to-release-0.10
vim-patch:b584117: runtime(doc): buffers can be re-used
2024-09-08 06:03:38 +08:00
zeertzjq
8611f4dcf0 vim-patch:b584117: runtime(doc): buffers can be re-used (#30300)
while at it, also move the note about :wincmd
directly to :h :wincmd, it doesn't seem to belong to the buffer section.

closes: vim/vim#15636

b584117b05

Co-authored-by: Christian Brabandt <cb@256bit.org>
(cherry picked from commit b40ec083ae)
2024-09-07 21:42:02 +00:00
Luuk van Baal
95c3fd4dc0 fix(decor): exclude invalid marks from meta total
Problem:  Marktree meta count still includes invalidated marks, making
          guards that check the meta total ineffective.
Solution: Revise marktree metadata when in/revalidating a mark.
2024-09-06 14:20:46 +02:00
zeertzjq
59d3d76b79
Merge pull request #30276 from neovim/backport-30274-to-release-0.10
vim-patch:9.1.0716: resetting setcellwidth() doesn't update the screen
2024-09-06 07:32:52 +08:00
zeertzjq
886a8b62c5 vim-patch:9.1.0716: resetting setcellwidth() doesn't update the screen (#30274)
Problem:  resetting setcellwidth() doesn't update the screen
Solution: Redraw after clearing the cellwidth table (Ken Takata)

closes: vim/vim#15628

539e9b571a

Co-authored-by: Ken Takata <kentkt@csc.jp>
(cherry picked from commit d60c753cff)
2024-09-05 22:52:31 +00:00
vanaigr
26b72b0f91 fix(api): nvim_buf_get_text() crashes with large negative column #28740
Problem:
crash when calling nvim_buf_get_text() with a large negative start_col:

    call nvim_buf_get_text(0, 0, -123456789, 0, 0, {})

Solution:
clamp start_col after subtracting it from the line length.

(cherry picked from commit d1d7d54680)
2024-09-03 15:30:37 +02:00
zeertzjq
1fe8dc4d2c
Merge pull request #30211 from neovim/backport-30209-to-release-0.10
fix(completion): don't include <Lua function> in -complete=
2024-09-01 08:26:33 +08:00
zeertzjq
5cb3505ab8 fix(completion): don't include <Lua function> in -complete= (#30209)
(cherry picked from commit bfa365a872)
2024-08-31 23:58:51 +00:00
zeertzjq
0f6f5c4682
Merge pull request #30210 from neovim/backport-30207-to-release-0.10
vim-patch: doc updates
2024-09-01 07:56:44 +08:00
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