Commit Graph

1822 Commits

Author SHA1 Message Date
zeertzjq
444e1ffe3e vim-patch:9.1.2028: [security]: Buffer-overflow with incomplete multi-byte chars (#37133)
Problem:  Buffer overflow in buf_write() when converting incomplete
          multi-byte characters (Kevin Goodsell)
Solution: Make the buffer slightly larger

closes: vim/vim#19007

f99de42a9f

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-28 00:37:55 +00:00
zeertzjq
7f1d7271d5 vim-patch:9.1.2027: filetype: bicep filetype used for 2 bicep file types (#37130)
Problem:  filetype: bicep filetype used for 2 bicep file types
Solution: Detect *.bicepparam files as bicep-param filetype, include
          new bicep-params and bicep filetype plugin
          (Scott McKendry)

The bicep language server handles parameter files differently than
regular bicep files. Treating them the same at the editor level leads to
false positive diagnostics in the editor.

References:

Bicep Language Constants:
- 51392d32ca/src/Bicep.Core/LanguageConstants.cs (L23)
VS Code Extension definition:
- 51392d32ca/src/vscode-bicep/package.json (L47)

closes: vim/vim#19026

4e722fdfdd

Co-authored-by: Scott McKendry <me@scottmckendry.tech>
2025-12-28 00:16:20 +00:00
zeertzjq
1e44a001ec vim-patch:9.1.2024: 'fsync' option cannot be set per buffer (#37129)
Problem:  'fsync' option cannot be set per buffer
Solution: Make 'fsync' option global-local
          (glepnir)

closes: vim/vim#19019

4d5b303726

Co-authored-by: glepnir <glephunter@gmail.com>
2025-12-28 08:14:45 +08:00
zeertzjq
f4eabcca4f vim-patch:9.1.2026: tests: patch 9.1.2019 not tested properly
Problem:  tests: patch 9.1.2019 not tested properly.
Solution: Add missing :exe (zeertzjq).

closes: vim/vim#19028

78046cc539
2025-12-28 07:02:03 +08:00
zeertzjq
e53accf8ec vim-patch:9.1.2019: inconsistent cursor encoding past EOL with ve=all
Problem:  When virtualedit is set to all, the cursor is supposed to be
          permitted to reside anywhere, including on the virtual space
          beyond the end of the buffer's text. Switching modes triggered
          a routine that "fixed" a cursor that was past the end of the
          line by shifting it back to the last actual character in the
          line and compensating with a virtual column offset. While
          visually identical, this re-encoding changed the underlying
          byte index, causing position-reporting functions to return
          inconsistent values after a mode change.
Solution: Skip this coordinate adjustment when virtual editing is fully
          enabled. By treating the line terminator as a valid, stable
          position, the cursor’s internal representation remains
          unchanged when entering or exiting Visual mode, ensuring
          consistent coordinate reporting. Add a regression test to
          check this functionality.
          (McAuley Penney)

fixes:  vim/vim#16276
closes: vim/vim#19009

491f0fa457

Co-authored-by: McAuley Penney <jacobmpenney@gmail.com>
2025-12-28 07:01:45 +08:00
zeertzjq
c11153b320 vim-patch:9.1.2021: filetype: fluent files are not recognized (#37117)
Problem:  filetype: fluent files are not recognized
Solution: Detect *.ftl files as fluent filetype (ners)

References:
- https://projectfluent.org/

closes: vim/vim#19011

b91b30643a

Co-authored-by: ners <ners@gmx.ch>
2025-12-27 01:35:19 +00:00
zeertzjq
7b5276b382 vim-patch:9.1.2020: tests: test_virtualedit.vim leaves swapfiles behind (#37115)
Problem:  tests: test_virtualedit.vim leaves swapfiles behind
Solution: Close open buffers using :bw! instead of :close!

a8a0ee5004

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-27 00:57:52 +00:00
zeertzjq
d7b882697b vim-patch:9.1.2017: getregionpos() depends on 'linebreak' setting (#37088)
Problem:  getregionpos() depends on 'linebreak' setting
Solution: Reset linebreak setting temporarily (McAuley Penney)

When a line is wrapped on word boundaries, getregionpos() may report a
different end column for a visual block than the cursor position used to
define the selection.

Update the blockwise calculation in getregionpos() to use the same
wrapping assumptions as visual block mode, so the reported region
matches the selection boundaries.

Add a regression test that forces wrapping and checks that the end
position stays consistent under "setlocal wrap" and "setlocal
linebreak".

closes: vim/vim#19006

8ea0e7205c

Co-authored-by: McAuley Penney <jacobmpenney@gmail.com>
2025-12-24 09:48:59 +08:00
zeertzjq
2a2c366a3e vim-patch:9.1.2016: cindent wrong indentation after do-while loop (#37087)
Problem:  At "if(0) do if(0); while(0); else", else should be aligned
          with outer if, but is aligned with inner if.
Solution: In function find_match, ignore "if" and "else" inside a
          do-while loop, when looking for "if". (Anttoni Erkkilä)

closes: vim/vim#19004

9d661b057e

Co-authored-by: Anttoni Erkkilä <anttoni.erkkila@protonmail.com>
2025-12-24 09:43:42 +08:00
zeertzjq
49b1a6540f vim-patch:9.1.2009: tests: "Xm4" test directory may not be deleted
Problem:  tests: "Xm4" test directory may not be deleted
Solution: Use "R" flag with mkdir() call to have the directory
          recursively deleted at the end of function Test_m4_format()
          (Muraoka Taro)

Test_m4_format in test_filetype.vim creates the "Xm4" directory with the
'D' flag. Then it creates two files in the "Xm4" directory. One of them,
"alocal.m4," was created with the 'D' flag, so it will disappear after
the test is complete. However, the other, "configure.ac," was created
without any flags, so it will remain even after the test is complete.
Because the parent directory "Xm4" was created with the 'D' flag, the
latter "configure.ac" remains and is not empty, so it will not be
deleted.

This forces the directory to be deleted regardless of its contents. As a
result, the two files "alocal.m4" and "configure.ac" created in the
directory are no longer needed, so they have been deleted.

closes: vim/vim#18995

de37e7430a

Co-authored-by: Muraoka Taro <koron.kaoriya@gmail.com>
2025-12-23 07:20:37 +08:00
zeertzjq
471be48d56 vim-patch:9.1.2008: filetype: hylo files are not recognized
Problem:  filetype: hylo files are not recognized
Solution: Detect *.hylo files as hylo filetype (Ambrus Tóth)

References:
- https://hylo-lang.org/

closes: vim/vim#18994

9c9982240a

Co-authored-by: Ambrus Tóth <ping@ambrus.dev>
2025-12-23 07:20:37 +08:00
zeertzjq
92910a8ab8 vim-patch:9.1.2007: filetype: bpftrace hashbang lines are not recognized
Problem:    bpftrace files are not recognized from the hashbang line.
Solution:   Add a hashbang check (Stanislaw Gruszka)

closes: vim/vim#18992

f2814754c0

Co-authored-by: Stanislaw Gruszka <stf_xl@wp.pl>
2025-12-23 07:20:37 +08:00
zeertzjq
b95848a8f1 vim-patch:8.2.1756: Vim9: :let will soon be disallowed (#37063)
Problem:    Vim9: :let will soon be disallowed.
Solution:   Add v:disallow_let temporarily.  Fix tests.

cfcd011fcd

The change to use checkforcmd() is already included in the port of patch
9.0.1505. This commit adds the missing :const check.

N/A patches:
vim-patch:8.2.1397: Vim9: return type of maparg() not adjusted for fourth arg
vim-patch:8.2.1623: Vim9: using :call where it is not needed
vim-patch:8.2.1766: Vim9: Some tests are still using :let
vim-patch:8.2.1788: Vim9: still allows :let for declarations
vim-patch:8.2.1882: Vim9: v:disallow_let is no longer needed

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-22 12:31:44 +08:00
Jan Edmund Lazo
398cf6d8d3 vim-patch:8.2.3657: Vim9: debug text misses one line of return statement
Problem:    Vim9: debug text misses one line of return statement.
Solution:   Add a line when not at a debug instruction. (closes vim/vim#9137)

112bed0cbe

Vim9 test "Test_Debugger_break_at_return()" commented out
to avoid unexpected side-effects even if all other tests pass.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-21 21:39:34 -05:00
Jan Edmund Lazo
4f71d9ce35 vim-patch:8.2.3383: Vim9: completion for :disassemble adds parenthesis
Problem:    Vim9: completion for :disassemble adds parenthesis.
Solution:   Don't add parenthesis. (Naohiro Ono, closes vim/vim#8802)

9aecf79c45

Co-authored-by: naohiro ono <obcat@icloud.com>
2025-12-21 21:17:34 -05:00
Jan Edmund Lazo
cd25ca5e0c vim-patch:8.2.3377: Vim9: :disass completion does not understand "s:"
Problem:    Vim9: :disass completion does not understand "s:".
Solution:   Expand "s:" to a pattern. (closes vim/vim#8780)

47016f5772

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-21 21:17:33 -05:00
Jan Edmund Lazo
525c348c29 vim-patch:8.2.2992: Vim9: completion for :disassemble is incomplete
Problem:    Vim9: completion for :disassemble is incomplete.
Solution:   Recognize the "debug" and "profile" arguments.

4ee9d8e04d

Vim9 ":disassemble" is N/A.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-21 21:17:33 -05:00
Jan Edmund Lazo
e0dcdef181 vim-patch:8.2.3431: completion for :disas sorts local functions first
Problem:    Completion for :disas sorts local functions first.
Solution:   Sort local functions last, like with :delfunc. (Naohiro Ono,
            closes vim/vim#8860)

dfe04dbff5

Vim9 ":disassemble" is N/A
but "commented" test code is a hint for future patches.

Co-authored-by: naohiro ono <obcat@icloud.com>
2025-12-21 21:17:33 -05:00
zeertzjq
f89558848b vim-patch:9.1.2001: cursor may end up in wrong window after :botright copen (#37056)
Problem:  After :botright copen and closing the quikfix window, the
          cursor ends up in the wrong window. The problem is fr_child
          always points to the first (leftmost for FR_ROW, topmost for
          FR_COL) child frame. When do :vsplit, the new window is
          created on the left, and frame_insert() updates the parent's
          fr_child to point to this new left window.
Solution: Create a snapshot before open the quickfix window and restore
          it when close it (glepnir).

closes: vim/vim#18961

b43f9ded7e

Co-authored-by: glepnir <glephunter@gmail.com>
2025-12-21 10:41:53 +08:00
zeertzjq
f15c28ed7a vim-patch:8.2.3766: converting a funcref to a string leaves out "g:"
Problem:    Converting a funcref to a string leaves out "g:", causing the
            meaning of the name depending on the context.
Solution:   Prepend "g:" for a global function.

c4ec338fb8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
Co-authored-by: Jan Edmund Lazo <jan.lazo@mail.utoronto.ca>
2025-12-20 09:45:47 +08:00
zeertzjq
2860d1e018 vim-patch:9.1.1998: tests: not enough tests for :setlocal omnifunc (#37023)
Problem:  Not enough tests for :setlocal omnifunc (after 9.1.1991).
Solution: Move the last :new after :setlocal. Also test with 'complete'
          (zeertzjq).

closes: vim/vim#18958

cedb1a3171
2025-12-19 08:08:26 +08:00
zeertzjq
c172fd9f46 vim-patch:9.1.1991: :setlocal changes effective global 'omnifunc' (#37013)
Problem:  :setlocal changes effective global 'omnifunc' (Maxim Kim)
Solution: Don't change global callback when using :setlocal (zeertzjq).

fixes:  vim/vim#18948
closes: vim/vim#18951

3e82b0ebfe
2025-12-17 23:26:42 +00:00
Jan Edmund Lazo
1b1a8895bd vim-patch:8.2.1941: Ex mode test fails on MS-Windows with GUI
Problem:    Ex mode test fails on MS-Windows with GUI.
Solution:   Skip the test when using gvim.

399db046ed

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-17 00:47:13 -05:00
Jan Edmund Lazo
d6607dae41 vim-patch:8.2.1939: invalid memory access in Ex mode with global command
Problem:    Invalid memory access in Ex mode with global command.
Solution:   Make sure the cursor is on a valid line. (closes vim/vim#7238)

3b6d57f2ce

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-17 00:46:41 -05:00
zeertzjq
544bde3acc vim-patch:9.1.1987: assert_equal() prepends unnecessary ':' when typed
Problem:  assert_equal() prepends unnecessary ':' when typed
          (after 9.0.1758).
Solution: Don't change a NULL stacktrace to an empty string (zeertzjq).

closes: vim/vim#18936

c4b3aefd0d
2025-12-17 06:47:34 +08:00
brianhuster
63abb1a88f feat(lsp): builtin :lsp command
Problem:
- Despite [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig)
  claims to be a "data-only" plugin, in fact it still provides some
  user-facing commands because they haven't been upstreamed to Nvim.

Solution:
- Upstream `:LspRestart`, `:LspStart` and `:LspStop` commands as `:lsp
  restart`, `:lsp start` and `:lsp stop` respectively.

Co-authored-by: glepnir <glephunter@gmail.com>
2025-12-16 13:46:04 -05:00
zeertzjq
7a866e6b20 vim-patch:9.1.1981: tests: test suite may stop on error in gen_opt_test.vim (#36988)
Problem:  tests: test suite may stop on error in gen_opt_test.vim
Solution: Use a different output file for log files (Muraoka Taro)

When running newtests, it may unexpectedly stop just before
test_options_all.

Cause: When generating the opt_test.vim file for test_options_all, the
failure is detected by the existence of test.log. Therefore, if a test
performed before test_options_all fails and test.log is created, it is
mistakenly thought that the generation of opt_tet.vim has failed, and
the test suite stops there.

So let's change the filename created when utils/gen_opt_test.vim fails
from test.log to gen_opt_test.log, so that it can be detected
independently from other test failures.

closes: vim/vim#18928

35de719c0c

Co-authored-by: MURAOKA Taro <koron.kaoriya@gmail.com>
2025-12-16 07:50:02 +08:00
zeertzjq
f494ce77f1 vim-patch:9.1.1978: tests: Test_smoothscroll_number() may fail (#36965)
Problem:  tests: Test_smoothscroll_number() may fail because of
          'showcmd'
Solution: Send redraw command (Hirohito Higashi)

closes: vim/vim#18921

5193375b10

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-12-15 01:06:13 +00:00
zeertzjq
f5e39560ff vim-patch:9.1.1980: filetype: N-Quads files are not recognized (#36967)
Problem:  filetype: N-Quads files are not recognized
Solution: Detect *.nq files as nq filetype

Reference:
- https://www.w3.org/TR/n-quads/

closes: vim/vim#18923

6c027b25f1

Co-authored-by: Gordian Dziwis <gordian@dziw.is>
2025-12-15 00:55:41 +00:00
zeertzjq
3985257496 vim-patch:9.1.1979: :helpclose allows range and counts (#36966)
Problem:  :helpclose incorrectly accepts a range and a count.
Solution: Remove EX_COUNT and EX_RANGE from the command definition.
          (Doug Kearns)

closes: vim/vim#18917

4c141bae3b

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-12-15 08:38:42 +08:00
Jan Edmund Lazo
7ce17cd2a2 vim-patch:8.2.4529: Vim9: comparing partial with function fails
Problem:    Vim9: comparing partial with function fails.
Solution:   Support this comparison.  Avoid a crash. (closes vim/vim#9909)
            Add more test cases.

ed0c62e7b1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-14 10:58:53 -05:00
Jan Edmund Lazo
2c560d8544 vim-patch:9.0.0025: accessing beyond allocated memory with the cmdline window
Problem:    Accessing beyond allocated memory when using the cmdline window in
            Ex mode.
Solution:   Use "*" instead of "'<,'>" for Visual mode.

c6fdb15d42

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-13 21:08:10 -05:00
Jan Edmund Lazo
cd543d618d vim-patch:8.2.4763: using invalid pointer with "V:" in Ex mode
Problem:    Using invalid pointer with "V:" in Ex mode.
Solution:   Correctly handle the command being changed to "+".

f50808ed13

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-13 21:08:10 -05:00
Jan Edmund Lazo
0c70fbf0d6 vim-patch:8.2.4633: Visual range does not work before command modifiers
Problem:    Visual range does not work before command modifiers.
Solution:   Move Visual range to after command modifiers.

c75bca3ee9

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-13 21:02:17 -05:00
zeertzjq
384a039db7 vim-patch:9.1.1974: tests: missing cleanup in Test_bwipe_during_save()
Problem:  tests: missing cleanup in Test_bwipe_during_save().
Solution: Reset &charconvert.

closes: vim/vim#18908

353103e59a
2025-12-12 15:51:06 +08:00
zeertzjq
e9da68effe vim-patch:9.1.1971: Crash when buffer gets deleted inside charconvert during save
Problem:  Crash when buffer gets deleted inside charconvert during save
Solution: Check for `b_saving` inside `can_unload_buffer()`, so we don’t try to
          unload a buffer while it’s still being saved (glepnir).

closes: vim/vim#18901

fe1c57cd2c

Co-authored-by: glepnir <glephunter@gmail.com>
2025-12-12 15:50:44 +08:00
zeertzjq
2b02dfa020 vim-patch:9.1.1970: visual end column returns wrong value after block edit (#36923)
Problem:  visual end column returns wrong value after block edit
Solution: update visual end column after block insert (phanium)

fixes:  vim/vim#18900
closes: vim/vim#18903

fa3bdc2501

Co-authored-by: phanium <91544758+phanen@users.noreply.github.com>
2025-12-12 09:38:11 +08:00
zeertzjq
5a83f23430 vim-patch:98a0cbf: patch 9.1.1971: crash with invalid positional argument 0 in printf() (#36919)
Problem:  crash with invalid positional argument 0 in printf()
Solution: Reject positional arguments <= 0.

closes: vim/vim#18898

98a0cbf05b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-12 08:14:58 +08:00
zeertzjq
18642a63be vim-patch:9.1.1969: Wrong cursor position after formatting with long 'formatprg' (#36918)
Problem:  Wrong cursor position after formatting with long 'formatprg'.
Solution: Don't show hit-enter prompt when there are stuffed characters.

Previously a stuffed character at the hit-enter prompt will dismiss the
prompt immediately and be put in the typeahead buffer, which leads to
incorrect behavior as the typeahead buffer is processed after the stuff
buffers. Using vungetc() when KeyStuffed is TRUE can fix this problem,
but since the hit-enter prompt isn't visible anyway (and is likely not
desired here), just skip the prompt instead, which also avoids a wait
when using "wait" instead of "hit-enter" in 'messagesopt'.

fixes:  vim/vim#18905
closes: vim/vim#18906

50325c3d59
2025-12-12 08:07:55 +08:00
Jan Edmund Lazo
08eb133c3f vim-patch:8.2.4474: memory allocation failures not tested in quickfix code
Problem:    Memory allocation failures not tested in quickfix code.
Solution:   Add alloc IDs and tests. (Yegappan Lakshmanan, closes vim/vim#9848)

5a2d4a3ecb

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2025-12-10 21:55:52 -05:00
Jan Edmund Lazo
e31cfc5eac vim-patch:partial:8.2.2400: Vim9: compiled functions are not profiled
Problem:    Vim9: compiled functions are not profiled.
Solution:   Add initial changes to profile compiled functions.  Fix that a
            script-local function was hard to debug.

b204990346

Port only test_profile.vim.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-10 20:28:17 -05:00
Jan Edmund Lazo
1ae7c11392 vim-patch:8.2.2404: Vim9: profiling try/catch not correct
Problem:    Vim9: profiling try/catch not correct.
Solution:   Add profile instructions.  Fix that "entry" did not rethrow an
            excpetion.

107e9cecf7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-10 20:28:17 -05:00
Jan Edmund Lazo
b3490536b9 vim-patch:8.2.2403: Vim9: profiling if/elseif/endif not correct
Problem:    Vim9: profiling if/elseif/endif not correct.
Solution:   Add profile instructions.  Fix that "elseif" was wrong.

ced68a0070

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-10 20:28:17 -05:00
Jan Edmund Lazo
dccc35e6e9 vim-patch:8.2.2571: test may leave file behind
Problem:    Test may leave file behind.
Solution:   Delete the temporary file.  Don't profile in the running Vim
            instance.

8c801b374b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-10 20:28:17 -05:00
Jan Edmund Lazo
8b79c32735 vim-patch:8.2.2411: profile test fails on MS-Windows
Problem:    Profile test fails on MS-Windows.
Solution:   Do the profiling in a separate Vim command.

98989a0014

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-10 20:28:17 -05:00
Jan Edmund Lazo
ffdee3a2e1 vim-patch:8.2.2409: Vim9: profiling only works for one function
Problem:    Vim9: profiling only works for one function.
Solution:   Select the right instructions when calling and returning.
            (closes vim/vim#7743)

e5ea346a07

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-10 20:28:17 -05:00
zeertzjq
747cf30c37 vim-patch:9.1.1965: q can accidentally start recording at more prompt (#36879)
Problem:  When exiting at the end of the more prompt (at the hit enter
          prompt) by hitting q the recording mode will be started.
          (Jakub Łuczyński)
Solution: Don't add the q key to the typeahead buffer
          in the function wait_return (Bjoern Foersterling)

fixes: vim/vim#2589
closes: vim/vim#18889

ecce3497fa

Co-authored-by: Bjoern Foersterling <bjoern.foersterling@gmail.com>
2025-12-09 22:25:47 +08:00
zeertzjq
5235f3663f vim-patch:9.1.1964: Wrong display when using setline() at hit-enter prompt (#36878)
Problem:  Wrong display when using setline() at hit-enter prompt
          (after 8.2.3204).
Solution: Only skip scrolling for changed lines in top area if it's
          scrolled down due to w_topline change. Also add more testing
          for what 8.2.3204 fixed (zeertzjq).

closes: vim/vim#18887

e72eacceab
2025-12-09 22:25:34 +08:00
zeertzjq
2f9f77cd72 vim-patch:9.1.1962: filetype: Erlang application resource files are not recognized (#36868)
Problem:  filetype: Erlang application resource files are not recognized
Solution: Add content-based filetype detection for application resource
          files matching extension '*.app' (Doug Kearns)

related: vim/vim#18835
closes:  vim/vim#18842

cf5c255260

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-12-09 09:08:09 +08:00
zeertzjq
647f11e6ae vim-patch:9.1.1958: Wrong display with sign_unplace() and setline() in CursorMoved (#36851)
Problem:  Wrong display when scrolling with 'scrolloff' and calling
          sign_unplace() and setline() in CursorMoved (after 8.2.3204).
Solution: Still scroll for changed lines below the top area when the top
          is scrolled down (zeertzjq)

closes: vim/vim#18878

2da433cff7
2025-12-08 09:24:26 +08:00