21699 Commits

Author SHA1 Message Date
9d065a4862 patch 9.1.1469: potential buffer-underflow with invalid hl_id
Problem:  potential buffer-underflow with invalid hl_id (mugitya03)
Solution: assert that the return-code of syn_get_final_id() if > 0

As a safety check, syn_get_final_id() may return zero when either the
provided hl_id is zero or larger than expected.

However, many callers of syn_get_final_id() do not check that the return
value is larger than zero but re-use the returned highlight id directly
like this:

  hl_id = syn_get_final_id(hl_id);
  sgp = &HL_TABLE()[hl_id - 1];	    // index is ID minus one

in which case, this would cause a buffer underrun and an access violation.

Let's use assert(hl_id > 0); to make sure that hl_id is larger than
zero.

Note to myself: I'll need to compile releases builds using -DNDEBUG once
a new release will be made

fixes: #17475
closes: #17512

Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.1469
2025-06-18 18:31:19 +02:00
03e5ee25fd patch 9.1.1468: filetype: bright(er)script files are not recognized
Problem:  filetype: bright(er)script files are not recognized
Solution: detect *.bs files as brighterscript filetype and *.brs as
          brightscript filetype, include filetype plugins (Riley Bruins)

closes: #17566

Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.1468
2025-06-18 18:23:05 +02:00
fff0132399 patch 9.1.1467: too many strlen() calls
Problem:  too many strlen() calls
Solution: Change expand_env() to return string length
          (John Marriott)

This commit does the following changes:
- In expand_env_esc():
  - return the length of the returned dst string.
  - refactor to remove some calls to STRLEN() and STRCAT()
  - add check for out-of-memory condition.
- Change call sites in various source files to use the return value

closes: #17561

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.1467
2025-06-18 18:20:11 +02:00
8311e7d6b4 runtime(vim): fix incorrect highlighting of User autocmds
There is no pattern after the user event name. The user event name is
the pattern.

closes: #17568

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-18 18:02:47 +02:00
48295111e5 patch 9.1.1466: filetype: not all lex files are recognized
Problem:  filetype: not all lex files are recognized
Solution: detect *.ll as lex, llvm or lifelines filetype, depending on
          the content (Eisuke Kawashima)

closes: #17560

Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.1466
2025-06-17 20:30:52 +02:00
acd04b2fd7 patch 9.1.1465: tabpanel: not correctly drawn with 'equalalways'
Problem:  tabpanel: not correctly drawn with 'equalalways'
Solution: call win_equal() (Hirohito Higashi)

closes: #17554

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.1465
2025-06-16 20:26:08 +02:00
b7ebe610cc translation(de): update German messages translation
closes: #17555

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-16 20:23:00 +02:00
234c728c53 runtime(optwin): fix tabpanel typo in optwin
related: #17555

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-16 20:22:30 +02:00
cb27992cda patch 9.1.1464: gv does not work in operator-pending mode
Problem:  gv does not work in operator-pending mode
          (liushapku)
Solution: remove the check for checkclearop in nv_gv_cmd()
          (phanium)

fixes: #3666
closes: #17551

Signed-off-by: phanium <91544758+phanen@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.1464
2025-06-16 20:19:15 +02:00
93318a9933 patch 9.1.1463: Integer overflow in getmarklist() after linewise operation
Problem:  Integer overflow in getmarklist() after linewise operation.
Solution: Don't add 1 to MAXCOL (zeertzjq)

related: neovim/neovim#34524
closes: #17552

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.1463
2025-06-16 20:10:38 +02:00
8ae8b304ee patch 9.1.1462: missing change from patch v9.1.1461
Problem:  missing change from patch v9.1.1461
Solution: change wrong TPL_LCOL macro in a few more places

Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.1462
2025-06-16 20:07:54 +02:00
152a450d88 runtime(sh): reset g:sh_fold_enabled after outputting its value in syntax script
fixes: #10701
closes: #17557

Signed-off-by: hakkadaikon <hakkadaikon@yahoo.co.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-16 19:54:37 +02:00
7841ca185d runtime(vimtutor): vimtutor throws Access Denied Error on MS-Windows
Problem:  MS-Windows: vimtutor throws Access Denied Error
Solution: switch the order of redirects. First redirect stdout, than
          stderr to stdout, Try to access $TEMP before current directory
          (which is usually c:\Program Files\vim\vim91\ and not writable
          for normal users)

closes: #17550

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-16 19:48:03 +02:00
e5c96e344c patch 9.1.1461: tabpanel: tabpanel vanishes with popup menu
Problem:  tabpanel: tabpanel vanishes with popup menu
Solution: remove pum-related test in tabpanel_leftcol(), refactor a few
          related functions (Hirohito Higashi)

This commit does the following:
- Delete unnecessary pum-related checks in the tabpanel_leftcol()
  function
- remove pum-related check in tabpanel_leftcol()
- The argument of the TPL_LCOL() macro has been deleted.
- The argument of the tabpanel_leftcol() function has been changed
  to void
- The return type of the `win_comp_pos()` function has been changed to
  void

closes: #17549

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.1461
2025-06-16 19:39:24 +02:00
e5297e39b3 patch 9.1.1460: MS-Windows: too many strlen() calls in os_win32.c
Problem:  MS-Windows: too many strlen() calls in os_win32.c
Solution: refactor code and remove calls to strlen() and wcscat()
          (John Marriott)

This commit does the following changes:
- in mch_get_exe_name():
  - refactor to remove call to wcsrchr().
  - refactor to replace calls to wcscat() with wcscpy().
  - move variables closer to where they are used.
  - change test to make sure that concatenating path and exe_pathw
    will fit inside the environment string (taking into account that
    path may be NULL).
- in executable_exists():
  - add namelen argument.
  - use string_T to store some strings.
  - refactor to remove calls to STRLEN() (via STRCAT()).
- in mch_getperm():
  - move call to mch_stat() into return statement and drop unneeded
    variable.
- in mch_wrename():
  - refactor to use wide character comparisons.
- some cosmetic code styling changes (removing extraneous spaces, etc).

closes: 17542

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.1460
2025-06-15 16:50:38 +02:00
f548ec46e4 runtime(keymaps): Add Azerbaijani keymap
closes: #17541

Signed-off-by: Rasul Samadzade <rasul.samadzade@protonmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-15 16:33:35 +02:00
6897f18ee6 patch 9.1.1459: xxd: coloring output is inefficient
Problem:  xxd prints color escape sequences for every octet
          even if the color doesn't change
Solution: use separate arrays for colors and text and only
          print escape sequences when the color changes
          (Emanuel Krollmann)

fixes: #15122
closes: #17535

Signed-off-by: Emanuel Krollmann <E.Krollmann@protonmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.1459
2025-06-15 16:24:09 +02:00
f5aa269f2d patch 9.1.1458: tabpanel: tabs not properly updated with 'stpl'
Problem:  tabpanel: tabs not properly updated with 'stpl'
Solution: remember the Column offset per tabpage
          (Hirohito Higashi)

fixes: #17519
closes: #17544

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.1458
2025-06-15 16:09:22 +02:00
631a50ceb9 runtime(doc): mention cannot ignored events in eventignorewin
closes: #17545

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-15 16:05:10 +02:00
7e47c1e735 runtime(netrw): remove g:netrw_quiet and reindent to 4 spaces
closes: #17539

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-15 15:26:44 +02:00
aef2e53cf8 runtime(comment): handle special chars ^$[ robustly
Make sure comment toggling works when 'commentstring' contains
any of the following regex special characters by escaping them:

^ $ [

closes: #17537

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-13 20:18:50 +02:00
1ded411a41 runtime(debcontrol): add hurd-amd64 architecture to syntax script
closes: #17525

Signed-off-by: Yuqian Yang <crupest@crupest.life>
Signed-off-by: James McCoy <jamessan@debian.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-13 20:11:42 +02:00
d296af94d0 runtime(masm): set 'com' and 'cms' options in ftplugin
closes: #17484

Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-12 22:07:40 +02:00
85f0711b4e runtime(zimbu): set 'commentstring' option in ftplugin
closes: #17478

Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-12 22:05:31 +02:00
91af4c4180 runtime(doc): improve the wording of 'sts', 'varts' and 'varsts' values
closes: #17522

Co-authored-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-12 21:56:19 +02:00
f5e3b5c04f runtime(netrw): refactor netrw#ErrorMsg -> netrw#msg#Notify
closes: #17526

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-12 21:51:42 +02:00
2eb995b569 runtime(defaults): Update the "Last Changes" header in defaults.vim
This change was forgotten from commit 6f6c0dba9f

closes: #17536

Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-12 21:40:45 +02:00
a9657c8952 patch 9.1.1457: compile warning with tabpanelopt
Problem:  compile warning with tabpanelopt
Solution: declare arg as UNUSED (John Marriott)

closes: #17528

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.1457
2025-06-12 21:37:18 +02:00
532a5fb131 patch 9.1.1456: comment plugin fails toggling if 'cms' contains \
Problem:  comment plugin fails toggling if 'cms' contains \
Solution: escape backslash (Maxim Kim)

groff could be commented using \" or \# and comment plugin fails to
uncomment such things.

NOTE: if newstyle comment would be introduced, e.g. .\#
for groff test would need to be adjusted.

closes: #17530

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.1456
2025-06-12 21:31:00 +02:00
16e9b477ab runtime(doc): remove an obsolete item from todo.txt
I cannot reproduce this defect.  The replication instructions refer to
Mercurial version numbers and I no longer use Mercurial for my Vim
source.  I tried comparing various Git versions of the example file,
src/if_cscope.c, and still couldn't reproduce the defect.  Also, I use
Vim's diff mode a lot and haven't seen such a problem in a long time.
I am confident that it has been fixed.

Therefore, the item should be removed from todo.txt.

closes: #17534

Signed-off-by: Gary Johnson <garyjohn@spocom.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-12 21:15:07 +02:00
ae31d7bfb4 patch 9.1.1455: Haiku: dailog objects created with no reference
Problem:  Haiku: dailog objects created with no reference
Solution: delete the objects before returning (jinyaoguo)

In the functions gui_mch_dialog() and gui_mch_font_dialog(), Dialog
objects are created but never escape the function scope. The call to
dialog->Go() only returns a boolean value and does not retain any
reference to the Dialog object itself, which may lead to potential
memory leak.

Fix this by deleting the object after using it.

closes: #17501

Signed-off-by: jinyaoguo <guo846@purdue.edu>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.1455
2025-06-11 21:30:01 +02:00
51289207f8 runtime(vim): Update base-syntax, improve function definition matching
- Fix highlighting of function names including /fu\%[nction]/ (E.g.,
  s:func(), foo.fu(), fu.func())
- Match :delfunction argument.

Reported by Aliaksei Budavei.

closes: #17428

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-11 21:16:14 +02:00
6cc9bd4001 patch 9.1.1454: tests: no test for pum at line break position
Problem:  Missing test case for pum display on a wrapped line.
Solution: Add a test case to cover pum behavior at line break positions.
          (glepnir)

closes: #17520

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.1454
2025-06-11 21:14:02 +02:00
5923216f79 runtime(openPlugin): Open should open file names with spaces in Windows
Use <f-args> instead of <q-args> in commands:

- :Open
- :Launch
- :URLOpen

fixes #17468
closes: #17517

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-11 21:12:27 +02:00
053aee01f7 runtime(doc): add more pointers to 'completeopt'
Before this commit, I had trouble finding information about configuring
the insert mode completion. In particular, it was not clear that the
'wildopt' config that I already had in my vimrc does not apply here.

Also, `insert.txt` barely mentioned 'completeopt' except when
describing popups (I was more interested in bash-like behavior
where the unique prefix of all completions is completed first).

I'm hoping these edits will make the relevant docs easier to find.

closes: #17515

Signed-off-by: Ilya Grigoriev <ilyagr@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-11 21:07:35 +02:00
600cd88cdf runtime(netrw): remove comment separators
closes: #17514

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-11 20:42:41 +02:00
e965b7ac5f patch 9.1.1453: tests: Test_geometry() may fail
Problem:  tests: Test_geometry() may fail
          (Gary Johnson)
Solution: allow a slightly smaller value when checking the number of
          lines.

fixes: #17491

Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.1453
2025-06-10 21:29:43 +02:00
6701480c43 runtime(filetype): Use s:StarSetf for all patterns ending in *
Problem:  Some filetype autocmds with patterns ending in * do not skip
          filenames matching g:ignored_patterns.
Solution: Move these autocmds to the appropriate section and call
          s:StarSetf() to set the filetype.

- Affected filetypes: dosini, execline, foam, messages, nginx, tmux.
- Convert foam filetype patterns to use wildcard matching.

closes: #17422

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 21:15:22 +02:00
bfa16364f1 runtime(doc): update documentation on tabstop settings
Unify the treatment of tabstop, correct errors and deprecate smarttab
usage.

closes: #17444

Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 21:12:31 +02:00
274efcc7e6 runtime(vim): Update base-syntax, contain let-heredocs
Limit heredoc matches to assignment statements.  Matching these at the
top level is very slow.

closes: #17473

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 21:02:43 +02:00
138fb951e0 runtime(reva): set 'cms' option in ftplugin, update URL
closes: #17488

Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 21:00:07 +02:00
a0316cd299 runtime(abap): set 'comments' and 'commentstring' option in ftplugin
Reference:
https://en.wikipedia.org/wiki/ABAP#Comments

closes: #17489

Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 20:57:14 +02:00
ecf8f15884 patch 9.1.1452: completion: redundant check for completion flags
Problem:  completion: redundant check for completion flags
Solution: refactor code slightly (glepnir)

refactor: nest fuzzy completion logic to avoid duplicate flag checks

- Combine COT_FUZZY checks into single nested condition
- Reduce redundant bitwise operations in ins_compl_new_leader()

closes: #17494

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.1452
2025-06-10 20:52:41 +02:00
30b4ddf925 patch 9.1.1451: tabpanel rendering artifacts when scrolling
Problem:  tabpanel rendering artifacts when scrolling
Solution: update scrolling logic (Hirohito Higashi)

fixes: #17495
closes: #17496

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.1451
2025-06-10 20:42:06 +02:00
1319009d59 runtime(netrw): get rid of s:Strlen() and use strdisplaywidth()
closes: #17498

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 20:39:50 +02:00
c413ac7068 runtime(java): Match raw-, non-generic-, and generic-type names of "java.lang"
And only match innermost element types of parameterised
array types.

References:
https://docs.oracle.com/javase/specs/jls/se21/html/jls-4.html#jls-4.8
https://docs.oracle.com/javase/specs/jls/se21/html/jls-6.html#jls-6.1
https://docs.oracle.com/javase/specs/jls/se21/html/jls-10.html

closes: #17499

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 20:37:39 +02:00
572d46035f runtime(gdshader): add comments and commentstring to ftplugin
closes: #17500

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 20:35:03 +02:00
a304e49790 patch 9.1.1450: Session has wrong arglist with :tcd and :arglocal
Problem:  Session has wrong arglist with :tcd and :arglocal.
Solution: Also use absolute path for :argadd when there is tabpage-local
          directory (zeertzjq).

related: neovim/neovim#34405
closes: #17503

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.1450
2025-06-10 20:31:44 +02:00
30cf017f2a runtime(8th): updated 8th syntax script
closes: #17505

Signed-off-by: Ron Aaron <ron@aaron-tech.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 20:27:57 +02:00
ed4eb74f7a patch 9.1.1449: typo in pum_display()
Problem:  typo in pum_display()
Solution: update the comment, remove empty new lines
          (glepnir)

closes: #17506

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.1449
2025-06-10 20:23:42 +02:00