]> git.ipfire.org Git - thirdparty/vim.git/log
thirdparty/vim.git
3 months agopatch 9.1.1213: cannot :put while keeping indent v9.1.1213
64-bitman [Sun, 16 Mar 2025 20:10:47 +0000 (21:10 +0100)] 
patch 9.1.1213: cannot :put while keeping indent

Problem:  cannot :put while keeping indent
          (Peter Aronoff)
Solution: add the :iput ex command (64-bitman)

fixes: #16225
closes: #16886

Signed-off-by: 64-bitman <60551350+64-bitman@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(syntax-tests): Support "wait-free" test failure
Aliaksei Budavei [Sun, 16 Mar 2025 19:59:28 +0000 (20:59 +0100)] 
runtime(syntax-tests): Support "wait-free" test failure

When certain changes guarantee failure for old syntax tests,
opt for faster failure by reducing the number of screendumps
made for each file "page" to be no greater than the assigned
value of a VIM_SYNTAX_TEST_WAIT_TIME environment variable.
(This variable will be ignored and more screendumps may be
made when Make is GNU Make and a parent Makefile is used.)

Barring regressions, and assuming that v9.1.1163~1 succeeds
in providing a correct synchronisation mechanism outside of
"VerifyScreenDump()", and assuming that "readfile()" always
obtains the latest contents written by "term_dumpwrite()" in
"VerifyScreenDump()"; making a single screendump of a file
"page" and following it with a single reading of the written
screendump file should be enough to decide whether to pass
or fail a syntax test.

In addition, re-enable self testing after v9.1.1183~2.

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1212: too many strlen() calls in edit.c
John Marriott [Sun, 16 Mar 2025 19:49:52 +0000 (20:49 +0100)] 
patch 9.1.1212: too many strlen() calls in edit.c

Problem:  too many strlen() calls in edit.c
Solution: refactor edit.c and remove strlen() calls
          (John Marriott)

This commit attempts to make edit.c more efficient by:

- in truncate_spaces() pass in the length of the string.
- return a string_T from get_last_insert(), so that the length of the
  string is available to the caller.
- refactor stuff_insert():

  - replace calls to stuffReadbuff() (which calls STRLEN() on it's
    string argument) with stuffReadbuffLen() (which gets the length of
    it's string argument passed in).
  - replace call to vim_strrchr() which searches from the start of the
    string with a loop which searches from end of the string to find the
    last ESC character.

- change get_last_insert_save() to call get_last_insert() to get the
  last_insert string (the logic is in one place).

closes: #16863

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1212: filetype: logrotate'd pacmanlogs are not recognized v9.1.1212
Eisuke Kawashima [Sun, 16 Mar 2025 19:37:14 +0000 (20:37 +0100)] 
patch 9.1.1212: filetype: logrotate'd pacmanlogs are not recognized

Problem:  filetype: logrotate'd pacmanlogs are not recognized
Solution: also detect pacman.log* files as pacmanlog filetype,
          remove BufNewFile autocmd (Eisuke Kawashima)

closes: #16873

Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(prql): include prql syntax script
Jonathan [Sun, 16 Mar 2025 19:32:13 +0000 (20:32 +0100)] 
runtime(prql): include prql syntax script

References:
https://prql-lang.org/
https://github.com/PRQL/prql

closes: #16885

Signed-off-by: Jonathan <vanillajonathan@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1211: TabClosedPre is triggered just before the tab is being freed v9.1.1211
Jim Zhou [Sun, 16 Mar 2025 19:24:57 +0000 (20:24 +0100)] 
patch 9.1.1211: TabClosedPre is triggered just before the tab is being freed

Problem:  TabClosedPre is triggered just before the tab is being freed,
          which limited its functionality.
Solution: Trigger it a bit earlier and also on :tabclose and :tabonly
          (Jim Zhou)

closes: #16890

Signed-off-by: Jim Zhou <jimzhouzzy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1210: translation(ru): missing Russian translation for the new tutor v9.1.1210
RestorerZ [Sun, 16 Mar 2025 18:49:41 +0000 (19:49 +0100)] 
patch 9.1.1210: translation(ru): missing Russian translation for the new tutor

Problem:  translation(ru): missing Russian translation for the new tutor
Solution: include new Russian translation, update the Makefile for
          installing the new translations (RestorerZ)

closes: #16901

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1209: colorcolumn not drawn after virtual text lines v9.1.1209
Matthias [Sun, 16 Mar 2025 18:27:51 +0000 (19:27 +0100)] 
patch 9.1.1209: colorcolumn not drawn after virtual text lines

Problem:  colorcolumn not drawn after virtual text lines
Solution: show colorcolumn on correct line with virtual text by adding
          the size of p_extra to virtual column offset (Matthias)

When a line has two or more lines of virtual text above it, the color
column used to appear on the line of the second virtual text line, while
the first virtual text line and the "real" text line did not have a
color column.

The color column for "above" virtual text is positioned by taking the
offset of the size of the virtual text lines and subtracting it from the
"virtual column" that we are in. If the result equals the color column,
this column is colored.

The "virtual column" is calculated from the beginning of the first
virtual text line and continues over the newlines up to the end of the
"real" text. However, the offset from the virtual text was reset at
every line.

Adding all those offsets together leads to the color column being placed
consistently at the line of the "real" text.

related: #12004
related: #16868
closes: #16904

Signed-off-by: Matthias <matthias.rader@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1208: MS-Windows: not correctly restoring alternate screen on Win 10 v9.1.1208
Christopher Plewright [Sun, 16 Mar 2025 18:14:31 +0000 (19:14 +0100)] 
patch 9.1.1208: MS-Windows: not correctly restoring alternate screen on Win 10

Problem:  MS-Windows: not correctly restoring alternate screen on Win 10
          after ssh (Daniel Viberg)
Solution: return a bit later in RestoreConsoleBuffer()
          (Christopher Plewright)

fixes: #16418
closes: #16897

Signed-off-by: Christopher Plewright <chris@createng.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1207: MS-Windows: build warning in filepath.c v9.1.1207
John Marriott [Sun, 16 Mar 2025 18:06:31 +0000 (19:06 +0100)] 
patch 9.1.1207: MS-Windows: build warning in filepath.c

Problem:  MS-Windows: build warning in filepath.c
          (after v9.1.1204)
Solution: add type cast (John Marriott)

Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agotranslation(ru): include Russian translation for chapter two of the tutorial
RestorerZ [Sat, 15 Mar 2025 09:31:10 +0000 (10:31 +0100)] 
translation(ru): include Russian translation for chapter two of the tutorial

closes: #16900

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(matchparen): line continuation causes failure in CI
Christian Brabandt [Sat, 15 Mar 2025 09:24:11 +0000 (10:24 +0100)] 
runtime(matchparen): line continuation causes failure in CI

so let's remove the line continuation

Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1206: tests: test_filetype fails when a file is a directory v9.1.1206
Christian Brabandt [Sat, 15 Mar 2025 09:19:48 +0000 (10:19 +0100)] 
patch 9.1.1206: tests: test_filetype fails when a file is a directory

Problem:  tests: test_filetype fails when a file is a directory
          (Eisuke Kawashima)
Solution: When encountering a directory instead of a file, skip that
          particular filetype test

fixes: #16894

Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(doc): symlinking netrw.txt causes problems during install on Windows
Christian Brabandt [Sat, 15 Mar 2025 09:04:39 +0000 (10:04 +0100)] 
runtime(doc): symlinking netrw.txt causes problems during install on Windows

So let's remove the symlink and copy the netrw documentation back into
runtime/doc directory. While at it, add a Makefile target to do this
whenever runtime/pack/dist/opt/netrw/doc/netrw.txt is updated.

fixes: #16878
fixes: #16872

Co-authored-by: Brandon Maier <brandon.maier@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1205: completion: preinserted text not removed when closing pum v9.1.1205
glepnir [Sat, 15 Mar 2025 08:59:22 +0000 (09:59 +0100)] 
patch 9.1.1205: completion: preinserted text not removed when closing pum

Problem:  completion: preinserted text not removed when closing pum
Solution: delete preinsert text inside in ins_compl_stop() (glepnir).

closes: #16891

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(tutor): updated Russian translation for tutor chapter 1
RestorerZ [Sat, 15 Mar 2025 08:55:37 +0000 (09:55 +0100)] 
runtime(tutor): updated Russian translation for tutor chapter 1

closes: #16899

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1204: MS-Windows: crash when passing long string to expand() v9.1.1204
zeertzjq [Sat, 15 Mar 2025 08:53:32 +0000 (09:53 +0100)] 
patch 9.1.1204: MS-Windows: crash when passing long string to expand()

Problem:  MS-Windows: crash when passing long string to expand() with
          'wildignorecase'.
Solution: Use the same buflen as unix_expandpath() in dos_expandpath().
          Remove an unnecessary STRLEN() while at it (zeertzjq).

closes: #16896

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(cs): Update C# runtime files
Nick Jensen [Sat, 15 Mar 2025 08:49:13 +0000 (09:49 +0100)] 
runtime(cs): Update C# runtime files

closes: #16884

Signed-off-by: Nick Jensen <nickspoon@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1203: matchparen keeps cursor on case label in sh filetype v9.1.1203
zeertzjq [Sat, 15 Mar 2025 08:36:13 +0000 (09:36 +0100)] 
patch 9.1.1203: matchparen keeps cursor on case label in sh filetype

Problem:  matchparen keeps cursor on case label in sh filetype
          (@categorical, after 9.1.1187).
Solution: Use :defer so that cursor is always restored, remove checks
          for older Vims, finish early if Vim does not support :defer

fixes: #16887
closes: #16888

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(doc): fix a typo in gitrebase filetype
skshetry [Sat, 15 Mar 2025 08:34:39 +0000 (09:34 +0100)] 
runtime(doc): fix a typo in gitrebase filetype

Introduced in 4d2c4b90f.

closes: #16892

Signed-off-by: skshetry <18718008+skshetry@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(doc): Tweak documentation style a bit
Hirohito Higashi [Sat, 15 Mar 2025 08:32:28 +0000 (09:32 +0100)] 
runtime(doc): Tweak documentation style a bit

closes: #16893

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(vim): Sync syntax generator base file with output file.
Doug Kearns [Sat, 15 Mar 2025 08:29:31 +0000 (09:29 +0100)] 
runtime(vim): Sync syntax generator base file with output file.

Synchronisation was lost in commit 0fab891 and the error propagated to
the output file in commit 5606ca5.

closes: #16889

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(doc): update a few minor omissions from 5876016 and 4d2c4b9
Christian Brabandt [Fri, 14 Mar 2025 11:05:52 +0000 (12:05 +0100)] 
runtime(doc): update a few minor omissions from 5876016 and 4d2c4b9

Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1202: Missing TabClosedPre autocommand v9.1.1202
Jim Zhou [Thu, 13 Mar 2025 20:58:25 +0000 (21:58 +0100)] 
patch 9.1.1202: Missing TabClosedPre autocommand

Problem:  Missing TabClosedPre autocommand
          (zoumi)
Solution: Add the TabClosedPre autcommand (Jim Zhou).

fixes: #16518
closes: #16855

Signed-off-by: Jim Zhou <jimzhouzzy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1201: 'completefuzzycollect' does not handle dictionary correctly v9.1.1201
glepnir [Thu, 13 Mar 2025 20:39:51 +0000 (21:39 +0100)] 
patch 9.1.1201: 'completefuzzycollect' does not handle dictionary correctly

Problem:  'completefuzzycollect' does not handle dictionary correctly
Solution: check for ctrl_x_mode_dictionary (glepnir)

closes: #16867

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(doc): make :h 'completefuzzycollect' a bit clearer
zeertzjq [Thu, 13 Mar 2025 20:30:10 +0000 (21:30 +0100)] 
runtime(doc): make :h 'completefuzzycollect' a bit clearer

- Fix grammar
- Use "matches" instead of "items" ("completion candidates" is used in
  some other places, but it's a bit verbose)
- "When set" is a bit vague, instead use "For specified modes"

closes: #16871

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(doc): document gitrebase filetype
Christian Brabandt [Thu, 13 Mar 2025 20:20:20 +0000 (21:20 +0100)] 
runtime(doc): document gitrebase filetype

closes: #16883

Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agotranslation(it): update menu_it
Antonio Giovanni Colombo [Thu, 13 Mar 2025 19:38:44 +0000 (20:38 +0100)] 
translation(it): update menu_it

Signed-off-by: Antonio Giovanni Colombo <azc100@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agotranslation(sr): Add chapter two of the new tutor
Ivan Pešić [Thu, 13 Mar 2025 19:33:26 +0000 (20:33 +0100)] 
translation(sr): Add chapter two of the new tutor

Add chapter two to the Serbian translation of the new tutor.
Update the Filelist with two new files.

closes: #16875

Signed-off-by: Ivan Pešić <27575106+eevan78@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1200: cmdline pum not cleared for input() completion v9.1.1200
zeertzjq [Thu, 13 Mar 2025 19:29:13 +0000 (20:29 +0100)] 
patch 9.1.1200: cmdline pum not cleared for input() completion

Problem:  Cmdline pum not cleared for input() completion.
Solution: Temporary reset RedrawingDisabled in cmdline_pum_cleanup(),
          like what is done in wildmenu_cleanup() (zeertzjq).

fixes: #16874
closes: #16876

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1199: gvim uses hardcoded xpm icon file v9.1.1199
Aurelien Gateau [Wed, 12 Mar 2025 22:16:42 +0000 (23:16 +0100)] 
patch 9.1.1199: gvim uses hardcoded xpm icon file

Problem:  Many X11/Wayland desktops support icon themes, and many themes
          provide a gvim icon, but this icon is ignored for the window
          itself because it is hardcoded in the source code.
Solution: Read the icon from the theme instead (Aurelien Gateau).

closes: #16859

Signed-off-by: Aurelien Gateau <mail@agateau.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(indent-tests): GitHub Actions doesn't show why indent tests failed
David Mandelberg [Wed, 12 Mar 2025 21:43:08 +0000 (22:43 +0100)] 
runtime(indent-tests): GitHub Actions doesn't show why indent tests failed

Problem:  GitHub Actions doesn't show why indent tests failed
Solution: Send the .fail files to stdout

References:
https://github.com/vim/vim/pull/16852#issuecomment-2719041781

closes: #16870

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1198: [security]: potential data loss with zip.vim v9.1.1198
Christian Brabandt [Wed, 12 Mar 2025 21:04:01 +0000 (22:04 +0100)] 
patch 9.1.1198: [security]: potential data loss with zip.vim

Problem:  [security]: potential data loss with zip.vim and special
          crafted zip files (RyotaK)
Solution: use glob '[-]' to protect filenames starting with '-'

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-693p-m996-3rmf

Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1197: process_next_cpt_value() uses wrong condition v9.1.1197
glepnir [Wed, 12 Mar 2025 20:28:39 +0000 (21:28 +0100)] 
patch 9.1.1197: process_next_cpt_value() uses wrong condition

Problem:  process_next_cpt_value() uses wrong condition
Solution: use cfc_has_mode() instead and remove redundant else if branch
          (glepnir)

closes: #16833

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1196: filetype: config files for container tools are not recognized v9.1.1196
David Mandelberg [Wed, 12 Mar 2025 20:23:39 +0000 (21:23 +0100)] 
patch 9.1.1196: filetype: config files for container tools are not recognized

Problem:  filetype: config files for container tools are not recognized
Solution: detect the ones that aren't detected yet as toml filetype
          (David Mandelberg)

The .containerignore format doesn't look exactly the same as gitignore,
but very close. And .dockerignore is already using gitignore.

References:
https://github.com/containers/common/blob/main/docs/containerignore.5.md
https://github.com/containers/common/blob/main/docs/containers.conf.5.md
https://github.com/containers/storage/blob/main/docs/containers-storage.conf.5.md
https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md
https://github.com/containers/image/blob/main/docs/containers-registries.conf.d.5.md

I wasn't sure exactly how to interpret what containers.conf(5) was
saying about modules, so I looked at
https://github.com/containers/common/tree/main/pkg/config/testdata/modules
to get examples, and based the detection off those.

closes: #16852

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(doc): remove unnecessary "an"
zeertzjq [Wed, 12 Mar 2025 20:16:13 +0000 (21:16 +0100)] 
runtime(doc): remove unnecessary "an"

"umask" is pronounce like "youmask", so having an "an" before it is a
bit strange.  In other places in the help, "umask" is not preceded by
either "a" or "an", and sometimes preceded by "the".

Also, "Note" is usually followed either by ":" or "that" in builtin.txt,
so add a ":" after "Note".

closes: 16860

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1195: inside try-block: fn body executed with default arg undefined v9.1.1195
Shane Harper [Wed, 12 Mar 2025 20:12:12 +0000 (21:12 +0100)] 
patch 9.1.1195: inside try-block: fn body executed with default arg undefined

Problem:  inside try-block: fn body executed when default arg is
          undefined
Solution: When inside a try-block do not execute function body after an
          error in evaluating a default argument expression
          (Shane Harper).

closes: #16865

Signed-off-by: Shane Harper <shane@shaneharper.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(doc): Update doc 52.6
Jim Zhou [Wed, 12 Mar 2025 19:57:24 +0000 (20:57 +0100)] 
runtime(doc): Update doc 52.6

Problem: the highlight-yank plugin exmaple provided in the doc behaves
 incorrectly when selection is set to exclusive.

Solution: use a unified offset of 1 and pass 'exclusive: false' to
  getregionpos(), while at it, also clarify when the
          TextYankPost autocommand triggers.

closes: #16866

Signed-off-by: Jim Zhou <jimzhouzzy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(compiler): allow customizing exe and args for tsc
Konfekt [Tue, 11 Mar 2025 20:40:04 +0000 (21:40 +0100)] 
runtime(compiler): allow customizing exe and args for tsc

closes: #16853

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(compiler): add comment for Dispatch
Konfekt [Tue, 11 Mar 2025 20:35:48 +0000 (21:35 +0100)] 
runtime(compiler): add comment for Dispatch

closes: #16854

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(tera): remove unwanted code and fix issues in syntax script
MuntasirSZN [Tue, 11 Mar 2025 20:17:45 +0000 (21:17 +0100)] 
runtime(tera): remove unwanted code and fix issues in syntax script

closes: #16857

Signed-off-by: MuntasirSZN <muntasir.joypurhat@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(doc): clarify that a umask is applied to mkdir()
Christian Brabandt [Tue, 11 Mar 2025 20:14:31 +0000 (21:14 +0100)] 
runtime(doc): clarify that a umask is applied to mkdir()

fixes: #16849

Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1194: filetype: false positive help filetype detection v9.1.1194
zeertzjq [Mon, 10 Mar 2025 20:30:29 +0000 (21:30 +0100)] 
patch 9.1.1194: filetype: false positive help filetype detection

Problem:  filetype: false positive help filetype detection
Solution: Only detect a file as help if modeline appears either at start
          of line or is preceded by whitespace (zeertzjq).

closes: #16845

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(man): improve :Man completion for man-db
David Mandelberg [Mon, 10 Mar 2025 20:26:50 +0000 (21:26 +0100)] 
runtime(man): improve :Man completion for man-db

On man-db systems, complete with actual man sections and pages, instead
of shell commands.

I tried to come up with a portable solution for multiple man
implementations in https://github.com/vim/vim/discussions/16794 but I
think the differences between implementations were too large to do that
without overly complicated code. So instead, I implemented it for man-db
(which I think is common on Linux) and hopefully left it easier for
other people to implement it on other systems in the future if they want
to.

closes: #16843

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1193: Unnecessary use of STRCAT() in au_event_disable() v9.1.1193
zeertzjq [Mon, 10 Mar 2025 20:15:19 +0000 (21:15 +0100)] 
patch 9.1.1193: Unnecessary use of STRCAT() in au_event_disable()

Problem:  Unnecessary use of STRCAT() in au_event_disable().  STRCAT()
          seeks to the end of new_ei, but here the end is already known.
Solution: Use STRCPY() and add p_ei_len to new_ei.  Also fix a typo in a
          comment.  Add a test that 'eventignore' works in :argdo
          (zeertzjq).

closes: #16844

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agotranslation(sr): Update Serbian messages translation
Ivan Pešić [Mon, 10 Mar 2025 20:13:08 +0000 (21:13 +0100)] 
translation(sr): Update Serbian messages translation

closes: #16846

Signed-off-by: Ivan Pešić <27575106+eevan78@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(doc): document vim syntax switches
Christian Brabandt [Mon, 10 Mar 2025 20:05:49 +0000 (21:05 +0100)] 
runtime(doc): document vim syntax switches

related: #16727
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(vim): Update base-syntax, improve :syntax highlighting
Doug Kearns [Mon, 10 Mar 2025 20:04:53 +0000 (21:04 +0100)] 
runtime(vim): Update base-syntax, improve :syntax highlighting

- Highlight missing :syntax subcommands.
- Don't highlight user specified syntax group names.

closes: #16847

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1192: Vim crashes with term response debug logging enabled v9.1.1192
Hirohito Higashi [Sun, 9 Mar 2025 15:35:14 +0000 (16:35 +0100)] 
patch 9.1.1192: Vim crashes with term response debug logging enabled

Problem:  Vim crashes with term response debug logging enabled and
          running in a non-writeable directory
Solution: use ch_log() instead of custom termresponse logging function
          (Hirohito Higashi)

closes: #16840

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(vim): Update base-syntax and generator, only match valid predefined variables
Doug Kearns [Sun, 9 Mar 2025 15:30:28 +0000 (16:30 +0100)] 
runtime(vim): Update base-syntax and generator, only match valid predefined variables

- Only match valid predefined and option variables.
- Match scope dictionaries.
- Highlight scope prefixed variables as a scope dictionary accessor. The
  vimVarScope syntax group can be linked to vimVar to disable this.
- Include support for Neovim-only predefined and option variables.

Temporary collateral damage - scope dictionaries match instead of keys
in dictionary literals.

closes: #16727

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(plsql): move fold option from syntax to filetype plugin
Lee Lindley [Sun, 9 Mar 2025 15:25:17 +0000 (16:25 +0100)] 
runtime(plsql): move fold option from syntax to filetype plugin

closes: #16838

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Lee Lindley <lee.lindley@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1191: tests: test for patch 9.1.1186 doesn't fail without the patch v9.1.1191
zeertzjq [Sun, 9 Mar 2025 15:14:45 +0000 (16:14 +0100)] 
patch 9.1.1191: tests: test for patch 9.1.1186 doesn't fail without the patch

Problem:  Test for patch 9.1.1186 doesn't fail without the patch.
Solution: Set 'nomodeline' in the test (zeertzjq).

closes: #16835

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1190: C indentation does not detect multibyte labels v9.1.1190
Anttoni Erkkilä [Sun, 9 Mar 2025 15:07:15 +0000 (16:07 +0100)] 
patch 9.1.1190: C indentation does not detect multibyte labels

Problem:  C indentation does not detect multibyte labels
Solution: Correctly skip over multibyte characters
          (Anttoni Erkkilä)

closes: #16770

Signed-off-by: Anttoni Erkkilä <anttoni.erkkila@protonmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoCI: Update clang to version 20
Philip H. [Sun, 9 Mar 2025 15:03:47 +0000 (16:03 +0100)] 
CI: Update clang to version 20

closes: #16836

Signed-off-by: Philip H. <47042125+pheiduck@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(sh): set b:match_skip to ignore matches for matchit
Christian Brabandt [Sun, 9 Mar 2025 09:15:39 +0000 (10:15 +0100)] 
runtime(sh): set b:match_skip to ignore matches for matchit

related: #16801
closes: chrisbra/matchit#50
closes: #16834

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1189: if_python: build error due to incompatible pointer types v9.1.1189
oreo639 [Sun, 9 Mar 2025 07:54:21 +0000 (08:54 +0100)] 
patch 9.1.1189: if_python: build error due to incompatible pointer types

Problem:  if_python: build error due to incompatible pointer types
Solution: cast pointer to PyObject* (oreo639)

Avoid build failure due to -Wincompatible-pointer-types becoming an error in
gcc 14.
When Py_LIMITED_API is < 0x030b0000, then the for Py_XDECREF must be PyObject*.
Vim targets Py_LIMITED_API = 0x03080000 (python 3.8).

closes: #16824

Signed-off-by: oreo639 <oreo6391@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1188: runtime(tera): tera support can be improved v9.1.1188
MuntasirSZN [Sun, 9 Mar 2025 07:49:14 +0000 (08:49 +0100)] 
patch 9.1.1188: runtime(tera): tera support can be improved

Problem:  runtime(tera): tera support can be improved
Solution: update tera filetype plugin, include a tera syntax script
          include tera syntax tests, update the filetype test,
          update makemenu and synmenu vim scripts
          (MuntasirSZN)

closes: #16830

Signed-off-by: MuntasirSZN <muntasir.joypurhat@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1187: matchparen plugin wrong highlights shell case statement v9.1.1187
Christian Brabandt [Sun, 9 Mar 2025 07:40:33 +0000 (08:40 +0100)] 
patch 9.1.1187: matchparen plugin wrong highlights shell case statement

Problem:  matchparen plugin wrong highlights shell case statement
          (Swudu Susuwu)
Solution: return early, if we are in a shSnglCase syntax element

The shell syntax element "case $var in foobar)" uses closing parenthesis
but there is no corresponding opening parenthesis for that syntax
element. However matchparen is not aware of such things and will happily
try to match just the next opening parenthesis.

So let's just add a way to opt out for such cases. In this case, use the
syntax state to check if the closing parenthesis belongs to the syntax
item "shSnglCase" and if it is, do not try to find a corresponding
opening parenthesis.

Since inspecting the syntax state might be expensive, put the whole
check behind a filetype test, so that matchparen will only perform this
particular check, when it knows the current buffer is a "sh" filetype.

fixes: #16801
closes: #16831

Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(doc): use GNOME instead of Gnome
zeertzjq [Sun, 9 Mar 2025 07:38:35 +0000 (08:38 +0100)] 
runtime(doc): use GNOME instead of Gnome

It's called "GNOME Terminal" in
https://gitlab.gnome.org/GNOME/gnome-terminal It's also called GNOME
Terminal in English Wikipedia
https://en.wikipedia.org/wiki/GNOME_Terminal and the Wikipedia pages of
8 other languages.

Also, make line wrapping the same in insert.txt and cmdline.txt.

closes: #16832

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1186: filetype: help files in git repos are not detected v9.1.1186
David Mandelberg [Sat, 8 Mar 2025 16:21:16 +0000 (17:21 +0100)] 
patch 9.1.1186: filetype: help files in git repos are not detected

Problem:  filetype: help files in git repos are not detected
Solution: detect */doc/*.txt files as help if they end with a help
          modeline, even if 'modeline' is off

Here's how I checked that this would still detect vim's own help files
correctly:

$ find . -type f -path '*/doc/*.txt' \
> -exec awk '{ } ENDFILE { print FILENAME ":" $0; }' '{}' + |
> grep -v 'vim:.*\<\(ft\|filetype\)=help\>'
./src/libvterm/doc/seqs.txt: 23    DECSM 42         = DECNRCM, national/multinational character

closes: #16817

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(nohlsearch): fix CursorHold loop
qaqland [Sat, 8 Mar 2025 16:16:18 +0000 (17:16 +0100)] 
runtime(nohlsearch): fix CursorHold loop

fix exception when entering the insert mode with paste

closes: #16818

Co-authored-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: qaqland <qaq@qaq.land>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(doc): warn users about potentially risky hotkey
David Mandelberg [Sat, 8 Mar 2025 16:06:50 +0000 (17:06 +0100)] 
runtime(doc): warn users about potentially risky hotkey

Also, mention that CTRL-SHIFT-V might be mapped to paste text, similar
to the note about CTRL-V.

References:
https://gitlab.gnome.org/GNOME/gnome-terminal/-/blob/2d7e9d78c9631be63b6b381f6966cb8808865ffb/src/org.gnome.Terminal.gschema.xml#L395-398
https://gitlab.gnome.org/chergert/ptyxis/-/blob/8942adde5b98c82c85238851743b371a034a1c1b/src/org.gnome.Ptyxis.gschema.xml.in#L529-L533

closes: #16816

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(syntax-tests): Improve parts of "runtest.vim"
Aliaksei Budavei [Sat, 8 Mar 2025 15:58:17 +0000 (16:58 +0100)] 
runtime(syntax-tests): Improve parts of "runtest.vim"

* Accommodate the calling of "EraseLineAndReturnCarriage()"
  to not interfere with the "skipped" and "failed" reports.

* Create the "failed" directory, if unavailable, without
  relying on "VerifyScreenDump()" to do it so that reporting
  with "Xtestscript#s:AssertCursorForwardProgress()" can be
  uniformly attempted.

* Make an only list copy of the "Xtestscript" contents and
  share it with every syntax test.

* Narrow the scope of the "filetype" and "failed_root" local
  variables.

closes: #16789

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1185: endless loop with completefuzzycollect and no match found v9.1.1185
glepnir [Sat, 8 Mar 2025 15:52:55 +0000 (16:52 +0100)] 
patch 9.1.1185: endless loop with completefuzzycollect and no match found

Problem:  endless loop with completefuzzycollect and no match found
Solution: move pointer to line end and break loop

closes: #16820

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(doc): CmdUndefined and FuncUndefined can always be nested
zeertzjq [Sat, 8 Mar 2025 15:45:20 +0000 (16:45 +0100)] 
runtime(doc): CmdUndefined and FuncUndefined can always be nested

closes: #16825

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1184: Unnecessary use of vim_tolower() in vim_strnicmp_asc() v9.1.1184
zeertzjq [Sat, 8 Mar 2025 15:42:48 +0000 (16:42 +0100)] 
patch 9.1.1184: Unnecessary use of vim_tolower() in vim_strnicmp_asc()

Problem:  Unnecessary use of vim_tolower() in vim_strnicmp_asc().
Solution: Use TOLOWER_ASC() instead (zeertzjq).

It was passing *s1 and *s2 to vim_tolower(). When char is signed, which
is the case on most platforms, c < 0x80 is always true, so it already
behaves the same as TOLOWER_ASC().

closes: #16826

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1083: "above" virtual text breaks cursorlineopt=number v9.1.1183
zeertzjq [Sat, 8 Mar 2025 15:27:37 +0000 (16:27 +0100)] 
patch 9.1.1083: "above" virtual text breaks cursorlineopt=number

Problem:  "above" virtual text breaks cursorlineopt=number.
Solution: Take "above" virtual text into account when applying
          CursorLineNr highlight.

fixes: #16828
closes: #16829

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(go): add 'keywordprg' and 'formatprg' to ftplugin
Phạm Bình An [Fri, 7 Mar 2025 18:19:31 +0000 (19:19 +0100)] 
runtime(go): add 'keywordprg' and 'formatprg' to ftplugin

closes: #16804

Signed-off-by: Phạm Bình An <phambinhanctb2004@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(syntax-tests): Re-introduce support for "phoney" languages
Aliaksei Budavei [Fri, 7 Mar 2025 18:12:45 +0000 (19:12 +0100)] 
runtime(syntax-tests): Re-introduce support for "phoney" languages

As of patch v9.1.1176~1, there are no longer makeshift Make
targets to accommodate language names that can match phoney
targets.  For example, "clean_" was previously generated for
Clean because otherwise it clashed with the "clean" target.

Additionally, enable test filtering for makeshift targets.

Reference:
https://wiki.clean.cs.ru.nl/Clean

closes: #16810

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1182: No cmdline completion for 'completefuzzycollect' v9.1.1182
zeertzjq [Fri, 7 Mar 2025 18:09:09 +0000 (19:09 +0100)] 
patch 9.1.1182: No cmdline completion for 'completefuzzycollect'

Problem:  No cmdline completion for the 'completefuzzycollect' option
          (after v9.1.1178)
Solution: Add cmdline completion for the 'completefuzzycollect' option,
          improve its description in optwin.vim (zeertzjq).

closes: #16813

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1181: Unnecessary STRLEN() calls in insexpand.c v9.1.1181
zeertzjq [Fri, 7 Mar 2025 18:06:02 +0000 (19:06 +0100)] 
patch 9.1.1181: Unnecessary STRLEN() calls in insexpand.c

Problem:  Unnecessary STRLEN() calls in insexpand.c (after 9.1.1178).
Solution: Use the already available length (zeertzjq).

closes: #16814

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1180: short-description v9.1.1180
zeertzjq [Fri, 7 Mar 2025 17:51:40 +0000 (18:51 +0100)] 
patch 9.1.1180: short-description

Problem:  The meaning of <Tab> depends on unspecified behavior
          (after 9.1.1179).
Solution: Return TAB in case bsearch() finds K_TAB.  Rename alt_name to
          pref_name as that's closer to it meaning (zeertzjq).

The man page of bsearch() says:

    The bsearch() function returns a pointer to a matching member of the
    array, or NULL if no match is found.  If there are multiple elements
    that match the key, the element returned is unspecified.

So it's possible that bsearch() finds K_TAB instead of TAB when trying
to get the key code for <Tab>. Actually, it can happen when adding a
single key to end of the table:

closes: #16821

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/misc2.c b/src/misc2.c
index 151745ca2..90f108a24 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -1141,7 +1141,8 @@ static struct key_name_entry
     {TRUE, K_XRIGHT, STRING_INIT("xRight"), NULL},
     {TRUE, K_XUP, STRING_INIT("xUp"), NULL},
     {TRUE, K_ZEND, STRING_INIT("zEnd"), NULL},
-    {TRUE, K_ZHOME, STRING_INIT("zHome"), NULL}
+    {TRUE, K_ZHOME, STRING_INIT("zHome"), NULL},
+    {TRUE, -1, STRING_INIT("zzDummyKey"), NULL}
     // NOTE: When adding a long name update MAX_KEY_NAME_LEN.
 };
 #undef STRING_INIT

Meanwhile IDX_KEYNAME_TAB doesn't do anything, as TAB and K_TAB have the
same name.

Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(vim): Update base-syntax, bug fixes
Doug Kearns [Fri, 7 Mar 2025 17:49:11 +0000 (18:49 +0100)] 
runtime(vim): Update base-syntax, bug fixes

- Allow trailing backslashes in option values.
- Match :map-special modifier.
- Match :map-arguments case-sensitively.
- Remove <*Leader> from map modifier list and allow in RHS of a mapping.

closes: #16822

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1179: too many strlen() calls in misc2.c v9.1.1179
John Marriott [Thu, 6 Mar 2025 21:26:23 +0000 (22:26 +0100)] 
patch 9.1.1179: too many strlen() calls in misc2.c

Problem:  too many strlen() calls in misc2.c
Solution: refactor misc2.c and use bsearch() instead of a linear search
          to find matches in the key_names_table array (John Marriott).

This commit changes misc2.c to use bsearch() to perform string searches of
the key_names_table array.

Implementation detail:
- Some entries in this array have alternate names. Add field alt_name to
  point to the alternate name.
- Some entries in this array are only available if a given feature is
  defined. Keep them in the array, but add a boolean field enabled to
  indicate if the record can be used or not. If the feature is not
  available, the corresponding enabled field is set to FALSE.

In my measurements running the test suite on a huge non-gui build on
linux, the number of string comparisons in get_special_key_code():
Before (linear search): 2,214,957
After (binary search): 297,770

A side effect of this is 1477 calls to STRLEN() in
get_special_key_name() for the same test run are no longer necessary.

While we are here, refactor call_shell() and the mshape_names array to
remove some STRLEN() calls.

closes: #16788

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1178: not possible to generate completion candidates using fuzzy matching v9.1.1178
glepnir [Thu, 6 Mar 2025 20:59:13 +0000 (21:59 +0100)] 
patch 9.1.1178: not possible to generate completion candidates using fuzzy matching

Problem:  not possible to generate completion candidates using fuzzy
          matching
Solution: add the 'completefuzzycollect' option for (some) ins-completion
          modes (glepnir)

fixes #15296
fixes #15295
fixes #15294
closes: #16032

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoeditorconfig: set editing style for comment and hlsearch package
Maxim Kim [Thu, 6 Mar 2025 20:13:25 +0000 (21:13 +0100)] 
editorconfig: set editing style for comment and hlsearch package

closes: #16805

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1177: filetype: tera files not detected v9.1.1177
MuntasirSZN [Thu, 6 Mar 2025 20:06:38 +0000 (21:06 +0100)] 
patch 9.1.1177: filetype: tera files not detected

Problem:  filetype: tera files not detected
Solution: detect '*.tera' files as tera filetype,
          include a simple filetype plugin
          (MuntasirSZN)

closes: #16806

Signed-off-by: MuntasirSZN <muntasir.joypurhat@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(doc): revert modeline change in vim9.txt
Christian Brabandt [Thu, 6 Mar 2025 20:01:26 +0000 (21:01 +0100)] 
runtime(doc): revert modeline change in vim9.txt

Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(new-tutor): add chapter two to the interactive tutorial
RestorerZ [Wed, 5 Mar 2025 20:49:37 +0000 (21:49 +0100)] 
runtime(new-tutor): add chapter two to the interactive tutorial

closes: #16803

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1176: wrong indent when expanding multiple lines v9.1.1176
glepnir [Wed, 5 Mar 2025 20:18:20 +0000 (21:18 +0100)] 
patch 9.1.1176: wrong indent when expanding multiple lines

Problem:  wrong indentation of lastline when expanding multiple lines
Solution: Check OPENLINE_FORCE_INDENT flag in open_line() (glepnir)

closes: #16786

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agotest(runtime/syntax): improve syntax tests
Eisuke Kawashima [Wed, 5 Mar 2025 20:15:45 +0000 (21:15 +0100)] 
test(runtime/syntax): improve syntax tests

When a syntax file is changed, timestamps of the corresponding files are
updated.

NOTE: At the moment this script does not strictly track dependency, like
cpp on c.

Also update ignore files

closes #16548

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoeditorconfig: set indent config for *.vim files
David Mandelberg [Wed, 5 Mar 2025 20:07:59 +0000 (21:07 +0100)] 
editorconfig: set indent config for *.vim files

I tried to figure out what was the most common using modelines. Note
that there are 2401 vim files, and the numbers in the other command
outputs below add up to significantly less than that, so it's possible
that my estimate of what's most common is way off.

```
$ find . -name \*.vim | wc -l
2401
```

It looks like 2 is the most common value by far for shiftwidth and
softtabstop, so I used that for indent_size.

```
$ git grep -hE '(^|\s)((vi|vim|ex):|(vi|[vV]im|ex):\s*set? .*:)' -- '*.vim' |
> grep -Eo '\<(sw|shiftwidth)=[0-9]+' | cut -d = -f 2 |
> sort | uniq -c | sort -n
      2 0
     14 3
     18 8
     75 4
    610 2

$ git grep -hE '(^|\s)((vi|vim|ex):|(vi|[vV]im|ex):\s*set? .*:)' -- '*.vim' |
> grep -Eo '\<(sts|softtabstop)=[^ :]+' | cut -d = -f 2 |
> sort | uniq -c | sort -n
      2 -1
      7 8
      9 0
      9 3
     43 4
    469 2
```

Similarly, 8 is by far the most common tabstop, so I didn't adjust that.

```
$ git grep -hE '(^|\s)((vi|vim|ex):|(vi|[vV]im|ex):\s*set? .*:)' -- '*.vim' |
> grep -Eo '\<(ts|tabstop)=[0-9]+' | cut -d = -f 2 |
> sort | uniq -c | sort -n
      1 20
      1 6
      1 9
      2 10
      2 16
      2 17
      3 15
      4 3
      5 18
      9 2
     40 4
    497 8
```

And expandtab is significantly more common than noexpandtab. Taking that
in combination with the common shiftwidth and softtabstop of 2 but
tabstop of 8, I set indent_style to space.

```
$ git grep -hE '(^|\s)((vi|vim|ex):|(vi|[vV]im|ex):\s*set? .*:)' -- '*.vim' |
> grep -Eo '\<(no)?(et|expandtab)\>' | sort | uniq -c | sort -n
     15 noexpandtab
     86 noet
    115 et
    309 expandtab
```

I did try to look at a few of the less common values for those options
to see if there was any obvious pattern, like all *.vim files in one
directory having a different setting. The only real pattern I noticed
was in runtime/pack/dist/opt/netrw, but that looks like it's imported
from a separate repository? So I think it might make more sense for them
to create their own .editorconfig file rather than putting settings for
that directory in this one.

closes: #16777

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(doc): mention alternative check for vim9script
Konfekt [Wed, 5 Mar 2025 20:03:21 +0000 (21:03 +0100)] 
runtime(doc): mention alternative check for vim9script

Vim9 syntax changed before Vim 9 leading to errors thrown if checked for
availability of Vim9script in Vim Version 8.2 such as

This check seems to work as well and throws less errors on Vim 8.2 such
as on Ubuntu 22.04

closes: #16783

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1175: inconsistent behaviour with exclusive selection and motion commands v9.1.1175
Jim Zhou [Wed, 5 Mar 2025 19:47:29 +0000 (20:47 +0100)] 
patch 9.1.1175: inconsistent behaviour with exclusive selection and motion commands

Problem:  inconsistent behaviour with exclusive selection and motion
          commands (aidancz)
Solution: adjust cursor position when selection is exclusive
          (Jim Zhou)

fixes: #16278
closes: #16784

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Jim Zhou <jimzhouzzy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(man): don't add jumps when loading a manpage
David Mandelberg [Wed, 5 Mar 2025 19:38:20 +0000 (20:38 +0100)] 
runtime(man): don't add jumps when loading a manpage

Without this change, pressing K while in one manpage to load another
one, then pressing CTRL-O to go back, results in going to the bottom of
the current (second) manpage. With this change, it goes back to the
previous manpage.

closes: #16791

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(vim): recognize <...> strings (and keys) for 'keywordprg'
Konfekt [Wed, 5 Mar 2025 19:33:00 +0000 (20:33 +0100)] 
runtime(vim): recognize <...> strings (and keys) for 'keywordprg'

see :help E499 and :h key-notation

closes: #16795

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1174: tests: Test_complete_cmdline() may fail v9.1.1174
Jim Zhou [Wed, 5 Mar 2025 19:25:11 +0000 (20:25 +0100)] 
patch 9.1.1174: tests: Test_complete_cmdline() may fail

Problem:  tests: when the file 'TestCommand?Test' exists,
          'Test_complete_cmdline()' will fail when writing the file. And
          there's no related cleaning operation for this kind of file
          before the test run.
Solution: modify `write` to `write!` to override (Jim Zhou).

closes: #16799

Signed-off-by: Jim Zhou <jimzhouzzy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(doc): mention bzip3 in gzip plugin documentation
Jim Zhou [Wed, 5 Mar 2025 19:22:24 +0000 (20:22 +0100)] 
runtime(doc): mention bzip3 in gzip plugin documentation

closes: #16800

Signed-off-by: Jim Zhou <jimzhouzzy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1173: filetype: ABNF files are not detected v9.1.1173
A4-Tacks [Wed, 5 Mar 2025 19:10:29 +0000 (20:10 +0100)] 
patch 9.1.1173: filetype: ABNF files are not detected

Problem:  filetype: ABNF files are not detected
Solution: detect '.abnf' file as abnf filetype and
          include an abnf syntax plugin (A4-Tacks).

References:
- RFC5234
- RFC7405

closes: #16802

Signed-off-by: A4-Tacks <wdsjxhno1001@163.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1172: [security]: overflow with 'nostartofline' and Ex command in tag file v9.1.1172
zeertzjq [Wed, 5 Mar 2025 19:05:18 +0000 (20:05 +0100)] 
patch 9.1.1172: [security]: overflow with 'nostartofline' and Ex command in tag file

Problem:  heap-buffer-overflow with 'nostartofline' and Ex command in
          tag file.
Solution: Set cursor column when moving cursor to line 1 (zeertzjq).

closes: #16796

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1171: tests: wrong arguments passed to assert_equal() v9.1.1171
zeertzjq [Tue, 4 Mar 2025 20:33:57 +0000 (21:33 +0100)] 
patch 9.1.1171: tests: wrong arguments passed to assert_equal()

Problem:  tests: wrong arguments passed to assert_equal()
          (after v9.1.1167).
Solution: Swap arguments in the assert_equal() call (zeertzjq).

closes: #16782

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1170: wildmenu highlighting in popup can be improved v9.1.1170
Girish Palya [Tue, 4 Mar 2025 19:56:30 +0000 (20:56 +0100)] 
patch 9.1.1170: wildmenu highlighting in popup can be improved

Problem:  wildmenu highlighting in popup can be improved
Solution: Check if the completion items contain submatches of the
          entered text (Girish Palya).

This update enables highlighting in the popup menu even when the matched
fragment or pattern appears within an item (string) rather than only at the
beginning. This is especially useful for custom completion, where menu items
may not always start with the typed pattern.

For specific use cases, refer to the two examples in
https://github.com/vim/vim/pull/16759

A sliding window approach is used with direct string comparison. Performance
is not a concern, as highlighting is applied only to displayed lines, even if
the menu list is arbitrarily long.

closes: #16785

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(netrw): upstream snapshot of v179
Luca Saccarola [Tue, 4 Mar 2025 19:36:31 +0000 (20:36 +0100)] 
runtime(netrw): upstream snapshot of v179

closes: #16787

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(doc): fix typo "bet" in :h 'completeopt'
zeertzjq [Mon, 3 Mar 2025 19:18:04 +0000 (20:18 +0100)] 
runtime(doc): fix typo "bet" in :h 'completeopt'

closes: #16773

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1169: using global variable for get_insert()/get_lambda_name() v9.1.1169
Yee Cheng Chin [Mon, 3 Mar 2025 19:12:05 +0000 (20:12 +0100)] 
patch 9.1.1169: using global variable for get_insert()/get_lambda_name()

Problem:  using global variable for get_insert()/get_lambda_name()
          (after v9.1.1151)
Solution: let the functions return a string_T object instead
          (Yee Cheng Chin)

In #16720, `get_insert()` was modified to store a string length in a
global variable to be queried immediately by another `get_insert_len()`
function, which is somewhat fragile. Instead, just have the function
itself return a `string_T` object instead. Also do the same for
`get_lambda_name()` which has similar issues.

closes: #16775

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1168: wrong flags passed down to nextwild() v9.1.1168
Girish Palya [Mon, 3 Mar 2025 19:01:06 +0000 (20:01 +0100)] 
patch 9.1.1168: wrong flags passed down to nextwild()

Problem:  wrong flags passed down to nextwild()
          (zeertzjq, after v9.1.1166)
Solution: only pass options flags (Girish Palya)

`options` needs to be passed into nextwild() since it may contain
WILD_KEEP_SOLE_ITEM which prevents the menu items list from getting
freed if there is only 1 item left (if `noselect` is set).

closes: #16778

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1167: mark '] wrong after copying text object v9.1.1167
Jim Zhou [Mon, 3 Mar 2025 18:53:26 +0000 (19:53 +0100)] 
patch 9.1.1167: mark '] wrong after copying text object

Problem:  mark '] wrong after copying text object (ubaldot)
Solution: Adjust position of '] for non-linewise, exclusive motions
          (Jim Zhou)

related: #16679
closes: #16772

Signed-off-by: Jim Zhou <jimzhouzzy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(doc): update how to get Vim
Christian Brabandt [Mon, 3 Mar 2025 07:16:27 +0000 (08:16 +0100)] 
runtime(doc): update how to get Vim

Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agopatch 9.1.1166: command-line auto-completion hard with wildmenu v9.1.1166
Girish Palya [Sun, 2 Mar 2025 21:55:57 +0000 (22:55 +0100)] 
patch 9.1.1166: command-line auto-completion hard with wildmenu

Problem:  command-line auto-completion hard with wildmenu
Solution: implement "noselect" wildoption value (Girish Palya)

When `noselect` is present in `wildmode` and 'wildmenu' is enabled, the
completion menu appears without pre-selecting the first item.

This change makes it easier to implement command-line auto-completion,
where the menu dynamically appears as characters are typed, and `<Tab>`
can be used to manually select an item. This can be achieved by
leveraging the `CmdlineChanged` event to insert `wildchar(m)`,
triggering completion menu.

Without this change, auto-completion using the 'wildmenu' mechanism is
not feasible, as it automatically inserts the first match, preventing
dynamic selection.

The following Vimscript snippet demonstrates how to configure
auto-completion using `noselect`:

```vim
vim9script
set wim=noselect:lastused,full wop=pum wcm=<C-@> wmnu
autocmd CmdlineChanged : timer_start(0, function(CmdComplete, [getcmdline()]))

def CmdComplete(cur_cmdline: string, timer: number)
  var [cmdline, curpos] = [getcmdline(), getcmdpos()]
  if cur_cmdline ==# cmdline  # Avoid completing each character in keymaps and pasted text
    && !pumvisible() && curpos == cmdline->len() + 1

    if cmdline[curpos - 2] =~ '[\w*/:]'  # Reduce noise by completing only selected characters
      feedkeys("\<C-@>", "ti")
      set eventignore+=CmdlineChanged  # Suppress redundant completion attempts
      timer_start(0, (_) => {
        getcmdline()->substitute('\%x00$', '', '')->setcmdline()  # Remove <C-@> if no completion items exist
        set eventignore-=CmdlineChanged
      })
    endif
  endif
enddef
```

fixes: #16551
closes: #16759

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
4 months agoruntime(tar): use readblob() instead of shelling out to file(1)
Christian Brabandt [Sun, 2 Mar 2025 21:23:28 +0000 (22:23 +0100)] 
runtime(tar): use readblob() instead of shelling out to file(1)

fixes: ##16761
closes: #16769

Co-authored-by: Jim Zhou <jimzhouzzy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>