Specifically, functions that are run in the context of the test runner
are put in module `test/testutil.lua` while the functions that are run
in the context of the test session are put in
`test/functional/testnvim.lua`.
Closes https://github.com/neovim/neovim/issues/27004.
Problem: `vim.deprecate()` can be relatively significantly slower than
the deprecated function in "Nvim" plugin.
Solution: Optimize checks for "Nvim" plugin. This also results into not
distinguishing "xxx-dev" and "xxx" versions when doing checks, which
is essentially covered by the deprecation logic itself.
With this rewrite I get the times from #28459: `{ 0.024827, 0.003797, 0.002024, 0.001774, 0.001703 }`.
For quicker reference:
- On current Nightly it is something like `{ 3.72243, 0.918169, 0.968143, 0.763256, 0.783424 }`.
- On 0.9.5: `{ 0.002955, 0.000361, 0.000281, 0.000251, 0.00019 }`.
Problem: tests: test_vim9_builtin is a bit slow
Solution: source tests from a buffer instead of
writing and sourcing a file (Yegappan Lakshmanan)
closes: vim/vim#1461422697b6179
N/A patch:
vim-patch:9.1.0299: Vim9: return type not set for a lambda assigned to script var
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: Crash when typing many keys with D- modifier (after 9.1.0227).
Solution: Don't treat a 0x80 byte inside a special sequence as the start
of a special sequence (zeertzjq).
closes: vim/vim#146136b13e3d4e4
**Problems**
When launching Neovim on Terminal.app on macOS (Apple Terminal),
it briefly shows like
`p$qm+q5463;524742;73657472676266;73657472676262$qm` in orange
background color partially on the screen.
**Solution**
Since Terminal.app seems not supporting DECRQM and DECRQSS queries,
calling `tui_request_term_mode` and `tui_query_extended_underline`
caused this unexpected output.
Therefore, if we know it's Apple Terminal (when `nsterm` is `true`),
don't call these checks.
Tested on Terminal.app (2.14, 453) on macOS 14.4.1.
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
Problem: Page scrolling does not always place the cursor at the top or
bottom of the window (Mathias Rav)
Solution: Place the cursor at the top or bottom of the window.
(Luuk van Baal)
4b6b0c4024
TODO:
FUNC_API_REMOTE_ONLY APIs such as `nvim_ui_*` cannot (yet) be used in
`nvim_exec_lua`. We can change FUNC_API_REMOTE_ONLY to allow
Vimscript/Lua to pass an explicit `channel_id`. #28437
ref https://github.com/neovim/neovim/issues/19596
FAILED test/functional/plugin/health_spec.lua @ 37: :checkhealth completions can be listed via getcompletion()
test/functional/plugin/health_spec.lua:40: Expected objects to be the same.
Passed in:
(string) 'provider.node'
Expected:
(string) 'provider.clipboard'
stack traceback:
test/functional/plugin/health_spec.lua:40: in function <test/functional/plugin/health_spec.lua:37>
Problem:
Besides being redundant with vim.iter():flatten(), `tbl_flatten` has
these problems:
- Has `tbl_` prefix but only accepts lists.
- Discards some results! Compare the following:
- iter.flatten():
```
vim.iter({1, { { a = 2 } }, { 3 } }):flatten():totable()
```
- tbl_flatten:
```
vim.tbl_flatten({1, { { a = 2 } }, { 3 } })
```
Solution:
Deprecate tbl_flatten.
Note:
iter:flatten() currently fails ("flatten() requires a list-like table")
on this code from gen_lsp.lua:
local anonym = vim.iter({ -- remove nil
anonymous_num > 1 and '' or nil,
'---@class ' .. anonymous_classname,
}):flatten():totable()
Should we enhance :flatten() to work for arrays?
Problem: tests: test_winfixbuf is a bit slow
Solution: use defer if possible, reset hidden option, use --not-a-term
when starting Vim using system() (Yegappan Lakshmanan)
closes: vim/vim#146114baf908d60
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem:
While the fold level computation is incremental, the evaluation of the
foldexpr is done on the full buffer. Despite that the foldexpr reads
from the cache, it can take tens of milliseconds for moderately big (10K
lines) buffers.
Solution:
Track the range of lines on which the foldexpr should be evaluated.
Problem: Using xstrlcpy() when the exact length of the string to be
copied is known is not ideal because it requires adding 1 to
the length and an unnecessary strlen().
Solution: Add xmemcpyz() and use it in place of such xstrlcpy() calls.
runtime(bp): fix comment definition in filetype plugin (vim/vim#14594)
I somehow messed up the previous patch, I think a copy-paste error when
creating the file.
Blueprint files have C and C++ style comments, not shell-like '#'
comments.
cee034112d
Co-authored-by: Bruno BELANYI <bruno@belanyi.fr>
Problem:
The use-case for the convenience functions vim.iter.map(),
vim.iter.filter(), vim.iter.totable() is not clear.
Solution:
Drop them for now. We can revisit after 0.10 release.
Problem: runtime(uci): No support for uci file types
(Wu, Zhenyu)
Solution: include basic uci ftplugin and syntax plugins
(Colin Caine)
closes: vim/vim#145754b3fab14db
Co-authored-by: Colin Caine <complaints@cmcaine.co.uk>
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
runtime(java): Support "g:ftplugin_java_source_path" with archived files
Also, document for "g:ftplugin_java_source_path" its current
modification of the local value of the 'path' option.
closes: vim/vim#1457036e667ab83
Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
Problem: No test that completing a partial mapping clears 'showcmd'.
Solution: Complete partial mappings in Test_showcmd_part_map() instead
of using :echo. Adjust some comments (zeertzjq).
closes: vim/vim#14580094c4390bd
Problem:
We need to establish a pattern for `enable()`.
Solution:
- First `enable()` parameter is always `enable:boolean`.
- Update `vim.diagnostic.enable()`
- Update `vim.lsp.inlay_hint.enable()`.
- It was not released yet, so no deprecation is needed. But to help
HEAD users, it will show an informative error.
- vim.deprecate():
- Improve message when the "removal version" is a *current or older* version.
- Updates nixpkgs to source a necessary Tree-sitter version
- Updates to a new llvm version as the old one was removed from nixpkgs
- Properly moves `doCheck` from a regular param to an attribute option