patch 9.1.1290: tests: missing cleanup in test_filetype.vim
Problem: tests: missing cleanup in test_filetype.vim, wrong name in
test_plugin_matchparen
Solution: Add :bwipe corresponding to :split, rename test case
closes: #17088
Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Phạm Bình An [Tue, 8 Apr 2025 18:40:12 +0000 (20:40 +0200)]
runtime(help): add omni completion and 'iskeyword' to filetype plugin
Problem:
- Help tags provide a good way to navigate the Vim documentation, but
many help documents don't use them effectively. I think one of the
reasons is that help writers have to look up help tags manually with
`:help` command, which is not very convenient.
- 'iskeyword' is only set for help buffers opened by `:help` command.
That means if I'm editing a help file, I cannot jump to tag in same
file using `Ctrl-]` unless I manually set it, which is annoying.
Solution:
- Add omni completion for Vim help tags.
- Set 'iskeyword' for `ft-help`
closes: #17073
Co-authored-by: Christian Brabandt <cb@256bit.org> Signed-off-by: Phạm Bình An <phambinhanctb2004@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1288: Using wrong window in ll_resize_stack()
Problem: Using wrong window in ll_resize_stack()
(after v9.1.1287)
Solution: Use "wp" instead of "curwin", even though they are always the
same value. Fix typos in documentation (zeertzjq).
closes: #17080
Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1284: not possible to configure pum truncation char
Problem: not possible to configure the completion menu truncation
character
Solution: add the "trunc" suboption to the 'fillchars' setting to
configure the truncation indicator (glepnir).
closes: #17006
Co-authored-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: glepnir <glephunter@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1283: quickfix stack is limited to 10 items
Problem: quickfix and location-list stack is limited to 10 items
Solution: add the 'chistory' and 'lhistory' options to configure a
larger quickfix/location list stack
(64-bitman)
patch 9.1.1276: inline word diff treats multibyte chars as word char
Problem: inline word diff treats multibyte chars as word char
(after 9.1.1243)
Solution: treat all non-alphanumeric characters as non-word characters
(Yee Cheng Chin)
Previously inline word diff simply used Vim's definition of keyword to
determine what is a word, which leads to multi-byte character classes
such as emojis and CJK (Chinese/Japanese/Korean) characters all
classifying as word characters, leading to entire sentences being
grouped as a single word which does not provide meaningful information
in a diff highlight.
Fix this by treating all non-alphanumeric characters (with class number
above 2) as non-word characters, as there is usually no benefit in using
word diff on them. These include CJK characters, emojis, and also
subscript/superscript numbers. Meanwhile, multi-byte characters like
Cyrillic and Greek letters will still continue to considered as words.
Note that this is slightly inconsistent with how words are defined
elsewhere, as Vim usually considers any character with class >=2 to be
a "word".
patch 9.1.1275: MS-Windows: Not possible to pass additional flags to Make_mvc
Problem: MS-Windows: Not possible to pass additional flags to Make_mvc
Solution: Introduce $CI_FLAGS and use it to pass additional flags for
the Github CI in order to treat size conversion warnings
(C4267) as errors (Yegappan Lakshmanan)
closes: #17028
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1272: completion: in keyword completion Ctrl_P cannot go back after Ctrl_N
Problem: completion: in keyword completion Ctrl_P cannot go back after
Ctrl_N
Solution: in find_compl_when_fuzzy() always return first match of array, after Ctrl_P
use compl_shown_match->cp_next instead of compl_first_match.
(glepnir)
closes: #17043
Signed-off-by: glepnir <glephunter@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1271: filetype: Power Query files are not recognized
Problem: filetype: Power Query files are not recognized
Solution: detect '*.pq' as pq filetype, include pq syntax and filetype
plugin (Anarion Dunedain)
Microsoft Power Query provides a powerful data import experience that
encompasses many features. Power Query works with desktop Analysis
Services, Excel, and Power BI workbooks, in addition to many online
services, such as Fabric, Power BI service, Power Apps, Microsoft 365
Customer Insights, and more. A core capability of Power Query is to
filter and combine, that is, to mash-up data from one or more of a rich
collection of supported data sources. Any such data mashup is expressed
using the Power Query M formula language. The M language is a
functional, case sensitive language similar to F#.
Reference:
- Power Query M formula language overview:
https://learn.microsoft.com/en-us/powerquery-m/
closes: #17045
Signed-off-by: Anarion Dunedain <anarion80@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1269: completion: compl_shown_match is updated when starting keyword completion
Problem: compl_shown_match is updated when starting keyword completion
and does not include fuzzy matching.
Solution: Do not update compl_shown_match when starting keyword
completion, since it is the one already selected by the
keyword completion direction. (glepnir)
closes: #17033
Signed-off-by: glepnir <glephunter@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1268: filetype: dax files are not recognized
Problem: filetype: dax files are not recognized
Solution: detect "*.dax" as dax filetype, include dax filetype and
syntax plugin (Anarion Dunedain)
Data Analysis Expressions (DAX) is a formula expression language used in
Analysis Services, Power BI, and Power Pivot in Excel. DAX formulas
include functions, operators, and values to perform advanced
calculations and queries on data in related tables and columns in
tabular data models.
DAX language overview:
- https://learn.microsoft.com/en-us/dax/dax-overview
closes: #17035
Signed-off-by: Anarion Dunedain <anarion80@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime(openPlugin): fix E480 when opening URLs with wildcards on Windows
This might be a bug in Windows Vim, as when using the following command
it throws E480:
```
:com! -complete=file -nargs=1 :Echo echo <q-args>
:Echo ?
E480: No match ?
```
Work-around this by using `-nargs=*` to allow more arguments, even
though this is not completely correct.
patch 9.1.1263: string length wrong in get_last_inserted_save()
Problem: string length wrong in get_last_inserted_save()
(after v9.1.1222)
Solution: when removing trailing ESC, also decrease the string length
(Christ van Willegen)
closes: #16961
Signed-off-by: Christ van Willegen <cvwillegen@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Hirohito Higashi [Sun, 30 Mar 2025 13:19:05 +0000 (15:19 +0200)]
patch 9.1.1262: heap-buffer-overflow with narrow 'pummaxwidth' value
Problem: heap-buffer-overflow occurs with narrow 'pummaxwidth' value
(after v9.1.1250)
Solution: test that st_end points after st pointer (Hirohito Higashi)
closes: #17005
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
ci: Check and confirm Vim feature flags exist before testing
Vim tests for features such as python3 relies on checking the feature
flag exists by doing `has('python3')`. However, if the feature itself is
broken and the flag returns 0, the relevant tests will simply silently
get ignored and CI will passed erroneously. As a preventive measure, as
basic checks to make sure certain feature flags are correct as a basic
smoke test.
Currently only checking two types of feature flags:
1. Features that depend on system packages being installed properly
(e.g. sodium) and could be erroneously dropped if the CI environment
changed or a bug exists in the configure script.
2. Scripting languages. When in dynamic mode, these feature flags (e.g.
"ruby", "python3") will return 0 when the lib cannot be found or the
code has an initialization bug. This happened in #16964 where CI
still passed despite Python 3 being broken.
closes: #16998
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Aliaksei Budavei [Sat, 29 Mar 2025 08:16:30 +0000 (09:16 +0100)]
runtime(java): Make changes for JDK 24 in syntax script
- "Demote" SecurityManager from the list of java.lang class
types to javaLangDeprecated.
- Reintroduce supported syntax-preview-feature numbers 455
and 476 as _new numbers_ 488 and 494, respectively.
References:
- https://openjdk.org/jeps/486 (Permanently Disable the Security Manager)
- https://openjdk.org/jeps/488 (Primitive Types in Patterns etc.)
- https://openjdk.org/jeps/494 (Module Import Declarations)
closes: #16977
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1258: regexp: max \U and \%U value is limited by INT_MAX
Problem: regexp: max \U and \%U value is limited by INT_MAX but gives a
confusing error message (related: v8.1.0985).
Solution: give a better error message when the value reaches INT_MAX
When searching Vim allows to get up to 8 hex characters using the /\V
and /\%V regex atoms. However, when using "/\UFFFFFFFF" the code point is
already above what an integer variable can hold, which is 2,147,483,647.
Since patch v8.1.0985, Vim already limited the max codepoint to INT_MAX
(otherwise it caused a crash in the nfa regex engine), but instead of
error'ing out it silently fell back to parse the number as a backslash
value and not as a codepoint value and as such this "/[\UFFFFFFFF]" will
happily find a "\" or an literal "F". And this "/[\d127-\UFFFFFFFF]"
will error out as "reverse range in character class).
Interestingly, the max Unicode codepoint value is U+10FFFF which still
fits into an ordinary integer value, which means, that we don't even
need to parse 8 hex characters, but 6 should have been enough.
However, let's not limit Vim to search for only max 6 hex characters
(which would be a backward incompatible change), but instead allow all 8
characters and only if the codepoint reaches INT_MAX, give a more
precise error message (about what the max unicode codepoint value is).
This allows to search for "[\U7FFFFFFE]" (will likely return "E486
Pattern not found") and "[/\U7FFFFFF]" now errors "E1517: Value too
large, max Unicode codepoint is U+10FFFF".
While this change is straight forward on architectures where long is 8
bytes, this is not so simple on Windows or 32bit architectures where long
is 4 bytes (and therefore the test fails there). To account for that,
let's make use of the vimlong_T number type and make a few corresponding
changes in the regex engine code and cast the value to the expected data
type. This however may not work correctly on systems that doesn't have
the long long datatype (e.g. OpenVMS) and probably the test will fail
there.
zeertzjq [Sat, 29 Mar 2025 08:05:52 +0000 (09:05 +0100)]
patch 9.1.1257: Mixing vim_strsize() with mb_ptr2cells() in pum_redraw()
Problem: Mixing vim_strsize() with mb_ptr2cells() in pum_redraw().
Solution: Change vim_strsize() to mb_string2cells() (zeertzjq).
Since vim_strsize() uses ptr2cells() for the cell width of each char, it
is strange to mix it with mb_ptr2cells(), which is used both just below
and in pum_screen_puts_with_attr(), and screen_puts_len() also uses
something similar. Meanwhile mb_string2cells() uses mb_ptr2cells() for
the cell width of each char.
Note that the vim_strsize() and mb_string2cells() actually return the
same value here, as the transstr() above makes sure the string only
contains printable chars, and ptr2cells() and mb_ptr2cells() only return
different values for unprintable chars.
closes: #17003
Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
glepnir [Fri, 28 Mar 2025 18:21:59 +0000 (19:21 +0100)]
patch 9.1.1255: missing test condition for 'pummaxwidth' setting
Problem: missing test condition for 'pummaxwidth' setting, pummaxwidth
not effective when width is 32 and height is 10
(after v9.1.1250)
Solution: add missing comparison condition in pum_width()
(glepnir)
closes: #16999
Signed-off-by: glepnir <glephunter@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1253: abort when closing window with attached quickfix data
Problem: If win_close() is called with a window that has quickfix stack
attached to it, the corresponding quickfix buffer will be
closed and freed after the buffer was already closed. At that
time curwin->w_buffer points to NULL, which the CHECK_CURBUF
will catch and abort if ABORT_ON_ERROR is defined
Solution: in wipe_qf_buffer() temporarily point curwin->w_buffer back to
curbuf, the window will be closed anyhow, so it shouldn't
matter that curbuf->b_nwindows isn't incremented.
closes: #16993
closes: #16985
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime(doc): non-portable sed regex in Makefile for pi_netrw.txt rule
Previously it was using '\0' in sed which is non-portable and does not
work in macOS. Fix this by using the '$' (end-of-line) regex atom (which
needs to be doubled in the Makefile) to append at the end instead. An
alternative would have been to use '&' which is the more portable
version of '\0'.
closes: #16996
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
John Marriott [Thu, 27 Mar 2025 17:12:32 +0000 (18:12 +0100)]
patch 9.1.1248: compile error when building without FEAT_QUICKFIX
Problem: compile error when building without FEAT_QUICKFIX
Solution: adjust ifdefs in popupwin.c, add CheckFeature quickfix
to a few tests (John Marriott, Hirohito Higashi)
closes: #16940
closes: #16962
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com> Co-authored-by: Zoltan Arpadffy <zoltan.arpadffy@gmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: John Marriott <basilisk@internode.on.net> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1247: fragile setup to get (preferred) keys from key_name_entry
Problem: fragile setup to get (preferred) keys from key_name_entry
(after v9.1.1179)
Solution: refactor the code further, fix a bug with "pref_name" key
entry introduced in v9.1.1180 (Yee Cheng Chin)
The optimization introduced for using bsearch() with key_name_entry
in #16788 was fragile as it required synchronizing a non-obvious index
(e.g. IDX_KEYNAME_SWU) with the array that could be accidentally changed
by any one adding a key to it. Furthermore, the "pref_name" that was
introduced in that change was unnecessary, and in fact introduced a bug,
as we don't always want to use the canonical name.
The bug is triggered when the user triggers auto-complete using a
keycode, such as `:set <Scroll<Tab>`. The bug would end up showing two
copies of `<ScrollWheelUp>` because both entries end up using the
canonical name.
In this change, remove `pref_name`, and simply use a boolean to track
whether an entry is an alt name or not and modify logic to respect that.
Add test to make sure auto-complete works with alt names
patch 9.1.1243: diff mode is lacking for changes within lines
Problem: Diff mode's inline highlighting is lackluster. It only
performs a line-by-line comparison, and calculates a single
shortest range within a line that could encompass all the
changes. In lines with multiple changes, or those that span
multiple lines, this approach tends to end up highlighting
much more than necessary.
Solution: Implement new inline highlighting modes by doing per-character
or per-word diff within the diff block, and highlight only the
relevant parts, add "inline:simple" to the defaults (which is
the old behaviour)
This change introduces a new diffopt option "inline:<type>". Setting to
"none" will disable all inline highlighting, "simple" (the default) will
use the old behavior, "char" / "word" will perform a character/word-wise
diff of the texts within each diff block and only highlight the
differences.
The new char/word inline diff only use the internal xdiff, and will
respect diff options such as algorithm choice, icase, and misc iwhite
options. indent-heuristics is always on to perform better sliding.
For character highlight, a post-process of the diff results is first
applied before we show the highlight. This is because a naive diff will
create a result with a lot of small diff chunks and gaps, due to the
repetitive nature of individual characters. The post-process is a
heuristic-based refinement that attempts to merge adjacent diff blocks
if they are separated by a short gap (1-3 characters), and can be
further tuned in the future for better results. This process results in
more characters than necessary being highlighted but overall less visual
noise.
For word highlight, always use first buffer's iskeyword definition.
Otherwise if each buffer has different iskeyword settings we would not
be able to group words properly.
The char/word diffing is always per-diff block, not per line, meaning
that changes that span multiple lines will show up correctly.
Added/removed newlines are not shown by default, but if the user has
'list' set (with "eol" listchar defined), the eol character will be be
highlighted correctly for the specific newline characters.
Also, add a new "DiffTextAdd" highlight group linked to "DiffText" by
default. It allows color schemes to use different colors for texts that
have been added within a line versus modified.
This doesn't interact with linematch perfectly currently. The linematch
feature splits up diff blocks into multiple smaller blocks for better
visual matching, which makes inline highlight less useful especially for
multi-line change (e.g. a line is broken into two lines). This could be
addressed in the future.
As a side change, this also removes the bounds checking introduced to
diff_read() as they were added to mask existing logic bugs that were
properly fixed in #16768.
closes: #16881
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1242: Crash when evaluating variable name
Problem: Crash when evaluating variable name (after v9.1.0870)
Solution: calculate the strlen() directly instead of pointer
arithmetics, fix missing assignment to lp->ll_name_end in
get_lval() (zeertzjq)
patch 9.1.1239: if_python: no tuple data type support
Problem: if_python: no tuple data type support (after v9.1.1232)
Solution: Add support for using Vim tuple in the python interface
(Yegappan Lakshmanan)
closes: #16964
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
phanium [Tue, 25 Mar 2025 19:15:31 +0000 (20:15 +0100)]
patch 9.1.1238: wrong cursor column with 'set splitkeep=screen'
Problem: With ':set splitkeep=screen', cursor did't restore column
correctly when splitting a window on a line longer than the
last line on the screen (after v9.1.0707)
Solution: Restore cursor column in `win_fix_scroll()` since it may be
changed in `getvcol()` after 396fd1ec2956 (phanium).
Hirohito Higashi [Tue, 25 Mar 2025 19:08:32 +0000 (20:08 +0100)]
patch 9.1.1237: Compile error with C89 compiler in term.c
Problem: Compile error with C89 compiler in term.c
(Zoltan Arpadffy)
Solution: split out LOG_TR macro into 2 different macros. LOG_TR1 that
takes only a single argument and LOG_TRN that takes 2
arguments. Remove the use of ##__VA_ARGS__ since the macro is
now always called with 2 arguments (Hirohito Higashi)
related: #16962
closes: #16969
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
zeertzjq [Mon, 24 Mar 2025 19:22:23 +0000 (20:22 +0100)]
patch 9.1.1233: Coverity warns about NULL pointer when triggering WinResized
Problem: Coverity warns about NULL pointer when triggering WinResized
Solution: Add OOM checks for windows_list like for scroll_dict. Remove
void casts that are unnecessary after 9.1.1084 (zeertzjq).
closes: #16959
Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>