This will fix the following error when using generators that have a
space in them, e.g. "Unix Makefiles":
"CMake Error: Could not create named generator Unix".
Closes https://github.com/neovim/neovim/issues/30218.
- Match -addr and -keepscript attributes and generate -addr values.
- Match attribute errors where = is specified.
- Highlight attributes with Special like other Ex command options.
- Don't highlight user-specified completion function args.
- Match :delcommand -buffer attribute.
closes: vim/vim#155863c07eb0c67
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Recognize colon-delimited second part of Runas_Spec that specifies
permitted groups, e.g.:
alan ALL = (root, bin : operator, system) ALL
This implementation is sloppy because it accepts any amount of colons
delimiting further Runas_Lists, but for now that's better than bailing
out completely as soon as a colon is encountered (esp. given that the
default sudoers uses these colons, breaking highlighting OOTB).
Also, while at it, make Vim recognize all Tag_Spec items, not just
{,NO}PASSWD
closes: vim/vim#15607bd69b39514
Co-authored-by: Christian Brabandt <cb@256bit.org>
For context, see https://github.com/neovim/neovim/pull/24738. Before
that PR, Nvim did not correctly handle captures with quantifiers. That
PR made the correct behavior opt-in to minimize breaking changes, with
the intention that the correct behavior would eventually become the
default. Users can still opt-in to the old (incorrect) behavior for now,
but this option will eventually be removed completely.
BREAKING CHANGE: Any plugin which uses `Query:iter_matches()` must
update their call sites to expect an array of nodes in the `match`
table, rather than a single node.
Problem: Window is updated with potentially invalid skipcol in recursive
window update path. I.e. cursor outside of visible range in
large line that does not fit.
Solution: Make sure it is valid (Luuk van Baal).
3d5065fc75
Match '(,'),'[,'],'{, and '} marks in Ex command ranges.
Thanks to Maxim Kim.
Fixesvim/vim#15332.
Closesvim/vim#15337.
d817609b87
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Problem: inserting with a count is inefficient
Solution: Disable calculation of the cursor position and topline, if a
count has been used (Ken Takata)
Optimize insertion when using :normal 10000ix.
This patch optimizes the insertion with a large count (e.g. `:normal
10000ix`).
It seems that calculation of the cursor position for a long line is slow
and it takes O(n^2). Disable the calculation if not needed.
Before:
```
$ time ./vim --clean -c 'normal 10000ix' -cq!
real 0m1.879s
user 0m1.328s
sys 0m0.139s
$ time ./vim --clean -c 'normal 20000ix' -cq!
real 0m5.574s
user 0m5.421s
sys 0m0.093s
$ time ./vim --clean -c 'normal 40000ix' -cq!
real 0m23.588s
user 0m23.187s
sys 0m0.140s
```
After:
```
$ time ./vim --clean -c 'normal 10000ix' -cq!
real 0m0.187s
user 0m0.046s
sys 0m0.093s
$ time ./vim --clean -c 'normal 20000ix' -cq!
real 0m0.217s
user 0m0.046s
sys 0m0.108s
$ time ./vim --clean -c 'normal 40000ix' -cq!
real 0m0.278s
user 0m0.093s
sys 0m0.140s
$ time ./vim --clean -c 'normal 80000ix' -cq!
real 0m0.494s
user 0m0.311s
sys 0m0.140s
$ time ./vim --clean -c 'normal 160000ix' -cq!
real 0m1.302s
user 0m1.140s
sys 0m0.094s
```
closes: vim/vim#1558809b80d23cf
Co-authored-by: Ken Takata <kentkt@csc.jp>
Problem: [security]: invalid cursor position may cause a crash
(after v9.1.0038)
Solution: Set cursor to the last character in a line, if it would
otherwise point to beyond the line; no tests added, as it
is unclear how to reproduce this.
Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-4ghr-c62x-cqfh396fd1ec29
Co-authored-by: Christian Brabandt <cb@256bit.org>
Using powershell as the default windows shell as using cmd alters $PATH
in a way that makes building neovim fail (powershell prioritizes visual
studio tools which is arguably more correct).
This was tested with gnu make for windows, which can be installed with
e.g. scoop. It does not work with nmake and it is extremely unlikely we
want to add nmake support as the makefile is merely supposed to be
syntactic sugar for the most common case. For similar reasons, the only
supported generator is ninja.
Problem: completion is inserted on Enter with "noselect"
(Carman Fu)
Solution: check noselect before update compl_shown_match
(glepnir)
fixes: vim/vim#15526closes: vim/vim#15530753794bae8
To check for a non-ASCII character, the condition should be >= 0x80, not
> 0x80. In this case it doesn't really matter as the 0x80 character is
unprintable and occupies 4 cells, but still make it consistent.
Problem: Behavior of Enter in completion depends on typing speed.
Solution: Don't make whether Enter selects original text depend on
whether completion has been interrupted, which can happen
interactively with a slow completion function.
Problem: prefix can be a symbol like period, the fuzzy matching can't
handle it correctly.
Solution: when prefix is empty or a symbol add all lsp completion
result into matches.
Use the grapheme break algorithm from utf8proc to support grapheme
clusters from recent unicode versions.
Handle variant selector VS16 turning some codepoints into double-width
emoji. This means we need to use ptr2cells rather than char2cells when
possible.
Improving syntax highlighting by allowing numbers, - and a $ as suffix
in user constants and by allowing hwConstants in If-Then statements
closes: vim/vim#1505987c01d9561
Co-authored-by: Tom Crecelius <holly@net-eclipse.net>
Problem: completion items can now have dedicated highlighting (through
`hl_group` and `kind_hlgroup` fields). Both of the fields combine
their highlight attributes with the underlying `PmenuXxx` group.
As default color scheme `Pmenu` and `PmenuSel` are intentionally
almost inverted versions of one another, the added highlighting will
be unreadable in one of them if done only through foreground (which is
the most convenient way for users and being able to do so is arguably
the biggest benefit of actually combining added highlighting).
Solution: adjust `PmenuSel` to utilize `attr=reverse`. This works
because `fg`/`bg` are first combined and only then reversed. This
results in a colored background for items with `hl_group` and
`kind_hlgroup` using text highlighting.
This also results in the same background for regular selected item,
while intentionally changing foreground from `Nvim{Light,Dark}Grey3`
to (essentially) `Nvim{Light,Dark}Grey2`. This both provides better
contrast ratio and does not need realigning of the whole block.
Problem:
Things like underlines are always given a default foreground highlight
regardless of the value of `sp`.
Solution:
Check for `sp` first, and apply that color to the text decoration color if it
exists.
Limitations:
If there is no value of `sp`, vim applies a text decoration color that matches
the foreground of the text. This is still not implemented (and seems like a much
more complex problem): in TOhtml, the underline will still be given a default
foreground highlight.
Problem: "dvgo" is not always an inclusive motion
(Iain King-Speir)
Solution: initialize the inclusive flag to false
fixes: vim/vim#15580closes: vim/vim#15582f8702aeb8f
Co-authored-by: Christian Brabandt <cb@256bit.org>
This reverts commit 7f6ff829aa.
The given reasoning and usecase is unsatisfactory. While it is true that
it allows to run `make build/bin/nvim`, it can easily be recreated with
`ninja -C build bin/nvim` which does the exact same thing. This minor
convenience is not worth adding the extra code given how rare this
usecase should be.
Introduce a new API variable "g:java_syntax_previews" whose
value must be a list of syntax preview feature numbers.
Enumerate the currently supported numbers in a table at the
end of the documentation entry for "ft-java-syntax".
Also, disable the recognition of String Templates. Despite
the withdrawal of this preview feature in its proposed form
from the upcoming JDK 23 release and the fact that the JDK
22 release is coming to EOL this September, an earlier
iteration of this preview feature was included in JDK 21
(LTS) whose EOL is projected to fall due in late 2028 and,
therefore, retain the current implementation.
Define "g:java_syntax_previews" and include number 430 in
its list to enable the recognition of String Templates:
------------------------------------------------------------
let g:java_syntax_previews = [430]
------------------------------------------------------------
References:
https://openjdk.org/jeps/430 (Preview)
https://openjdk.org/jeps/459 (Second Preview)
https://openjdk.org/jeps/465 (Third Preview)
https://mail.openjdk.org/pipermail/amber-spec-experts/2024-April/004106.htmlcloses: vim/vim#155798556e23ee9
Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
Problem: Installing treesitter parser is hard (harder than
climbing to heaven).
Solution: Add optional support for wasm parsers with `wasmtime`.
Notes:
* Needs to be enabled by setting `ENABLE_WASMTIME` for tree-sitter and
Neovim. Build with
`make CMAKE_EXTRA_FLAGS=-DENABLE_WASMTIME=ON
DEPS_CMAKE_FLAGS=-DENABLE_WASMTIME=ON`
* Adds optional Rust (obviously) and C11 dependencies.
* Wasmtime comes with a lot of features that can negatively affect
Neovim performance due to library and symbol table size. Make sure to
build with minimal features and full LTO.
* To reduce re-compilation times, install `sccache` and build with
`RUSTC_WRAPPER=<path/to/sccache> make ...`
Problem: The matchparen plugin is slow on a long line.
Solution: Don't use a regexp to get char at and before cursor.
(zeertzjq)
Example:
```vim
call setline(1, repeat(' foobar', 100000))
runtime plugin/matchparen.vim
normal! $hhhhhhhh
```
closes: vim/vim#1556881e7513c86