Commit Graph

31866 Commits

Author SHA1 Message Date
Sean Dewar
f3ce67549c fix(terminal): avoid more busy_start lacking busy_stop (#32509)
Problem: after #32458, it may still be possible for `busy_start` UI events to be
emitted without matching `busy_stop`s in the terminal.

Solution: do `terminal_enter`'s cursor visibility check immediately after
setting/restoring State so it occurs before events. This ensures that if pending
escape sequences are processed while in `terminal_enter`, the cursor's initial
visibility is set before `is_focused` is checked by `term_settermprop`.

As a result, we can move the call to `showmode` back to where it was originally.
2025-02-19 10:47:44 +00:00
zeertzjq
a3eb49f638 vim-patch:9.1.1122: too many strlen() calls in findfile.c (#32516)
Problem:  too many strlen() calls in findfile.c
Solution: refactor findfile.c and remove calls to strlen()
          (John Marriott)

closes: vim/vim#16595

d6e3c9048d

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-02-19 17:14:38 +08:00
zeertzjq
9005134cdc vim-patch:9.0.0532: edit test is flaky when run under valgrind (#32518)
Problem:    Edit test is flaky when run under valgrind.
Solution:   Send some text to the terminal to trigger a redraw.

14f91765c0

Cherry-pick Test_edit_shift_bs() from patch 8.2.4876.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-02-19 06:32:45 +00:00
zeertzjq
5d03060743 test(lua/hl_spec): fix hang on exit with ASAN (#32508) 2025-02-18 21:22:46 +08:00
Christian Clason
4c2d14a370 build(deps): bump tree-sitter to v0.25.2 2025-02-18 10:41:11 +01:00
zeertzjq
4a2a54f993 vim-patch:5647c91: runtime(doc): add reference to extendnew() at extend() (#32500)
related: vim/vim#16607

5647c91355

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-02-17 22:59:34 +00:00
Sören Tempel
639734bed4 fix(tests): remove the __extension__ keyword in filter_complex_blocks (#32483)
Problem: This keyword is used by GCC and Clang to prevent -Wpedantic
(and other options) from emitting warnings for many GNU C extensions.
This is used heavily in Alpine Linux through musl libc and
foritfy-headers. Without filtering the __extension__ keyword some type
definitions are duplicated. For example, timeval is defined once as

  struct timeval { time_t tv_sec; suseconds_t tv_usec; };

and once as:

  __extension__ struct timeval { time_t tv_sec; suseconds_t tv_usec; };

Without this patch, the LuaJIT C parser doesn't recognize that these
definitions are equivalent, causing unit test to fail on Alpine Linux.

Solution: Filter out the keyword in filter_complex_blocks.
2025-02-18 06:43:48 +08:00
Riley Bruins
1827ab7a1f fix(treesitter): separately track the number of valid regions
We need to add a separate variable to keep track of this information,
since we cannot read the length of the valid regions table itself, since
it has holes.
2025-02-17 15:13:26 +00:00
Justin M. Keyes
b360c06085 refactor(channel): eliminate special case in on_proc_exit() #32485
Problem:
on_proc_exit() has a special-case that assumes that the UI client will
never spawn more than 1 child process.

Solution:
If the Nvim server exits, the stream EOF will trigger `rpc_close()` in
the UI client, so we don't need the special case in `on_proc_exit`.
Pass `Channel.exit_status` from `rpc_close()` so that the correct exit
code is reflected.
2025-02-17 02:26:19 -08:00
dundargoc
bd0a65bc15 docs: misc (#32258)
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: Julian Visser <12615757+justmejulian@users.noreply.github.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-02-17 10:33:20 +08:00
zeertzjq
5e7801329f test(lua/hl_spec): reduce flakiness (#32489) 2025-02-17 10:32:35 +08:00
zeertzjq
bfd59c955f test: reduce flakiness in highlight tests (#32488) 2025-02-17 01:45:53 +00:00
zeertzjq
9d699e2005 vim-patch:68ba6c2: runtime(vim): Update base-syntax, improve performance (#32487)
Contain the vimNotation syntax group, matching this at top level is
unnecessary and very slow.

The removed vimString and vimNumber definitions are broken and/or never
match. They have long been replaced by newer definitions.

closes: vim/vim#16645

68ba6c2c6c

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-02-17 08:00:33 +08:00
phanium
a75b09019f docs: stdpath() type #32480 2025-02-16 13:33:56 -08:00
Maria José Solano
0e8e4a07f5 fix(diagnostic): don't include diagnostic code when using custom formatter #32464 2025-02-16 12:13:29 -08:00
zeertzjq
906ad04ddd fix(marks): handle composing in inline virt_text with 'nowrap' (#32477) 2025-02-16 22:54:32 +08:00
zeertzjq
8452032554 fix(marks): handle double-with inline virt_text with 'nowrap' (#32476) 2025-02-16 14:05:13 +00:00
Maria José Solano
efe92f9dff fix(docs): update context type in vim.lsp.LocationOpts.OnList 2025-02-16 11:31:08 +01:00
Sean Dewar
a49f95d887 fix(terminal): avoid mismatched busy_start without busy_stop (#32458)
Problem: `showmode` in `terminal_enter` may cause `vpeekc` to process events,
which may handle pending escape sequences. If `CSI ? 25 l` is handled to hide
the cursor, it may remain hidden even after leaving terminal mode if both
`terminal_enter` and (indirectly) `showmode` call `ui_busy_start`, as there is
only one matching call to `ui_busy_stop` after leaving terminal mode.

Solution: let `terminal_enter` handle setting the initial visibility of the
cursor before calling `showmode`.

Closes #32456.

This simple solution assumes it isn't possible for e.g. `os_breakcheck` to be
called indirectly by something else before `terminal_enter` initially handles
cursor visibility and after it restores it, which I think is true.
2025-02-15 17:25:48 +00:00
dundargoc
8e4b77134a ci(test): disable ubuntu arm
There are too many flakes and intermittent failures to reliably use it.
Disable it for the time being until things stabilize.
2025-02-15 14:55:25 +01:00
Christian Clason
0a0f53663b vim-patch:3f60114: runtime(keymap): Add ukrainian-enhanced keymap
The "Ukrainian enhanced keymap" allows you to type Ukrainian in Vim
using jcuken Windows layout.

Original file is made by Ivan Korneliuk and can be found at
https://github.com/vansha/ukrainian-enhanced.vim. It is being added here
with the permission of the author.

There is another ukrainian layout already in Vim, namely the
keymap\ukrainian-jcuken.vim script by Anatoli Sakhnik. But this one
differs in way it maps numeric keys. It uses values usual for Windows
users.

closes: vim/vim#16628

3f60114236

Co-authored-by: Vladyslav Rehan <rehanvladyslav@gmail.com>
2025-02-15 11:20:50 +01:00
zeertzjq
10a3a85473 vim-patch:faf4112: runtime(doc): document ComplMatchIns highlight for insert-completion (#32448)
closes: vim/vim#16636

faf4112cdc

Co-authored-by: glepnir <glephunter@gmail.com>
2025-02-14 23:42:16 +00:00
zeertzjq
1cdeb037c1 vim-patch:9.1.1112: Inconsistencies in get_next_or_prev_match() (#32447)
Problem:  Inconsistencies in get_next_or_prev_match() (after 9.1.1109).
Solution: Change "file" to "entry" or "match" in comments.  Use the same
          order of branches for PAGEUP and PAGEDOWN (zeertzjq).

closes: vim/vim#16633

b6c900be9c
2025-02-14 23:24:26 +00:00
Mathias Fussenegger
f20335a54c feat(lsp): add support for completionItem.command resolving
`command` was already resolved via a `completionItem/resolve` request
but only if `additionalTextEdits` were also present, and the
`resolveSupport` capability wasn't listed.

Closes https://github.com/neovim/neovim/issues/32406
2025-02-14 19:49:08 +01:00
dundargoc
c091bc3b9a ci(release): change to ubuntu-22.04
Ubuntu 20.04 is deprecated.
2025-02-14 14:54:18 +01:00
glepnir
cff5fa49fc fix(float): "Not enough room" error for 1-line float #25192
Problem: set winbar on a floating window which only have one row will
cause crash.

Solution: when new floating window only have one room don't copy winbar
from target window"

Fix #19464
2025-02-14 05:28:51 -08:00
zeertzjq
dc33879dc2 Merge pull request #32442 from zeertzjq/vim-407319f
vim-patch: runtime file updates
2025-02-14 20:48:39 +08:00
dundargoc
ca5fca2912 build(windows)!: drop cat and tee executables from windows
The legitimacy of the binaries can't be guaranteed and poses a security
risk. A replacement version of these may be introduced in the future in
a more secure manner.

Closes https://github.com/neovim/neovim/issues/32431.
2025-02-14 13:10:11 +01:00
zeertzjq
565152a2ac vim-patch:d7deeff: runtime(exports): include simple filetype plugin
closes: vim/vim#16625

d7deeffe11

Co-authored-by: Matt Perry <matt@mattperry.com>
2025-02-14 19:54:14 +08:00
zeertzjq
92f0933abb vim-patch:407319f: runtime(samba): include simple filetype plugin
closes: vim/vim#16626

407319fe89

Co-authored-by: Matt Perry <matt@mattperry.com>
2025-02-14 19:53:54 +08:00
zeertzjq
f247402010 vim-patch:9.1.1107: cannot loop through completion menu with fuzzy (#32438)
Problem:  cannot loop through completion menu with fuzzy and nosort in
          'completeopt'
          (Tomasz N)
Solution: Reset cur to zero and update compl_shown_match when
          'completeopt' contains "nosort" but not "noselect"
          (glepnir)

fixes: vim/vim#16624
closes: vim/vim#16629

c0b7ca406b

Co-authored-by: glepnir <glephunter@gmail.com>
2025-02-14 09:09:01 +08:00
zeertzjq
478c71f03c vim-patch:9.1.1109: cmdexpand.c hard to read (#32437)
Problem:  cmdexpand.c hard to read
Solution: refactor the file slightly (glepnir)

closes: vim/vim#16621

977561a719

Co-authored-by: glepnir <glephunter@gmail.com>
2025-02-14 08:26:52 +08:00
zeertzjq
6b387bde69 vim-patch:4f010c9: runtime(vim): Update base-syntax, always match continuation comments to EOL (#32435)
closes: vim/vim#16630

4f010c90bd

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-02-14 07:49:57 +08:00
zeertzjq
9f85dace94 vim-patch:9.1.1108: 'smoothscroll' gets stuck with 'listchars' "eol" (#32434)
Problem:  'smoothscroll' gets stuck with 'listchars' "eol".
Solution: Count size of 'listchars' "eol" in line size when scrolling.
          (zeertzjq)

related: neovim/neovim#32405
closes: vim/vim#16627

2c47ab8fcd
2025-02-13 23:21:45 +00:00
Till Bungert
93480f7fba feat(term): trigger TermRequest for APC (#32407)
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-02-13 08:24:01 -06:00
Maria José Solano
e4c6e732fd feat(lsp): add select kind in showMessageRequest #32387 2025-02-13 05:48:56 -08:00
Justin M. Keyes
375847fb33 Merge #32426 fix(lsp): reset active request when reporting an error 2025-02-13 05:19:33 -08:00
glepnir
c374f26430 fix(lsp): clear word when expand multi-lines word (#32393)
Problem: When expanding a completion item that contains a multi-line word, the word is not deleted correctly.

Solution: If the word contains a line break, delete the text from Context.cursor to the current cursor position.
2025-02-13 11:24:38 +01:00
Robert Muir
b42dc232c5 fix(lsp): autotrigger should only trigger on client's triggerCharacters (#32266)
Problem: autotrigger option of vim.lsp.completion.enable() would trigger
all clients, as long as it matched at least one client's
triggerCharacters.

Solution: trigger only the clients with triggerCharacters matching the
character. overtriggering still happens if any client returns
isIncomplete=true (this case is more involved).


Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2025-02-13 11:08:11 +01:00
Christian Clason
0c3d2c9560 vim-patch:8f3277f: runtime(nroff): set define option & add matchit config in ftplugin
closes: vim/vim#16619

8f3277fbbe

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2025-02-13 10:03:28 +01:00
Yi Ming
2df68d3696 refactor(lsp): handling errors and nil responses together 2025-02-13 12:01:16 +08:00
Yi Ming
d76f7fef13 fix(lsp): reset active request when reporting an error 2025-02-13 11:59:18 +08:00
Yi Ming
4fd2694f20 fix(lsp): missing method parameter when canceling requests 2025-02-13 10:19:34 +08:00
zeertzjq
66b60fe62b Merge pull request #32425 from zeertzjq/vim-4a530a6
vim-patch: update Vim syntax
2025-02-13 09:42:35 +08:00
zeertzjq
212fce1636 vim-patch:a9c0642: runtime(vim): Update base-syntax, match Vim9 boolean and null literals in parens
- Match Vim9 boolean and null literals in parenthesised expressions and
  function argument lists.
- Match read-only registers in expressions.

closes: vim/vim#16622

a9c06429ac

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-02-13 09:05:31 +08:00
zeertzjq
3b4ef34fc3 vim-patch:1aa287e: runtime(vim): Update base-syntax, improve variable matching
- Match variables after operators, including line continuations.
- Match option variables without leading whitespace.
- Explicitly match expression subscripts.
- Match Vim9 variables in LHS of assignments and method calls.
- Match option variables (&option) with a dedicated syntax group like
  environment variables.
- Match list literals, fixes: vim/vim#5830
- Match :{un}lockvar arguments.
- Match registers and environment variables in :let unpack lists.
- Match lambda expressions
- Match Vim9 scope blocks
- Match variables in :for subject
- Highlight user variables with Normal
- Improve this/super keyword matching, fixes: vim/vim#15970

closes: vim/vim#16476

1aa287e048

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-02-13 09:03:42 +08:00
zeertzjq
c58566a5ab vim-patch:4a530a6: runtime(vim): Update base-syntax, match :debuggreedy count prefix
Match :0debuggreedy as a special case until better range/count support
is implemented.

closes: vim/vim#16572

4a530a632b

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-02-13 09:02:03 +08:00
Christian Clason
8117db48ed ci(cirrus): update to freebsd-14-2
Previous `freebsd-14-0` image was dropped
2025-02-12 17:43:42 +01:00
luukvbaal
15bc930fca fix(memline): don't check line count for closed memline #32403
Problem:  Error thrown when for invalid line number which may be accessed
          in an `on_detach` callback at which point line count is
          intentionally set to 0.
Solution: Move empty memline check to before line number check.
2025-02-12 08:20:51 -08:00
Yi Ming
be8d87014c fix(lsp): on detach, cancel pending foldingRange requests #31509
Problem:
1. Open a relatively large file (so the server needs some time to
   process the request).
2. Then immediately execute `:bdelete`.
3. Once the request is completed, the handler will obtain the bufstate
   of a buffer already unloaded.

    Error executing vim.schedule lua callback: ...7841_1/share/nvim/runtime/lua/vim/lsp/_folding_range.lua:119: assertion failed!
    stack traceback:
            [C]: in function 'assert'
            ...7841_1/share/nvim/runtime/lua/vim/lsp/_folding_range.lua:119: in function 'multi_handler'
            ...7841_1/share/nvim/runtime/lua/vim/lsp/_folding_range.lua:140: in function 'handler'
            ...HEAD-c137841_1/share/nvim/runtime/lua/vim/lsp/client.lua:669: in function ''
            vim/_editor.lua: in function <vim/_editor.lua:0>

Solution:
On detach, cancel all pending textDocument_foldingRange requests.
2025-02-12 06:22:59 -08:00