Commit Graph

33339 Commits

Author SHA1 Message Date
Jan Edmund Lazo
7c38f428f4 vim-patch:9.0.2023: need more tests for :cq
Problem:  need more tests for :cq
Solution: Add more tests, including wraparound on linux

ba9aed4497

vim-patch:9.0.2042: Test_cq_zero_exmode fails without channel feature

Problem:  Test_cq_zero_exmode fails without channel feature
Solution: Make the test check the channel feature

closes: vim/vim#13365

c290009e99

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-07-21 21:33:01 -04:00
Jan Edmund Lazo
9a5b3a39f3 vim-patch:8.2.2905: no error when defaults.vim cannot be loaded
Problem:    No error when defaults.vim cannot be loaded.
Solution:   Add an error message. (Christian Brabandt, closes vim/vim#8248)

1d3a14ecf0

Neovim doesn't support defaults.vim.
N/A test but this should "help" reduce patch rejections.

vim-patch:8.2.2906: ASAN reports errors for test_startup

Problem:    ASAN reports errors for test_startup for unknown reasons.
Solution:   Temporarily disable the new test.

a5787c3742

vim-patch:8.2.2927: test commented out because it fails with ASAN

Problem:    Test commented out because it fails with ASAN.
Solution:   Only skip the test when running with ASAN.

a83d06026d

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-07-21 21:33:01 -04:00
zeertzjq
ea2d226df6 Merge pull request #34894 from janlazo/vim-8.1.0857
vim-patch:8.1.{770,857,914,977,1004,1526,1551,1565,1584,1629,1641,1703,1728,1730,1736,1802,1853,1891,2127,2200},8.2.3922,9.0.{546,928},9.1.1382
2025-07-21 12:02:05 +08:00
zeertzjq
8ee82da3cf vim-patch:1f6faff: runtime(doc): mention the "pipefail" shell option (#35016)
related: vim/vim#17787

1f6faff912

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-07-21 07:54:31 +08:00
zeertzjq
2795df7aac Merge pull request #35015 from zeertzjq/vim-9.1.1571
vim-patch:9.1.{1571,1573}: CmdlineChanged triggered to often
2025-07-21 07:53:54 +08:00
zeertzjq
22d1fb8c01 vim-patch:9.1.1573: Memory leak when pressing Ctrl-D in cmdline mode
Problem:  Memory leak when pressing Ctrl-D in cmdline mode
          (after 9.1.1571).
Solution: Free prev_cmdbuff before assigning to it.
          (zeertzjq).

Existing tests already cover this. This change fixes the CI failure.

closes: vim/vim#17807

c02bef26fd
2025-07-21 07:16:55 +08:00
zeertzjq
bbc368dfce vim-patch:9.1.1571: CmdlineChanged triggered to often
Problem:  The CmdlineChanged event was firing unnecessarily, even when
          the command line's content hadn't actually changed.

Solution: I've added a check to compare the command-line buffer's state
          before and after key processing. The `CmdlineChanged` event
          now only triggers if the buffer's contents are genuinely
          different (Girish Palya).

closes: vim/vim#17803

239c4e4abe

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-07-21 07:15:51 +08:00
Jan Edmund Lazo
85bd0b6a03 vim-patch:8.1.1891: functions used in one file are global
Problem:    Functions used in one file are global.
Solution:   Add "static". (Yegappan Lakshmanan, closes vim/vim#4840)

5843f5f37b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-07-20 18:37:33 -04:00
Jan Edmund Lazo
f2d92ba6ca refactor: fixup! vim-patch:8.1.0877: new buffer
https://github.com/neovim/neovim/pull/9674 removed switch_to_win_for_buf().
This vim-patch removed the last relevant usage of find_win_for_buf()
Vim uses switch_to_win_for_buf() only for if_py_both.
2025-07-20 18:37:33 -04:00
Jan Edmund Lazo
b79ed66e4a vim-patch:8.1.1736: viminfo support is spread out
Problem:    Viminfo support is spread out.
Solution:   Move more viminfo code to viminfo.c. (Yegappan Lakshmanan,
            closes vim/vim#4717)  Reorder code to make most functions static.

c3328169d5

735aa4c4c8 was the partial port for
the typedefs.
This patch completes the viminfo->shada port.

- get_shada_parameter()
- find_shada_parameter()

Other patches below are N/A.

vim-patch:8.1.1728: wrong place for command line history viminfo support

Problem:    Wrong place for command line history viminfo support.
Solution:   Move it to viminfo.c.

5f32ece459

vim-patch:8.1.1730: wrong place for mark viminfo support

Problem:    Wrong place for mark viminfo support.
Solution:   Move it to viminfo.c. (Yegappan Lakshmanan, closes vim/vim#4716)

1e78e69680

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-07-20 18:37:33 -04:00
Jan Edmund Lazo
6a97eb332a refactor: fixup! vim-patch:8.2.4881: "P" in Visual
7978660efb removed all uses of ff:

```diff
-yankreg_T *get_y_previous(void)
-{
-  return y_previous;
-}
-
-void set_y_previous(yankreg_T *yreg)
-{
-  y_previous = yreg;
-}
```
2025-07-20 18:37:13 -04:00
Jan Edmund Lazo
4765d4e059 vim-patch:8.1.1584: the evalfunc.c file is getting too big
Problem:    The evalfunc.c file is getting too big.
Solution:   Move channel and job related functions to channel.c.

0a1f56fcfe

---

N/A patches below:

vim-patch:8.1.0770: inconsistent use of ELAPSED_FUNC

Problem:    Inconsistent use of ELAPSED_FUNC.
Solution:   Consistently use ELAPSED_FUNC.  Also turn ELAPSED_TYPE into a
            typedef. (Ozaki Kiichi, closes vim/vim#3815)

1ac56c2d11

vim-patch:8.1.0914: code related to findfile() is spread out

Problem:    Code related to findfile() is spread out.
Solution:   Put findfile() related code into a new source file. (Yegappan
            Lakshmanan, closes vim/vim#3934)

5fd0f5052f

vim-patch:8.1.1004: function "luaV_setref()" not covered with tests

Problem:    Function "luaV_setref()" not covered with tests.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#4089)

e165f63598

vim-patch:8.1.1551: warning for shadowing popup_dragwin

Problem:    Warning for shadowing popup_dragwin. (Dominique Pelle)
Solution:   Add missing change.

6c17543b56

vim-patch:8.1.1629: terminal function help is in the wrong file

Problem:    Terminal function help is in the wrong file.
Solution:   Move the function details to terminal.txt.

6bf2c6264b

vim-patch:8.1.1641: garbage collection may run at a wrong moment

Problem:    Garbage collection may run at a wrong moment. (Trygve Aaberge)
Solution:   Postpone garbage collection while parsing messages. (closes vim/vim#4620)

6cc7e21412

vim-patch:8.1.1703: breaking out of loop by checking window pointer insufficient

Problem:    Breaking out of loop by checking window pointer is insufficient.
Solution:   Check the window ID and the buffer number. (closes vim/vim#4683)

6138640806

vim-patch:8.1.1802: missing change to call_callback()

Problem:    Missing change to call_callback().
Solution:   Add missing change.

b2129068a5

vim-patch:8.1.1853: timers test is still flaky

Problem:    Timers test is still flaky.
Solution:   Compute the time to sleep more accurately.

52953194af

---
Seems N/A now because of commit 09370eae77
---

vim-patch:8.1.2200: crash when memory allocation fails

Problem:    Crash when memory allocation fails.
Solution:   Check for NULL curwin and curbuf. (Christian Brabandt,
            closes vim/vim#4839)

1cac70953d

vim-patch:8.2.3922: cannot build with dynamic Ruby 3.1

Problem:    Cannot build with dynamic Ruby 3.1.
Solution:   Add "_EXTRA" variables for CI.  Add missing functions. (Ozaki
            Kiichi, closes vim/vim#9420)

8bb3fe4d4d

vim-patch:9.0.0546: supporting Ruby 1.8 makes code complicated

Problem:    Supporting Ruby 1.8 makes code complicated.
Solution:   Drop Ruby 1.8 support, it is ancient. (Ken Takata, closes vim/vim#11195)

236ccbf6f8

vim-patch:9.0.0928: using Ruby LDFLAGS may cause build problems

Problem:    Using Ruby LDFLAGS may cause build problems.
Solution:   Do not add Ruby LDFLAGS to Vim's LDFLAGS. (Zdenek Dohnal,
            closes vim/vim#11592)

1d822afaf6

vim-patch:9.1.1382: if_ruby: unused compiler warnings from ruby internals

Problem:  if_ruby: unused compiler warnings from ruby internals
Solution: disable -Wunused-parameter for if_ruby internal code
          (Philip H.)

closes: vim/vim#17297

411730e277

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-07-20 18:36:39 -04:00
Jan Edmund Lazo
00c2e7d89c vim-patch:8.1.1526: no numerical value for the patchlevel
Problem:    No numerical value for the patchlevel.
Solution:   Add v:versionlong.

37df9a4401

Restore "highest_patch()" solely for "v:versionlong".
Copy/paste Test_vvar_scriptversion2() from patch 9.1.1540.
It works without ":scriptversion 2".
In general, if Vim's test works with ":scriptversion 1", just port it
for additional coverage.

---

vim-patch:8.1.1565: MS-Windows: no sound support

Problem:    MS-Windows: no sound support.
Solution:   Add sound support for MS-Windows. (Yasuhiro Matsumoto, Ken Takata,
            closes vim/vim#4522)

9b283523f2

----

"sound" feature is N/A now but this updates "v:versionlong" docs.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-07-20 18:36:39 -04:00
Jan Edmund Lazo
1e81b54075 vim-patch:8.1.0977: blob not tested with Ruby
Problem:    Blob not tested with Ruby.
Solution:   Add more test coverage.  fixes a crash. (Dominique Pelle,
            closes vim/vim#4036)

0d13cce345

-----

https://github.com/neovim/neovim/pull/15211 ports Blob type.
"Test_ruby_Vim_blob()" was already committed.
Skipped because "ruby provider" did not implement Blob API.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-07-20 18:36:39 -04:00
Jan Edmund Lazo
fadbc0e717 vim-patch:8.1.2127: the indent.c file is a bit big
Problem:    The indent.c file is a bit big.
Solution:   Move C-indent code a a new cindent.c file.  Move other
            indent-related code to indent.c. (Yegappan Lakshmanan,
            closes vim/vim#5031)

14c01f8348

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-07-20 18:36:38 -04:00
Jan Edmund Lazo
441d222c0d vim-patch:8.1.0857: indent functionality is not separated
Problem:    Ignore functionality is not separated.
Solution:   Move indent functionality into a new file. (Yegappan Lakshmanan,
            closes vim/vim#3886)

4b47162cce

----

Partial port of v8.1.2127 by porting directly to indent_c.c,
not indent.c.

----

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-07-20 18:36:38 -04:00
Maria José Solano
c3991b8ef4 fix(lsp): show notification with empty hover response (#35014) 2025-07-20 16:58:40 -04:00
Justin M. Keyes
2495015455 Merge #35002 refactor(lsp): extract Client._on_detach to reduce duplicated code 2025-07-20 12:41:35 -04:00
zeertzjq
b6b793634a vim-patch:9.1.1572: expanding $var does not escape whitespace for 'path' (#35010)
Problem:  expanding $var does not escape whitespace for 'path'
Solution: Escape whitespace when expanding 'path' option.
          (Miguel Barro)

closes: vim/vim#17801

8b004081c4

Co-authored-by: Miguel Barro <miguel.barro@live.com>
2025-07-20 15:16:10 +00:00
zeertzjq
c556c6677b vim-patch:31ec664: runtime(doc): Update help syntax, match :autocmd options (#35008)
- Match :autocmd options and special buffer pattern.
- Normalise ellipsis (three dots) in Ex command argument lists.

closes: vim/vim#17793

31ec66403d

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-07-20 14:11:30 +00:00
Yi Ming
6831c7de65 refactor(lsp): inline on_client_exit 2025-07-20 22:09:27 +08:00
zeertzjq
4962c60c6f vim-patch:partial:d3170f5: runtime(doc): Tweak documentation about tab pages (#35007)
closes: vim/vim#17799

d3170f59e0

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-07-20 22:05:46 +08:00
Yi Ming
5400df0f7f refactor(lsp): track clients in all_clients once initialized 2025-07-20 22:05:03 +08:00
zeertzjq
0f9b5dd0b4 vim-patch:9.1.1570: Copilot suggested some improvements in cmdexpand.c (#35006)
Problem:  Copilot suggested some improvements in cmdexpand.c
          (after v9.1.1556)
Solution: Use better variable names and comments
          (John Marriott).

closes: vim/vim#17795

88b735973c

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-07-20 21:29:35 +08:00
zeertzjq
b91613f42c vim-patch:9.1.1567: crash when using inline diff mode (#35005)
Problem:  Crash when using inline diff mode
          (Ilya Grigoriev)
Solution: Set tp_diffbuf to NULL when skipping a diff block
          (Yee Cheng Chin).

Fix an array out of bounds crash when using diffopt+=inline:char when 4
or more buffers are being diff'ed. This happens when one of the blocks
is empty. The inline highlight logic skips using that buffer's block,
but when another buffer is used later and calls diff_read() to merge the
diff blocks together, it could erroneously consider the empty block's
diff info which has not been initialized, leaving to diff numbers that
are invalid. Later on the diff num is used without bounds checking which
leads to the crash.

Fix this by making sure to unset tp_diffbuf to NULL when we skip a
block, so diff_read() will not consider this buffer to be used within
inline diff. Also, add more bounds checking just to be safe.

closes: vim/vim#17805

c8b99e2d13

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-07-20 21:11:43 +08:00
Christian Clason
14cafbcc85 vim-patch:1afe8c3: runtime(rust): improve loading time
fixes: vim/vim#17745
closes: vim/vim#17749

1afe8c3a4d

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-07-20 13:27:55 +02:00
Christian Clason
8dfad04ce9 vim-patch:a2578e0: runtime(uc): include uc filetype plugin
closes: vim/vim#17802

a2578e08d5

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-07-20 13:27:55 +02:00
Yi Ming
8f75c0b586 refactor(lsp): extract Client._on_detach to reduce duplicated code 2025-07-20 15:09:38 +08:00
Peter Cardenas
e5c2ce5905 fix(treesitter): ":EditQuery [lang]" with injected languages #34914
Problem:
`:EditQuery` command accepts a language argument, but it doesn't
highlight properly for injected languages.

Solution:
- Fully parse with the root language and then filter the query on the
  child trees that are of the language requested.
- Also support completion (`EditQuery <tab>`).
2025-07-19 11:36:51 -07:00
Riley Bruins
c5167ffc18 feat(lsp): support linked editing ranges #34388
ref: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_linkedEditingRange
2025-07-19 10:54:49 -07:00
Phạm Bình An
db1542af3d fix(tutor): use legacy syntax for lesson 3.1 #34996
Problem:
- Extmark breaks lesson 3.1 of vim-01-beginner.tutor because when users
  delete the line and put it elsewhere, the extmark doesn't move to the
  put location.
- This doesn't mean the extmark implementation is bad though (note that
  thanks to extmark, for the first time, we can make lesson 2.6 really
  interactive), it's just that the tutor format has never been made for
  kinds of lessons like lesson 3.1, which is why all "expected" in that
  lesson are -1, which also means that lesson is not interactive in the
  first place. Also see lesson 2.1.3 in vim-02-beginner, where the mark
  is just used to mark the first line of the exercise, which also prove
  my point.

Solution:
- For a not-really-interactive lesson like lesson 3.1, just use legacy
  syntax. I borrow the old vimtutor's `--->` to mark the exercises of
  the lesson.
- Less redundant interactive marks also make the json files smaller and
  more maintainable.
2025-07-19 08:31:37 -07:00
Christian Clason
f21ada30e1 vim-patch:ba3a5a7: runtime(sh): properly delete shell commands in syntax file
closes: vim/vim#17785

ba3a5a7372

Co-authored-by: Christoffer Aasted <chr.aasted@gmail.com>
2025-07-19 11:19:40 +02:00
Christian Clason
b21c357b9c vim-patch:a2fff3f: runtime(lf): update syntax to support lf version r36
Adds the lf release 36 specific syntax highlighting changes.

related: andis-sprinkis/lf-vim#22 by @CatsDeservePets

closes: vim/vim#17792

a2fff3fb94

Co-authored-by: Andis Spriņķis <andis@sprinkis.com>
Co-authored-by: CatsDeservePets <145048791+CatsDeservePets@users.noreply.github.com>
2025-07-19 11:19:40 +02:00
György Andorka
46648c3867 fix(pack): close confirmation buffer's tabpage by ID #34971
Problem: On canceling the update (triggering `WinClosed`), the tab page
will most probably be closed too. Closing some other tab page while the
confirmation buffer is open also changes tab page numbers. We are trying
to close the wrong tab page in both cases.

Solution: save the tab page ID, and attempt to get the tab page number
from the ID when closing the buffer.
2025-07-18 18:40:16 -07:00
zeertzjq
3a140ddbc6 Merge pull request #34995 from zeertzjq/vim-97501af
vim-patch: Vim syntax updates
2025-07-19 06:31:38 +08:00
zeertzjq
10a0c59487 vim-patch:2f7c957: runtime(vim): Update base syntax and generator, improve command/function distinction
- Match Ex command modifiers and functions with the same name correctly.
  E.g., :browse and browse().
- Match full :eval command.

closes: vim/vim#17789

2f7c957c8d

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-07-19 06:06:52 +08:00
zeertzjq
73943eb0d1 vim-patch:97501af: runtime(vim): Update base syntax, match "any" type distinctly
Allow for special highlighting of the "any" Vim9 type.

Addresses comment
https://github.com/vim/vim/pull/17722#issuecomment-3075531052

closes: vim/vim#17769

97501afda3

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-07-19 06:01:17 +08:00
Phạm Bình An
f2691199fa fix(tutor): use invalidate field in nvim_buf_set_extmark() #34989
Problem:
If users delete a line containing extmark, it will move to the next
line, which could highlight the next line in an unwanted way.

Solution:
- Use `invalidate` field in `nvim_buf_set_extmark()` to prevent the
extmark from moving.
- Also save from "priority" hacking, since we can check if the extmark
  is valid in `nvim_buf_get_extmarks()` now.
2025-07-18 13:02:09 -07:00
Justin M. Keyes
26bbeadda3 Merge #34991 pack.txt help file 2025-07-18 13:54:14 -04:00
Phạm Bình An
f5829957f2 feat(env): remove VIM_VERSION_NODOT macro #34890
Problem:
- The VIM_VERSION_NODOT macro maintained support for legacy Vim
  version-specific runtime directories (e.g., "vim82") which I believe
  have never been relevant for Neovim

Solution:
- Remove it
- Rename `vim_version_dir()` to `vim_runtime_dir()`
2025-07-18 10:46:33 -07:00
Evgeni Chasnovski
586e6d427a docs: fix help tag link #34988 2025-07-18 10:45:35 -07:00
Evgeni Chasnovski
a3cfdcebb9 docs: move *packages* and *package-create* into 'pack.txt' 2025-07-18 17:43:41 +03:00
Evgeni Chasnovski
538c945fdf docs(pack): move vim.pack documentation into a separate file 2025-07-18 17:39:23 +03:00
zeertzjq
d7050d6e39 vim-patch:f2290a6: runtime(compiler): Add PHPStan compiler (#34985)
closes: vim/vim#17781

f2290a6823

Co-authored-by: Dietrich Moerman <dietrich.moerman@gmail.com>
2025-07-18 09:18:26 +00:00
Christian Clason
9df9d3af3b vim-patch:b7fc24d: runtime(python): Highlight f-strings in Python
fixes: vim/vim#10734
fixes: vim/vim#14033
closes: vim/vim#17767

b7fc24d3a3

Co-authored-by: Rob B <github@0x7e.net>
2025-07-18 10:33:05 +02:00
Justin M. Keyes
fd5d04fbff Merge #34921 tutor: reimplement interactive marks as extmarks 2025-07-17 23:26:55 -04:00
brianhuster
1de2a03fc7 test(tutor_spec): remove test description("Tutor: tutor")
Problem:
It is redundant since we have another test that test interactive marks
in lesson 2.6 of tutor 1
2025-07-18 10:04:36 +07:00
brianhuster
1255a8d88d refactor(tutor): reimplement interactive marks as extmark in Lua
Problem:
From https://matrix.to/#/!cylwlNXSwagQmZSkzs:matrix.org/$Ofj-TFIsEMbp0O9OhE8xuZSNi-nhRLtZTOgs6JRLNrs?via=matrix.org&via=gitter.im&via=mozilla.org

In lesson 2.6, users are asked to remove the second, forth and fifth
lines with `dd` command, then they are asked to undo twice to make the
text go back to original state. But after that, the mark ✗ appears
again, which confuses the user because they think they do something
wrong. This is a limitation with the current implementation, which is
based on line number only.

Solution:
Reimplement interactive marks as extmarks in Lua. This also make the
feature less fragile, as users can remove, add some arbitrary lines
without breaking the interactive marks.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-07-18 10:04:20 +07:00
zeertzjq
995bc31eaf vim-patch:3ab6941: runtime(doc): Tweak documentation (#34980)
closes: vim/vim#17759

3ab6941713

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-07-18 02:01:29 +00:00
zeertzjq
7631302ad6 vim-patch:9.1.1544: :retab cannot be limited to indentation only (#34939)
Problem:  :retab cannot be limited to indentation only
Solution: add the optional -indentonly parameter
          (Hirohito Higashi)

closes: vim/vim#17730

836e54f5de

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-07-18 01:30:32 +00:00