Commit Graph

35052 Commits

Author SHA1 Message Date
luukvbaal
8bdfd286e5 fix(messages): adjust msg_show "empty" kind logic (#37427)
Problem:  A message ending in an unprintable character may emit a
          msg_show event with the "empty" kind. No empty message event
          for echom "".
Solution: Adjust conditions for emitting "empty" msg_show events.
2026-01-19 17:15:44 +01:00
zeertzjq
30259d6af7 Merge pull request #37459 from zeertzjq/vim-658cc10
vim-patch: runtime file updates
2026-01-19 07:24:50 +08:00
zeertzjq
069a5ef8e0 vim-patch:0b103d6: runtime(haskell): add include-search and define support in ftplugin
closes: vim/vim#19143

0b103d6a7c

Co-authored-by: Mateo Gjika <104777599+mateoxh@users.noreply.github.com>
2026-01-19 07:02:22 +08:00
zeertzjq
a71ea81b86 vim-patch:638bbc5: runtime(doc): Update advice for [gnt]roff users
Content:
* Offer more specific guidance regarding input line breaks and sentence
  endings.
* Advise what to do when a line ends with sentence-ending punctuation
  but doesn't end a sentence.
* Advise against use of blanks lines and leading spaces for formatting
  when a macro package is in use.
* Advise how to achieve visual separation in the document without
  affecting formatting.
* Point out how the newline/end-of-sentence rules aid diffing.
* Distinguish the separate processes of inter-sentence space
  supplementation and filling.
* Use conventional (but accessible) terms from typography instead of
  more casual, approximate ones.
* Clarify what sort of extension the ms package's `XP` macro is.

Style:
* Fix comma splice with a semicolon.
* Use slightly more standard/idiomatic English.

Sources:
* https://rhodesmill.org/brandon/2012/one-sentence-per-line/
* https://www.ualberta.ca/en/computing-science/media-library/docs/unix-beginners.pdf
  (p. 20)
* https://www.gnu.org/software/groff/manual/groff.html.node/Input-Conventions.html
* https://cgit.git.savannah.gnu.org/cgit/groff.git/tree/doc/ms.ms?h=1.23.0#n1131
* https://docs-archive.freebsd.org/44doc/usd/18.msdiffs/paper.pdf

closes: vim/vim#19193

638bbc57c1

Co-authored-by: G. Branden Robinson <g.branden.robinson@gmail.com>
2026-01-19 07:01:58 +08:00
zeertzjq
3bbd646f59 vim-patch:617bf46: runtime(doc): Tweak documentation style in {ft_context,terminal}.txt
closes: vim/vim#19199

617bf466bb

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2026-01-19 06:57:35 +08:00
zeertzjq
095fb2abd8 vim-patch:658cc10: runtime: Changed old "Sponsor" menu item name to a new one
Problem:  There is an unavailable "Sponsor/Register" item in the Help
          menu.
Solution: The item name has been unified to "Sponsor".

The item names of tlmenu, which are only valid in terminal mode, were
not updated, so unnecessary items that were unavailable were displayed.

This item is also very confusing when creating menu translations.

In addition, the indentation of an item with the same name in the
regular menu has been corrected.

closes: vim/vim#19201

658cc102f6

Co-authored-by: Muraoka Taro <koron.kaoriya@gmail.com>
2026-01-19 06:52:14 +08:00
zeertzjq
3264dfee75 vim-patch:9.1.1989: Vim intro screen shows register message
Problem:  Vim intro screen shows register message (after v9.1.1893)
Solution: Remove the register message, registering is no longer useful
          and possible.

fixes:  vim/vim#18933
closes: vim/vim#18934

Signed-off-by:

ca12f62d0a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-01-19 06:51:47 +08:00
Christian Clason
c52f6eb49a vim-patch:9.1.2094: filetype: tiger files are not recognized
Problem:  filetype: tiger files are not recognized
Solution: Detect *.tig files as tiger filetype
          (Christian Clason).

Reference:
- https://www.cs.princeton.edu/~appel/modern/

closes: vim/vim#19202

eb53ed5de0

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2026-01-18 23:33:22 +01:00
Emanuel Krollmann
f36dd7557a fix(autocmd): heap UAF with :bwipe in Syntax autocmd
Problem:
Creating an autocommand which executes `:bwipe` on the Syntax event
causes a heap-use-after-free.

Solution: set BF_SYN_SET flag before applying autocommands
2026-01-18 17:56:34 +00:00
glepnir
5a65321684 fix(pum): text overflows into border on truncation (#37438)
Problem:
When text is too long, it overflows into the border. This happens because
grid_line_maxcol includes border columns, so grid_line_puts can write
there.

Solution:
Truncate string to available width when need_fcs_trunc is set.
2026-01-18 08:55:30 +00:00
zeertzjq
41068c77aa fix(normal): assertion failure with "gk" in narrow window (#37444)
When width1 and width2 are negative the assertion may fail. It seems
that adding a negative value to w_curswant won't cause any problems, so
just change the assertion.
2026-01-18 11:46:13 +08:00
Sean Dewar
a5e5ec8910 fix(api): parse_expression crash with unopened ] and node
Problem: nvim_parse_expression null pointer dereference with unmatched ]
followed by a node.

Solution: if ast_stack was empty, set new_top_node_p to top of the stack after
pushing the list literal node; similar to what's done for curlies.

This bug was originally found by a Matrix user, but I couldn't remember how to
trigger it... Ran into the other crash while finding a repro. :P
2026-01-17 13:22:55 +00:00
Sean Dewar
5226801be2 fix(api): parse_expression crash with ident and curly
Problem: nvim_parse_expression null pointer dereference when parsing an
identifier followed by { with "highlight" parameter set to false.

Solution: only set opening_hl_idx if pstate->colors is not NULL.

Not added to parser_tests.lua as that uses highlight = true.
2026-01-17 13:22:55 +00:00
zeertzjq
f3cfe9a94b vim-patch:8.2.0371: crash with combination of terminal popup and autocmd (#37433)
Problem:    Crash with combination of terminal popup and autocmd.
Solution:   Disallow closing a popup that is the current window.  Add a check
            that the current buffer is valid. (closes vim/vim#5754)

cee52204ca

Cherry-pick related changes from patch 9.0.1454.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-01-17 11:53:58 +00:00
zeertzjq
b4ce549f2a Merge pull request #37431 from zeertzjq/vim-9.1.2087
vim-patch:9.1.{2087,2090}
2026-01-17 19:01:09 +08:00
zeertzjq
960cba7b3b vim-patch:9.1.2090: Last buffer not freed with EXITFREE
Problem:  Last buffer not freed with EXITFREE (after 9.1.2087).
Solution: Free the last buffer when inside free_all_mem()
          (zeertzjq).

This isn't really a memory leak, as the last buffer's memory is still
reachable via pointers like firstbuf and lastbuf. But it's possible that
this may cause false ASAN warnings in the future, which is what EXITFREE
is supposed to prevent.

closes: vim/vim#19194

6c118afeaa
2026-01-17 18:37:48 +08:00
zeertzjq
eb5a7cc0dd vim-patch:9.1.2087: Crash when using :tabonly in BufUnload
Problem:  Crash when using :tabonly in BufUnload.
Solution: Set curbuf when setting curwin->w_buffer. Don't wipe out a
          buffer if there are no other buffers. Don't decrement
          b_nwindows if it was 0 before buf_freeall() (zeertzjq).

fixes:  vim/vim#19088#issuecomment-3710172769
closes: vim/vim#19186

fa64f92f6a
2026-01-17 18:37:47 +08:00
Christian Clason
06e4b159ed fix(health): show full curl output
Problem: The health check for `curl` strips the first line of the
version output, which contains potentially useful information.

Solution: Only trim empty lines.
2026-01-17 11:28:00 +01:00
zeertzjq
e51f5e17e1 vim-patch:9.0.0909: error message for layout change does not match action (#37436)
Problem:    Error message for layout change does not match action.
Solution:   Pass the command to where the error is given. (closes vim/vim#11573)

9fda81515b

Thinking about this again, it's actually OK to check split_disallowed in
window_layout_locked(), so add the check.
Also add missing window_layout_locked() in tabpage_close().

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-01-17 10:58:26 +08:00
zeertzjq
8754118213 test: remove duplicate test (#37434)
This test is a copy of Test_bufunload_all() and requires too much
additional cleanup for the Windows log message.
2026-01-17 08:31:18 +08:00
zeertzjq
03494ad048 vim-patch:9.1.2088: Redundant NULL checks in find_pattern_in_path() (#37432)
Problem:  Redundant NULL checks in find_pattern_in_path().
Solution: Remove the NULL checks. Also fix typos in test_diffmode.vim
          (zeertzjq).

After assigning to inc_opt on line 2976, it's dereferenced immediately,
and not assigned another value afterwards, so checking for NULL after
line 2977 is redundant.

closes: vim/vim#19185

ce394b13e9
2026-01-17 06:34:34 +08:00
zeertzjq
dde914f926 Merge pull request #37422 from zeertzjq/vim-9.1.0059
vim-patch:9.1.{0059,0117,0671,1043,partial:1110}: WinNewPre
2026-01-16 16:18:02 +08:00
bfredl
4f44705a47 Merge pull request #37189 from bfredl/zigsafe
ci: test -Doptimize=ReleaseSafe
2026-01-16 09:14:54 +01:00
zeertzjq
5c4d9261a4 vim-patch:partial:9.1.1110: Vim tests are slow and flaky
Problem:  Vim tests are slow and flaky at the same time due to reliance
          on timeouts which are unreliable.
Solution: improve Vim test performance and reduce flakiness
          (Yee Cheng Chin)

closes: vim/vim#16615

e70587dbdb

Remaining test_crash.vim changes only.

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2026-01-16 15:55:34 +08:00
zeertzjq
20a7e74444 vim-patch:9.1.1043: [security]: segfault in win_line()
Problem:  [security]: segfault in win_line()
          (fizz-is-on-the-way)
Solution: Check that ScreenLines is not NULL

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-j3g9-wg22-v955

9d1bed5ecc

Omit ex_redraw_crash: remove in patch 9.1.1110.

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-01-16 15:55:34 +08:00
zeertzjq
786c5fbdec vim-patch:9.1.0671: 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

fb3f969936

Cherry-pick doc updates from latest Vim runtime.

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-01-16 15:55:34 +08:00
zeertzjq
4544cec168 vim-patch:9.1.0117: Stop split-moving from firing WinNew and WinNewPre autocommands
Problem:  win_splitmove fires WinNewPre and possibly WinNew when moving
          windows, even though no new windows are created.
Solution: don't fire WinNew and WinNewPre when inserting an existing
          window, even if it isn't the current window. Improve the
          accuracy of related documentation. (Sean Dewar)

related: vim/vim#14038

96cc4aef3d

Most of the patch was already ported. This includes the remaining part.

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2026-01-16 15:55:34 +08:00
zeertzjq
d6e5286d2c vim-patch:9.1.0059: No event triggered before creating a window
Problem:  No event is triggered before creating a window.
          (Sergey Vlasov)
Solution: Add the WinNewPre event (Sergey Vlasov)

fixes: vim/vim#10635
closes: vim/vim#12761

1f47db75fd

Not sure if this should be triggered before creating a floating window,
as its use case is related to window layout.

Co-authored-by: Sergey Vlasov <sergey@vlasov.me>
2026-01-16 15:55:33 +08:00
Jan Edmund Lazo
992eaac082 vim-patch:8.2.0370: the typebuf_was_filled flag is sometimes not reset (#37404)
Problem:    The typebuf_was_filled flag is sometimes not reset, which may
            cause a hang.
Solution:   Make sure typebuf_was_filled is reset when the typeahead buffer is
            empty.

e49b4bb895

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-01-16 15:11:07 +08:00
zeertzjq
43339dee40 Merge pull request #37419 from zeertzjq/vim-af973d4
vim-patch: runtime file updates
2026-01-16 07:53:27 +08:00
zeertzjq
074ca976de vim-patch:16c2279: runtime(sh): highlight single-dash short options containing digits
fixes: vim/vim#19082

16c2279062

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-01-16 07:27:30 +08:00
zeertzjq
d423dd8b8b vim-patch:5529b75: runtime(c): Do not highlight noreturn in C++ code
closes: vim/vim#19170

5529b750a7

Co-authored-by: Wu Yongwei <wuyongwei@gmail.com>
2026-01-16 07:27:18 +08:00
zeertzjq
b94061a71d vim-patch:f25c343: runtime(csh): Support negated if in matchit
Currently, the matchit configuration chokes on valid syntax like:

```csh
if !(true) then
   true
endif
```

Make sure the negation syntax is supported.

closes: vim/vim#19172

f25c343b26

Co-authored-by: Simão Afonso <simao.afonso@powertools-tech.com>
2026-01-16 07:27:08 +08:00
zeertzjq
5144d802c3 vim-patch:f8cde69: runtime(rapid): Update syntax file for ABB Rapid
Also remove trailing white spaces.

closes: vim/vim#19175

f8cde69788

Co-authored-by: Patrick Meiser-Knosowski <knosowski@graeffrobotics.de>
2026-01-16 07:26:59 +08:00
zeertzjq
d01f1f379c vim-patch:4969b8d: runtime(mbsync): Add syntax highlighting for TLSVersions keyword
mbsync deprecated SSLVersions. Now use TLSVersions (we keep
computability with SSLVersions).

closes: vim/vim#19179

4969b8db4a

Co-authored-by: Mathis Bernadet <matbernadet@emi.u-bordeaux.fr>
2026-01-16 07:26:48 +08:00
zeertzjq
182a8f08b2 vim-patch:af973d4: runtime(yaml): fix indentation script
Problem:  The indentation of Ansible Playbooks gets messed up after
          gg=G (after 9179ddc0608813e)
Solution: Remove one shiftwidth() that seems to be misplaced.

closes: vim/vim#19180

af973d4018

Co-authored-by: Bjoern Foersterling <bjoern.foersterling@gmail.com>
2026-01-16 07:25:46 +08:00
Sean Dewar
ba1d50fdc3 vim-patch:9.1.2086: Memory leak when skipping invalid literal dict
Problem:  memory leak when not evaluating (just parsing) invalid literal
          dict.
Solution: Always clear the key's typval (Sean Dewar)

Though "check_typval_is_value(&tv) == FAIL && !evaluate" is maybe never
true, also always clear tvs if check_typval_is_value fails; at worst
this would be a no-op as their initial types are VAR_UNKNOWN.

closes: vim/vim#19178

b10a3e1a20

check_typval_is_value change is for Vim9 script. (from 9.0.2163)

N/A patch:
vim-patch:9.0.2163: Vim9: type can be assigned to list/dict

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2026-01-15 23:21:33 +00:00
Sean Dewar
7e2e116343 fix(api): nvim_get_option_value dummy buffer crashes
Problem: nvim_get_option_value with "filetype" set can crash if autocommands
open the dummy buffer in more windows, or if &bufhidden == "wipe".

Solution: Attempt to close all dummy buffer windows before wiping. Promote the
dummy buffer to a normal buffer if that fails.
2026-01-15 20:08:45 +00:00
Sean Dewar
40114d1631 refactor: remove dead code, adjust comment
Removed code doesn't seem to do anything? Looks like a clobbered remnant from
when do_filetype_autocmd lived in did_set_string_option.

Doc comment for wipe_buffer doesn't decrement top_file_num since a2d25b7 (2016),
which presumably means the comment on marks doesn't apply either. (fmark_T::fnum
can't refer to the wrong buffer as numbers aren't reused here anymore)
2026-01-15 20:08:45 +00:00
Sean Dewar
3cb462a960 fix(api): autocmds mess up nvim_get_option_value's dummy buffer
Problem: When the "filetype" key is set for nvim_get_option_value, autocommands
can crash Nvim by prematurely wiping the dummy buffer, or cause options intended
for it to instead be set for unrelated buffers if switched during OptionSet.

Solution: Don't crash. Also quash side-effects from setting the buffer options.
2026-01-15 20:08:45 +00:00
bfredl
b4db223d33 fix(build): treesitter parsers are not ReleaseSafe 2026-01-15 11:43:46 +01:00
bfredl
1427b94200 fix(typval): allocated dynamic size must be at least the static size
fixes #37160
2026-01-15 11:43:46 +01:00
bfredl
ad1c07ebb9 build(ci): test zig build -Doptimize=ReleaseSafe
the ReleaseSafe build mode activates UBSAN rules
which was previously untested, most notably `-fsanitize=object-size`
2026-01-15 11:43:40 +01:00
bfredl
6082b7f850 Merge pull request #37040 from p00f/push-nwlkmnvmmlrt
feat(build.zig): add option to use system dependencies
2026-01-15 11:07:40 +01:00
zeertzjq
405c6c9bb0 Merge pull request #37403 from zeertzjq/vim-9.1.0700
vim-patch:9.1.{0700,0701,0702,0703}
2026-01-15 14:51:13 +08:00
zeertzjq
094d3dd3d4 vim-patch:9.1.0703: crash with 2byte encoding and glob2regpat()
Problem:  possible crash with 2-byte encoding and glob2regpat()
          (after v9.1.0700, v9.1.0702)
Solution: include both bytes for a multi-byte character for an
          escaped character

closes: vim/vim#15590

c9bfed2fda

DBCS 'encoding' is N/A.

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-01-15 14:15:36 +08:00
zeertzjq
8c31b3eeac vim-patch:9.1.0702: Patch 9.1.0700 broke CI
Problem:  Patch 9.1.0700 broke CI
Solution: Revert for now

f459d68ecf

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-01-15 14:15:36 +08:00
zeertzjq
0de85e322a vim-patch:9.1.0701: crash with NFA regex engine when searching for composing chars
Problem:  crash with NFA regex engine when searching for composing chars
          (SuyueGuo)
Solution: When there is no composing character, break out of the loop
          and check that out1 state is not null

fixes: vim/vim#15583

c3a02d78bd

Test uses DBCS 'encoding', which is N/A.

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-01-15 14:15:36 +08:00
zeertzjq
11b3699252 vim-patch:9.1.0700: crash with 2byte encoding and glob2regpat()
Problem:  possible crash with 2byte encoding and glob2regpat()
Solution: Skip over character, if it is multi-byte character

1c815b54bb

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-01-15 14:15:36 +08:00
Jan Edmund Lazo
5042394241 vim-patch:9.1.0697: [security]: heap-buffer-overflow in ins_typebuf (#37372)
Problem:  heap-buffer-overflow in ins_typebuf
          (SuyueGuo)
Solution: When flushing the typeahead buffer, validate that there
          is enough space left

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

322ba91086

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-01-15 13:35:21 +08:00