Commit Graph

32987 Commits

Author SHA1 Message Date
d21e2463fd fix: update deps hash for zig 0.14.0 2025-06-14 17:19:33 +08:00
76d213efbe feat(lsp): support multiline semantic tokens #34458 2025-06-13 08:30:08 -07:00
8001276bd0 docs: vim.fs., diagnostics, lsp #34402 2025-06-13 07:49:21 -07:00
1d5b3b5b4c feat(treesitter)!: apply offset! directive to all captures #34383
This commit changes the `offset!` directive so that instead of setting a
`metadata.range` value for the entire pattern, it will set a
`metadata.offset` value. This offset will be applied to the range only
in `vim.treesitter.get_range()`, rather than at directive application
time. This allows the offset to be applied to any and all nodes captured
by the given pattern, and removes the requirement that `#offset!` be
applied to only a single node.

The downside of this change is that plugins which read from
`metadata.range` may be thrown off course, but such plugins should
prefer `vim.treesitter.get_range()` when retrieving ranges anyway.

Note that `#trim!` still sets `metadata.range`, and
`vim.treesitter.get_range()` still reads from `metadata.range`, if it
exists.
2025-06-13 06:42:10 -07:00
9ec6c19c67 docs(extui): rename box->msg, more->pager, prompt->dialog
Includes breaking changes to the `opts` layout. "box" doesn't really
describe anything other than a floating window so was an unwanted synonym.
2025-06-13 14:28:01 +02:00
76f76fb083 fix(extui): only append messages exceeding 'cmdheight' to "more"
Problem:  8defe1a declared the "more" window the most convenient place to
          route messages to if it is already open for msg.pos == 'cmd'.
          In usage, this doesn't appear to be the case. Appending messages
          as added in that commit is still useful, but should only be done
          for messages that spill 'cmdheight'.
Solution: Only append messages exceeding 'cmdheight' to the more window.
          To do this, instead of immediately writing to the more buffer,
          write to the cmd buffer and calculate its height. Then copy the
          text and its highlights to the more buffer.
2025-06-13 14:28:01 +02:00
3e30323135 fix(coverity/554963): preallocate msg.items to avoid FORWARD_NULL #34484
*** CID 554963:           (FORWARD_NULL)
/src/nvim/memline.c: 3484             in findswapname()
3478                 if (swap_exists_action != SEA_NONE) {
3479                   kv_printf(msg, _("Swap file \""));
3480                   kv_printf(msg, "%s", fhname);
3481                   kv_printf(msg, _("\" already exists!"));
3482                   char *run_but = _("&Open Read-Only\n&Edit anyway\n&Recover\n&Quit\n&Abort");
3483                   char *but = _("&Open Read-Only\n&Edit anyway\n&Recover\n&Delete it\n&Quit\n&Abort");
>>>     CID 554963:           (FORWARD_NULL)
>>>     Passing null pointer "msg.items" to "do_dialog", which dereferences it.
3484                   choice = (sea_choice_T)do_dialog(VIM_WARNING, _("VIM - ATTENTION"), msg.items,
3485                                                    proc_running ? run_but : but, 1, NULL, false);
3486
3487                   // compensate for missing "Delete it" button
3488                   choice += proc_running && choice >= 4;
3489                   // pretend screen didn't scroll, need redraw anyway
/src/nvim/memline.c: 3492             in findswapname()
3486
3487                   // compensate for missing "Delete it" button
3488                   choice += proc_running && choice >= 4;
3489                   // pretend screen didn't scroll, need redraw anyway
3490                   msg_reset_scroll();
3491                 } else {
>>>     CID 554963:           (FORWARD_NULL)
>>>     Passing null pointer "msg.items" to "msg_outtrans", which dereferences it.
3492                   msg_outtrans(msg.items, 0, false);
3493                 }
3494                 no_wait_return--;
3495                 kv_destroy(msg);
3496                 xfree(fhname);
3497               }
2025-06-13 05:19:30 -07:00
29c8dabd41 fix(insexpand): update showmode when updating the screen (#34466)
Problem:  Eagerly calling `showmode()` to update showmode where setting
          `redraw_showmode` to be updated later would suffice.
Solution: Set `redraw_showmode` instead of calling `showmode()` if not
          showing a busy message followed by a `ui_flush()`.
2025-06-13 10:37:19 +02:00
1ede826e04 vim-patch:d296af9: runtime(masm): set 'com' and 'cms' options in ftplugin
closes: vim/vim#17484

d296af94d0

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-06-13 09:56:35 +02:00
beee60f3a0 vim-patch:85f0711: runtime(zimbu): set 'commentstring' option in ftplugin
closes: vim/vim#17478

85f0711b4e

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-06-13 09:56:35 +02:00
90b682891d vim-patch:91af4c4: runtime(doc): improve the wording of 'sts', 'varts' and 'varsts' values (#34480)
closes: vim/vim#17522

91af4c4180

Co-authored-by: Damien Lejay <damien@lejay.be>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-06-13 00:53:48 +00:00
82d0883c2d fix(lsp): correct diagnostic data support and related info capabilities (#34454) 2025-06-12 14:00:42 -04:00
7486c2f6aa feat(lsp): <Plug> mapping for signature help cycling #34039
Replace direct function mappings with `<Plug>` mappings for cycling
through overloaded signatures, providing better customization options
for users. This change keeps the default mapping (`<C-s>`) for cycling
if `<Plug>(nvim.lsp.ctrl-s)` is not mapped.
2025-06-12 10:56:39 -07:00
f99e3a8a2a feat(lsp): incremental selection via "textDocument/selectionRange" #34011
Select outwards with "an" and inwards with "in" in Visual mode.
Ranges are reset when leaving Visual mode.
2025-06-12 09:25:19 -07:00
a9b8a8dc6c fix(lsp): _cancel_all_requests() tries to cancel completed requests #34105
Problem:
The cancel function returned by `vim.lsp.buf_request` tries to cancel
all the requests, including those that have already been completed,
causing "Cannot find request with id ... whilst attempting to cancel"
errors to be logged when it is called.

Solution:
Only cancel the requests that are present in `client.requests`.
2025-06-12 09:21:53 -07:00
ac12dc49cc fix(clipboard): enable cache for function providers #34470
Problem:
With these settings, copy/pasting `blockwise-visual` (with `CTRL+V`)
incorrectly pastes as a `linewise` mode because `regtype` is ignored:

    vim.opt.clipboard = 'unnamedplus'
    vim.g.clipboard = 'osc52'

To reproduce: press `CTRL+V` and select some characters press `p` and
observe that it is pasted in `linewise` mode.

Solution:
Enable the [clipboard.vim](https://github.com/neovim/neovim/blob/master/runtime/autoload/provider/clipboard.vim#L281-L283))
cache for function providers, so that `regtype` is maintained for the OSC52
clipboard provider.
2025-06-12 09:18:23 -07:00
d86d4bacc1 fix(messages): make swapfile attention message part of prompt (#34414)
Problem:  The swapfile attention message is not repeated after clearing
          the screen.
          After clearing the screen `msg_scrolled` is reset without
          clearing other related variables, causing an assert.
Solution: Make the attention message part of the confirm prompt.
          Call `msg_reset_scroll()`.
2025-06-12 11:57:17 +02:00
221b6ddf1c Merge pull request #34412 from bfredl/ui_buf
fix(msgpack): flush incomplete big UI event before packing RPC event
2025-06-12 11:35:33 +02:00
b8ee354f12 fix(msgpack): flush incomplete big UI event before packing RPC event
This might happen, e.g. if we send a fast RPC reply in a os_breakcheck()
in the middle of redrawing and big ui_ext events are produced.

fixes #31316
2025-06-12 11:05:38 +02:00
dc05598d02 fix(cmdline): set search cursor after ui_flush() (#34418)
Problem:  vim.ui_attach cmdline events emitted with an ephemeral cursor
          position that is only used as the start of the search.
Solution: Delay setting the cursor position until after ui_flush().
2025-06-12 08:53:10 +02:00
66e4784f5a fix(float): ensure relative window grid is allocated (#34459)
Problem:  Uninitialized grid for a "win" relative float when redrawing
          just after it has been opened.
Solution: Ensure window grid is allocated or assigned the default grid.
2025-06-12 08:51:29 +02:00
5f00e6adaf vim-patch:5128920: runtime(vim): Update base-syntax, improve function definition matching (#34463)
- Fix highlighting of function names including /fu\%[nction]/ (E.g.,
  s:func(), foo.fu(), fu.func())
- Match :delfunction argument.

Reported by Aliaksei Budavei.

closes: vim/vim#17428

51289207f8

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-06-12 08:05:20 +08:00
3a2ac2300b vim-patch:9.1.1454: tests: no test for pum at line break position (#34462)
Problem:  Missing test case for pum display on a wrapped line.
Solution: Add a test case to cover pum behavior at line break positions.
          (glepnir)

closes: vim/vim#17520

6cc9bd4001

Co-authored-by: glepnir <glephunter@gmail.com>
2025-06-12 08:04:36 +08:00
47df8f5a4b vim-patch:053aee0: runtime(doc): add more pointers to 'completeopt' (#34460)
Before this commit, I had trouble finding information about configuring
the insert mode completion. In particular, it was not clear that the
'wildopt' config that I already had in my vimrc does not apply here.

Also, `insert.txt` barely mentioned 'completeopt' except when
describing popups (I was more interested in bash-like behavior
where the unique prefix of all completions is completed first).

I'm hoping these edits will make the relevant docs easier to find.

closes: vim/vim#17515

053aee01f7

Co-authored-by: Ilya Grigoriev <ilyagr@users.noreply.github.com>
2025-06-12 07:32:07 +08:00
6bee2f686f fix(shada): prevent use-after-free when mapping file marks (#34446)
Problem: When ignore_buf skips buffers during initialization,
shada_read_when_writing uses entry.data.filemark.fname directly
as map key, but later frees the entry, leaving dangling pointers.

Solution: Always create independent copies of filenames as map keys
using xstrdup() for new items, and free all keys during cleanup.

Fix #34440
2025-06-11 22:31:48 +00:00
6a71239cd5 fix(terminal): don't disable scrolloff for non-terminal buffers (#34451) 2025-06-11 14:47:06 +00:00
de87ceb3be feat(tui): support APC queries in TermResponse (#34426)
Add support for APC sequences to libtermkey and the TermResponse
autocommand event.
2025-06-11 08:26:58 -05:00
966b1da183 fix(editorconfig): a custom property is treated as a section (#34445)
Problem: A custom property containing a pair of square brackets will be
treated as a section.
Solution: Change the logic parsing a section, remove the first match
regex `%b[]`.

Signed-off-by: fortime <palfortime@gmail.com>
2025-06-11 08:26:38 -05:00
7aafbca510 vim-patch:c413ac7: runtime(java): Match raw-, non-generic-, and generic-type names of "java.lang"
And only match innermost element types of parameterised
array types.

References:
https://docs.oracle.com/javase/specs/jls/se21/html/jls-4.html#jls-4.8
https://docs.oracle.com/javase/specs/jls/se21/html/jls-6.html#jls-6.1
https://docs.oracle.com/javase/specs/jls/se21/html/jls-10.html

closes: vim/vim#17499

c413ac7068

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2025-06-11 10:15:16 +02:00
719c7e2312 vim-patch:138fb95: runtime(reva): set 'cms' option in ftplugin, update URL
closes: vim/vim#17488

138fb951e0

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-06-11 10:15:16 +02:00
8cd0ef06bb vim-patch:a0316cd: runtime(abap): set 'comments' and 'commentstring' option in ftplugin
Reference:
https://en.wikipedia.org/wiki/ABAP#Comments

closes: vim/vim#17489

a0316cd299

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-06-11 10:15:16 +02:00
b1aed2b40a vim-patch:572d460: runtime(gdshader): add comments and commentstring to ftplugin
closes: vim/vim#17500

572d46035f

Co-authored-by: Maxim Kim <habamax@gmail.com>
Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-06-11 10:15:16 +02:00
677a50bb26 vim-patch:30cf017: runtime(8th): updated 8th syntax script
closes: vim/vim#17505

30cf017f2a

Co-authored-by: Ron Aaron <ron@aaron-tech.com>
2025-06-11 10:15:16 +02:00
bac133e4b6 fix(lsp): announce diagnostic tag support (#34436)
This commit also adds a type annotation to the returned client
capabilities table, because without it lua_ls does not provide
autocompletion for the fields within the table.
2025-06-10 21:26:06 -07:00
fb7a234f01 test: value of has("gui_running") after :restart (#34439) 2025-06-11 10:41:56 +08:00
37d6ac8a15 test(screen): still match by full row when {MATCH:} is present (#34437)
Add '^' and '$' around the pattern. This makes it less likely to make
mistakes of when writing tests with {MATCH:}, as most such tests have
text before and after {MATCH:}.
2025-06-11 01:56:12 +00:00
1abcd9fe28 vim-patch:9.1.1452: completion: redundant check for completion flags (#34434)
Problem:  completion: redundant check for completion flags
Solution: refactor code slightly (glepnir)

refactor: nest fuzzy completion logic to avoid duplicate flag checks

- Combine COT_FUZZY checks into single nested condition
- Reduce redundant bitwise operations in ins_compl_new_leader()

closes: vim/vim#17494

ecf8f15884

Co-authored-by: glepnir <glephunter@gmail.com>
2025-06-11 00:06:48 +00:00
79ce71430f vim-patch:bfa1636: runtime(doc): update documentation on tabstop settings (#34433)
Unify the treatment of tabstop, correct errors and deprecate smarttab
usage.

closes: vim/vim#17444

bfa16364f1

Co-authored-by: Damien Lejay <damien@lejay.be>
2025-06-10 23:53:35 +00:00
8ea18de959 vim-patch:274efcc: runtime(vim): Update base-syntax, contain let-heredocs (#34431)
Limit heredoc matches to assignment statements.  Matching these at the
top level is very slow.

closes: vim/vim#17473

274efcc7e6

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-06-10 23:35:59 +00:00
612f8e7c9e vim-patch:9.1.1450: Session has wrong arglist with :tcd and :arglocal (#34430)
Problem:  Session has wrong arglist with :tcd and :arglocal.
Solution: Also use absolute path for :argadd when there is tabpage-local
          directory (zeertzjq).

related: neovim/neovim#34405
closes: vim/vim#17503

a304e49790
2025-06-10 23:35:42 +00:00
cbc9d9b9c7 Merge pull request #34429 from zeertzjq/vim-9.1.1447
vim-patch:9.1.{1447,1449}
2025-06-11 07:05:25 +08:00
5075043823 vim-patch:9.1.1449: typo in pum_display()
Problem:  typo in pum_display()
Solution: update the comment, remove empty new lines
          (glepnir)

closes: vim/vim#17506

ed4eb74f7a

Co-authored-by: glepnir <glephunter@gmail.com>
2025-06-11 06:42:32 +08:00
ac772706cc vim-patch:9.1.1447: completion: crash when backspacing with fuzzy completion
Problem:  completion: crash when backspacing with fuzzy completion
Solution: Don't dereference compl_first_match when it's NULL
          (zeertzjq).

related: neovim/neovim#34419
closes: vim/vim#17511

91782b4aeb
2025-06-11 06:42:28 +08:00
b5aef05b8f fix(terminal): fix OSC 8 parsing (#34424)
vterm does not send us the terminator in the string fragment. Our OSC 8
parser assumed that it was and therefore treated short strings as
invalid (as it assumed it was missing a terminator).
2025-06-10 15:52:45 -05:00
228ff6e547 Merge pull request #34411 from zeertzjq/tui-crash
fix(tui): wait for embedded server's exit code
2025-06-10 23:27:14 +08:00
c2aa5fd915 test: :restart works on Windows 2025-06-10 23:00:38 +08:00
2dba5abcb2 fix(tui): wait for embedded server's exit code
Uses the undocumented "error_exit" UI event for a different purpose:
When :detach is used on the server, send an "error_exit" with 0 `status`
to indicate that the server shouldn't wait for client exit.
2025-06-10 23:00:21 +08:00
b98eefd803 fix(shada): prevent 'nobuflisted' buffers in v:oldfiles #34373
Problem: 'nobuflisted' buffers are incorrectly added to v:oldfiles.

Solution: Use ignore_buf() consistently in shada_write() for buffer
marks processing.
2025-06-10 06:50:16 -07:00
93925fe020 vim-patch:446a98f: runtime(rpl): set commentstring option in ftplugin
closes: vim/vim#17487

446a98f0b6

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-06-10 09:10:59 +02:00
4387c26691 vim-patch:9e9fe66: runtime(postscr): set commentstring option in ftplugin
closes: vim/vim#17486

9e9fe66437

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-06-10 09:10:59 +02:00