When using vim9-syntax plugin, :VimKeywordPrg does not lookup functions
correctly, as it relies solely on syntax names to find the help topic.
The syntax keyword used for builtin function is vi9FuncNameBuiltin in
vim9-syntax plugin, not vimFuncName expected by :VimKeywordPrg, so the
fallback rules apply, and there is no fallback rule for function calls.
Fix by just checking if the first char after topic is '(', and if so
assume help topic is a function.
closes: vim/vim#19320ac5af8ecd3
Co-authored-by: Mark Woods <mwoods.online.ie@gmail.com>
- Match &option, and &[lg]:option variables.
- Match Ex commands after :bar.
- Fix matching of pre and post context text.
- Style - use '..' for string concatenation.
fixesvim/vim#17567closes: vim/vim#17653c65643cbec
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Problem:
When building Neovim with Emscripten for WebAssembly, the
`CMAKE_TOOLCHAIN_FILE` is not propagated to dependency builds.
So libuv attempts to include Linux-specific headers like
`sys/epoll.h` which don't exist in the WebAssembly environment.
From #37572:
…/NeovimWeb/external/neovim/.deps/build/src/libuv/src/unix/linux.c:44:10:
fatal error: 'sys/epoll.h' file not found
44 | #include <sys/epoll.h> | ^~~~~~~~~~~~~
Solution:
1. Add initialization for DEPS_CMAKE_ARGS to prevent CMake errors.
2. Implement conditional logic to always pass CMAKE_TOOLCHAIN_FILE to
dependencies.
This allows dependencies like libuv to detect they're building for
WebAssembly and disable incompatible Linux specific features such as
epoll which resolves the sys/epoll.h error.
From the LSP Spec:
> There are two uses cases where it can be beneficial to only compute
> semantic tokens for a visible range:
>
> - for faster rendering of the tokens in the user interface when a user
> opens a file. In this use case, servers should also implement the
> textDocument/semanticTokens/full request as well to allow for flicker
> free scrolling and semantic coloring of a minimap.
> - if computing semantic tokens for a full document is too expensive,
> servers can only provide a range call. In this case, the client might
> not render a minimap correctly or might even decide to not show any
> semantic tokens at all.
This commit unifies the usage of range and full/delta requests as
recommended by the LSP spec and aligns neovim with the way other LSP
clients use these request types for semantic tokens.
When a server supports range requests, neovim will simultaneously send a
range request and a full/delta request when first opening a file, and
will continue to issue range requests until a full response is
processed. At that point, range requests cease and full (or delta)
requests are used going forward. The range request should allow servers
to return a result faster for quicker highlighting of the file while it
works on the potentially more expensive full result. If a server decides
the full result is too expensive, it can just error out that request,
and neovim will continue to use range requests.
This commit also fixes and cleans up some other things:
- gen_lsp: registrationMethod or registrationOptions imply dynamic
registration support
- move autocmd creation/deletion to on_attach/on_detach
- debounce requests due to server refresh notifications
- fix off by one issue in tokens_to_ranges() iteration
Problem:
`Client.on_exit` runs `Client._on_detach` and the client removal logic
within two separate `vim.schedule` sequentially. However, since
`Client._on_detach` executes `LspNotify` inside `vim.schedule`, this
causes `LspNotify` to be executed after the client removal, which is
scheduled first. At that point, a valid `Client` can no longer be
retrieved within the autocmd callback.
Solution:
Put the client deletion inside the `vim.schedule` call.
Problem: 0x08 is treated as Backspace instead of Ctrl-H on Windows.
Solution: Treat 0x7f as Backspace if VT input is enabled, so that 0x08
is treated as Ctrl-H.
Ref: https://github.com/microsoft/terminal/issues/4949
Problem:
Temporary files from /tmp/ and /private/ paths clutter :oldfiles list.
Additionally, the documented Windows default (rA:,rB:) was never applied
due to a missing platform condition.
Solution:
Drop platform-specific shada differences and default to excluding
/tmp/ and /private/ paths.
Problem: The wildmenu is hidden behind the dialog window with "list" in 'wildmode'.
Global ('laststatus' set to 3) statusline is hidden behind the
pager window.
Solution: Check wildmenumode() to adjust the dialog position when necessary.
Ensure pager is positioned above the global statusline with 'laststus' set to 3.
problem: currently when empty string is set as prompt the prompt-mark
column doesn't update.
solution: ensure the column is reset to 0 when starting prompt buffer and
before creating a new prompt after prompt-callback.
Problem: Internal messages do not have an ID, which is unexpected and
undocumented.
Solution: Always assign a msg_id to msg_show events, simplifying
logic/expectations for UIs.
Problem: No empty msg_ruler event after leaving a window whose ruler
is not part of the statusline with 'rulerformat'.
Solution: Properly keep track of when a ruler event was emitted with
'rulerformat' to emit clear event.
Problem: Scheduled callbacks reference potentially outdated window
handles e.g. after switching tabpage.
Solution: Use ext.wins which stores the updated window handles.
Problem:
Using vim.defer_fn() just before Nvim exit leaks luv handles.
Solution:
Make vim.schedule() return an error message if scheduling failed.
Make vim.defer_fn() close timer if vim.schedule() failed.
Problem:
`on_list` is supposed to replace the default list-handler. With the current order of these `if` statements `on_list` won't be called if `loclist` is true.
Solution:
Change the order of the relevant blocks.
- fix readability issue with IncSearch/CurSearch
- add highlights to some of ftplugins distributed with vim
closes: vim/vim#19295c99aaf4c87
Co-authored-by: Maxim Kim <habamax@gmail.com>
Problem:
On Windows, writing to a pipe doesn't work if the pipe isn't connected
yet. This causes an RPC request to a session newly created by connect()
to hang, as it's waiting for a response to a request that never reaches
the server.
Solution:
Wait for uv.pipe_connect() callback to be called when using connect().
Problem: using NOT with a float returns a float in legacy vim script
(kennypete)
Solution: Return a number instead of a float (Yegappan Lakshmanan)
fixes: vim/vim#19282closes: vim/vim#19289ecc3faef61
N/A patches:
vim-patch:8.2.1980: Vim9: some tests are not done at the script level
vim-patch:9.1.2122: Vim9: Negating a float doesn't result in a bool
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem:
Currently, : mark is set in start of prompt-line. But more relevant
location is where the user text starts.
Solution:
Store and update column info on ': just like the line info
Previously, adjust_start_col returned nil when completion items had
different start position from lsp textEdit range
This caused the completion to fall back to \k*$ which ignores the
non-keyword characters
Changes:
- adjust_start_col: now returns the minimum start postion among all
items instead of nil
- _lsp_to_complete_items - normalizes the items by adding the gap between
current and minimum start
Fixes: https://github.com/neovim/neovim/issues/37441
Problem: 'cursorline' and part of 'statusline' are missing after
:diffput to an empty buffer.
Solution: Make sure the cursor doesn't go beyond the last line after
:diffput (zeertzjq)
related: neovim/neovim#37621
closes: vim/vim#19281ce1e562fda
Problem: crash when using 'tagfunc' (Rodrigo Queipo)
Solution: Do not add the user_data to the 'info' dictionary when called
for insert mode completion (the TAG_INS_COMP flag is set).
Completion should not depend on the state of a previous tag
jump. (Yasuhiro Matsumoto)
fixes: vim/vim#19255closes: vim/vim#1928457b577df32
Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Problem: tests: Test_language_cmd fails on OpenBSD because the test
uses an invalid locale name and expects the command to produce
an error. OpenBSD accepts (almost) any locale name as valid by
design, so the :lang command succeeds and the test fails.
Solution: Slightly update the "bad" locale name to make it something
that OpenBSD considers invalid by adding a dot (but not ending
with ".UTF-8"). Maintain the original two underscores in the
name because that ensures Windows will also see it as invalid
(Kevin Goodsell).
closes: vim/vim#19280371583642a