Commit Graph

31552 Commits

Author SHA1 Message Date
6a425e7045 docs: misc
Co-authored-by: Axel <axelhjq@gmail.com>
Co-authored-by: Colin Kennedy <colinvfx@gmail.com>
Co-authored-by: Daiki Noda <sys9kdr@users.noreply.github.com>
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: Jean-Jacq du Plessis <1030058+jj-du-plessis@users.noreply.github.com>
Co-authored-by: Juan Giordana <juangiordana@gmail.com>
Co-authored-by: Lincoln Wallace <locnnil0@gmail.com>
Co-authored-by: Matti Hellström <hellstrom@scm.com>
Co-authored-by: Steven Locorotondo <steven.locorotondo@justeattakeaway.com>
Co-authored-by: Yochem van Rosmalen <git@yochem.nl>
Co-authored-by: glepnir <glephunter@gmail.com>
Co-authored-by: ifish <fishioon@live.com>
2025-01-11 10:34:12 +01:00
c060a6ea64 vim-patch:9.1.1001: ComplMatchIns highlight hard to read on light background (#31958)
Problem:  ComplMatchIns highlight hard to read on light background
          (after v9.1.0996)
Solution: define the highlighting group cleared, it should be configured in
          colorschemes separately (glepnir)

closes: vim/vim#16414

ad409876d9

Co-authored-by: glepnir <glephunter@gmail.com>
2025-01-11 09:08:01 +08:00
df45b336f5 vim-patch:695522d: runtime(vim): Update base-syntax, highlight literal string quote escape (#31957)
Match the '' escape sequence in literal strings.  These were previously
ending the current string and starting another concatenated literal
string.

closes: vim/vim#16415

695522dea3

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-01-11 08:27:50 +08:00
fbe546e25d vim-patch:9.1.0996: ComplMatchIns may highlight wrong text (#31931)
Problem:  ComplMatchIns may highlight wrong text
Solution: don't highlight in case of fuzzy match,
          skip-highlight when not inserting anything
          (glepnir)

closes: vim/vim#16404

e890887b80
2025-01-10 23:58:45 +00:00
dcaf9a60e9 vim-patch:51754c8: runtime(editorconfig): set omnifunc to syntaxcomplete func
closes: vim/vim#16419

51754c8a49

Co-authored-by: Yochem van Rosmalen <git@yochem.nl>
2025-01-11 00:44:06 +01:00
aa2b44fbb0 fix(treesitter): don't return error message on success #31955
Problem:
The `vim.treesitter.language.add` function returns
a error message even when it succeeds.

Solution:
Don't return error message on success.
2025-01-10 14:46:19 -08:00
37c77ab46b fix(messages): attaching/detaching ext_messages causes asserts #31952
Problem:  Assert hit related to message kind, which is reset after a
          ext_messages UI is forcibly detached, so the assertion is
          expectedly false. Assert hit related to message grid variables
          after an ext_messages UI attaches while message grid is scrolled.
Solution: Don't check message kind assertion if no ext_messages UI is
          attached. Flush message grid when first/last ext_messages UI
          attaches/detaches.
2025-01-10 14:43:45 -08:00
cb02c20569 refactor(treesitter.foldexpr): remove unused parse_injections parameter 2025-01-10 22:06:35 +00:00
0717dfbfaf refactor(api): deprecate nvim_notify #31938
Problem:
The `nvim_notify` API (note: unrelated to `vim.notify()` Lua API) was
not given any real motivation in https://github.com/neovim/neovim/pull/13843

There are, and were, idiomatic and ergonomic alternatives already.

Solution:
Deprecate `nvim_notify`.
2025-01-10 11:42:04 -08:00
b06f42b502 vim-patch:df4a7d7: runtime(tiasm): use correct syntax name tiasm in syntax script (#31942)
vim-patch:df4a7d7: runtime(tiasm):  use correct syntax name tiasm in syntax script

closes: vim/vim#16416

df4a7d7617

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2025-01-10 17:17:34 +08:00
87610d82db fix(decor): set invalid flag for end of invalidated paired marks 2025-01-10 08:14:38 +01:00
a37784ad83 vim-patch:9.1.1000: tests: ruby tests fail with Ruby 3.4 (#31940)
Problem:  tests: ruby tests fail with Ruby 3.4
Solution: adjust expected output for Ruby 3.4
          (Yee Cheng Chin)

Vim's Ruby tests relied on explicit matching of output texts which are
fragile in design. Ruby 3.4 has changed the output slightly (using
'name' instead of `name', and also using more spaces in dictionary
printouts). Modify the Vim tests to be less fragile to such changes.

closes: vim/vim#16411

ebea31e454

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-01-10 08:04:02 +08:00
846a2019c0 vim-patch:9.1.0999: Vim9: leaking finished exception (#31939)
Problem:  leaking finished exception
          (after v9.1.0984)
Solution: use finish_exception to clean up caught exceptions
          (Yee Cheng Chin)

In Vimscript, v:exception/throwpoint/stacktrace are supposed to reflect
the currently caught exception, and be popped after the exception is
finished (via endtry, finally, or a thrown exception inside catch).
Vim9script does not handle this properly, and leaks them instead. This
is clearly visible when launching GVim with menu enabled.  A caught
exception inside the s:BMShow() in menu.vim would show up when querying
`v:stacktrace` even though the exception was already caught and handled.

To fix this, just use the same functionality as Vimscript by calling
`finish_exception` to properly restore the states. Note that this
assumes `current_exception` is always the same as `caught_stack` which
believe should be the case.

Added tests for this. Also fix up test_stacktrace to properly test the
stack restore behavior where we have nested exceptions in catch blocks
and to also test the vim9script functionality properly.

- Also, remove its dependency on explicitly checking a line number in
  runtest.vim which is a very fragile way to write tests as any minor
  change in runtest.vim (shared among all tests) would require changing
  test_stacktrace.vim. We don't actually need such granularity in the
  test.

closes: vim/vim#16413

2051af1642

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-01-10 08:03:44 +08:00
7c00e0efbb docs: misc #31867 2025-01-09 09:26:45 -08:00
0c296ab224 feat(docs): "yxx" runs Lua/Vimscript code examples #31904
`yxx` in Normal mode over a Lua or Vimscript code block section will execute the code.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-01-09 08:36:16 -08:00
1e47aa677a fix(api): deprecated API nvim_get_option does not validate option name #31919
Problem:
Deprecated API `nvim_get_option()` doesn't validate the option name,
which leads to an assertion failure.

Solution:
Validate option name in `nvim_get_option()`.

Ref: #31894
2025-01-09 07:32:27 -08:00
5135a23219 Merge #31900 from luukvbaal/nvim_echo 2025-01-09 06:36:29 -08:00
dcaf8bef08 Merge pull request #31844 from bfredl/iter_crash
fix(decoration): fix crash when on_lines decor provider modifies marktree
2025-01-09 13:37:28 +01:00
5c92b40b4b feat(api): deprecate nvim_out/err_write(ln) 2025-01-09 13:35:42 +01:00
ead5683ff9 feat(api): add err field to nvim_echo() opts
Problem:  We want to deprecate `nvim_err_write(ln)()` but there is no
          obvious replacement (from Lua). Meanwhile we already have
          `nvim_echo()` with an `opts` argument.
Solution: Add `err` argument to `nvim_echo()` that directly maps to
          `:echoerr`.
2025-01-09 13:35:40 +01:00
6dd7fcaafd Merge pull request #31898 from bfredl/termbomb
fix(terminal): don't crash on unprintable chars
2025-01-09 13:35:25 +01:00
f8c8a245aa fix(terminal): don't crash on unprintable chars
fixes #31897
2025-01-09 11:22:00 +01:00
33ff546b50 fix(decoration): fix crash when on_lines decor provider modifies marktree
If a "on_lines" callback changes the structure of the marktree, the
iterator (which is used for an entire window viewport) might now
point to invalid memory. Restore the iterator to the beginning of the
line in this case.

fixes #29484
2025-01-09 11:17:42 +01:00
3f0adf90de vim-patch:9.1.0998: filetype: TI assembly files are not recognized (#31929)
Problem:  filetype: TI assembly files are not recognized
Solution: inspect '*.sa' and assembly files and detect TI assembly
          files, include filetype plugin and syntax script for TI
          assembly files (Wu, Zhenyu)

closes: vim/vim#15827

4f73c07abf

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2025-01-09 17:30:26 +08:00
d740a4274d vim-patch:8ab1819: runtime(xf86conf): add section name OutputClass to syntax script
References:
https://man.archlinux.org/man/xorg.conf.5#DESCRIPTION

closes: vim/vim#16397

8ab1819df6

Co-authored-by: Jan-Arvid Harrach <jharrach@tutanota.com>
2025-01-09 08:07:30 +01:00
5f85e78db3 vim-patch:9.1.0997: too many strlen() calls in drawscreen.c (#31927)
Problem:  too many strlen() calls in drawscreen.c
Solution: refactor drawscreen.c and remove calls to strlen(),
          make get_keymap_str() (in screen.c) return string length
          instead of TRUE/FALSE (John Marriott).

a21240b97d

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-01-09 12:49:45 +08:00
19c9572d36 Revert "refactor(options): set option value for non-current context directly" (#31924)
Reverts #31112
2025-01-09 12:32:25 +08:00
822313e42b vim-patch:partial:9.1.0882: too many strlen() calls in insexpand.c (#31490)
Problem:  too many strlen() calls in insexpand.c
Solution: Refactor insexpand.c and reduce number of calls to STRLEN(),
          fix a warning get_next_filename_completion(), add new function
          ins_compl_leader_len() (John Marriott)

closes: vim/vim#16095

5e6ea92b2c

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-01-09 08:59:59 +08:00
0d469b697e vim-patch:1718e7d: runtime(vim): Update base-syntax, improve ex-bang matching (#31922)
Always match ex-bang explicitly rather than incidentally as the ! operator.

fixes: vim/vim#16221
closes: vim/vim#16410

1718e7d07e

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-01-09 00:40:50 +00:00
c4b658fed8 Merge pull request #31112 from famiu/refactor/options/set_option_for
refactor(options): set option value for non-current context directly
2025-01-08 17:56:21 +00:00
17b46d01e2 test(treesitter): inspect_tree #31182
To prevent #30986 and #31198 regression update inspect_tree tests
2025-01-08 05:06:09 -08:00
5b9518b436 fix(api): nvim_set_decoration_provider callback return type #31912
Problem: incorrect return type doc causes luals `Annotations specify that at most 0 return value(s) are required, found 1 returned here instead.` diagnosis

Solution: correct return type doc
2025-01-08 04:37:29 -08:00
561580aba5 vim-patch:9.1.0995: filetype: shaderslang files are not detected
Problem:  filetype: shaderslang files are not detected
Solution: detect '*.slang' files as shaderslang filetype,
          include a filetype and syntax script (mtvare6)

Reference:
https://shader-slang.com/

closes: vim/vim#16387

616219f684

Co-authored-by: mtvare6 <mtvare6@proton.me>
2025-01-08 10:32:45 +01:00
141114c170 fix(api): crash on invalid buffer to nvim_buf_del_user_command (#31908) 2025-01-08 05:16:41 +00:00
6719276040 fix(highlight): make TablineSel more noticeable with 'notermguicolors' #31905
Problem: Linking `TablineSel` to `Normal` makes it more noticeable with
`notermguicolors` but less so with `termguicolors` (compared to using
bold text in both cases).

Solution: use bold text with `termguicolors` and regular with
`notermguicolors`.
2025-01-07 14:02:35 -08:00
b12b91c274 feat(health): show :checkhealth in floating window #31086
Problem: health can not shown in a floating window
Solution: add g:health variable
2025-01-07 08:09:01 -08:00
d9ee0d2984 perf(treesitter): don't fetch parser for each fold line
**Problem:** The treesitter `foldexpr` calls `get_parser()` for each
line in the buffer when calculating folds. This can be incredibly slow
for buffers where a parser cannot be found (because the result is not
cached), and exponentially more so when the user has many
`runtimepath`s.

**Solution:** Only fetch the parser when it is needed; that is, only
when initializing fold data for a buffer.

Co-authored-by: Jongwook Choi <wookayin@gmail.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-01-07 16:43:45 +01:00
b67fcd0488 fix(highlight): make TablineSel more noticeable #31896
The default `TablineSel` highlighting makes it subjectively difficult to
differentiate the selected tab from unselected ones.
2025-01-07 04:21:15 -08:00
d8bc08db7f refactor: adopt vterm
We have changed too much to consider it a mere bundled dependency (such
as unicode handling in e3bfcf2fd4), and
can consider it our own at this point.
2025-01-07 12:35:24 +01:00
4d94059919 vim-patch:3159b64: runtime(sh): fix typo in Last Change header
related: vim/vim#16394

3159b6494e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-01-07 08:03:13 +01:00
b44a8ba1e7 vim-patch:cf1f555: runtime(sh): add PS0 to bashSpecialVariables in syntax script
PS0 is also a special prompt variable. (It is expanded and displayed
after it reads a command but before executing it.)

References:
https://www.gnu.org/software/bash/manual/html_node/Interactive-Shell-Behavior.html

closes: vim/vim#16394

cf1f55548d

Co-authored-by: Jon Parise <jon@indelible.org>
2025-01-07 08:03:13 +01:00
a942dea157 vim-patch:7ceaa8f: runtime(vim): Remove trailing comma from match_words
fixes: vim/vim#16377 (`filetype plugin indent on` breaks matchit).
closes: vim/vim#16389

7ceaa8f3dd

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-01-07 08:03:13 +01:00
e27f7125d6 Merge pull request #31893 from zeertzjq/vim-9.1.0984
vim-patch:9.1.{0984,0991}: getstacktrace(), v:stacktrace
2025-01-07 09:42:17 +08:00
8fa4306eb9 vim-patch:9.1.0991: v:stacktrace has wrong type in Vim9 script
Problem:  v:stacktrace has wrong type in Vim9 script.
Solution: Change the type to t_list_dict_any.  Fix grammar in docs.
          (zeertzjq)

closes: vim/vim#16390

6655bef330
2025-01-07 09:15:10 +08:00
d5308637bf vim-patch:9.1.0984: exception handling can be improved
Problem:  exception handling can be improved
Solution: add v:stacktrace and getstacktrace()

closes: vim/vim#16360

663d18d610

Co-authored-by: ichizok <gclient.gaap@gmail.com>
Co-authored-by: Naruhiko Nishino <naru123456789@gmail.com>
2025-01-07 09:15:10 +08:00
06ff5480ce vim-patch:9.1.0993: New 'cmdheight' behavior may be surprising #31892
Problem:  Although patch 9.1.0990 fixed a real problem/inconsistency,
          it also introduced new behavior that may break BWC and/or be
          unexpected. Before 9.1.0990, window commands could make the
          topframe smaller (without changing 'cmdheight'; quirk that is
          now fixed), but did not allow extending the topframe beyond
          the 'cmdheight' set by the user. After 9.1.0990, the user can
          reduce the 'cmdheight' below the value they set explicitly,
          through window commands, which may lead to confusion.
          (aftere v9.1.0990)
Solution: Store the value explicitly set by the user and clamp the
          'cmdheight' when resizing the topframe. This also applies to
          dragging laststatus, which in contrast to window commands
          _did_ allow reducing the 'cmdheight' to values below the one
          set by the user. So with this patch there is still new
          behavior, but I think in a way that is less surprising.
          While at it, also fix a Coverity warning, introduced in
          v9.1.0990 (Luuk van Baal)

c97e869535
2025-01-06 17:00:09 -08:00
30de00687b refactor(treesitter): simplify condition #31889 2025-01-06 16:56:53 -08:00
b6ab294838 fix: fix incorrect search code 2025-01-06 20:03:17 +00:00
3d9fb975b9 Merge #31625 perf(decor): improve iter_captures() cache 2025-01-06 07:09:34 -08:00
86770108e2 fix(lsp): open_floating_preview() zindex relative to current window #31886
Problem:  open_floating_preview() may be hidden behind current window if
          that is floating and has a higher zindex.
Solution: Open floating preview with zindex higher than current window.
2025-01-06 06:05:50 -08:00