Commit Graph

1787 Commits

Author SHA1 Message Date
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
zeertzjq
ff90032aa5 vim-patch:9.1.1961: :0tab behaves like :tab for :stag when 'swb' contains "newtab"
Problem:  :0tab behaves like :tab for :stag when 'switchbuf' contains
          "newtab" (after 9.1.1949).
Solution: Don't override cmod_tab if it's already non-zero (zeertzjq).

closes: vim/vim#18859

2b3566d89e
2025-12-08 08:11:11 +08:00
zeertzjq
69f4fd84aa vim-patch:9.1.1949: :stag does not use 'swichtbuf' option
Problem:  :stag does not use 'swichtbuf' option, though the
          documentation states differently
          (Christian Brabandt)
Solution: Respect 'switchbuf' option (Yegappan Lakshmanan).

related: vim/vim#18845
closes: vim/vim#18856

efc7509be2

Cherry-pick some test_tagjump.vim changes from patches 9.0.{0363,0767}.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2025-12-08 08:09:17 +08:00
zeertzjq
d6be2b3312 vim-patch:9.1.1957: filetype: bpftrace files are not recognized (#36838)
Problem:  filetype: bpftrace files are not recognized
Solution: Detect *.bt files as btftrace filetype,
          include a btftrace filetype plugin (Stanislaw Gruszka)

closes: vim/vim#18866

b60b33a9dc

Co-authored-by: Stanislaw Gruszka <stf_xl@wp.pl>
2025-12-06 20:02:16 +08:00
zeertzjq
e8fdc7ef9a vim-patch:9.1.1944: getwininfo() does not return if statusline is visible (#36828)
Problem:  gewininfo() does not return if statusline is visible
Solution: Add status_height to the dict items returned by
          getwininfo() (Hirohito Higashi)

closes: vim/vim#18841

a04ab5f04c

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-12-05 07:38:05 +08:00
zeertzjq
c758423cf2 vim-patch:9.1.1951: tests: Test_windows_external_cmd_in_cwd() only run in huge builds
Problem:  tests: Test_windows_external_cmd_in_cwd() is only run in huge
          builds (after 9.1.1947).
Solution: Move it to test_system.vim so that it is run in normal builds.

closes: vim/vim#18853

2c164f02c6
2025-12-04 11:54:27 +08:00
zeertzjq
ffdc632ea1 vim-patch:9.1.1952: tests: need better tests for tf files
Problem:  tests: need better tests for tf files
Solution: Add better filetype test for terraform/tf filetype

closes: vim/vim#18339

23f23e611f

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-04 08:28:09 +08:00
zeertzjq
132567c71f vim-patch:9.1.1950: tests: Test_tagjump.vim leaves swapfiles behind
Problem:  tests: Test_tagjump.vim leaves swapfiles behind
Solution: Close open buffers using :bw! instead of :close!

05a56aabee

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-04 08:27:50 +08:00
zeertzjq
c3c8a18af7 vim-patch:9.1.1945: tests: Test_getbufwintabinfo() leaves swapfiles behind
Problem:  tests: Test_getbufwintabinfo() leaves swapfiles behind
Solution: Close all open buffers using %bw!

397ad21268

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-03 09:00:49 +08:00
zeertzjq
7452a8a568 vim-patch:9.1.1941: tests: Test_execute_register() leaves swapfile behind
Problem:  tests: Test_execute_register() leaves swapfile behind
Solution: Use :bw instead of :close to close the buffer completely

791478b30a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-03 09:00:24 +08:00
zeertzjq
b64e36cef0 vim-patch:9.1.1943: Memory leak with :breakadd expr
Problem:  Memory leak with :breakadd expr
Solution: Free debug_oldval and debug_newval before assigning to them.
          Verify the existing (though confusing) :breakadd expr behavior
          (zeertzjq).

It seems that :breakadd expr doesn't work as documented at all. This PR
only fixes the memory leak. The tests are for the existing behavior.

closes: vim/vim#18844

a474de64df
2025-12-02 07:24:28 +08:00
zeertzjq
62de643b89 vim-patch:partial:9.0.1570: some tests are slow
Problem:    Some tests are slow.
Solution:   Make a few test cases faster.

bf63011a52

Only include the RunDbgCmd() to s:RunDbgCmd() change.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-02 07:08:34 +08:00
zeertzjq
9b15d4c756 vim-patch:9.0.0688: debugger does not display the whole command
Problem:    Debugger does not display the whole command.
Solution:   Set ea.cmd before checking for a breakpoint.

33b55b562b

The code change is already covered by #35019.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-02 07:08:34 +08:00
zeertzjq
d13e8f1a34 vim-patch:9.1.1939: tests: test_matchfuzzy() leaves swapfiles behind
Problem:  tests: test_matchfuzzy() leaves swapfiles behind
Solution: Close loaded buffers using "%bw"

6e9694df10

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-01 11:06:39 +08:00
zeertzjq
c9f63d13b6 vim-patch:9.1.1938: tests: excessive wait in Test_matchfuzzy_initialized
Problem:  tests: excessive wait in Test_matchfuzzy_initialized
Solution: Use term_wait() instead of the TermWait() wrapper
          (Corey Hickey)

Test_matchfuzzy_initialized is a terminal test, which are specified to be
"flaky" and automatically retried. The TermWait wrapper multiplies the
specified wait time by higher values for later retries, maxing out at
10x the specified value. This makes tries vim/vim#3 to vim/vim#6 sleep for 20 seconds
each, which makes the test very slow to work with. The specified intent
of the test (as noted in a comment eight lines above here) is to
sleep for 2s.

closes: vim/vim#18822

d4f9de889b

Co-authored-by: Corey Hickey <bugfood-c@fatooh.org>
2025-12-01 11:06:39 +08:00
zeertzjq
3c60598239 vim-patch:9.1.1937: tests: Test_matchfuzzy_initialized() fails
Problem:  tests: Test_matchfuzzy_initialized() fails
Solution: Send a dummy key (Corey Hickey)

Test_matchfuzzy_initialized seems to expect that the 'lvimgrep' will be
interrupted by sending a SIGINT. If the search finishes beforehand,
though, then the SIGINT triggers vim to tell the user how to quit.

Vim does not show this message immediately, though; instead, vim shows
the message next time it is active. When StopVimInTerminal() sends a key
sequence intended to cause vim to quit, this activates vim to show the
message instead of quitting.

I do not understand every detail of the problem fully--if I type the
characters from StopVimInTerminal() into a post-SIGTERM terminal
directly, that seems to work ok; there seems to be a timing issue due to
sending all the characters at once.

This fix does make the test work reliably for me, and the test still
works even if I limit my CPU frequency so that the search is interrupted
by the SIGINT.

fixes: vim/vim#18821
related: vim/vim#18822

a3925d783a

Co-authored-by: Corey Hickey <bugfood-c@fatooh.org>
2025-12-01 11:06:39 +08:00
zeertzjq
3f8e51cee7 vim-patch:9.1.1936: filetype: Erlang lexical files are not recognized
Problem:  filetype: Erlang lexical files are not recognized
Solution: Detect *.xrl files as leex filetype, include syntax and
          filetype plugins (Jon Parise).

leex is the lexical analyzer generator for Erlang. Its input file format
follows a section-based structure and uses the `.xrl` file extension.

This initial work includes file detection, an ftplugin (which inherits
the Erlang configuration), and a syntax definition.

Reference:
-  https://www.erlang.org/doc/apps/parsetools/leex.html

related: vim/vim#18819
closes: vim/vim#18832

b087c5452b

Co-authored-by: Jon Parise <jon@indelible.org>
2025-12-01 10:11:34 +08:00
zeertzjq
8310f20526 vim-patch:9.1.1935: filetype: not all Erlang files are recognized
Problem:  filetype: not all Erlang files are recognized
Solution: Detect *.app.src and rebar.config files as erlang filetype
          (John Parise).

*.app.src files contain Erlang application definitions. (There are also
*.app files, which are similar but more often build artifacts, and that
file extension is too ambiguous to be recognized by default.)

Reference:
- https://www.erlang.org/doc/system/applications.html

Rebar is the Erlang build tool. rebar.config uses Erlang syntax.

Reference:
- https://rebar3.org/docs/configuration/configuration/

closes: vim/vim#18835

2b2580e61a

Co-authored-by: Jon Parise <jon@indelible.org>
2025-12-01 10:11:34 +08:00
Jan Edmund Lazo
26641c0c56 vim-patch:9.0.0010: returning 0 for has('patch-9.0.0') is inconsistent
Problem:    Returning 0 for has('patch-9.0.0') is inconsistent.
Solution:   Make it return 1. (closes vim/vim#10640)

b0375d466e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-11-29 20:59:24 -05:00
Jan Edmund Lazo
d4a8d169a2 vim-patch:9.0.0113: has() is not strict about parsing the patch version
Problem:    has() is not strict about parsing the patch version.
Solution:   Check the version more strictly. (Ken Takata, closes vim/vim#10752)

d90f91fe30

Co-authored-by: K.Takata <kentkt@csc.jp>
2025-11-29 13:32:07 -05:00
Jan Edmund Lazo
0d3ee26860 vim-patch:9.0.0057: has('patch-xxx') returns true
Problem:    has('patch-xxx') returns true.
Solution:   Check for digit. (closes vim/vim#10751)

5154a88800

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-11-29 10:31:14 -05:00
zeertzjq
da6edcb91b vim-patch:9.1.1934: filetype: not all starlark files are recognized (#36743)
Problem:  filetype: not all starlark files are recognized
Solution: Detect *.sky files as starlark filetype (Bruno Belanyi)

References:
- https://docs.bazel.build/versions/0.17.1/skylark/spec.html

closes: vim/vim#18807

3ba6a97fea

Co-authored-by: Bruno Belanyi <bruno@belanyi.fr>
2025-11-29 00:31:52 +00:00
zeertzjq
2c6469aca4 vim-patch:9.1.1933: completion: complete_match() is not useful (#36726)
Problem:  completion: complete_match() Vim script function and
          'isexpand' option are not that useful and confusing
          (after v9.1.1341)
Solution: Remove function and option and clean up code and documentation
          (Girish Palya).

complete_match() and 'isexpand' add no real functionality to Vim. They
duplicate what `strridx()` already does, yet pretend to be part of the
completion system. They have nothing to do with the completion mechanism.

* `f_complete_match()` in `insexpand.c` does not call any completion code.
   It’s just a `STRNCMP()` wrapper with fluff logic.
* `'isexpand'` exists only as a proxy argument to that function.
   It does nothing on its own and amounts to misuse of a new option.

The following Vim script function can be used to implement the same
functionality:

```vim
  func CompleteMatch(triggers, sep=',')
    let line = getline('.')->strpart(0, col('.') - 1)
    let result = []
    for trig in split(a:triggers, a:sep)
      let idx = strridx(line, trig)
      if l:idx >= 0
        call add(result, [idx + 1, trig])
      endif
    endfor
    return result
  endfunc
```

related: vim/vim#16716
fixes: vim/vim#18563
closes: vim/vim#18790

cbcbff8712

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-11-28 10:10:31 +08:00
zeertzjq
19d5b28977 vim-patch:9.1.1931: completion: wrong item selected with fuzzy and noinsert (#36725)
Problem:  completion: wrong item selected with fuzzy and noinsert
          (Evgeni Chasnovski)
Solution: Reset selected item after fuzzy sort
          (Girish Palya)

fixes: vim/vim#18802
closes: vim/vim#18816

057ea1232a

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-11-28 09:07:22 +08:00
zeertzjq
812186e2dc vim-patch:9.1.1930: completion: 'completefuzzycollect' is too obscure
Problem:  completion: 'completefuzzycollect' option is too obscure
Solution: Deprecate the option, but don't error out for existing scripts,
          behave like 'completefuzzycollect' is set when fuzzy
          completion is enabled (Girish Palya).

fixes: vim/vim#18498
closes: vim/vim#18788

33fbfe003c

Remove this option completely, as it's introduced in Nvim v0.12 cycle.

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-11-28 07:53:49 +08:00
zeertzjq
a212fc7745 vim-patch:9.1.1929: completion: spell completion wrong with fuzzy (#36709)
Problem:  completion: spell completion wrong with fuzzy
Solution: Disable fuzzy sort for spell completion
          (Maxim Kim)

fixes vim/vim#18800
closes: vim/vim#18809

0e1ab0adb8

Co-authored-by: Maxim Kim <habamax@gmail.com>
2025-11-27 09:22:06 +08:00
zeertzjq
30a09bdd7e vim-patch:9.1.1923: wrong error when assigning to read-only register (#36644)
Problem:  When assigning to @. in a :let command an incorrect "E15"
          error is emitted.
Solution: Emit the correct "E354" error. (Doug Kearns).

An incorrect "E488" error was also emitted in Vim9 script assignments.

It appears that the code deleted in this commit was added to work around
a limitation in the returned value from find_name_end() that no longer
exists.

See commit 76b92b2830841fd4e05006cc3cad1d8f0bc8101b (tag: v7.0b).

closes: vim/vim#18757

2447131e00

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-11-21 08:24:00 +08:00
zeertzjq
a8b9660ca3 vim-patch:9.1.1920: tests: not enough testing for wildtrigger() pum redrawing (#36642)
Problem:  tests: not enough testing for wildtrigger() pum redrawing.
Solution: Also test redrawing when leaving cmdline mode (zeertzjq).

closes: vim/vim#18773

eb33c2eb28
2025-11-20 23:49:55 +00:00
altermo
caa9419355 refactor!: optwin.lua #36505
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-11-19 20:43:15 -08:00
zeertzjq
ef0c522077 vim-patch:9.1.1918: completion: crash with fuzzy completion (#36578)
Problem:  completion: crash with fuzzy completion
          (Christian Brabandt)
Solution: When completion candidates are gathered from a different
          window, and when completing `<c-p>`, linked list should be
          sorted only after all items are collected (Girish Palya).

fixes: vim/vim#18752
closes: vim/vim#18756

6437997d83

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-11-17 09:33:04 +08:00
Justin M. Keyes
f01c212e37 docs: rework main help page 2025-11-16 00:55:28 -05:00
zeertzjq
8d72d1ceb4 vim-patch:9.1.1916: WinEnter autocommand confuses Vim when closing tabpage (#36567)
Problem:  WinEnter autocommand may confuse Vim when closing tabpage
          (hokorobi)
Solution: Verify that curwin did not change in close_others()

fixes: vim/vim#18722
closes: vim/vim#18733

61b73b89a3

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-11-15 23:18:39 +00:00
Chip Senkbeil
c123b7245c refactor(path)!: support RFC3986 in path_with_url() #36564
Problem:
Nvim does not recognize URI scheme with numeric characters. While rare, there
are URIs that contain numbers (e.g. [ed2k://](https://en.wikipedia.org/wiki/Ed2k_URI_scheme))
and characters like `+` (e.g. `svn+ssh`). I use it in
[distant.nvim](https://github.com/chipsenkbeil/distant.nvim) to support
multiple, distinct connections using `distant+1234://` as the scheme.
Otherwise, if you open a file with the same name & path on two different
machines from the same Nvim instance, their buffer names will conflict
when just using `distant://`.

Solution:
Adds full support for detecting URI scheme per
[RFC3986](https://www.rfc-editor.org/rfc/rfc3986#section-3.1)
2025-11-15 13:40:01 -08:00
zeertzjq
dc682bcbcf vim-patch:9.1.1915: :breaklist accepts unprocessed arguments. (#36561)
Problem:  :breaklist accepts unprocessed arguments.
Solution: Remove EX_EXTRA flag from the Ex command definition.
          (Doug Kearns)

The command should emit an "E488: Trailing characters" error rather than
silently accept arguments.

closes: vim/vim#18746

de7049ede1

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-11-15 19:09:19 +08:00
zeertzjq
d017f3c9a0 vim-patch:9.1.1914: runtime(netrw): wipes unnamed buffers (#36551)
Problem:  runtime(netrw): LocalBrowseCheck() wipes unnamed buffers when
          g:netrw_fastbrowse=0 (Carlos Falgueras García)
Solution: Check that bufname() is not empty

fixes: vim/vim#18740
closes: vim/vim#18741

384685fade

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-11-13 23:59:35 +00:00
zeertzjq
16e9c21d8d vim-patch:9.1.1913: Error message with :unlet! and non-existing dictionary item (#36549)
Problem:  Error message with :unlet! and non-existing dictionary item
          (Coacher)
Solution: Set GLV_QUIET when using unlet with bang attribute

fixes: vim/vim#18516
closes: vim/vim#18734

b8119920eb

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-11-13 23:32:42 +00:00