1
0
forked from aniani/vim

20146 Commits

Author SHA1 Message Date
Christian Brabandt
bd69b39514
runtime(sudoers): improve recognized Runas_Spec and Tag_Spec items
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: #15607

Signed-off-by: Ivan Shapovalov <intelfx@intelfx.name>
Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-09-02 09:55:00 +02:00
Luuk van Baal
3d5065fc75
patch 9.1.0708: Recursive window update does not account for reset skipcol
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).

closes: #15605

Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0708
2024-09-01 10:33:56 +02:00
Marc Jakobi
9abd02d16a
runtime(nu): include filetype plugin
This is used to set the commentstring option.

closes: #15601

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Marc Jakobi <marc.jakobi@tiko.energy>
2024-09-01 09:21:16 +02:00
Christian Brabandt
396fd1ec29
patch 9.1.0707: [security]: invalid cursor position may cause a crash
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-cqfh

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0707
2024-08-31 17:58:16 +02:00
James McCoy
75ba87ba62
patch 9.1.0706: tests: test_gettext fails when using shadow dir
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>
v9.1.0706
2024-08-31 17:15:08 +02:00
James McCoy
4e527a2d55
CI: Install locales-all package
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>
2024-08-31 17:15:03 +02:00
zeertzjq
58d705238c
patch 9.1.0705: Sorting of fuzzy filename completion is not stable
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>
v9.1.0705
2024-08-31 17:05:39 +02:00
JNylson
41ba26566f
translation(pt): update Portuguese/Brazilian menu translation
closes: #15592

Signed-off-by: JNylson <nylsinho_ba@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-31 17:04:01 +02:00
Doug Kearns
d817609b87
runtime(vim): Update base-syntax, match bracket mark ranges
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>
2024-08-31 16:57:32 +02:00
Doug Kearns
e2c4e07795
runtime(doc): Update :help :command-complete list
closes: #15602

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
2024-08-31 16:44:14 +02:00
Ken Takata
09b80d23cf
patch 9.1.0704: inserting with a count is inefficient
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>
v9.1.0704
2024-08-31 16:35:06 +02:00
Ughur Alakbarov
7c8bbc6d28
runtime(doc): use mkdir -p to save a command
closes: #15599

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Ughur Alakbarov <58857108+ugur-a@users.noreply.github.com>
2024-08-31 16:12:39 +02:00
Christian Brabandt
c9bfed2fda
patch 9.1.0703: crash with 2byte encoding and glob2regpat()
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>
v9.1.0703
2024-08-29 22:15:03 +02:00
Tom Crecelius
87c01d9561
runtime(hollywood): update syn highlight for If-Then statements and For-In-Loops
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>
2024-08-29 22:09:49 +02:00
Christian Brabandt
f459d68ecf
patch 9.1.0702: Patch 9.1.0700 broke CI
Problem:  Patch 9.1.0700 broke CI
Solution: Revert for now

Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0702
2024-08-28 23:46:53 +02:00
Christian Brabandt
c3a02d78bd
patch 9.1.0701: crash with NFA regex engine when searching for composing chars
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>
v9.1.0701
2024-08-28 23:17:52 +02:00
Christian Brabandt
1c815b54bb
patch 9.1.0700: crash with 2byte encoding and glob2regpat()
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>
v9.1.0700
2024-08-28 22:08:35 +02:00
Christian Brabandt
f8702aeb8f
patch 9.1.0699: "dvgo" is not always an inclusive motion
Problem:  "dvgo" is not always an inclusive motion
          (Iain King-Speir)
Solution: initialize the inclusive flag to false

fixes: #15580
closes: #15582

Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0699
2024-08-28 20:39:24 +02:00
Aliaksei Budavei
8556e23ee9
runtime(java): Provide support for syntax preview features
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.html

closes: #15579

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-27 22:32:13 +02:00
zeertzjq
d56c451e1c
patch 9.1.0698: tests: "Untitled" file not removed when running Test_crash1_3 alone
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: #15578
closes: #15577

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0698
2024-08-26 18:45:37 +02:00
Christian Brabandt
322ba91086
patch 9.1.0697: [security]: heap-buffer-overflow in ins_typebuf
Problem:  heap-buffer-overflow in ins_typebuf
          (SuyueGuo)
Solution: When flushing the typeahead buffer, validate that there
          is enough space left

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-4ghr-c62x-cqfh

Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0697
2024-08-25 21:33:03 +02:00
James McCoy
663950d700
patch 9.1.0696: installing runtime files fails when using SHADOWDIR
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>
v9.1.0696
2024-08-25 20:22:11 +02:00
glepnir
88a6dd036a
runtime(doc): fix typo
closes: #15572

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-25 15:49:54 +02:00
Christian Brabandt
cd83173def
patch 9.1.0695: tests: test_crash leaves Untitled file around
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>
v9.1.0695
2024-08-24 17:34:19 +02:00
JNylson
a68e34c993
translation(br): Update Brazilian translation
The previous patch 18de7adaf43 somehow wasn't correctly applied and
broke the check script

related: #15558

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: JNylson <nylsinho_ba@hotmail.com>
2024-08-24 16:54:03 +02:00
JNylson
377ad8c71f
translation(pt): Update menu_pt_br
closes: #15566

Signed-off-by: JNylson <nylsinho_ba@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-24 16:35:33 +02:00
zeertzjq
81e7513c86
patch 9.1.0694: matchparen is slow on a long line
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>
v9.1.0694
2024-08-24 16:32:24 +02:00
Ken Takata
dc2c75c6b5
patch 9.1.0693: Configure doesn't show result when not using python3 stable abi
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>
v9.1.0693
2024-08-24 16:27:50 +02:00
zeertzjq
d1c8d2de4b
patch 9.1.0692: Wrong patlen value in ex_substitute()
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>
v9.1.0692
2024-08-24 11:33:39 +02:00
Christian Brabandt
3f7024cf86
patch 9.1.0691: python3: stable-abi may cause segfault on Python 3.11
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>
v9.1.0691
2024-08-23 18:39:08 +02:00
Doug Kearns
7866d54ecc
runtime(vim): Update base-syntax, match :loadkeymap after colon and bar
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>
2024-08-23 18:37:55 +02:00
John M Devin
5d1c551057
runtime(mane): Improve <Plug>ManBS mapping
related: #15547 and #15538
closes: #15556

Signed-off-by: John M Devin <john.m.devin@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-23 18:36:08 +02:00
glepnir
38f99a1f0d
patch 9.1.0690: cannot set special highlight kind in popupmenu
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>
v9.1.0690
2024-08-23 18:31:06 +02:00
Yee Cheng Chin
56186e41db
translation(pt): Revert and fix wrong Portuguese menu translation files
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>
2024-08-23 18:12:05 +02:00
Yee Cheng Chin
79b5fc5697
translation(pt): revert Portuguese menu translation
This reverts commit d88a39e0d69ee0568475cea68121fcc68f8ba0ed.

related: #14674
related: #15557

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
2024-08-23 18:09:47 +02:00
JNylson
18de7adaf4
translation(br): Update Brazilian translations
closes: #15558

Signed-off-by: JNylson <nylsinho_ba@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-23 18:06:34 +02:00
Doug Kearns
7884cc7418
runtime(vim): Update base-syntax, improve :let-heredoc highlighting
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>
2024-08-23 18:01:35 +02:00
Christian Brabandt
cacb6693c1
patch 9.1.0689: [security]: buffer-overflow in do_search() with 'rightleft'
Problem:  buffer-overflow in do_search() with 'rightleft'
          (SuyueGuo)
Solution: after reversing the text (which allocates a new buffer),
          re-calculate the text length

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-v2x2-cjcg-f9jm

Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0689
2024-08-22 21:40:14 +02:00
Ken Takata
95e90781a4
runtime(vim): Improve heredoc handling for all embedded scripts
* 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
  d164f2a521f8e52e587727657fb1c19e9a25f32a.
* 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>
2024-08-22 21:29:39 +02:00
Christian Brabandt
25618fc9ea
patch 9.1.0688: Vim9: dereferences NULL pointer in check_type_is_value()
Problem:  Vim9: dereferences NULL pointer in check_type_is_value()
          (Suyue Guo)
Solution: Verify that the pointer is not Null

fixes: #15540
closes: #15545

Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0688
2024-08-22 21:25:18 +02:00
Christian Brabandt
dabf07e458
patch 9.1.0687: Makefile may not install desktop files
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: #15528
fixes: #15546

Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0687
2024-08-22 21:20:15 +02:00
Luca Saccarola
1c4f40213b
runtime(man): Fix <Plug>ManBS
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 #15538
closes: #15547

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-22 21:17:19 +02:00
Aliaksei Budavei
2750b83fa1
runtime(java): Make the bundled &foldtext function optional
- 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>
2024-08-22 21:09:32 +02:00
yasuda
c75dad0177
runtime(netrw): Change line on mx if command output exists
closes: #15550

Signed-off-by: yasuda <yasuda@kyoto-sr.co.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-22 21:06:32 +02:00
yasuda
38cfa2b662
runtime(netrw): Fix mf-selected entry highlighting
closes: #15551

Signed-off-by: yasuda <yasuda@kyoto-sr.co.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-22 20:54:47 +02:00
Dennis van den Berg
0e9fd7755d
runtime(htmlangular): add html syntax highlighting
fixes: #15459
closes: #15552

Signed-off-by: Dennis van den Berg <dennis.vandenberg@nedap.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-22 20:50:11 +02:00
Ken Takata
4a0dc29e5f
translation(it): Fix filemode of Italian manpages
closes: #15544

Signed-off-by: Ken Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-21 19:57:21 +02:00
John M Devin
fd01eb21e5
runtime(doc): Update outdated man.vim plugin information
closes: #15536

Signed-off-by: John M Devin <john.m.devin@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-21 13:26:37 +02:00
Christian Brabandt
bc29ea6286
runtime(zip): simplify condition to detect MS-Windows
related: #15519

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-21 08:20:13 +02:00
Christian Brabandt
7790ea0c68
patch 9.1.0686: zip-plugin has problems with special characters
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: #15505
closes: #15519

Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0686
2024-08-20 22:41:52 +02:00