Problem: floaing preview window can be closed by some
ex commands like `only` `fclose` which will not clean the bufvar
Solution: use WinClosed event with floating_winnr for clean
bufnr, and add test cases for vim.lsp.util.open_floating_preview
Detect a few more default archive types, correctly handle file
extensions with digits in it.
fixes: vim/vim#16099closes: vim/vim#16104cacfccf803
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Option metadata like list of valid values for an option and
option flags are not listed in the `options.lua` file and are instead
manually defined in C, which means option metadata is split between
several places.
Solution: Put metadata such as list of valid values for an option and
option flags in `options.lua`, and autogenerate the corresponding C
variables and enums.
Supersedes #28659
Co-authored-by: glepnir <glephunter@gmail.com>
Problem:
`validate_option_value_args()` returns `OK` even if option name is
invalid or if option doesn't have the supported scope, which leads to
Neovim still trying to erroneously get/set the option in those cases,
which can lead to an assertion failure when `option_has_scope()` is
invoked. This issue miraculously doesn't exist in release builds since
the assertion is skipped and `(get/set)_option_value_for` returns if
there is an error set, but that is not the intended location for that
error to be caught.
Solution:
Make `validate_option_value_args()` return `FAIL` if there is an error
set, which causes the API option functions to return early instead of
trying to get/set an invalid option.
The newer UCRT runtime has native support for UTF-8, including forcing
it as the active codepage even before `main()` is called. This means
the c runtime will properly convert windows WCHAR:s into UTF-8 bytes,
as early as the argv/argc params to `main()` . Whereas MSVCRT does not
support this reliably and required us to use `wmain()`.
Only MSVC supports using manifest files directly as source files.
The solution for other Windows toolchains is to use a .rc file.
By making it a separate module, the embedded Nvim session can require
this module directly instead of setup code sending over the module via
RPC.
Also make exec_lua wrap _G.print so messages can be seen
in the test output immediately as the exec_lua returns.
Problem: 'wildmenu' not enabled by default in nocp mode
Solution: promote the default Vim value to true, it has been enabled
in defaults.vim anyhow, so remove it there (Luca Saccarola)
closes: vim/vim#16055437bc13ea1
Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
Problem:
Since [version 3.17](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocuments),
LSP supports specifying the position encoding (aka offset encoding) supported by
the client through `positionEncoding`. Since #31209, Nvim fully supports
`utf-8`, `utf-16`, and `utf-32` encodings.
Previously, nvim assumed all clients for a buffer had the same
`offset_encoding`, so:
* Nvim provides `vim.lsp._get_offset_encoding()` to get `offset_encoding`, but
this function is incorrect because `offset_encoding` is per-client, not
per-buffer.
* Based on the strategy of `vim.lsp._get_offset_encoding()`,
`vim.lsp.util.make_position_params()`, `vim.lsp.util.make_range_params()`, and
`vim.lsp.util.make_given_range_params()` do not require the caller to pass
`offset_encoding`, which is invalid.
* https://github.com/neovim/neovim/issues/25272
Solution:
* Mark `vim.lsp._get_offset_encoding()` as `@deprecated`.
* Change the type annotations of `vim.lsp.util.make_position_params()`,
`vim.lsp.util.make_range_params()`, `vim.lsp.util.make_given_range_params()`
to require the `offset_encoding` param.
Problem: filetype: openCL files are not recognized
Solution: detect '*.cl' files as opencl or lisp filetype,
include a opencl syntax and filetype plugin (Wu, Zhenyu)
closes: vim/vim#15825e2c27ca8ef
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Problem: filetype: karel files are not detected
Solution: detect '*.kl' files as karel filetype,
include syntax and filetype plugin
(Kirill Morozov)
closes: vim/vim#16075fdac54d7bb
Co-authored-by: Kirill Morozov <kirill@robotix.pro>
Co-authored-by: KnoP-01 <knosowski@graeffrobotics.de>
Problem: too many strlen() calls in eval.c
Solution: Refactor eval.c to remove calls to STRLEN()
(John Marriott)
closes: vim/vim#16066bd4614f43d
Co-authored-by: John Marriott <basilisk@internode.on.net>
Problem:
Capability register logic is spread across 3 files.
Solution:
- Consolidate (and simplify) logic into the client.
- Teach client.supports_method about resolve methods
Problem: Not possible to only set a "redraw later" type with
nvim__redraw, which seems to be desired for the
treesitter highlighter.
Solution: Do not update the screen when "flush" is explicitly set to
false and only redraw later types are present. In that case,
do not call ui_flush() either.
Problem: curswant not set on gm in folded line
(citizenmatt)
Solution: in a folded line, call update_curswant_force()
fixes: vim/vim#11596closes: vim/vim#11994closes: vim/vim#153989848face74
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem:
'listchars' (in particular multispace) breaks visual heading due to
`Whitespace` highlight group.
Solution:
Disable 'list' (and thus all listchars) by default for `checkhealth`
files.
Fixes#31145
**Problem:** Despite the LSP providing the option for language servers
to specify a range with a hover response (for highlighting), Neovim does
not give the option to highlight this range.
**Solution:** Add an option to `buf.hover()` which causes this range to
be highlighted.
Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
Problem: nvim__redraw's "range" marks a buffer range for redraw, and subsequently
flushes the UI without updating the windows containing that buffer.
Solution: Implicitly update the screen, unless specified otherwise.
Only update the screen with the last call of the treesitter
on_changedtree() callback.
Problem: Separate message emitted for each newline present in Lua
print() arguments.
Solution: Make msg_multiline() handle NUL bytes. Refactor print() to use
msg_multiline(). Refactor vim.print() to use print().
Problem: Treesitter highlighter implements an on_bytes callback that
just re-marks a buffer range for redraw. The edit that
prompted the callback will already have done that.
Solution: Remove redundant on_bytes callback from the treesitter
highlighter module.