Commit Graph

9208 Commits

Author SHA1 Message Date
zeertzjq
ae588c183f vim-patch:9.1.1754: :helptags doesn't skip examples with syntax
Problem:  :helptags doesn't skip examples with syntax
          (Evgeni Chasnovski)
Solution: Check for examples with syntax (zeertzjq).

fixes: vim/vim#18273
closes: vim/vim#18277

6f020cde56
2025-09-12 07:32:42 +08:00
zeertzjq
50efe61c3c vim-patch:partial:9.0.0323: using common name in tests leads to flaky tests
Problem:    Using common name in tests leads to flaky tests.
Solution:   Rename files and directories to be more specific.

3b0d70f4ff

This includes only test_help.vim changes.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-09-12 07:26:37 +08:00
Cameron Ring
0f64f0f5b6 fix(startup): crash in read_stdin #35699
Problem:
Crash on startup in some situations due to call to `set_curbuf`
with the current value of `cur_buf`.

Solution:
Switch buffers before doing the wipeout of the stdin buffer.
Use cmdline cmds instead of raw buffer pointers to avoid lifetime issues.
2025-09-10 21:37:42 -07:00
zeertzjq
aa33ea86e1 vim-patch:9.1.1752: tests: need another test for v9.1.1750 behaviour
Problem:  tests: No test when deleting text after autocompletion with preinsert
          did complete an entry
Solution: Verify, that after deletion autocompletion does not reinsert
          the deleted text. Note: the actual issue was fixed with v9.1.1750.
          (Girish Palya)

Pre v9.1.1750 behaviour:
When autocomplete is enabled with *preinsert*, deleting text after selecting a
longer match could cause unintended reinsertion, e.g.:

- Matches available: "foo" and "foobar".
- User selects "foobar" with Ctrl-N
- User deletes characters back to "foo".
- Autocomplete then incorrectly re-inserts "bar", preventing deletion past "foo".

v9.1.1750 removes the unwanted reinsertion so text can be deleted correctly.

closes: vim/vim#18259

fe0061c609

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-09-11 07:23:29 +08:00
zeertzjq
5a7586a109 vim-patch:9.1.1750: completion: preinserted text highlighed using ComplMatchIns
Problem:  completion: preinserted text highlighed using ComplMatchIns
Solution: Use highlighting group PreInsert and update the documentation
          (Girish Palya).

When "preinsert" is included in 'completeopt', only the PreInsert
highlight group should be applied, whether autocompletion is active or not.
Previously, ComplMatchIns was used when autocompletion was not enabled.

Related to https://github.com/vim/vim/pull/18213.

closes: vim/vim#18254

2525c56e42

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-09-11 07:23:28 +08:00
zeertzjq
9076fdc123 fix(runtime): add "Added", "Changed", "Removed" to "vim" colorscheme (#35704)
These were added to syncolor.vim in Vim patch 9.1.0016.
2025-09-11 06:55:43 +08:00
zeertzjq
f6ed46c2a7 vim-patch:9.1.1747: completion: redo (.) broken with preinsert and autocompletion (#35698)
Problem:  completion: redo (.) broken with preinsert and autocompletion
Solution: Make redo (.) work with preinsert and autocompletion
          (Girish Palya)

closes: vim/vim#18253

306a138172

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-09-09 23:53:33 +00:00
zeertzjq
eb19206e03 vim-patch:9.1.1742: complete: preinsert does not work well with 'autocomplete' (#35692)
Problem:  complete: preinsert does not work well with preinsert
Solution: Make "preinsert" completeopt value work with autocompletion
          (Girish Palya)

This change extends Insert mode autocompletion so that 'preinsert' also
works when 'autocomplete' is enabled.

Try: `:set ac cot=preinsert`

See `:help 'cot'` for more details.

closes: vim/vim#18213

fa6fd41a94

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-09-09 03:35:41 +00:00
glepnir
c553008e74 fix(api): crash when moving curwin to other tabpage #35679
Problem: nvim_win_set_config may crash when attempting to move curwin to a
different tabpage if there is no other non-float available to switch to.

Solution: fix the crash. Fix ONE_WINDOW checks in winframe_find_altwin and
win_altframe to consider floating windows by instead using one_window. Allow
one_window to consider non-current tabpages. We can use one_window in
win_close_othertab now to also better reflect its use in win_close.

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2025-09-08 18:30:20 -07:00
zeertzjq
223f9622df vim-patch:9.1.1744: tests: Test_skip_wildtrigger_hist_navigation() may fail
Problem:  tests: Test_skip_wildtrigger_hist_navigation() may fail
          (zeertzjq).
Solution: Correct test to validate intended behavior (Girish Palya).

See https://github.com/vim/vim/pull/18219#issuecomment-3265183318

closes: vim/vim#18243

3980c86525

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-09-09 08:25:58 +08:00
zeertzjq
b51eba9273 vim-patch:9.1.1738: cmdline-autocompletion breaks history navigation
Problem:  cmdline-autocompletion breaks history navigation (ddad431)
Solution: Support history navigation in cmdline autocompletion (Girish
          Palya)

Up/Down arrows support history navigation when using wildtrigger()

fixes: vim/vim#18207
closes: vim/vim#18219

708ab7f5fb

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-09-09 08:25:19 +08:00
James McCoy
a7b8102f20 Merge pull request #35659 from jamessan/enable-arm-unittests
Fix unittests on aarch64 / arm64
2025-09-08 20:13:16 -04:00
zeertzjq
7f2298ad32 fix(cmdline): fix inconsistent behavior with ext_popupmenu (#35688) 2025-09-09 00:11:13 +00:00
Shadman
acb99b8a65 fix(prompt_buffer): plugins can't set ': mark #35624
Problem:
Currently, prompt_buffer manages `:` mark by itself and exposes it
read-only mark. However when it fails there can be no mitigation made
by plugins. The `:` mark should act like a regular marks and be
modifiable.

Solution:
Allow plugins to set `:` mark.
2025-09-08 15:09:48 -07:00
zeertzjq
29f30ad91c vim-patch:9.1.1679: unclear what key causes CmdlineLeave autocommand (#35677)
Problem:  unclear what key causes CmdlineLeave autocommand
Solution: Set |v:char| to the key (Girish Palya).

related: vim/vim#17806
closes: vim/vim#18063

ba9551d131

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-09-08 11:40:12 +08:00
zeertzjq
da78772328 test(lsp): fix flakiness in inline completion test (#35676)
The flakiness happens because get() uses vim.schedule(), and a following
key may be processed before the scheduled event. Use poke_eventloop() to
ensure that the scheduled event is processed.
2025-09-08 02:54:57 +00:00
zeertzjq
bea87b4a9e test: add tests for #20348 2025-09-08 09:24:13 +08:00
zeertzjq
18f24b85c3 vim-patch:9.1.1740: Memory leak with wildmode=longest,full and wildoptions=pum
Problem:  Memory leak with wildmode=longest,full and wildoptions=pum
          (after 9.1.1737).
Solution: Avoid using showmatches() and WILD_NEXT together.  Also fix
          wildmode=longest,noselect:full selecting wrong item
          (zeertzjq).

fixes: vim/vim#18228
closes: vim/vim#18229

c7f235bd43
2025-09-08 09:02:37 +08:00
zeertzjq
d784ed7013 vim-patch:9.1.1739: Matches may be listed twice with wildmode=longest,list
Problem:  Matches may be listed twice with wildmode=longest,list when
          "longest" doesn't change command line (after 9.1.1737).
Solution: Set did_wild_list when trying "list" after "longest"
          (zeertzjq).

closes: vim/vim#18227

a28a2eb9d9
2025-09-08 09:02:37 +08:00
zeertzjq
f2bda1effc vim-patch:9.1.1737: Patch v9.1.1714 introduce a regression for wildmenu
Problem:  Patch v9.1.1714 introduce a regression for wildmenu (zeertzjq)
Solution: Restore behavior of "longest" in 'wildmode' (Girish Palya)

- Fixed a regression caused by PR vim/vim#18125 selecting wrong item
- Fixed another regression where the first pasted text did not appear on
  the command-line after starting Vim.

closes: vim/vim#18212

8fec92d631

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-09-08 09:02:37 +08:00
zeertzjq
1359578abb vim-patch:9.1.1714: completion: wildmode=longest:full selects wrong item
Problem:  completion: wildmode=longest:full selects wrong item
          (zeertzjq)
Solution: Fix issue, refactor ex_getln.c slightly
          (Girish Palya)

fixes: vim/vim#18102
closes: vim/vim#18125

2eccb4d0be

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-09-08 09:02:37 +08:00
zeertzjq
3b5337ab6c vim-patch:9.1.1676: completion: long line shown twice
Problem:  completion: long line shown twice
          (Maxim Kim)
Solution: Fix the issue, disable an incorrect test.
          (Girish Palya)

fixes: vim/vim#18035
closes: vim/vim#18088

57379302aa

Omit removal of blank line in Test_noselect_expand_env_var() as it's
added again in patch 9.1.1682.
Cherry-pick two blank lines in Test_long_line_noselect() from patch
9.1.1682.

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-09-08 09:02:37 +08:00
Evgeni Chasnovski
fa3920282d fix(pack): handle Git environment variables #35626
Problem: Some environment variables which are useful when working inside
  a bare repository can affect any Git operation.

Solution: Explicitly unset problematic environment variables.
2025-09-07 14:42:09 -07:00
skewb1k
448f15ca39 feat(json): pretty-format (indent) with vim.json.encode() #35424
Problem:
There is no straightforward way to pretty-print objects as JSON.
The existing `vim.inspect` outputs LON.

Solution:
Introduce an `indent` option for `vim.json.encode()` which enables
human-readable output with configurable indentation.

Adapts PR to upstream: openresty/lua-cjson#114
2025-09-07 14:38:27 -07:00
Evgeni Chasnovski
7853cde29a feat(pack): vim.pack.get() gets VCS info #35631
Problem:
Force resolve `spec.version` overrides the information about whether
a user supplied `version` or not. Knowing it might be useful in some use
cases (like comparing to previously set `spec` to detect if it has
changed).

Solution:
Do not resolve `spec.version`. This also improves speed when triggering
events and calling `get()`.
- Place default branch first when listing all branches.
- Use correct terminology in `get_hash` helper.
- Do not return `{ '' }` if there are no tags.

Problem:
There is no way to get more information about installed plugins, like
current revision or default branch (necessary if resolving default
`spec.version` manually). As computing Git data migth take some time,
also allow `get()` to limit output to only necessary set of plugins.

Solution:
- introduce arguments to `get(names, opts)`, which follows other
  `vim.pack` functions. Plugin extra info is returned by default and
  should be opt-out via `opts.info = false`.
  - Examples:
    - Get current revision: `get({ 'plug-name' })[1].rev`
    - Get default branch: `get({ 'plug_name' })[1].branches[1]`
- `update()` and `del()` act on plugins in the same order their names
  are supplied. This is less surprising.
- default `opts.info` to `true` since this simplifies logic for the
  common user, while still leaving the door open for a faster `get()` if
  needed.
2025-09-07 09:59:31 -07:00
James McCoy
e702f97518 fix(tests): ignore vector math types
As noted in #34908, the arm unittests fail due to unrecognized types:

    ERROR    test/unit/testutil.lua @ 802: Expressions parser works with &opt
    test/unit/testutil.lua:774: test/unit/testutil.lua:758: (string) '
    test/unit/testutil.lua:288: declaration specifier expected near '__SVFloat32_t''
    exit code: 256

After testing on Debian's arm64 porterbox, the unittests cleanly pass
when ignoring various types defined in
/usr/include/aarch64-linux-gnu/bits/math-vector.h
2025-09-06 20:15:35 -04:00
Sean Dewar
da39966a3a fix(api): win_set_config error message for splitting from a float #35650
Problem: after #34287 nvim_win_set_config no longer errors when attempting to
split from a floating window only if "win" is 0.

Solution: fix the regression, reduce the scope of "parent" and similar checks to
only where it's currently used and add test coverage for the errors.
2025-09-06 13:22:46 -07:00
Evgeni Chasnovski
069be91106 feat(pack): use nvim_echo{kind=progress} to report progress #35625
Problem: Progress reports use plain `nvim_echo()` with manually
  constructed messages and populate history on every call.

Solution: Use `nvim_echo()` with newly added `kind=progress` which (at
  least for now) is meant to be a unified interface for showing progress
  report. Also save in history only first and last progress report
  messages.
2025-09-05 07:12:28 -07:00
zeertzjq
0bafbe872b vim-patch:9.1.1732: filetype: .inc file detection can be improved (#35635)
Problem:  filetype: .inc file detection can be improved
Solution: Update filetype detection for Pascal and BitBake code
          (Martin Schwan).

Fix the detection of .inc files containing Pascal and BitBake code:

- the concatenated string, merged from three lines, only contains one
  beginning and the pattern "^" would not match as expected. Use a range()
  loop to iterate each line string individually. This way, the pattern "^"
  works for beginning of lines.

- improve BitBake include file detection by also matching forward-slashes
  "/" in variable names and assignment operators with a dot ".=" and "=.".
  Valid examples, which should match, are:

    PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
    MACHINEOVERRIDES =. "qemuall:"
    BBPATH .= ":${LAYERDIR}"

- parse twenty instead of just three lines, to accommodate for potential
  comments at the beginning of files

closes: vim/vim#18202

9fd1a657d2

Co-authored-by: Martin Schwan <m.schwan@phytec.de>
2025-09-05 17:22:24 +08:00
Justin M. Keyes
9898327bd7 Merge #35621 from fredizzimo/refactor-mouse-spec
refactor(tests): don't compare the full screen in mouse_spec
2025-09-05 00:40:13 -04:00
Fred Sundvik
e6cdb76665 refactor(tests): don't compare the full screen in mouse_spec
Problem:
Adding multigrid tests to `mouse_spec` requires all tests to test both
the multigrid and non-multigrid screen state, which adds a lot of extra
code.

Solution:
Instead of testing the full screen state, only test substrings of it.
2025-09-05 00:12:55 +03:00
shadmansaleh
2415d8f424 fix(progress): message-id not sent to ui with history set to false 2025-09-04 20:37:05 +06:00
Justin M. Keyes
9c3099f0cf docs: lsp, misc
- Problem: It's not clear for new plugin developers that `:help` uses
  a help-tags file for searching the docs, generated by `:helptags`.
  - Solution: Hint to the |:helptags| docs for regenerating the tags
    file for their freshly written documentation.

Co-authored-by: Yochem van Rosmalen <git@yochem.nl>
2025-09-03 23:03:51 -04:00
luukvbaal
de950f8272 fix(window): avoid referencing cmdline_win after it is closed #35617
Solution:  A window marked for ext_cmdline usage is still referenced
           after it is already closed and freed.
Solution:  Unset cmdline_win when the window is closed.
2025-09-03 16:28:23 -07:00
zeertzjq
17da1ad8f4 vim-patch:9.1.1730: filetype: vivado journal/log files are not recognized (#35613)
Problem:  filetype: vivado journal/log files are not recognized
Solution: Detect vivado*.{jou,log} as tcl filetype (Wu Zhenyu).

closes: vim/vim#18191

9a6cafdc1c

Also fix missing anchor in the pattern from the port of patch 9.1.1602.

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2025-09-04 07:16:47 +08:00
Fred Sundvik
f2536aa795 test: make it possible to test multiple screen string matches
Problem:
Currently it's only possible to test a single string match in the
screen, which makes it hard match multiple strings in the screen to
avoid having to compare the whole screen state.

It's also not possible to test if a string match is not found in the screen.

Solution:
Support an array of `any` matches and also support `none`, which does a
negative comparision.
2025-09-03 21:35:21 +03:00
Sean Dewar
bf5f7c1591 fix(window): don't add a hsep when out of room if global stl is off
Problem: a horizontal separator may be added to a window that doesn't need one
if there is no room when moving a different window.

Solution: only restore a hsep in winframe_restore when the global statusline is
enabled.
2025-09-03 18:34:37 +01:00
Evgeni Chasnovski
431004dda2 fix: screenchar()/screenstring() with hidden floating windows #35560 2025-09-02 11:21:19 -07:00
Shadman
79bfeecdb4 feat(editor)!: insert-mode ctrl-r should work like paste #35477
Problem:
insert-mode ctrl-r input is treated like raw user input, which is almost
never useful. This means any newlines in the input are affected by
autoindent, etc., which is:
- slow
- usually breaks the formatting of the input

Solution:
- ctrl-r should be treated like a paste, not user-input.
- does not affect `<c-r>=`, so `<c-r>=@x` can still be used to get the
  old behavior.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-09-01 21:05:16 -07:00
Shadman
8a12a01466 feat(progress): better default format + history sync #35533
Problem:
The default progress message doesn't account for
message-status. Also, the title and percent sections don't get written
to history. And progress percent is hard to find with variable length messages.

Solution:
Apply highlighting on Title based on status. And sync the formated msg
in history too. Also updates the default progress message format to
{title}: {percent}% msg
2025-09-01 15:13:21 -07:00
Justin M. Keyes
d8a8825679 feat(lua): vim.wait() returns callback results #35588
Problem:
The callback passed to `vim.wait` cannot return results directly, it
must set upvalues or globals.

    local rv1, rv2, rv3
    local ok = vim.wait(200, function()
      rv1, rv2, rv3 = 'a', 42, { ok = { 'yes' } }
      return true
    end)

Solution:
Let the callback return values after the first "status" result.

    local ok, rv1, rv2, rv3 = vim.wait(200, function()
      return true, 'a', 42, { ok = { 'yes' } }
    end)
2025-09-01 13:26:46 -07:00
Yi Ming
6888f65be1 feat(lsp): vim.lsp.inline_completion on_accept #35507 2025-09-01 08:46:29 -07:00
Volodymyr Chernetskyi
06df337617 vim-patch:9.1.1718: filetype: kubectl config file is not recognized #35583
Problem:  filetype: kubectl config file is not recognized
Solution: Detect .kube/kubectl as yaml filetype
          (Volodymyr Chernetskyi).

References:
- https://kubernetes.io/docs/reference/kubectl/kuberc/

closes: vim/vim#18169

6cd6857cbe
2025-09-01 08:16:43 -07:00
Volodymyr Chernetskyi
8fc1db043a vim-patch:9.1.1717: filetype: AWS cli alias file is not recognized #35581
Problem:  filetype: AWS cli alias file is not recognized
Solution: Detect .aws/cli/alias as confini filetype
          (Volodymyr Chernetskyi).

References:
- https://docs.aws.amazon.com/cli/v1/userguide/cli-usage-alias.html

related: vim/vim#18169

be0589f1d2
2025-09-01 08:16:34 -07:00
Riley Bruins
77e3efecee feat(lsp): support textDocument/onTypeFormatting (#34637)
Implements [on-type
formatting](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#textDocument_onTypeFormatting)
using a `vim.on_key()` approach to listen to typed keys. It will listen
to keys on the *left hand side* of mappings. The `on_key` callback is
cleared when detaching the last on-type formatting client. This feature
is disabled by default.

Co-authored-by: Maria José Solano <majosolano99@gmail.com>
2025-08-31 14:09:12 -07:00
zeertzjq
6a330f893b fix(lua): report error in Lua Funcref callback properly (#35555) 2025-08-31 06:44:23 +08:00
Volodymyr Chernetskyi
c333d64663 vim-patch:9.1.1709: filetype: kyaml files are not recognized
Problem:  filetype: kyaml files are not recognized
Solution: Detect *.kyml files as yaml filetype
          (Volodymyr Chernetskyi)

References:
- https://kubernetes.io/blog/2025/08/27/kubernetes-v1-34-release/#alpha-support-for-kyaml-a-kubernetes-dialect-of-yaml

closes: vim/vim#18158

d5c89cc6bb

Co-authored-by: Volodymyr Chernetskyi <19735328+chernetskyi@users.noreply.github.com>
2025-08-30 11:58:00 +02:00
zeertzjq
4edeaaa6e2 vim-patch:partial:9.1.1708: tests: various tests can be improved (#35548)
Problem:  tests: various tests can be improved
Solution: Use string interpolation to concatenate strings in
          test_winfixbuf, check for specific errors in assert_fails()
          (Yegappan Lakshmanan)

closes: vim/vim#18151

97ea879b9b

Cherry-pick Test_file_perm.vim changes from patch 9.0.{0363,0611}.
Skip Test_colornames_assignment_and_unassignment().

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2025-08-30 08:55:48 +08:00
zeertzjq
68a2e0ef78 vim-patch:9.1.1713: filetype: fvwm2m4 files are no longer detected
Problem:  filetype: fvwm2m4 files are no longer recognized
          (after 9.1.1687).
Solution: Add a special case in m4 filetype detection (zeertzjq).

closes: vim/vim#18146

5355e81868

Co-authored-by: Damien Lejay <damien@lejay.be>
2025-08-30 06:57:09 +08:00
zeertzjq
61712cbc3a vim-patch:9.1.1697: tests: no test for aclocal.m4
Problem:  tests: no test for aclocal.m4
          (after v9.1.1693)
Solution: Add a test that aclocal.m4 is detected as config filetype

related: vim/vim#18065

f5670a1596

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-08-30 06:57:09 +08:00