Commit Graph

33814 Commits

Author SHA1 Message Date
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
e084a99040 vim-patch:9.1.1751: potential buffer-overflow in find_pattern_in_path() (#35705)
Problem:  potential buffer-overflow in find_pattern_in_path()
Problem:  Verify ptr p has enough room before adding ins_compl_len()

fixes: vim/vim#18195
closes: vim/vim#18249

21ecb0d2e2

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-09-10 09:39:18 +00:00
zeertzjq
014c3bad8a refactor(lua): fix coverity warning from #35536 (#35703) 2025-09-10 17:14:50 +08:00
zeertzjq
16018b1117 Merge pull request #35577 from janlazo/vim-8.1.1751
vim-patch:8.1.{1751,1920,1940},9.0.0729
2025-09-10 12:58:33 +08:00
Jan Edmund Lazo
681ec17b50 vim-patch:8.1.1940: script tests fail
Problem:    Script tests fail.
Solution:   Don't set vimvars type in set_vim_var_nr().

34ed68d40e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-09-09 23:45:56 -04:00
Jan Edmund Lazo
58ee249c2c vim-patch:9.0.0729: the rightleft and arabic features are disabled
Problem:    The rightleft and arabic features are disabled.
Solution:   Re-enable the features, some users want to use the functionality.

ae906c8b1b

bug-reports -> bug-report

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-09-09 23:45:44 -04:00
Jan Edmund Lazo
f7c86742e7 vim-patch:8.1.1920: cannot always close a popup when filter consumes all events
Problem:    Cannot close a popup by the X when a filter consumes all events.
Solution:   Check for a click on the close button before invoking filters.
            (closes vim/vim#4858)

f63962378d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-09-09 23:45:43 -04:00
Jan Edmund Lazo
89e2f346a8 vim-patch:8.1.1751: when redrawing popups plines_win() may be called often
Problem:    When redrawing popups plines_win() may be called often.
Solution:   Pass a cache to mouse_comp_pos().

9d5ffceb3f

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-09-09 23:45:43 -04:00
zeertzjq
856d2a7892 refactor: remove cmdline_pum_create() return value (#35701) 2025-09-10 08:39:08 +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
739fc26d77 vim-patch:80981e1: runtime(doc): mention 'findfunc' at :h :find (#35697)
fixes: vim/vim#18250
related: vim/vim#18253

80981e1db9

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-09-10 07:02:53 +08:00
bfredl
b95aedeae4 Merge pull request #35536 from bfredl/skipahead
perf(highlight): allow decoration providers to skip ranges without data

fixes #35644
2025-09-09 20:53:31 +02:00
bfredl
5119c03be7 fix(treesitter): use subpriorities for tree ordering
This partially reverts 0b8a72b739,
that is unreverts 15e77a56b7

"priority" is an internal neovim concept which does not occur in shared
queries. Ideally a single priority space should eventually be enough
for our needs. But as we don't want to poke at the usages of
priorities right now in the wider ecosystem,
introduce the "subpriorities" so that treesitter code can distinguish
highlights of the same priorities with different tree nesting depth.

This mainly affects `injection.combined` as parent-tree nodes might appear
in the middle of child-tree nodes which otherwise is not possible.
2025-09-09 12:56:49 +02:00
bfredl
f9d2115a35 perf(highlight): allow decoration providers to skip ranges without data
Continuing the work of #31400

That PR allowed the provider to be invoked multiple times per line.
We want only to do that when there actually is more data later on the
line. Additionally, we want to skip over lines which contain no new
highlight items. The TS query cursor already tells us what the next
position with more data is, so there is no need to reinvoke the range
callback before that.

NB: this removes the double buffering introduced in #32619 which
is funtamentally incompatible with this (nvim core is supposed to keep
track of long ranges by itself, without requiring a callback reinvoke
blitz). Need to adjust the priorities some other way to fix the same issue.
2025-09-09 12:54:04 +02:00
zeertzjq
d15936f6ef Merge pull request #35693 from zeertzjq/vim-6bb16d2
vim-patch: Python syntax updates
2025-09-09 12:40:12 +08:00
zeertzjq
12868474db vim-patch:77cfc49: runtime(python): highlight ellipsis literals
The ellipsis literal (`...`) can be used in multiple contexts:

- Placeholders:     `class Foo: ...`
- Containers:       `Tuple[int, ...]`
- Assignments:      `x = ...`

This is a trickier pattern to match because we can't rely on keyword
boundaries, so we instead look for exactly three dots (`...`).

This does mean that we will match the `...` portion of `x...x`, which
isn't valid Python syntax, but I think that's an acceptable trade-off
that avoids making this pattern much more complex.

Reference:
- https://docs.python.org/3/library/constants.html#Ellipsis

closes: vim/vim#18107

77cfc49060

Co-authored-by: Jon Parise <jon@indelible.org>
2025-09-09 11:39:23 +08:00
zeertzjq
53e78bec7c vim-patch:6bb16d2: runtime(python): Update syntax file, fix f-string float highlighting
Fix matching of floats at the beginning of an f-string replacement
field, immediately after the opening brace.

The existing pattern, using `\zs`, cannot consume the already matched
`{` so use a lookbehind instead.

See comment: https://github.com/vim/vim/pull/17962#issuecomment-3201550443

closes: vim/vim#18220

6bb16d2cee

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-09-09 11:37:12 +08: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
c951fa9eeb Merge pull request #35690 from zeertzjq/vim-9.1.1738
vim-patch:9.1.{1738,1744},d7d6a6f
2025-09-09 09:14:43 +08:00
notomo
bbfcde3ab2 fix(lsp): check if buffer is valid in scheduled client:on_attach() #35672
Problem:
lsp._capability.is_enabled() can raise error if buffer is invalid in client:on_attach().

- error
```
./build/bin/nvim --clean --headless +"source ./minimal.lua"
vim.schedule callback: ...omo/workspace/neovim/runtime/lua/vim/lsp/_capability.lua:209: scoped variable: Invalid buffer id: 2
stack traceback:
        [C]: in function '__index'
        ...omo/workspace/neovim/runtime/lua/vim/lsp/_capability.lua:209: in function 'is_enabled'
        ...e/notomo/workspace/neovim/runtime/lua/vim/lsp/client.lua:1108: in function <...e/notomo/workspace/neovim/runtime/lua/vim/lsp/client.lua:1101>
```
- reproduction minimal.lua
```lua
vim.opt.runtimepath:append("/path/to/nvim-lspconfig/")
vim.lsp.enable("lua_ls")

vim.cmd.tabedit("runtime/lua/vim/_defaults.lua")
vim.api.nvim_create_autocmd({ "LspAttach" }, {
  group = vim.api.nvim_create_augroup("test", {}),
  callback = function()
    vim.cmd.tabedit("runtime/lua/vim/_defaults.lua")
    local bufnr = vim.api.nvim_get_current_buf()
    vim.api.nvim_buf_delete(bufnr, { force = true })
  end,
})
```

Solution:
Check whether buffer is valid.
2025-09-08 17:52:25 -07:00
zeertzjq
327a2d57eb vim-patch:d7d6a6f: runtime(doc): Improve doc for cmdline-autocompletion
- Address https://github.com/vim/vim/pull/18219#issuecomment-3264634710
- Make the cmdline-autocompletion help more user friendly

closes: vim/vim#18245

d7d6a6f05a

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-09-09 08:30:34 +08: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
Justin M. Keyes
1cb1cfead0 docs: drop "xx.vim" syntax help-tags #35623
Problem:
These "foo.vim" syntax tags add 100+ useless tags to help. In
particular, "progress.vim" is the first match for "progress", which not
the result anyone is actually looking for, since Nvim 0.12 gained the
"progress-message" feature.

Solution:
Drop the "foo.vim" syntax tags. The "ft-foo" tags are more appropriately
named.
2025-09-07 20:45:22 -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
f0bf6d7647 Merge pull request #35673 from zeertzjq/vim-9.1.1676
vim-patch: cmdline completion fixes
2025-09-08 10:38:37 +08: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
zeertzjq
a16064ff29 vim-patch:partial:9.1.1639: completion: popup may be misplaced
Problem:  During commandline completiom, popup window placement can be
          incorrect when 'noselect' is present in 'wildmode'
          (Shane-XB-Qian)
Solution: Disable "showtail" feature when 'noselect' is present.

fixes: vim/vim#17969
closes: vim/vim#18001

1e38198a41

Partial port excluding the showtail change and the test.

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-09-08 09:02:36 +08:00
skewb1k
ad22d0ace9 fix(cjson): fix strbuf_set_length incorrectness #35565
`strbuf_set_length` was incorrectly updating
length with `+=` instead of assignment.

Also syncs minor updates with upstream.
2025-09-07 15:45:34 -07:00
Evgeni Chasnovski
0c49167490 docs: adjust *lua-plugin-init* wording #35600
Problem: Unnecessarily anecdotal wording.

Solution: Adjust wording while delivering the same message.
2025-09-07 15:04:09 -07: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
glepnir
2b156be19c refactor(api): redundant w_pos_changed assignment #35663
Problem: w_pos_changed flag was being set redundantly after win_config_float call

Solution: remove duplicate assignment since win_config_float already sets this flag internally
2025-09-07 10:11:32 -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
github-actions[bot]
fd59e72b47 docs: update version.c #35576
vim-patch:8.1.1919: using window options when passing a buffer to popup_create()
vim-patch:8.1.1954: more functions can be used as a method
vim-patch:8.1.1982: more functions can be used as methods
vim-patch:8.1.1986: more functions can be used as methods
vim-patch:8.1.1987: more functions can be used as methods
vim-patch:8.1.1993: more functions can be used as methods
vim-patch:8.1.1996: more functions can be used as methods
vim-patch:8.1.2004: more functions can be used as methods
vim-patch:8.1.2295: if buffer of popup is in another window cursorline sign shows

vim-patch:8.2.0568: the man filetype plugin overwrites the unnamed register
vim-patch:8.2.1186: with SGR mouse codes balloon doesn't show up after click
vim-patch:8.2.3539: GTK3: with 'rightleft' set scrollbar may move unintentionally
vim-patch:8.2.3681: cannot drag popup window after click on a status line
vim-patch:8.2.4561: build failure with some combination of features
vim-patch:8.2.4984: dragging statusline fails for window with winbar

vim-patch:9.0.0136: after CTRL-Left-mouse click a mouse scroll also has CTRL
vim-patch:9.0.0696: it is unclear if the +rightleft and +arabic features are used
vim-patch:9.0.0931: MS-Windows: mouse column limited to 223
vim-patch:9.0.1896: "below" virtual text doesn't work with 'rightleft'
2025-09-07 09:36:52 -07:00
zeertzjq
5f23ce732d Merge pull request #35664 from zeertzjq/vim-efb913a
vim-patch: runtime file updates
2025-09-07 22:00:54 +08:00
zeertzjq
4521f6da7d vim-patch:1ed2ff7: runtime(m4): Remove m4Type and leftover m4Function in syntax script
closes: vim/vim#18223

1ed2ff77d8

Co-authored-by: Damien Lejay <damien@lejay.be>
2025-09-07 21:22:52 +08:00
zeertzjq
91fa613fad vim-patch:6505dc6: runtime(nu): Add new Nushell runtime files
See: https://github.com/elkasztano/nushell-syntax-vim

Thanks to Pete Cruz (@Petesta) for promoting this addition.

closes: vim/vim#18208

6505dc69d3

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-09-07 21:22:12 +08:00