Problem: tests: test_gettext fails when using shadow dir
Solution: Link the ru_RU directory into the shadow testdir
(James McCoy)
Link the ru_RU directory into shadow testdir
When the ru_RU locale is present, but the build is using a shadowdir,
then test_gettext_cp1251.vim and test_gettext_utf8.vim fail:
From test_gettext_cp1251.vim:
Executed Test_gettext() in 0.000848 seconds
Executed 1 test in 0.007010 seconds
1 FAILED:
Found errors in Test_gettext():
command line..script /home/runner/work/vim/vim/src/shadow/testdir/runtest.vim[607]..function RunTheTest[57]..Test_gettext line 9: Expected '������: ' but got 'ERROR: '
From test_gettext_utf8.vim:
Executed Test_gettext() in 0.000908 seconds
Executed 1 test in 0.007339 seconds
1 FAILED:
Found errors in Test_gettext():
command line..script /home/runner/work/vim/vim/src/shadow/testdir/runtest.vim[607]..function RunTheTest[57]..Test_gettext line 9: Expected '������: ' but got 'ERROR: '
This is because it's unable to load the translations from the ru_RU test
directory, since it wasn't symlinked into the shadow directory.
closes: #15591
Signed-off-by: James McCoy <jamessan@jamessan.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
The test_gettext* files need specific locales available to exercise
their tests.
related: #15591
Signed-off-by: James McCoy <jamessan@jamessan.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Sorting of fuzzy filename completion is not stable
Solution: Compare indexes when scores are equal. Fix some typos.
(zeertzjq)
closes: #15593
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Match '(,'),'[,'],'{, and '} marks in Ex command ranges.
Thanks to Maxim Kim.
Fixes#15332.
Closes#15337.
Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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: #15588
Signed-off-by: K.Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: possible crash with 2-byte encoding and glob2regpat()
(after v9.1.0700, v9.1.0702)
Solution: include both bytes for a multi-byte character for an
escaped character
closes: #15590
Signed-off-by: Christian Brabandt <cb@256bit.org>
Improving syntax highlighting by allowing numbers, - and a $ as suffix
in user constants and by allowing hwConstants in If-Then statements
closes: #15059
Signed-off-by: Tom Crecelius <holly@net-eclipse.net>
Signed-off-by: Ola Söder <rolfkopman@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: crash with NFA regex engine when searching for composing chars
(SuyueGuo)
Solution: When there is no composing character, break out of the loop
and check that out1 state is not null
fixes: #15583
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: possible crash with 2byte encoding and glob2regpat()
Solution: Skip over character, if it is multi-byte character
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: "dvgo" is not always an inclusive motion
(Iain King-Speir)
Solution: initialize the inclusive flag to false
fixes: #15580closes: #15582
Signed-off-by: Christian Brabandt <cb@256bit.org>
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: #15579
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: "Untitled" file not removed when running Test_crash1_3 alone
with TEST_FILTER (after v9.1.0695)
Solution: Use a TearDown function instead of another test.
(zeertzjq)
closes: #15578closes: #15577
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: installing runtime files fails when using SHADOWDIR
Solution: revert part of v9.1.0609, since runtime/doc/Makefile's default
value for VIMPROG does not work if vim was built in a SHADOWDIR.
(James McCoy)
closes: #15575
Signed-off-by: James McCoy <jamessan@jamessan.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: test_crash leaves Untitled file around
Solution: cleanup at the end of the test_crash.vim test file
Signed-off-by: Christian Brabandt <cb@256bit.org>
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: #15568
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Configure doesn't show result when not using python3 stable
abi (after v9.1.0691)
Solution: Add back AC_MSG_RESULT() (Ken Takata)
related: #15555
Signed-off-by: Ken Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Wrong patlen value in ex_substitute() (after 9.1.0426).
Solution: Compute patlen after finding end separator.
(zeertzjq)
Add a more explicit test. The test already passes as the only case
where a overlarge patlen value matters was fixed by patch 9.1.0689.
closes: #15565
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: python3: stable-abi may cause segfault on Python 3.11
(Audrius Kažukauskas, after v9.1.0668)
Solution: do not enable the stable Python ABI by default, only when used
with --with-python3-stable-abi argument is given
related: #15543
Signed-off-by: Christian Brabandt <cb@256bit.org>
Match :loadkeymap after Ex colons and bars.
Don't generate :loadkeymap as it is matched with a custom syntax group.
closes: #15554
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: cannot set special highlight kind in popupmenu
Solution: add kind_hlgroup item to complete function
(glepnir)
closes: #15561
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
In #14674, the Brazilian and Portuguese localization files were
erroneously combined, even though those are separate locales. This
reverts that change, but maintains some of the original typo fixes in
it.
closes: #15557
related: #14674
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
The end marker is not required to match the indent of :let when "trim"
is specified, it may also appear without leading whitespace as normal.
closes: #15564
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
* Improve heredoc handling
- Support "trim" for all the embedded scripts.
- Check the indent of "trim" for "let" and all the embedded scripts.
* Update missing part of vim.vim.base in the commit
d164f2a521.
* Update gen_syntax_vim.vim to catch up with 9.1.0685's source code.
closes: #15542
Signed-off-by: K.Takata <kentkt@csc.jp>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: dereferences NULL pointer in check_type_is_value()
(Suyue Guo)
Solution: Verify that the pointer is not Null
fixes: #15540closes: #15545
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Makefile may not install desktop files
Solution: Check for "$(DESTDIR)$(DATADIR)" instead of just "$DESTDIR",
which is usually not defined, add uninstall rules for the
icons and the desktop files
closes: #15528fixes: #15546
Signed-off-by: Christian Brabandt <cb@256bit.org>
This change does 2 things:
- make sure the mapping <Plug>ManBS sets the buffer to modified
to avoid a potential error message
- remove commented q mapping
fixes#15538closes: #15547
Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
- Obtain and pass through translated messages with this
function.
- If "g:java_foldtext_show_first_or_second_line" is defined,
assign this function to &foldtext.
closes: #15549
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: zip-plugin has problems with special characters
(user202729)
Solution: escape '*?[\' on Unix and handle those chars
a bit differently on MS-Windows, add a test, check
before overwriting files
runtime(zip): small fixes for zip plugin
This does the following:
- verify the unzip plugin is executable when loading the autoload plugin
- handle extracting file names with '[*?\' in its name correctly by
escaping those characters for the unzip command (and handle those
characters a bit differently on MS-Windows, since the quoting is different)
- verify, that the extract plugin is not overwriting a file (could cause
a hang, because unzip asking for confirmation)
- add a test zip file which contains those special file names
fixes: #15505closes: #15519
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: too many strlen() calls in usercmd.c
Solution: refactor code to reduce the number or strlen() calls
(John Marriott)
closes: #15516
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>