9136 Commits

Author SHA1 Message Date
d4c8e8df1c vim-patch:a24f5be: runtime(python): highlight bytes in python
- Highlight bytes literals
- Do not highlight Unicode escape sequences in bytes literals

fixes: vim/vim#14033
fixes: vim/vim#17726
closes: vim/vim#17728

a24f5be86d

Co-authored-by: Rob B <github@0x7e.net>
2025-07-15 00:14:00 +02:00
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
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
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
7e8aa0585e refactor(lsp): rename vim.lsp.semantic_tokens start/stop to enable() 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
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
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
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
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
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
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
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
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
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