Problem: Vim9: null_object and null_class are no reserved names
Solution: Add null_object and null_class as reserved names.
(Yegappan Lakshmanan)
closes: #17054
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: too long functions in vim9type.c
Solution: refactor into separate functions
(Yegappan Lakshmanan)
closes: #17056
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: trailing comment char in test_popupwin
Solution: remove crufty tail comment (Doug Kearns)
Remove a crufty tail comment from Test_popup_with_border_and_padding().
The line used to be in a string list and the closing quote and comma
persist.
closes: #17058
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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".
related: #16881 (diff inline highlight)
closes: #17050
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Improve backslash handling in :set option values. There is no special
handling for options supporting Windows path separators yet.
See :help option-backslash.
Remove the vimSetString syntax group. Option string values cannot be
specified with a quoted string, this is a command terminating tail
comment.
fixes: #16913closes: #17034
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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>
Problem: Vim9: no support for object<type> as variable type
Solution: add support for object<type> (Yegappan Lakshmanan)
closes: #17041
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Coverity warns about using uninitialized value
(after 9.1.1270).
Solution: Put an empty string in "buf" when allocation fails (zeertzjq).
closes: #17040
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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>
Allow the opening parenthesis of a command substitution to appear at
EOL.
This fixes the issue raised in
https://github.com/vim/vim/issues/17026#issuecomment-2774112284.
closes: #17044
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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>
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>
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-overviewcloses: #17035
Signed-off-by: Anarion Dunedain <anarion80@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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.
fixes: #17029
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: no support for type list/dict<object<any>>
Solution: add proper support for t_object_any
(Yegappan Lakshmanan)
closes: #17025
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: no tests for typing normal char during completion
Solution: add a test verifying the default behaviour (see :h
popupmenu-completion)
related: #17019
Co-authored-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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>
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>
Problem: No test for 'pummaxwidth' non-truncated items (after v9.1.1250)
Solution: Add shorter items to Test_pum_maxwidth_multibyte() (zeertzjq).
closes: #17007
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: some issues with comment package and tailing spaces
Solution: correctly capture trailing spaces with the ac/ic text object
(Maxim Kim)
This commit fixes a few issues with the comment package:
1) both ac and ic incorrectly miss the last //
```
// hello trailing spaces
//
```
2) fix ac/ic with last empty comment line,
vac should also select last line with #
```py
# print("hello")
# print("world")
#
#
$endofbuffer$
```
closes: #17013
Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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>
- "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>
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.
fixes: #16949closes: #16994
Signed-off-by: Christian Brabandt <cb@256bit.org>
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>
Tuples were introduced in commit 9cb865e. See PR #16776.
fixes: #16965closes: #16935
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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>
Problem: need more tests for the comment plugin
Solution: add a tests for the [gb]:comment_first_col setting
(Maxim Kim)
closes: #16995
Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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: #16993closes: #16985
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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>
Problem: Typos in code and docs related to 'diffopt' "inline:".
(after v9.1.1243)
Solution: Fix typos and slightly improve the docs.
(zeertzjq)
closes: #16997
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>