Commit Graph

33259 Commits

Author SHA1 Message Date
3eb597c999 vim-patch:baa781a: runtime(python2): highlight unicode strings in python2
fixes: vim/vim#14033
fixes: vim/vim#17726
closes: vim/vim#17729

baa781a4c3

Co-authored-by: Rob B <github@0x7e.net>
2025-07-15 00:14:00 +02:00
73987a4301 vim-patch:e85a66a: runtime(erlang): Add support for triple-quoted strings and docstrings
Erlang recently added the `-moduledoc` attribute as well as triple
quoted strings and the `~` prefix for binary strings, see [1].

Erlang also added nominal types. See EEP-69 [2].

This commit removes the documentation of "g:erlang_highlight_bifs" and
"g:erlang_highlight_special_atoms", which are not longer supported.
"g:erlang_old_style_highlight" is kept undocumented (as it should not be
used by new users).

This commit contains the modifications in the following PR and commits:

- vim-erlang/vim-erlang-runtime#58
- vim-erlang/vim-erlang-runtime@43d18d3
- vim-erlang/vim-erlang-runtime@ac88ebf
- vim-erlang/vim-erlang-runtime@19c1be9
- vim-erlang/vim-erlang-runtime@7f5cefc
- vim-erlang/vim-erlang-runtime@976b10b

[1]: https://www.erlang.org/doc/system/documentation.html
[2]: https://www.erlang.org/eeps/eep-0069

closes: vim/vim#17687

e85a66a4d4

Co-authored-by: Csaba Hoch <csaba@cursorinsight.com>
Co-authored-by: Johannes Christ <jc@jchri.st>
2025-07-15 00:14:00 +02:00
a945686444 feat(term): increase max scrollback to 1000000
Problem:
Cannot use `nvim_open_term()` to pipe terminal scrollback > 100000

Solution:
Increase scrollback limit to 1000000

If there's no technical consequences of doing this, can be set even
higher in the future.
2025-07-14 16:41:18 +01:00
12276832ab fix(runtime): set 'foldmethod' for Lua ftplugin #34929
Problem:
Neovim's Lua ftplugin doesn't set `'foldmethod'`, though Vim one sets it 1341176e7b/runtime/ftplugin/lua.vim (L66-L68)

Solution:
Set it
2025-07-14 05:28:30 -07:00
7bf04bc01f test(fold): flaky "doesn't open folds that are not touched" #34911 2025-07-13 17:05:01 -07:00
9f16b598f9 vim-patch:1341176: runtime(vim): Update help syntax file, improve highlighting of included Vim examples (#34924)
- Take over as file maintainer.
- Improve highlighting of legacy script examples by using :syn-iskeyword
  with the default 'iskeyword' value. Vim9 script examples are not
  supported yet.
- Match admonition labels in more contexts.
- Match URLs in more contexts.

fixes vim/vim#17721
closes: vim/vim#17731

1341176e7b

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-07-13 23:11:22 +00:00
f487ae90cf vim-patch:9.1.1539: completion: messages don't respect 'shm' setting (#34923)
Problem:  completion: messages don't respect 'shm' setting
Solution: Turn off completion messages when 'shortmess' includes "c"
          (Girish Palya).

`:set shortmess+=c` is intended to reduce noise during completion by
suppressing messages.
Previously, some completion messages still appeared regardless of this setting.

This change ensures that **all** completion-related messages are suppressed
when `'c'` is present in `'shortmess'`.

Not entirely sure if the original behavior was intentional. If there's a
reason certain messages were always shown, feel free to close this without
merging.

closes: vim/vim#17737

fe1d3c8af7

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-07-13 22:53:40 +00:00
96ec4db3e9 build(deps): bump tree-sitter to v0.25.8 2025-07-13 23:00:50 +02:00
7cd5356a6f feat(net): vim.net.request(), :edit [url] #34140
Problem:
Nvim depends on netrw to download/request URL contents.

Solution:
- Add `vim.net.request()` as a thin curl wrapper:
  - Basic GET with --silent, --show-error, --fail, --location, --retry
  - Optional `opts.outpath` to save to a file
  - Operates asynchronously. Pass an `on_response` handler to get the result.
- Add integ tests (requires NVIM_TEST_INTEG to be set) to test success
  and 404 failure.
- Health check for missing `curl`.
- Handle `:edit https://…` using `vim.net.request()`.

API Usage:
1. Asynchronous request:

    vim.net.request('https://httpbingo.org/get', { retry = 2 }, function(err, response)
      if err then
        print('Fetch failed:', err)
      else
        print('Got body of length:', #response.body)
      end
    end)

2. Download to file:

    vim.net.request('https://httpbingo.org/get', { outpath = 'out_async.txt' }, function(err)
      if err then print('Error:', err) end
    end)

3. Remote :edit integration (in runtime/plugin/net.lua) fetches into buffer:

    :edit https://httpbingo.org/get
2025-07-13 13:43:11 -07:00
444a8b3ec6 vim-patch:6f85cec: runtime(python): update rendering of Unicode named literals in syntax script
This change:

* enforces that the alias starts with a letter
* allows the other words in an alias to be separated by either a space
  or a hyphen, but not both or double separators
* allows only a letter after space, possibly followed by letters or
  digits
* allows both letters and digits after a hyphen

Tested with:

    a = '\N{Cyrillic Small Letter Zhe} is pronounced as zh in pleasure'
    b = '\N{NO-BREAK SPACE} is needed here'
    # ... other tests here
    r = '\N{HENTAIGANA LETTER E-1} is a Japanese hiragana letter archaic ye'
    s = '\N{CUNEIFORM SIGN NU11 TENU} is a correction alias'
    t = '\N{RECYCLING SYMBOL FOR TYPE-1 PLASTICS} base shape is a triangle'
    print(a)
    print(b)
    print(r)
    print(s)
    print(t)

The tests confirm the behavior and are selected from real Unicode
tables/aliases to check these combinations based on the specification.

fixes: vim/vim#17323
closes: vim/vim#17735

6f85cec4fb

Co-authored-by: Zvezdan Petkovic <zpetkovic@acm.org>
2025-07-13 11:07:40 +02:00
3e7f5d95aa vim-patch:ce1d196: runtime(vim): Update base syntax, improve :match highlighting (#34912)
- Match the range prefix separately as a count.
- Match an explicit count of 1, rarely used but seen in the wild.
- Allow whitespace between the count and command.

closes: vim/vim#17717

ce1d1969f3

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-07-13 16:39:19 +08:00
73fbc693b5 refactor(lsp): drop vim.lsp.util._refresh() #33903
Problem:
- util._refresh() is only used by `inlay_hint.lua` and `document_color.lua`, and
  both have their own wrapper functions;
- util._refresh() provides unified parameters, but this layer of wrapping is
  almost meaningless because
  - document color does not need the range parameter;
  - inlay hint requires a range parameter, but it is not complicated

Therefore, it can be considered redundant.
ref https://github.com/neovim/neovim/pull/32887#discussion_r1996413602

Solution:
Remove it.
2025-07-12 22:00:10 -07:00
89b946aa87 fix(lua): vim.diff is nil in uv.new_work() thread #34909
Problem:
The "gitsigns" plugin runs `vim.diff` in a thread (`uv.new_work`), but
`vim.diff` is nil in that context:

    Lua callback:
    …/gitsigns.nvim/lua/gitsigns/diff_int.lua:30: bad argument #1 to 'decode' (string expected, got nil)
    stack traceback:
      [C]: in function 'decode'
      …/gitsigns.nvim/lua/gitsigns/diff_int.lua:30: in function <…/gitsigns.nvim/lua/gitsigns/diff_int.lua:29>
    Luv thread:
    …/gitsigns.nvim/lua/gitsigns/diff_int.lua:63: attempt to call field 'diff' (a nil value)

Solution:
Revert the `stdlib.c` change (set `vim.diff` instead of `vim._diff`).
2025-07-12 20:54:22 -07:00
5c4f9b05fa Merge #34797 refactor(lsp): enable()/is_enabled() 2025-07-12 23:44:21 -04:00
7e8aa0585e refactor(lsp): rename vim.lsp.semantic_tokens start/stop to enable() 2025-07-13 11:03:22 +08:00
a8d9f3331e test(lsp): remove the deprecated feed_command 2025-07-13 11:03:22 +08:00
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