- 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.
fixesvim/vim#17721closes: vim/vim#177311341176e7b
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
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#17737fe1d3c8af7
Co-authored-by: Girish Palya <girishji@gmail.com>
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
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#17323closes: vim/vim#177356f85cec4fb
Co-authored-by: Zvezdan Petkovic <zpetkovic@acm.org>
- 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#17717ce1d1969f3
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
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.
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`).
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.
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.
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
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.
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.
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).
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#177207306e8fcdb
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.
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#8855fixes: vim/vim#17527closes: vim/vim#17695b7b7fa04bf
Co-authored-by: Christian Brabandt <cb@256bit.org>
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.
- 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#177126ac2e4aa0a
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
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.
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.
fixes: vim/vim#17474closes: vim/vim#1768332a1b26ef3
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#1770641ee98c3c5
Co-authored-by: Wu Yongwei <wuyongwei@gmail.com>
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).
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>
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.
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>
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().
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.