0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

19166 Commits

Author SHA1 Message Date
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>
2024-08-20 22:41:52 +02:00
John Marriott
9e795852f3
patch 9.1.0685: too many strlen() calls in usercmd.c
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>
2024-08-20 20:57:23 +02:00
glepnir
753794bae8
patch 9.1.0684: completion is inserted on Enter with "noselect"
Problem:  completion is inserted on Enter with "noselect"
          (Carman Fu)
Solution: check noselect before update compl_shown_match
          (glepnir)

fixes: #15526
closes: #15530

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-20 19:58:44 +02:00
kuuote
0fd1cb1b1f
patch 9.1.0683: mode() returns wrong value with <Cmd> mapping
Problem:  mode() returns wrong value with <Cmd> mapping
Solution: Change decision priority of VIsual_active and move
          visual mode a bit further down (kuuote)

closes: #15533

Signed-off-by: kuuote <znmxodq1@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-20 19:53:17 +02:00
Ernie Rael
cb90ea9cba
patch 9.1.0682: Vim9: Segfault with uninitialized funcref
Problem:  Vim9: Segfault with uninitialized funcref
          (Daniel Viberg)
Solution: Check the Funcref for being Null before trying to access it
          (Ernie Rael)

fixes: #15523

Signed-off-by: Ernie Rael <errael@raelity.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-19 21:47:35 +02:00
Aliaksei Budavei
6bff6a2fa4
patch 9.1.0681: tests: Analyzing failed screendumps is hard
Problem:  tests: Analyzing failed screendumps is hard
Solution: Facilitate the viewing of rendered screendumps under src/
          add some documentation on how to use the viewdumps.vim
          script (Aliaksei Budavei)

With the submitted "viewdumps.vim" script, a few manual
steps in typical workflows (see below) can be automated.
The updated "README.txt" contains additional information.

============================================================

Reviewing LOCAL failed screendump tests can be arranged as
follows:

1) Run tests and generate screendumps:
------------------------------------------------------------
cd /path/to/fork/src/testdir
make
------------------------------------------------------------

2) Examine the screendumps from the "failed" directory:
------------------------------------------------------------
../vim -u NONE -S viewdumps.vim
------------------------------------------------------------

============================================================

Reviewing UPLOADED failed screendump tests can be arranged
as follows (it can be further locally scripted):

1) Fetch an artifact with failed screendumps from
"github.com/vim/vim/actions/runs/A_ID/artifacts/B_ID".

2) Extract the archived files:
------------------------------------------------------------
unzip /tmp/failed-tests.zip -d /tmp
------------------------------------------------------------

3) Set up the "dumps" directory.  Create a symlink to
"/path/to/fork/dirs/dumps" in the extracted directories so
that term_dumpdiff() can be used.  (The lookup algorithm
resolves "dumps" for every loaded filename.  So, with
"/tmp/src/testdir/failed/*.dump" files passed as script
arguments, the algorithm will make the files in
"/tmp/src/testdir/dumps" queried.)
------------------------------------------------------------
cd /path/to/fork
ln -s $(pwd)/src/testdir/dumps /tmp/src/testdir/dumps
------------------------------------------------------------

4) Examine the extracted screendumps:
------------------------------------------------------------
./src/vim -u NONE -S src/testdir/viewdumps.vim \
  /tmp/src/testdir/failed/*.dump
------------------------------------------------------------

5) Clean up:
------------------------------------------------------------
unlink /tmp/src/testdir/dumps
rm -rf /tmp/src
------------------------------------------------------------

============================================================

Reviewing SUBMITTED FOR PULL REQUEST screendump tests can be
arranged as follows (it can be further locally scripted):

1) List the fetched changeset and write the changed "dumps"
filenames to "/tmp/filelist":
------------------------------------------------------------
cd /path/to/fork
git switch prs/1234
git diff-index --relative=src/testdir/dumps/ \
  --name-only prs/1234~1 > /tmp/filelist
------------------------------------------------------------

2) Reconcile relative filepaths, and copy next-to-be-updated
"dumps" files in the "failed" directory (note the missing
new screendumps, if any):
------------------------------------------------------------
git switch master
cd src/testdir/dumps
test -d ../failed || mkdir ../failed
cp -t ../failed $(cat /tmp/filelist)
------------------------------------------------------------

3) Remember about the introduced INVERTED relation between
"dumps" and "failed", i.e. the files to be committed are in
"dumps" already and their previous versions are in "failed";
therefore, copy the missing new screendumps from "dumps" to
"failed" (otherwise these won't be shown):
------------------------------------------------------------
git switch prs/1234
cp -t ../failed foo_10.dump foo_11.dump foo_12.dump
------------------------------------------------------------

4) Examine the screendumps from the "failed" directory (new
screendumps will be shown with no difference between their
versions):
------------------------------------------------------------
cd ..
../vim -u NONE -S viewdumps.vim
------------------------------------------------------------

closes: #15515

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-19 21:33:26 +02:00
Zoltan Arpadffy
10231ac638
patch 9.1.0680: VMS does not have defined uintptr_t
Problem:  VMS does not have defined uintptr_t
Solution: Add type definitions (Zoltan Arpadffy)

closes: #15520

Signed-off-by: Zoltan Arpadffy <zoltan.arpadffy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-18 16:59:20 +02:00
zeertzjq
bc11f6d9d4
patch 9.1.0679: Rename from w_closing to w_locked is incomplete
Problem:  Rename from w_closing to w_locked is incomplete
          (after 9.1.0678).
Solution: Rename remaining occurrences of w_closing to w_locked and
          update comments (zeertzjq).

closes: #15504

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-16 21:11:31 +02:00
Christian Brabandt
0a6e57b09b
patch 9.1.0678: [security]: use-after-free in alist_add()
Problem:  [security]: use-after-free in alist_add()
          (SuyueGuo)
Solution: Lock the current window, so that the reference to
          the argument list remains valid.

This fixes CVE-2024-43374

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-15 22:15:28 +02:00
Gregory Anders
3b59be4ed8
patch 9.1.0677: :keepp does not retain the substitute pattern
Problem:  :keeppatterns does not retain the substitute pattern
          for a :s command
Solution: preserve the last substitute pattern when used with the
          :keeppatterns command modifier (Gregory Anders)

closes: #15497

Signed-off-by: Gregory Anders <greg@gpanders.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-15 22:09:28 +02:00
Ken Takata
12cb1d1326
translation(ja): Update Japanese translations to latest release
https://github.com/vim-jp/lang-ja/releases/tag/20240815

closes: #15498

Signed-off-by: Ken Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-15 22:02:45 +02:00
RestorerZ
cca3df9275
translation: improve the po/cleanup.vim script
explicitly delete into the black-hole register

closes: #15499

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-15 21:47:09 +02:00
RestorerZ
81b62dd654
patch 9.1.0676: style issues with man pages
Problem:  style issues with man pages
Solution: update man pages and test_xxd.vim, since it uses
          the xxd man page (RestorerZ)

closes: #15489

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-15 21:39:33 +02:00
Christian Brabandt
ded1677dd2
patch 9.1.0675: Patch v9.1.0674 causes problems
Problem:  Patch v9.1.0674 causes problems
Solution: Revert it for now

Revert "patch 9.1.0674: Vim9: compiling abstract method fails because of missing return"

This reverts commit 7477861e0d1d4bb168a65585c49c66e57b3ec636.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-14 23:05:41 +02:00
Ernie Rael
7477861e0d
patch 9.1.0674: Vim9: compiling abstract method fails because of missing return
Problem:  Vim9: compiling abstract method fails because of missing
          return (Aliaksei Budavei)
Solution: don't require a return statement for an abstract method when
          compiling (Ernie Rael)

fixes: #15432
closes: #15441

Signed-off-by: Ernie Rael <errael@raelity.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-14 14:53:55 +02:00
Ernie Rael
58c9579430
patch 9.1.0673: Vim9: too recursive func calls when calling super-class method
Problem:  Vim9: too recursive func calls when calling super-class method
          with non-overriden super-call methods. (Aliaksei Budavei)
Solution: use interface method, when super is to be used (Ernie Rael)

When compiling "super.Func()" force class context to class that defines
function that is doing "super.Func()".
ISN_METHODCALL arg "cmf_is_super" for specific ufunc.

fixes: #15448
fixes: #15463 (2) super.method may not execute in context of defining
                  class
closes: #15477

Signed-off-by: Ernie Rael <errael@raelity.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-13 23:27:22 +02:00
Aliaksei Budavei
d33afe12c6
runtime(syntax-tests): Facilitate the viewing of rendered screendumps
With the submitted "viewdumps.vim" script, a few manual
steps in typical workflows (see below) can be automated.
The updated "README.txt" contains additional information.

============================================================

Reviewing LOCAL failed syntax tests can be arranged as
follows:

1) Run tests and generate screendumps:
------------------------------------------------------------
cd /path/to/fork/runtime/syntax
make clean test
------------------------------------------------------------

2) Examine the screendumps from the "failed" directory:
------------------------------------------------------------
../../src/vim --clean -S testdir/viewdumps.vim
------------------------------------------------------------

============================================================

Reviewing UPLOADED failed syntax tests can be arranged as
follows (it can be further locally scripted):

1) Fetch an artifact with failed screendumps from
"github.com/vim/vim/actions/runs/A_ID/artifacts/B_ID".

2) Extract the archived files:
------------------------------------------------------------
unzip /tmp/failed-tests.zip -d /tmp
------------------------------------------------------------

3) Set up the "dumps" directory.  Create a symlink to
"/path/to/fork/dirs/dumps" in the extracted directories so
that term_dumpdiff() can be used.  (The lookup algorithm
resolves "dumps" for every loaded filename.  So, with
"/tmp/runtime/syntax/testdir/failed/*.dump" files passed
as script arguments, the algorithm will make the files in
"/tmp/runtime/syntax/testdir/dumps" queried.)
------------------------------------------------------------
cd /path/to/fork
ln -s $(pwd)/runtime/syntax/testdir/dumps \
  /tmp/runtime/syntax/testdir/dumps
------------------------------------------------------------

4) Examine the extracted screendumps:
------------------------------------------------------------
./src/vim --clean -S runtime/syntax/testdir/viewdumps.vim \
  /tmp/runtime/syntax/testdir/failed/*.dump
------------------------------------------------------------

5) Clean up:
------------------------------------------------------------
unlink /tmp/runtime/syntax/testdir/dumps
rm -rf /tmp/runtime
------------------------------------------------------------

============================================================

Reviewing SUBMITTED FOR PULL REQUEST syntax tests can be
arranged as follows (it can be further locally scripted):

1) List the fetched changeset and write the changed "dumps"
filenames to "/tmp/filelist":
------------------------------------------------------------
cd /path/to/fork
git switch prs/1234
git diff-index --relative=runtime/syntax/testdir/dumps/ \
  --name-only prs/1234~1 > /tmp/filelist
------------------------------------------------------------

2) Reconcile relative filepaths, and copy next-to-be-updated
"dumps" files in the "failed" directory (note the missing
new screendumps, if any):
------------------------------------------------------------
git switch master
cd runtime/syntax/testdir/dumps
cp -t ../failed $(cat /tmp/filelist)
------------------------------------------------------------

3) Remember about the introduced INVERTED relation between
"dumps" and "failed", i.e. the files to be committed are in
"dumps" already and their previous versions are in "failed";
therefore, copy the missing new screendumps from "dumps" to
"failed" (otherwise these won't be shown):
------------------------------------------------------------
git switch prs/1234
cp -t ../failed foo_10.dump foo_11.dump foo_12.dump
------------------------------------------------------------

4) Examine the screendumps from the "failed" directory (new
screendumps will be shown with no difference between their
versions):
------------------------------------------------------------
cd ..
../../../src/vim --clean -S viewdumps.vim
------------------------------------------------------------

closes: #15476

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-12 18:43:06 +02:00
Christian Brabandt
8d02e5cf96
patch 9.1.0672: marker folds may get corrupted on undo
Problem:  marker folds may get corrupted on undo (Yousef Mohammed)
Solution: when adjusting folds, make sure that line1 is the lower limit
          and line2 is the upper line limit. In particular, line2 should
          not be able to get smaller than line1.

fixes: #15455
closes: #15466

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-11 20:12:41 +02:00
Christian Brabandt
fb3f969936
Problem: crash with WinNewPre autocommand
Problem:  crash with WinNewPre autocommand, because window
          structures are not yet safe to use
Solution: Don't trigger WinNewPre on :tabnew

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-11 20:09:17 +02:00
RestorerZ
e20aeb875c
patch 9.1.0670: po file encoding fails on *BSD during make
Problem:  po file encoding fails on *BSD during make
Solution: instead of using `$<` make use of variable `$?` which should
          be equivalent when the rule is dependent on only a single
          file (RestorerZ).

closes: #15471

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-11 20:03:35 +02:00
Antonio Giovanni Colombo
659713da33
translation(it): Update Italian translation
Signed-off-by: Antonio Giovanni Colombo <azc100@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-11 19:49:16 +02:00
Ken Takata
2630687315
translation: Stop using msgconv
It caused differences from Unix-like systems. Make sure that the same
files are generated both on Windows and Unix.

fixes: #14490
fixes: #14601
closes: #15469

Also
- update a few more auto-generated po files
- Make_mvc.mak work with Cygwin/MSYS2's gettext by using copy /b instead
  of copy /a

Signed-off-by: Ken Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-11 19:06:58 +02:00
Ken Takata
1c032e36a6
patch 9.1.0669: if_python: stable python ABI not used by default
Problem:  stable python ABI not used by default
Solution: Enable stable python ABI v3.8 when building with python3/dyn
          by default, update the default Python3 version to 3.8 for
          MS-Windows (Ken Takata)

closes: #15470
related: #15457

Signed-off-by: Ken Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-11 18:41:41 +02:00
Ken Takata
9abd7158d7
patch 9.1.0668: build-error with python3.12 and stable ABI
Problem:  build-error with python3.12 and stable ABI (zdohnal)
Solution: Add type casts, define Py_INCREF for Python3.12 and higher
          (Ken Takata)

fixes: #15460

Signed-off-by: Ken Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-10 09:44:20 +02:00
Ken Takata
181fda18e9
translations: Update generated po files
Some auto-generated po files cause differences after building Vim.
Update them.

closes: #15468

Signed-off-by: Ken Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-10 09:38:24 +02:00
zeertzjq
b026a293b1
patch 9.1.0667: Some other options reset curswant unnecessarily when set
Problem:  Some other options reset curswant unnecessarily when set.
          (Andrew Haust)
Solution: Don't reset curswant when setting 'comments', 'commentstring'
          or 'define' (zeertzjq)

fixes: #15462
closes: #15467

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-10 09:35:20 +02:00
zeertzjq
9c4b2462bb
patch 9.1.0666: assert_equal() doesn't show multibyte string correctly
Problem:  assert_equal() doesn't show multibyte string correctly
Solution: Properly advance over a multibyte char.
          (zeertzjq)

closes: #15456

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-09 19:52:10 +02:00
zeertzjq
6b97d7ad19
patch 9.1.0665: Locked variable can be changed in a :for loop
Problem:  Locked variable can be changed in a :for loop.
Solution: Always do a full permission check on the first loop iteration
          where ASSIGN_DECL is not set (zeertzjq).

related: #12470
fixes: #15450
closes: #15454

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-08 21:05:57 +02:00
Ken Takata
568cbc92a6
patch 9.1.0664: MS-Windows: console vim did not switch back to main screen on exit
Problem:  MS-Windows: console vim did not switch back to main screen on
          exit
Solution: switch back to main screen on exit (Ken Takata)

`vim.exe --cmd quit` quitted without switching back to the main screen
buffer and the alternate screen buffer was kept shown.

Restore the main screen buffer even when termcap mode has not been
started.

closes: #15443

Signed-off-by: Ken Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-07 21:18:24 +02:00
Christian Brabandt
91efcd115e
patch 9.1.0663: tests: zip test still resets 'shellslash' option
Problem:  tests: zip test still resets 'shellslash' option
Solution: Remove resetting the 'shellslash' option, the zip
          plugin should now be able to handle this options

closes: #15434

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-06 20:19:50 +02:00
zeertzjq
da090f95df
patch 9.1.0662: filecopy() may return wrong value when readlink() fails
Problem:  filecopy() may return wrong value when readlink() fails.
Solution: Set ret to -1 so that 0 is returned when readlink() fails.
          (zeertzjq)

closes: #15438

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-06 19:51:09 +02:00
Damien
d7af21e746
patch 9.1.0661: the zip plugin is not tested.
Problem:  the zip plugin is not tested.
Solution: include tests (Damien)

closes: #15411

Signed-off-by: Damien <141588647+xrandomname@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-05 20:24:11 +02:00
Christopher Plewright
f5f69e8663
patch 9.1.0660: MS-Windows: Shift-Insert does work on old conhost
Problem:  MS-Windows: Shift-Insert does not work on old conhost
          (Nick Jensen, after 9.0.1146)
Solution: handle Shift-Insert specifically
          (Christian Plewright)

fixes: #15326
closes: #15430

Signed-off-by: Christopher Plewright <chris@createng.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-04 19:57:44 +02:00
Ken Takata
2708afa640
patch 9.1.0659: MS-Windows: MSVC Makefile is a bit hard to read
Problem:  MS-Windows: MSVC Makefile is a bit hard to read
          (after v9.1.0657)
Solution: indent the if/else statements to improve readability
          (Ken Takata)

closes: #15428

Signed-off-by: Ken Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-04 18:31:48 +02:00
zeertzjq
62d861741b
patch 9.1.0658: Coverity warns about dereferencing NULL pointer.
Problem:  Coverity warns about dereferencing NULL pointer.
Solution: Bail out if vim_strrchr() returns NULL.
          (zeertzjq)

________________________________________________________________________________________________________
*** CID 1616019:    (NULL_RETURNS)
/src/help.c: 834 in fix_help_buffer()
828                                  continue;
829                              t2 = gettail(f2);
830                              e2 = vim_strrchr(t2, '.');
831                              if (e1 - f1 != e2 - f2
832                                          || fnamencmp(f1, f2, e1 - f1) != 0)
833                                  continue;
>>>     CID 1616019:    (NULL_RETURNS)
>>>     Dereferencing a pointer that might be "NULL" "(char_u *)e2" when calling "vim_fnamecmp".
834                              if (fnamecmp(e1, ".txt") == 0
835                                             && fnamecmp(e2, fname + 4) == 0)
836                                  // use .abx instead of .txt
837                                  VIM_CLEAR(fnames[i1]);
838                          }
839                      }
/src/help.c: 816 in fix_help_buffer()
810                      // the same directory.
811                      for (i1 = 0; i1 < fcount; ++i1)
812                      {
813                          f1 = fnames[i1];
814                          t1 = gettail(f1);
815                          e1 = vim_strrchr(t1, '.');
>>>     CID 1616019:    (NULL_RETURNS)
>>>     Dereferencing a pointer that might be "NULL" "(char_u *)e1" when calling "vim_fnamecmp".
816                          if (fnamecmp(e1, ".txt") != 0
817                                             && fnamecmp(e1, fname + 4) != 0)
818                          {
819                              // Not .txt and not .abx, remove it.
820                              VIM_CLEAR(fnames[i1]);
821                              continue;

closes: #15420

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-03 14:52:00 +02:00
Ken Takata
87d63d34b6
patch 9.1.0657: MS-Windows: MSVC build time can be optimized
Problem:  MS-Windows: MSVC build time can be optimized
Solution: Stop using Powershell, show detected version, read _MSC_VER
          and _MSC_FULL_VER in a single cl execution. (Ken Takata)

closes: #15421

Signed-off-by: Ken Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-03 14:40:35 +02:00
Ken Takata
cdf1c7a73a
patch 9.1.0656: MS-Windows: MSVC Makefile CPU handling can be improved
Problem:  MS-Windows: MSVC Makefile CPU handling can be improved
Solution: Update Makefile and also remove some old code
          (Ken Takata)

* The variable `ASSEMBLY_ARCHITECTURE` was originally used to generate
  the manifest file. However, this was removed in v7.0.198.  Remove
  `ASSEMBLY_ARCHITECTURE` and use `CPU` instead.
* `/arch:AVX512` is available starting from Visual C++ 2017.
* ARM64 was not considered when validating CPUNR.
  Skip the validation for ARM64 for now.
* Remove old code for VC6/7 and Win9x.

closes: #15422

Signed-off-by: Ken Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-03 14:36:37 +02:00
Adam Monsen
0aa65b48fb
patch 9.1.0655: filetype: goaccess config file not recognized
Problem:  filetype: goaccess config file not recognized
Solution: detect 'goaccess.conf' as goaccess filetype, also
          include a basic syntax and ftplugin (Adam Monsen)

Add syntax highlighting for GoAccess configuration file.

GoAccess is a real-time web log analyzer and interactive viewer that
runs in a terminal in *nix systems or through your browser.

GoAccess home page: https://goaccess.io

closes: #15414

Signed-off-by: Adam Monsen <haircut@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-02 19:58:00 +02:00
glepnir
b9de1a057f
patch 9.1.0654: completion does not respect completeslash with fuzzy
Problem:  completion does not respect completeslash with fuzzy
          (egesip)
Solution: Change path separator on Windows, depending on 'completeslash'
          option value (glepnir)

fixes: #15392
closes: #15418

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-02 19:14:38 +02:00
Christian Brabandt
a0b5bc1285
patch 9.1.0653: Patch v9.1.0648 not completely right
Problem:  Patch v9.1.0648 not completely right
          (zeertzjq)
Solution: Remove always true condition

closes: #15415

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-02 19:06:41 +02:00
John Marriott
b4ea77185c
patch 9.1.0652: too many strlen() calls in syntax.c
Problem:  too many strlen() calls in syntax.c
Solution: refactor code to reduce the number or strlen() calls,
          get rid of un-used SYN_NAMELEN macro
          (John Marriott)

closes: #15368

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-01 23:01:25 +02:00
Mohamed Akram
0214680a8e
patch 9.1.0651: ex: trailing dot is optional for :g and :insert/:append
Problem:  ex: trailing dot is optional for :g and :insert/:append
Solution: don't break out early, when the next command is empty.
          (Mohamed Akram)

The terminating period is optional for the last command in a global
command list.

closes: #15407

Signed-off-by: Mohamed Akram <mohd.akram@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-01 22:53:01 +02:00
zeertzjq
e8feaa354e
patch 9.1.0650: Coverity warning in cstrncmp()
Problem:  Coverity warning in cstrncmp()
          (after v9.1.0645)
Solution: Change the type of n2 to int.
          (zeertzjq)

________________________________________________________________________________________________________
*** CID 1615684:  Integer handling issues  (INTEGER_OVERFLOW)
/src/regexp.c: 1757 in cstrncmp()
1751                 n1 -= mb_ptr2len(s1);
1752                 MB_PTR_ADV(p);
1753                 n2++;
1754             }
1755             // count the number of bytes to advance the same number of chars for s2
1756             p = s2;
>>>     CID 1615684:  Integer handling issues  (INTEGER_OVERFLOW)
>>>     Expression "n2--", which is equal to 18446744073709551615, where "n2" is known to be equal to 0, underflows the type that receives it, an unsigned integer 64 bits wide.
1757             while (n2-- > 0 && *p != NUL)
1758                 MB_PTR_ADV(p);
1759
1760             n2 = p - s2;
1761
1762             result = MB_STRNICMP2(s1, s2, *n, n2);

closes: #15409

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-01 22:48:53 +02:00
zeertzjq
c1ed788c1b
patch 9.1.0649: Wrong comment for "len" argument of call_simple_func()
Problem:  Wrong comment for "len" argument of call_simple_func().
Solution: Remove the "or -1 to use strlen()".  Also change its type to
          size_t to remove one cast. (zeertzjq)

closes: #15410

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-01 22:46:54 +02:00
Christian Brabandt
b29f4abcd4
patch 9.1.0648: [security] double-free in dialog_changed()
Problem:  [security] double-free in dialog_changed()
          (SuyueGuo)
Solution: Only clear pointer b_sfname pointer, if it is different
          than the b_ffname pointer.  Don't try to free b_fname,
          set it to NULL instead.

fixes: #15403

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-46pw-v7qw-xc2f

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-01 22:35:18 +02:00
Christian Brabandt
8a0bbe7b8a
patch 9.1.0647: [security] use-after-free in tagstack_clear_entry
Problem:  [security] use-after-free in tagstack_clear_entry
          (Suyue Guo )
Solution: Instead of manually calling vim_free() on each of the tagstack
          entries, let's use tagstack_clear_entry(), which will
          also free the stack, but using the VIM_CLEAR macro,
          which prevents a use-after-free by setting those pointers
          to NULL

This addresses CVE-2024-41957

Github advisory:
https://github.com/vim/vim/security/advisories/GHSA-f9cr-gv85-hcr4

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-01 22:35:18 +02:00
Ernie Rael
164096927b
patch 9.1.0646: Vim9: imported function may not be found
Problem:  Vim9: imported function may not be found
Solution: Try to find the function by name (Ernie Rael)

fixes: #15381
closes: #15382

Signed-off-by: Ernie Rael <errael@raelity.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-31 22:18:11 +02:00
Christian Brabandt
22e8e12d9f
patch 9.1.0645: regex: wrong match when searching multi-byte char case-insensitive
Problem:  regex: wrong match when searching multi-byte char
          case-insensitive (diffsetter)
Solution: Apply proper case-folding for characters and search-string

This patch does the following 4 things:

1) When the regexp engine compares two utf-8 codepoints case
   insensitive it may match an adjacent character, because it assumes
   it can step over as many bytes as the pattern contains.

   This however is not necessarily true because of case-folding, a
   multi-byte UTF-8 character can be considered equal to some
   single-byte value.

   Let's consider the pattern 'ſ' and the string 's'. When comparing and
   ignoring case, the single character 's' matches, and since it matches
   Vim will try to step over the match (by the amount of bytes of the
   pattern), assuming that since it matches, the length of both strings is
   the same.

   However in that case, it should only step over the single byte value
   's' by 1 byte and try to start matching after it again. So for the
   backtracking engine we need to ensure:
   * we try to match the correct length for the pattern and the text
   * in case of a match, we step over it correctly

   There is one tricky thing for the backtracing engine. We also need to
   calculate correctly the number of bytes to compare the 2 different
   utf-8 strings s1 and s2. So we will count the number of characters in
   s1 that the byte len specified. Then we count the number of bytes to
   step over the same number of characters in string s2 and then we can
   correctly compare the 2 utf-8 strings.

2) A similar thing can happen for the NFA engine, when skipping to the
   next character to test for a match. We are skipping over the regstart
   pointer, however we do not consider the case that because of
   case-folding we may need to adjust the number of bytes to skip over.
   So this needs to be adjusted in find_match_text() as well.

3) A related issue turned out, when prog->match_text is actually empty.
   In that case we should try to find the next match and skip this
   condition.

4) When comparing characters using collections, we must also apply case
   folding to each character in the collection and not just to the
   current character from the search string.  This doesn't apply to the
   NFA engine, because internally it converts collections to branches
   [abc] -> a\|b\|c

fixes: #14294
closes: #14756

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-30 20:39:18 +02:00
zeertzjq
74011dc1fa
patch 9.1.0644: Unnecessary STRLEN() when applying mapping
Problem:  Unnecessary STRLEN() when applying mapping.
          (after v9.1.0642)
Solution: Use m_keylen and vim_strnsave().
          (zeertzjq)

closes: #15394

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-30 19:17:56 +02:00
Christian Brabandt
1254e6db83
patch 9.1.0643: terminal: cursor may end up on invalid position
Problem:  terminal: cursor may end up on invalid position after reducing
          the scrollback lines (user202729)
Solution: After reducing the scrollback size, check the cursor position,
          making sure it does not end up on an invalid line

fixes: #15351

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-29 21:19:51 +02:00