Commit Graph

33243 Commits

Author SHA1 Message Date
7ac4cbcd2e refactor(lsp): utility functions for enable()/is_enabled() 2025-07-13 11:03:22 +08:00
4778a4c201 fix(lsp): prevent flicker in codelens virtual text #34888
Problem:
Calling lsp.codelens.refresh() causes transient visual flicker because
codelens virtual texts are briefly replaced with "Unresolved lens ..."
before being resolved and redrawn. Since refresh() is triggered
frequently (e.g., on CursorHold or InsertLeave), this leads to redundant
and noisy virtual text updates, even when the final text hasn't changed.

Solution:
Do not update virtual text for a line if some lenses for that line are
not resolved yet.

A trade-off is that the user may temporarily see outdated virtual text.
However, that's preferable to spamming updates on every refresh.
2025-07-12 16:55:58 -07:00
815916b450 test: zig build thread_spec.lua failure after vim.text.diff rename
Problem:
Since renaming `vim.diff` to `vim.text.diff`, `thread_spec.lua` fails in
the zig build. Is `vim.text.diff` not available in the thread context?
Why does it only fail in the zig build?

    FAILED   ./test/functional/lua/thread_spec.lua @ 217: thread vim.* diff
    ./test/functional/lua/thread_spec.lua:229: Expected objects to be the same.
    Passed in:
    (nil)
    Expected:
    (table: 0x7f221d392218) {
      [1] = 'notification'
    E5113: Lua chunk:
      [2] = 'result'
      [3] = {
        [1] = '@@ -1 +1 @@
    -Hello
    +Helli
    ' } }

    stack traceback:
            ./test/functional/lua/thread_spec.lua:229: in function <./test/functional/lua/thread_spec.lua:217>

    FAILED   ./test/functional/lua/thread_spec.lua @ 372: threadpool vim.* work
    ./test/functional/lua/thread_spec.lua:384: Expected objects to be the same.
    Passed in:
    (table: 0x7f2225be2c30) {
      [1] = 'notification'
      [2] = 'result'
     *[3] = {
       *[1] = vim.NIL } }
    Expected:
    (table: 0x7f2225be25c0) {
      [1] = 'notification'
      [2] = 'result'
     *[3] = {
       *[1] = '@@ -1 +1 @@
    -Hello
    +Helli
    ' } }

    stack traceback:
            ./test/functional/lua/thread_spec.lua:384: in function <./test/functional/lua/thread_spec.lua:372>

Solution:
Use `vim._diff` in the test, until a root cause is found.
2025-07-12 18:58:17 -04:00
f3a54e7ccf refactor(lua): rename vim.diff => vim.text.diff #34864
Problem:
`vim.diff()` was introduced before we had the `vim.text` module, where
it obviously belongs.

Solution:
Move it.
2025-07-12 22:36:07 +00:00
430be9d01d ci(test): use ARM ubuntu linux for more CI jobs #34908
Problem:
We temporarily disabled linux arm ci because of stability issues with
the runner. #32339 Since then, the hardware was changed, so we can try
re-enabling ARM linux CI. https://github.com/actions/partner-runner-images/issues/47#issuecomment-2678170225

Solution:
- re-enable arm linux ci. reverts 8e4b77134a
- also use arm image for these jobs, where arm seems to run much faster:
- `lint` (step: `clang-tidy`)
    - master: 1m5s
    - this pr (linux ARM): 37s
- `clang-analyzer` (step: `cmake --build ...`)
    - master: 10m
    - this pr (linux ARM) 5m 55s
- `with-external-deps` (step: `Build`)
    - master: 26s
    - this pr (linux ARM): 21s
2025-07-12 14:32:59 -07:00
3812cb1cd1 build(deps): bump tree-sitter to v0.25.7 2025-07-12 21:29:41 +02:00
2422fbdd5f fix(health): bad format() call #34904
Problem:
Bad format() call on PUC Lua #34901

    Error: Failed to run healthcheck for "vim.health" plugin. Exception:
    runtime/lua/vim/health/health.lua:89: bad argument #1 to 'format' (string expected, got nil)

Solution:
Avoid passing nil.
2025-07-12 11:27:51 -07:00
eb5b4b9e57 build(deps): bump tree-sitter-vim to v0.7.0 2025-07-12 18:57:52 +02:00
d2098057a7 docs(autocmd): generate events enum type #34883 2025-07-12 07:46:13 -07:00
34fbfa3586 refactor(build): use consistent cmake names #34893
CMake is functions/macros are case-insensitive (unlike variables), but
names differing only by case (e.g. "BuildLuaJit" instead of
"BuildLuajit") may look the same at a glance. This can be confusing if
you do a case-sensitive search, such as by using the * key in neovim to
search for other instances of the word under the cursor.
2025-07-12 07:00:36 -07:00
f1babb322b refactor(qf): move syntax code for qf-toc to qf.lua #34879 2025-07-11 18:13:20 -07:00
8c6ea76ebc fix(extui): disable cmdline highlighter when showing a message (#34887)
Problem:  When message is moved from message window to cmdline,
          the cmdline highlighter is not disabled.
Solution: Disable the highlighter (and only scroll to bottom when
          message was moved to pager).
2025-07-12 01:15:31 +02:00
d4074b812d vim-patch:9.1.1538: tests: string options in gen_opt_test.vim not fully sorted (#34891)
Problem:  tests: string options in gen_opt_test.vim aren't fully sorted.
Solution: Sort the string options alphabetically.  Also make description
          of 'maxsearchcount' start with lower-case for consistency with
          other options, update documentation for searchcount().

closes: vim/vim#17720

7306e8fcdb
2025-07-11 22:56:43 +00:00
7f5b5d34cf fix(window): don't store invalid height in window config (#34885)
Problem:  When 'winminheight' is zero and the window height is set to
          zero, the actual height is clamped whereas the stored config
          value is not. Reciprocal window configuration through
          nvim_win_get_config() then results in an error.
Solution: Also clamp the stored dimensions in the window config.
2025-07-11 16:53:30 +00:00
9e968635ef fix(extui): check if buffers/windows exist before deleting (#34886)
Problem: Disabling vim._extui may try to delete non-existent windows/buffers.
Solution: Check that window/buffer is valid before deleting.
2025-07-11 17:31:30 +02:00
4f3aa7bafb Merge #34558 docs 2025-07-10 22:36:16 -04:00
7a69fefdb9 fix(vim.json): loss of precision on integers >14 digits #34876
Problem: multiple DAP servers keep assuming they can have internal IDs
         up to 2**52, which get corrupted by the Neovim JSON encoder.
Solution: change (1) constant and add a test so nobody breaks it while
          updating the library.

Fixes: https://github.com/neovim/neovim/issues/24532
Fixes: https://github.com/mfussenegger/nvim-dap/issues/1534
Fixes: https://github.com/facebook/buck2/issues/1032
2025-07-10 19:07:56 -07:00
c3e2926f17 docs: deprecate :ownsyntax 2025-07-10 21:50:46 -04:00
e78c877688 docs: rename ui.txt => api-ui-events.txt 2025-07-10 21:50:46 -04:00
58df501913 docs: api, pack, events, develop 2025-07-10 21:50:46 -04:00
00f8f94d5b vim-patch:9.1.1535: the maximum search count uses hard-coded value 99 (#34873)
Problem:  The maximum search count uses a hard-coded value of 99
          (Andres Monge, Joschua Kesper)
Solution: Make it configurable using the 'maxsearchcount' option.

related: vim/vim#8855
fixes: vim/vim#17527
closes: vim/vim#17695

b7b7fa04bf

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-07-11 09:17:05 +08:00
54cde0674b test(ui/{cmdline,message}2_spec): reduce flakiness/runtime #34875
Problem:  Storing the configured 'cmdheight' value is scheduled and
          may happen after cmdline2_spec already entered block_mode.
          Excessive wait time for expected screen state due to delayed
          ruler after an error message.
Solution: Only schedule storing the user configured 'cmdheight' if
          v:vim_did_enter is unset. Use regular message instead of error.
2025-07-10 17:52:50 -07:00
9809ce8b47 vim-patch:6ac2e4a: runtime(vim): Update base syntax, improve function call highlighting (#34874)
- Match more function calls.
- Contain function call syntax groups.
- Improve differentiation between Ex commands and builtin functions with
  the same name.  Remove special cases.  Command modifiers are not
  currently well differentiated from functions.

closes: vim/vim#17712

6ac2e4aa0a

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-07-11 07:20:25 +08:00
68e316e3f9 feat(diagnostic): jump to related info location from open_float #34837
This commit allows users to jump to the location specified in a
diagnostic's `relatedInformation`, using `gf` from within the
`open_float` window. The cursor need only be on line that displays the
related info.
2025-07-10 11:24:17 -07:00
7bd4dfd209 refactor(lsp): simplify multiline semantic token logic #34698
This commit makes it so that only one call to `vim.str_byteindex` is
needed, at the end of the `end_line`, `end_col` calculations.
2025-07-10 11:12:18 -07:00
4745270bf1 feat(lsp): support textDocument/colorPresentation (#34823)
feat(lsp): support for `textDocument/colorPresentation`
2025-07-10 08:51:26 -07:00
213360c389 fix(lsp): custom 'winborder' in make_floating_popup_options() #34868 2025-07-10 05:51:13 -07:00
5803994a1c fix(highlight): preserve bg transparency with winblend=100 #34825
Problem: When winblend=100 is set on floating windows with transparent
background, the desktop background is not visible through the window.

Solution: Add special case to preserve transparency (-1) when blend
ratio is 100% and background was originally transparent.
2025-07-10 05:42:45 -07:00
e644038f06 docs: move vim.system to own section 2025-07-10 13:34:58 +01:00
7f18811668 vim-patch:32a1b26: runtime(filetype): improve asm heuristics and move into FTasmsyntax() (#34863)
fixes: vim/vim#17474
closes: vim/vim#17683

32a1b26ef3

vim-patch:41ee98c: runtime(filetype): fix incorrect pattern and break early

- Using `\n` is incorrect, as result of getline() does not contain line
  breaks and only uses `\n` for NUL bytes.
- Return when b:asmsyntax is set, like many other filetypes.

closes: vim/vim#17706

41ee98c3c5

Co-authored-by: Wu Yongwei <wuyongwei@gmail.com>
2025-07-10 20:30:39 +08:00
fccd016a0f vim-patch:bda55df: Revert "runtime(haskell): Add single quote to iskeyword in ftplugin (vim/vim#8191)"
This reverts commit 5e6e4042b1c9685bce86493e3ee6fe916a7f221c.

related: vim/vim#8191

bda55df3b8

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-07-10 09:29:15 +02:00
e65c0a0810 fix(tui): check for title support correctly (#34866) 2025-07-10 14:17:20 +08:00
fb0dc825e9 feat(option): custom chars in 'winborder' #33772
Problem: winborder option only supported predefined styles and lacked support for custom border characters.

Solution: implement parsing for comma-separated list format that allows specifying 8 individual border characters (topleft, top, topright, right, botright, bottom, botleft, left).
2025-07-09 18:15:08 -07:00
7526fb449d feat(extui): use winborder for msg window #34859
Problem:  The message window is essentially a regular floating window
          but does not use 'winborder'.
          Still some "scratch" buffer options unset after it was removed
          from its window.
Solution: Do not set the border when opening the window message.
          Forego passing `scratch = true` when opening a buffer,
          set the options manually when necessary.

Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
2025-07-09 17:42:47 -07:00
8aed423072 vim-patch:3987eac: runtime(doc): clarify how ex ranges are adjusted when acting on folds (#34862)
closes: vim/vim#17696

3987eac572

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-07-09 22:55:35 +00:00
76f6868e0a fix(runtime): no conceal in qf on :lopen #34854
Problem:
No conceal in qf on `lopen` since 74fcc945. Repro:

    nvim --clean +'tab Man ls' +'norm gO' +lclose +lopen

Solution:
Consider "Table of contents" title.
2025-07-09 09:36:10 -07:00
840cdb9589 feat(shada): shada should not store nobuflisted buffers #21818
Problem:  Shada jumplist entries still include entries from e.g. 'nobuflisted' buffers.
Solution: Check `ignore_buf()` before adding jumplist entries, followup to b98eefd8.

Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
2025-07-09 09:33:20 -07:00
3a3484be29 test(messages/cmdline_spec): convert highlight IDs to name and format (#34845)
Problem:  Hardcoded highlight IDs for ext_messages/cmdline output need
          to be adjusted everytime a builtin highlight group is added.
Solution: Store a global map of default highlights through nvim_get_hl()
          and fetch missing (custom) highlight groups through synIDattr().
          Use more compact formatting for screen:expect().
2025-07-09 09:33:19 +00:00
3c9484b550 feat(extui): show dismissed message in cmdline (#34745)
Problem:  An accidental key press can dismiss a routed message to be
          shown in full before the user was able to read it.
          'verbose' message routing based on an outdated condition results
          in "last_set" messages being separated from its message pair.
Solution: Show a message to be shown in full in the cmdline window instead
          of the pager. Keep it there and update the spill indicator when
          the message is dismissed.
          Remove the 'verbose' message routing.
2025-07-09 11:17:18 +02:00
88774965e5 feat(api): relax contract, allow return-type void => non-void #34811
Allow changing return-type from `void => non-void`.
2025-07-09 02:40:08 +00:00
96aef50624 Merge pull request #34852 from zeertzjq/vim-9.1.1526
vim-patch:9.1.{1526,1528}
2025-07-09 08:55:08 +08:00
5fe310c5e6 vim-patch:9.1.1528: completion: crash with getcompletion()
Problem:  completion: crash with getcompletion()
          (zeertzjq)
Solution: Don't set may_expand_pattern in f_getcompletion(),
          unset may_expand_pattern() once it is not longer needed
          (Girish Palya).

fixes: vim/vim#17680
closes: vim/vim#17686

f2ec8d4afc

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-07-09 08:06:23 +08:00
ef0ec7edac vim-patch:9.1.1526: completion: search completion match may differ in case
Problem:  completion: search completion match may differ in case
          (techntools)
Solution: add "exacttext" to 'wildoptions' value (Girish Palya)

This flag does the following:

exacttext
      When this flag is present, search pattern completion
      (e.g., in |/|, |?|, |:s|, |:g|, |:v|, and |:vim|)
      shows exact buffer text as menu items, without
      preserving regex artifacts like position
      anchors (e.g., |/\<|). This provides more intuitive
      menu items that match the actual buffer text. However,
      searches may be less accurate since the pattern is not
      preserved exactly.
      By default, Vim preserves the typed pattern (with
      anchors) and appends the matched word. This preserves
      search correctness, especially when using regular
      expressions or with 'smartcase' enabled. However, the
      case of the appended matched word may not exactly
      match the case of the word in the buffer.

fixes: vim/vim#17654
closes: vim/vim#17667

93c2d5bf7f

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-07-09 08:06:23 +08:00
db7c2acbc6 vim-patch:9.1.1532: termdebug: not enough ways to configure breakpoints (#34851)
Problem:  termdebug: not enough ways to configure breakpoints
Solution: add the termdebug_config['signs'] config setting, rework the
          termdebug test cases (Dimitry Ishenko)

Allow to configure custom breakpoint signs so one can do something like
this:

```vim
let g:termdebug_config['signs'] = ['>1', '>2', '>3', '>4', '>5', '>6', '>7', '>8', '>9']
let g:termdebug_config['sign'] = '>>'
```

where the first 9 breakpoints will have their own signs and the rest
will be the same (>>).

While at it, rework the test for the termdebug plugin:

- Added test for g:termdebug_config['signs'].
- Added test for g:termdebug_config['sign'].
- Moved test for g:termdebug_config['sign_decimal'] into
  Test_termdebug_basic()

closes: vim/vim#17694

c4bca1de0b

Co-authored-by: Dimitry Ishenko <dimitry.ishenko@gmail.com>
2025-07-08 22:38:58 +00:00
435f03ee10 docs: tag of :EditQuery #34844
Problem:
- Running `:h :EditQuery` throws error `E149: Sorry, no help for
  :EditQuery`
- vim_diff.txt miss an entry for `:EditQuery`

Solution:
- Make tag `[:EditQuery]()` right-aligned, similar to command `:Open`
- Update vim_diff.txt
2025-07-08 05:28:12 -07:00
bb6422f1ad docs(tutor): Chinese (zh-CN) translation #34803
Co-authored-by: glepnir <glephunter@gmail.com>
2025-07-08 05:26:39 -07:00
28b7c2df52 fix(health): floating window closes when opening TOC (gO) #34794
Problem: Health check floating window gets closed when pressing 'gO' to show TOC because LSP floating preview system auto-closes on BufEnter events triggered by :lopen.

Solution: Temporarily disable BufEnter event for the current window during TOC operations and adjust window layout to prevent overlap.
2025-07-08 05:21:09 -07:00
f68a5c40f0 feat(messages): add "prev_cmd" argument to msg_history_show (#34779)
Problem:  Unable to tell whether msg_history_show event is emitted for a
          :messages or g< command.
Solution: Add "prev_cmd" argument that is set to true for g<.
2025-07-08 11:19:02 +02:00
f576b59a09 docs: type fixes #34831 2025-07-07 18:56:22 -07:00
bf9d3e4bf8 fix(prompt): lnum update via nvim_buf_set_lines if buf != curbuf #34833
Fixes the case from https://github.com/neovim/neovim/issues/34561#issuecomment-3031536581
2025-07-07 17:42:45 -07:00