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:
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.
Problem:
The order of the validation performed by vim.validate() is
unpredictable.
- harder to write reliable tests.
- confusing UX because validation result might return different errors randomly.
Solution:
Iterate the input using `vim.spairs()`.
Future:
Ideally, the caller could provide an "ordered dict".
compiler(rime_deployer): include new compiler, use it for '*.custom.yaml' files (vim/vim#14460)
8a31de6dd2
Co-authored-by: wzy <32936898+Freed-Wu@users.noreply.github.com>
Problem: filetype: some requirements files are not recognized
Solution: Detect '*-requirements.txt', 'constraints.txt',
'requirements.in', 'requirements/*.txt' and 'requires/*.txt'
as requirements filetype, include pip compiler, include
requirements filetype and syntax plugin
(Wu, Zhenyu, @raimon49)
closes: vim/vim#14379f9f5424d3e
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Co-authored-by: raimon <raimon49@hotmail.com>
runtime(java): Recognise non-ASCII identifiers (vim/vim#14543)
* runtime(java): Recognise non-ASCII identifiers
Also:
- Remove the already commented out and less general in its
definition javaFuncDef alternative.
- Stop recognising some bespoke {p,trace} debugging API.
Non-ASCII identifiers have been supported from the outset
of the Java language.
> An _identifier_ is an unlimited-length sequence of _Java
> letters_ and _Java digits_, the first of which must be a
> Java letter. An identifier cannot have the same spelling
> (Unicode character sequence) as a keyword . . . Boolean
> literal . . . or the null literal . . .
> . . . . . . . .
> Letters and digits may be drawn from the entire Unicode
> character set . . .
> . . . . . . . .
> A Java letter is a character for which the method
> Character.isJavaLetter . . . returns true. A Java
> letter-or-digit is a character for which the method
> Character.isJavaLetterOrDigit . . . returns true.
> . . . . . . . .
> The Java letters include . . . for historical reasons, the
> ASCII underscore (_) . . . and dollar sign ($) . . .
(Separate syntax tests will be written when particular parts
now touched will have been further improved.)
Reference:
https://javaalmanac.io/jdk/1.0/langspec.pdf [§3.8]
* Take on the maintenance of Java filetype and syntax files
4052474a1b
Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
Problem: filetype: some mail tools not recognized
Solution: Detect '.mbsncrc' as conf, '.msmtprc' as msmtp
and '.notmuch-config' as ini filetype
(Shane-XB-Qian)
closes: vim/vim#14533a7a9a476cf
Co-authored-by: shane.xb.qian <shane.qian@foxmail.com>
runtime(i3config/swayconfig): update syntax scripts
modifications with the goals of:
- simplifying structure by using group `cluster`s
- improving visual highlighting responsiveness by using `nextgroup`
- improving recursive wm-msg command highlighting
- separating command variants meant for runtime and for config only
closes: vim/vim#14544dd83b63eb5
Problem:
vim.diagnostic.enable() does not match the signature of vim.lsp.inlay_hint.enable()
Solution:
- Change the signature so that the first 2 args are (bufnr, enable).
- Introduce a 3rd `opts` arg.
- Currently it only supports `opts.ns_id`.
Problem:
:checkhealth node.js check fails:
ERROR Failed to run healthcheck for "provider.node" plugin ...
node/health.lua:98: attempt to call local 'message' (a string value)
`message` is called as a function, when it is actually a string.
Solution:
Pass `message` to `warn()` as an argument.
Fix#28346
Problem:
`vim.diagnostic.is_disabled` and `vim.diagnostic.disable` are unnecessary
and inconsistent with the "toggle" pattern (established starting with
`vim.lsp.inlay_hint`, see https://github.com/neovim/neovim/pull/25512#pullrequestreview-1676750276
As a reminder, the rationale is:
- we always need `enable()`
- we always end up needing `is_enabled()`
- "toggle" can be achieved via `enable(not is_enabled())`
- therefore,
- `toggle()` and `disable()` are redundant
- `is_disabled()` is a needless inconsistency
Solution:
- Introduce `vim.diagnostic.is_enabled`, and `vim.diagnostic.enable(…, enable:boolean)`
- Note: Future improvement would be to add an `enable()` overload `enable(enable:boolean, opts: table)`.
- Deprecate `vim.diagnostic.is_disabled`, `vim.diagnostic.disable`
Problem:
vim.ui.open "locks up" Nvim if the spawned process does not terminate. #27986
Solution:
- Change `vim.ui.open()`:
- Do not call `wait()`.
- Return a `SystemObj`. The caller can decide if it wants to `wait()`.
- Change `gx` to `wait()` only a short time.
- Allows `gx` to show a message if the command fails, without the
risk of waiting forever.
runtime(vim): Update base-syntax, fix nested function folding (vim/vim#14397)
Only match function folding start and end patterns at the start of a
line, excluding heredocs and :append/:change/:insert commands.
Fixesvim/vim#143934ba70cab37
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): don't set compiler, update a comment for vimdoc compiler (vim/vim#14532)
e92ed1b45c
Co-authored-by: Shane-XB-Qian <shane.qian@foxmail.com>
Problem: String interpolation fails for Dict type
Solution: Support Dict data type properly, also support :put =Dict
(without having to convert it to string() first)
(Yegappan Lakshmanan)
fixes: vim/vim#14529closes: vim/vim#14541f01493c550
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: noautocmd is confusing; despite its name, it doesn't block all
autocommands (instead it blocks only those related to setting the buffer), and
is commonly used by plugins to open windows while producing minimal
side-effects.
Solution: be consistent and block all autocommands when noautocmd is set.
This includes WinNew (again), plus autocommands from entering the window (if
enter is set) like WinEnter, WinLeave, TabEnter, .etc.
See the discussion at https://github.com/neovim/neovim/pull/14659#issuecomment-2040029517
for more information.
Remove win_set_buf's noautocmd argument, as it's no longer needed.
NOTE: pum_create_float_preview sets noautocmd for win_set_buf, but all its
callers already use block_autocmds.
Despite that, pum_create_float_preview doesn't actually properly handle
autocommands (it has no checks for whether those from win_enter or
nvim_create_buf free the window).
For now, ensure autocommands are blocked within it for correctness (in case it's
ever called outside of a block_autocmds context; the function seems to have been
refactored in #26739 anyway).
runtime(vim): Update base-syntax, add legacy header folding
Allow for syntax-based folding of Vim9 script legacy header regions.
This is enabled with the "H" flag of the g:vimsyn_folding config variable.
closes: vim/vim#14530ce06493aeb
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
runtime(i3config): Line continuation is not detected for 'set' command (vim/vim#14531)
Problem: Valid i3config syntax is highlighted as error.
Solution: Skip over line-breaks correctly.
5392970921
Co-authored-by: julio-b <julio.bacel@gmail.com>
runtime(go): fix highlighting import string followed by some comment (vim/vim#14538)
122d068585
Co-authored-by: Linda_pp <rhysd@users.noreply.github.com>
Problem:
The `:terminal` auto-close logic does not support `&shell` that has
arguments, e.g., `/bin/bash -O globstar`.
Solution:
Join `argv` and match `&shell`. This is not perfect since `&shell` may
contain irregular spaces and quotes, but it seems to be good enough.