Compare commits

...

4069 Commits

Author SHA1 Message Date
zeertzjq
834e1181da Merge pull request #35545 from zeertzjq/vim-9.1.1687
vim-patch:9.1.{1687,1693,1697,1713}: m4 ft detection updates
2025-08-30 07:22:13 +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
zeertzjq
8a1afac653 vim-patch:9.1.1693: tests: test_filetype fails in shadow dir
Problem:  tests: test_filetype fails in shadow dir
          (after v9.1.9.1.1687)
Solution: Use a custom test that does not rely on configure.ac
          being existing in the upper directory tree.

de6e560150

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-08-30 06:57:09 +08:00
zeertzjq
dab31a3637 vim-patch:9.1.1687: filetype: autoconf filetype not always correct
Problem:  filetype: autoconf filetype not always correct
Solution: Detect aclocal.m4 as config filetype, detect configure.ac as
          config filetype, fall back to POSIX m4 (Damien Lejay).

closes: vim/vim#18065

2b55474f0a

Co-authored-by: Damien Lejay <damien@lejay.be>
2025-08-30 06:57:08 +08:00
bfredl
772f1966a3 Merge pull request #31400 from vanaigr/decor-provider-range
feat(decor): add range-based highlighting
2025-08-29 10:33:15 +02:00
zeertzjq
19f2e5c3eb vim-patch:b760062: runtime(debversions): Move bullseye, focal, and oracular to "unsupported" (#35531)
These versions have exited their standard support term as of
- bullseye: 2024-08-14
- focal: 2025-05
- oracular: 2025-07-10

closes: vim/vim#18134

b760062897

Co-authored-by: James McCoy <jamessan@jamessan.com>
2025-08-29 07:23:43 +08:00
Siddhant Agarwal
7a71235399 fix(server): serverlist({peer=true}) does not find peer servers #35506 2025-08-28 06:41:31 -07:00
Shadman
bc6737250d fix(progress): simplify ui-event, introduce default presentation #35527
Problem:
`msg_show` has "progress" info (title, status, percent) which is not presented
by default.

Solution:
Format TUI messages as `{title}: {msg}...{percent}%`. This also gets sent to UI.

- With specific formatting sent to UI we can remove the `progress` item from
  `msg_show` event. It can be added if needed in the future. Also, having
  a default presentation makes the feature more useful.
- For `vim._extui` we just need to implement the replace-msg-with-same-id
  behavior.
- If any UI/plugin wants to do anything fancier, they can handle the `Progress`
  event.
2025-08-28 06:33:41 -07:00
vanaigr
5edbabdbec perf: add on_range in treesitter highlighting 2025-08-28 08:22:38 -05:00
vanaigr
118e7e7111 test: add treesitter long lines benchmark 2025-08-28 08:22:38 -05:00
Christian Clason
c10e36fc01 refactor(lua): consistent use of local aliases 2025-08-28 11:34:01 +02:00
Meriel Luna Mittelbach
a33284c2c0 fix(health): accept TERM=tmux-direct #35511
tmux-direct is functionally the same as tmux-256color, except it
directly reports 24-bit color and how to set them (setaf/setab)
via ncurses 6.x's extended terminfo format.
2025-08-27 20:01:07 -07:00
Robert Muir
729111d3a3 fix(lsp): don't treat MarkedString[] with language id as empty #35518
Problem:
Hover response of MarkedString[] where the first element contains a
language identifier treated as empty.

Solution:
Fix empty check to handle case of MarkedString[] where the first element
is a pair of a language and value.
2025-08-27 18:51:30 -07:00
zeertzjq
2ac00f1350 vim-patch:9.1.1698: Some error numbers are not documented (#35522)
Problem:  Some error numbers are not documented
          (Restorer)
Solution: Document missing error numbers (Yegappan Lakshmanan).

fixes: vim/vim#18114
closes: vim/vim#18135

5e27058fc4

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2025-08-28 00:15:06 +00:00
zeertzjq
24020ef2dd vim-patch:9.1.1700: Multiline ignorecase specific pattern does not match with 'ignorecase' (#35520)
Problem:  a pattern that involves a backref on a different line does not
          match when 'ignorecase' is set (QiWei, after v9.1.0645)
Solution: Use MB_STRNICMP when ignorecase is set, fix tests to close
          swapfiles

related: vim/vim#14756
fixes: vim/vim#17470
closes: vim/vim#18104

bf82e58a70

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-08-28 07:35:22 +08:00
zeertzjq
9512aac42a Merge pull request #35519 from zeertzjq/vim-9.1.1701
vim-patch:9.1.{1701,1702}
2025-08-28 07:26:34 +08:00
zeertzjq
a3b1159949 vim-patch:9.1.1702: tests: test_edit still fails on CI
Problem:  tests: test_edit still fails on CI
          (after v9.1.1701)
Solution: Fix the skip condition

42acf736a3

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-08-28 06:58:10 +08:00
zeertzjq
c961361406 vim-patch:9.1.1701: tests: failure on CI with GUI and ASAN in test_edit.res
Problem:  tests: failure on CI with GUI and ASAN in test_edit.res
          (Hirohito Higashi)
Solution: Disable the test for that specific situation in CI, close
          swapfiles

fixes: vim/vim#18070

6c14c4625b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-08-28 06:57:52 +08:00
Justin M. Keyes
bcf952e85f Merge #35505 from ofseed/lsp-fix-autocomplete 2025-08-27 13:33:17 -04:00
phanium
cd7cf4bd16 fix(extui): error on :call input('') (#35515)
Problem:  Error on empty string prompt.
Solution: (prompt .. '\n'):gmatch('(.-)\n').
2025-08-27 17:12:17 +02:00
Yi Ming
db1b7f7412 fix(lsp): update completion items on TextChangedP 2025-08-27 20:40:35 +08:00
Yi Ming
6c3e9b5573 fix(lsp): update on CursorHoldI cause users unable to select() 2025-08-27 20:38:49 +08:00
Yi Ming
6005fcf671 fix(lsp): opts.wrap always true 2025-08-27 20:02:42 +08:00
zeertzjq
9269a1da35 fix(floatwin): handle viewport width properly at end of window (#35490)
Also avoid repeated calls of compute_foldcolumn().
2025-08-27 19:27:50 +08:00
zeertzjq
117b129378 vim-patch:9.1.1694: filetype: Buck eXtension Lang files are not recognized (#35504)
Problem:  filetype: Buck eXtension Lang files are not recognized
Solution: Detect *.bxl files as bzl filetype.
          (Jade Lovelace)

References:
- https://buck2.build/docs/bxl/

closes: vim/vim#18130

3aea867b27

Co-authored-by: Jade Lovelace <jadel@mercury.com>
2025-08-27 12:23:31 +08:00
zeertzjq
6014174b71 vim-patch:3571388: runtime(lf): update syntax to support lf version r37 (#35503)
Adds the lf release 37 specific syntax highlighting changes.

From the PR andis-sprinkis/lf-vim#23 by @CatsDeservePets

closes: vim/vim#18115

3571388ded

Co-authored-by: Andis Spriņķis <andis@sprinkis.com>
2025-08-27 12:23:17 +08:00
zeertzjq
3586e047e6 vim-patch:9.1.1695: Need more Vim script specific tests (#35500)
Problem:  Need more Vim script specific tests
Solution: Add more tests (Yegappan Lakshmanan).

closes: vim/vim#18118

e810ba5a1f

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2025-08-27 10:18:10 +08:00
zeertzjq
b116ed7b12 vim-patch:9.1.1690: Missing recursion guard in dos/unix_expandpath() (#35499)
Problem:  Missing recursion guard in dos/unix_expandpath()
Solution: Add guard variables (ashamedbit)

fixes: vim/vim#18099
closes: vim/vim#18106

e8948a1f80

Co-authored-by: ashamedbit <muralianiruddhan@gmail.com>
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-08-27 10:17:30 +08:00
zeertzjq
443278c587 refactor: rename ga_concat_strings_sep() to ga_concat_strings() (#35498)
This adds a missing change from Vim patch 7.4.279.

N/A patch:
vim-patch:9.1.1691: over-allocation in ga_concat_strings()
2025-08-27 10:17:12 +08:00
zeertzjq
4263ec21c2 vim-patch:9.1.1688: potential buffer overrun in bufwrite.c (#35497)
Problem:  potential buffer overrun in bufwrite.c
Solution: Use a temporary variable (John Marriott)

In my Windows 11 Pro 64-bit build MAXPATHL is 1024 and IOSIZE is 1025.
In my Archlinux Linux 64-bit build MAXPATHL is 4096 and IOSIZE is 1025.

In funuction buf_write():
There is a check (line 713) that makes sure the length of fname is less
than MAXPATHL. There is a call to STRCPY() (line 1208) which copies the
string at fname into IObuff (which has size IOSIZE). For Unix builds
fname is set to sfname which may or may not be shorter. However, if
sfname is NULL sfname is set to fname.

Therefore, in builds where MAXPATHL > IOSIZE (eg in my linux build), it
is theoretically possible for the STRCPY() call to exceed the bounds of
IObuff.

This PR addresses this by copying fname into a local variable that has
the same maximum size as fname.

In addition:
Given that the filename is unconditionally overwritten in the for loop,
only copy the directory portion of fname. Move variable i closer to
where it is used.

closes: vim/vim#18095

a19b019b87

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-08-27 10:16:59 +08:00
zeertzjq
c741927883 vim-patch:9.1.1689: CmdlineChanged not triggered by <Del> (#35496)
Problem:  CmdlineChanged not triggered by <Del>
Solution: Use STRCMP() instead of STRNCMP()
          (Shougo Matsushita)

closes: vim/vim#18101

540480697d

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2025-08-27 10:16:44 +08:00
zeertzjq
8f78591f9a fix(column): wrong alignment and highlight with empty 'display' (#35495)
This fixes a regression from #26961.
2025-08-27 10:16:13 +08:00
Shadman
8b171852a9 feat(api): nvim_echo can emit Progress messages/events #34846
Problem:
Nvim does not have a core concept for indicating "progress" of
long-running tasks. The LspProgress event is specific to LSP.

Solution:
- `nvim_echo` can emit `kind="progress"` messages.
  - Emits a `Progress` event.
  - Includes new fields (id, status, percent) in the `msg_show` ui-event.
  - The UI is expected to overwrite any message having the same id.
- Messages have a globally unique ID.
  - `nvim_echo` returns the message ID.
- `nvim_echo(… {id=…})` updates existing messages.

Example:

    local grp = vim.api.nvim_create_augroup("Msg", {clear = true})
    vim.api.nvim_create_autocmd('Progress', {
      pattern={"term"},
      group = grp,
      callback = function(ev)
        print(string.format('event fired: %s', vim.inspect(ev))..'\n')
      end
    })

    -- require('vim._extui').enable({enable=true, msg={target='msg', timeout=1000}})
    vim.api.nvim_echo({{'searching'}}, true, {kind='progress',  percent=80, status='running', title="terminal(ripgrep)"})
    local id = vim.api.nvim_echo({{'searching'}}, true, {kind='progress', status='running', percent=10, title="terminal(ripgrep)"})
    vim.api.nvim_echo({}, true, {id = id, kind='progress', percent=20, status = 'running', title='find tests'})
    vim.api.nvim_echo({}, true, {id = id, kind='progress', status='running', percent=70})
    vim.api.nvim_echo({{'complete'}}, true, {id = id, kind='progress', status='success', percent=100, title="find tests"})

Followups:
- Integrate with 'statusline' by listening to the Progress autocmd event.
- Integrate progress ui-event with `vim._extui`.
2025-08-26 13:48:53 -07:00
Sean Dewar
1e1619de83 fix(eval): winnrs of unfocusable/hidden windows #35474
Problem: various functions may return incorrect window numbers for unfocusable
or hidden windows.

Solution: fix the checks. Make sure current windows in non-current tabpages have
a window number.

Fixes #35453
2025-08-26 13:13:05 -07:00
Sean Dewar
6a409e0507 fix(terminal): don't trigger TextChangedT for unrelated redraws
Problem: TextChangedT fires depending on whether Nvim needs to update_screen
while in terminal mode. This makes little sense as redraws can be completely
unrelated to the terminal. Also, TextChanged could be fired from changes in
terminal mode after returning to normal mode.

Solution: trigger it when b:changedtick changes, like other such events. Happens
when invalid cells are refreshed, though is no longer affected by cursor
changes. Don't fire TextChanged from changes in terminal mode after leaving.

Unlike the other TextChanged* events, I've elected to not have it be influenced
by typeahead. Plus, unlike when leaving insert mode when no TextChangedI events
are defined, I don't trigger TextChanged when returning to normal mode from
changes in terminal mode (is that a Vim bug?)

Curiously, Vim's TextChangedT is different; it's tied to its terminal cursor
redraws, which triggers pretty eagerly (but is unaffected by unrelated redraws)
- usually *twice* when data is sent to the terminal (regardless of whether it
causes any visible changes, like incomplete escape codes; wasn't true for Nvim).

Not clear to me how this event was actually intended to work, but this seems to
make the most sense to me.
2025-08-26 09:49:12 +01:00
Sean Dewar
e6ba78919c fix(terminal): possibly wrong wrow/wcol in active terminal
Problem: w_wrow/col calculation in terminal_check_cursor is wrong when the
terminal is smaller than the window. Common when there's a larger window open
with the same terminal, or just after a resize (as refresh_size is deferred).

Solution: don't calculate it; validate_cursor will correct it later if it's
out-of-date.

Note that the toplines set for the terminal (also before this PR) assume
'nowrap' (which is set by default for terminal windows), and that no weird stuff
like filler lines are around. That means, for example, it's possible for the
cursor to be moved off-screen if there's wrapped lines. If this happens, it's
likely update_topline will move the cursor back on screen via validate_cursor or
similar, but maybe this should be handled more elegantly in the future?
2025-08-26 09:49:12 +01:00
Sean Dewar
c845f1923d fix(terminal): patch various autocommand-related holes
Problem: autocommands can cause various problems in terminal mode, which can
lead to crashes, for example.

Solution: fix found issues. Move some checks to terminal_check and guard against
autocommands messing with things. Trigger TermEnter/Leave after terminal mode
has changed/restored most state. Wipeout the correct buffer if TermLeave
switches buffers and fix a UAF if it or WinScrolled/Resized frees the terminal
prematurely.

These changes also allow us to remove the buffer restrictions on TextChangedT;
they were inadequate in stopping some issues, and WinScrolled/Resized was
lacking them anyway.
2025-08-26 09:49:12 +01:00
Sean Dewar
b7124ae768 fix(terminal): update winopts and focus when switching terminals
Problem: window options and terminal focus notifications not updated when
switching terminals without leaving terminal mode.

Solution: update them.
2025-08-26 09:49:12 +01:00
Sean Dewar
d07cbb2f42 fix(terminal): check size when creating new tabpage
Problem: when creating a new tabpage with a terminal window, terminal size is
not updated if there is no statusline.

Solution: do not rely on last_status to implicitly call terminal_check_size as a
side effect of making room for a statusline; call it directly.
2025-08-26 09:49:12 +01:00
Sean Dewar
61217e3618 fix(terminal): avoid events messing up topline of focused terminal
Problem: topline of a focused terminal window may not tail to terminal output if
events scroll the window.

Solution: set the topline in terminal_check_cursor.
2025-08-26 09:49:12 +01:00
Sean Dewar
ad1dfc92a0 fix(terminal): add various missing redraws
Problem: missing redraws when restoring saved cursorline/column, plus missing
statusline and mode redraws when not updating the screen in terminal mode.

Solution: schedule the redraws in a similar manner to other modes and remove
some now unnecessary redrawing logic. Redraw if cursorline-related options
change from entering terminal mode. This fixes test failures in later commits.

WTF: TextChangedT triggers based on must_redraw, which is... fun...? Try to
preserve its behaviour as much as we can for now.
2025-08-26 09:49:12 +01:00
Sean Dewar
5e521c3b5a fix(terminal): avoid tailed cursor in focused terminal in events
Problem: in terminal mode, adjust_topline moves curwin's cursor to the last row
so set_topline tails the non-scrollback area. This may result in the observed
cursor position remaining tailed in events within the focused terminal, rather
than reflecting the actual cursor position.

Solution: use the focused terminal's actual cursor position immediately, rather
than relying on the next terminal_check_cursor call in terminal_check to set it.

Note: Maybe also possible for terminal mode cursor position to be stale
(reporting the normal mode position) when switching buffers in events to another
terminal until the next terminal_check call? (or until refresh_terminal is
called for it) Maybe not worth fixing that, though.
2025-08-26 09:49:12 +01:00
Jan Edmund Lazo
088ba835ed vim-patch:8.2.0845: text properties crossing lines not handled correctly (#35483)
Problem:    Text properties crossing lines not handled correctly.
Solution:   When joining lines merge text properties if possible.
            (Axel Forsman, closes vim/vim#5839, closes vim/vim#5683)

87be9be1db

Port docs from patch v8.1.0688.
Rewrite docs for ml_replace_buf_len().

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-26 12:54:13 +08:00
zeertzjq
821bfc02fb vim-patch:9.1.1685: Missing changes from PR 18068 (#35482)
Problem:  Missing changes from PR 18068
Solution: Include the missing changes
          (Girish Palya)

c6a0f42cdb

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-26 07:24:21 +08:00
zeertzjq
516363e6ba test: increase timeout in 'autocompletedelay' test (#35467)
Change timeout from 200ms to 400ms, which is still 100ms lower than the
'autocompletedelay' value.
2025-08-25 15:33:54 +08:00
Jan Edmund Lazo
5f3d00a5a6 vim-patch:8.1.2371: FEAT_TEXT_PROP is a confusing name (#35466)
Problem:    FEAT_TEXT_PROP is a confusing name.
Solution:   Use FEAT_PROP_POPUP. (Naruhiko Nishino, closes vim/vim#5291)

05ad5ff0ab

textprop,popuwin remain N/A features.
getchar.c has the relevant code changes.

Port runtest.vim changes from patch v8.1.1561.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-25 15:16:16 +08:00
Justin M. Keyes
58060c2340 Merge #33972 feat(lsp): textDocument/inlineCompletion 2025-08-24 22:17:34 -04:00
Yi Ming
42f244bf18 fix(lsp): check whether buffer is valid when scheduled #35461 2025-08-24 18:59:56 -07:00
Yi Ming
0e70aa0e86 feat(lsp): support textDocument/inlineCompletion 2025-08-25 09:48:27 +08:00
Justin M. Keyes
bccec33f5a docs: misc #35459 2025-08-24 23:43:48 +00:00
zeertzjq
b2a136bd67 Merge pull request #35445 from janlazo/vim-9.1.0546
vim-patch:8.1.{579,654,655},9.1.0546
2025-08-25 07:36:59 +08:00
Maria José Solano
1f63735f17 fix(lsp): treat nil inlay hint result as empty array (#35458)
`gopls` seems to send a nil result when there are no inlay hints for the
buffer. [The protocol](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_inlayHint)
allows for the server to send an array or nil, and it isn't clear what
nil should represent. I think it's reasonable to treat it as an empty
array though.
2025-08-24 15:46:08 -07:00
Jan Edmund Lazo
76729a2044 vim-patch:8.1.0655: when appending a line text property flags are not added
Problem:    When appending a line text property flags are not added.
Solution:   Add text properties to a newly added line.

b56ac049ea

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-24 18:43:18 -04:00
Jan Edmund Lazo
b5e20d7dff vim-patch:8.1.0654: when deleting a line text property flags are not adjusted
Problem:    When deleting a line text property flags are not adjusted.
Solution:   Adjust text property flags in preceding and following lines.

c1a9bc1a72

"textprop" feature remains N/A.
Porting to sync ml_delete_int() with Vim 8.2.0845 and later.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-24 11:00:01 -04:00
Jan Edmund Lazo
5a14a2679d vim-patch:8.1.0579: cannot attach properties to text
Problem:    Cannot attach properties to text.
Solution:   First part of adding text properties.

98aefe7c32

"textprop" feature remains N/A.
Porting for ml_replace_len().

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-24 10:56:05 -04:00
Yi Ming
40f5115ac4 fix(lua): disable strict_indexing when converting LSP positions 2025-08-24 21:02:02 +08:00
zeertzjq
6018aed92f Merge pull request #35454 from zeertzjq/vim-f66674c
vim-patch: runtime file updates
2025-08-24 20:40:06 +08:00
zeertzjq
98407a8b91 vim-patch:99964e2: runtime(python): support 'type's soft keyword form
`type` became a soft keyword in Python 3.12. In that form, it is a
statement that declares a type alias:

    # type_stmt ::= 'type' identifier [type_params] "=" expression
    type Point = tuple[float, float]

To implement support for this, this change does three things:

1. adds a `pythonType` group (linked to `Type`)
2. matches `type` followed by an identifier as `pythonStatement`
3. continues to match `type` in other forms as `pythonBuiltin`

Ref:
- https://docs.python.org/3/reference/lexical_analysis.html#soft-keywords
- https://docs.python.org/3/reference/simple_stmts.html#the-type-statement

closes: vim/vim#18090

99964e2ea7

Co-authored-by: Jon Parise <jon@indelible.org>
2025-08-24 20:09:33 +08:00
zeertzjq
e12eca77ee vim-patch:e06d81f: runtime(sh): add syntax highlighting support for ${ cmd;} and ${|cmd;}
bash 5.3 (released July 2025) added support for ${ cmd;} and
${|cmd;} style command substitution, which is similar (but not
identical) to ksh/mksh.

closes: vim/vim#18084

e06d81fe67

Co-authored-by: Kevin Pulo <kevin.pulo@mongodb.com>
2025-08-24 20:09:02 +08:00
zeertzjq
53802da38b vim-patch:f66674c: runtime(fstab): Added mtab support to fstab syntax.
closes: vim/vim#18074

f66674cf42

Co-authored-by: Radu Dineiu <radu.dineiu@gmail.com>
2025-08-24 20:08:15 +08:00
Yi Ming
62b45b8fe4 feat(lua): conversion between extmark positions 2025-08-24 19:38:38 +08:00
Yi Ming
7499c9f9a7 feat(lua): conversion between cursor positions 2025-08-24 19:38:38 +08:00
Yi Ming
a4a690e597 docs(lua): mark vim.Pos.Optional as optional 2025-08-24 19:38:38 +08:00
zeertzjq
523371b044 vim-patch:9.1.1681: tests: no test for actually moving cursor with 'acl' (#35452)
Problem:  tests: no test for actually moving cursor when menu is not
          open with 'autocompletedelay'.
Solution: Use <Up> first in the test. Also remove two unnecessary <Esc>s
          in completion timeout test (zeertzjq).

closes: vim/vim#18097

e8b99ff6d5
2025-08-24 11:33:44 +00:00
zeertzjq
0b8a9bde0e fix(diff): set default diff flags properly (#35450) 2025-08-24 14:42:10 +08:00
zeertzjq
810a234978 vim-patch:9.1.1672: completion: cannot add timeouts for 'cpt' sources (#35447)
Problem:  completion: cannot add timeouts for 'cpt' sources
          (Evgeni Chasnovski)
Solution: Add the 'autocompletetimeout' and 'completetimeout' options
          (Girish Palya)

fixes: vim/vim#17908
closes: vim/vim#17967

69a337edc1

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-24 13:16:55 +08:00
Jan Edmund Lazo
17601e709f vim-patch:9.1.0546: vim-tiny fails on CTRL-X/CTRL-A
Problem:  vim-tiny fails on CTRL-X/CTRL-A
          (Rob Foehl, after 9.1.0172)
Solution: Move #ifdefs, so that after changing the line in del_bytes,
          the cached textlen value is invalidated

closes: vim/vim#15178

03acd4761b

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-08-23 23:47:26 -04:00
Yochem van Rosmalen
c1fa3c7c37 feat(gen_help_html): generate helptags.json, helptag.html #35442
Problem:
No way to know the html page with the docs of a tag when you only have
the tag name.

Solution:
Generate a helptags.json that maps tags to their locations.
Generate a helptag.html page that redirects to the HTML page of the given tag.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-08-23 15:04:52 -07:00
Riley Bruins
29c5559ce1 fix(treesitter): show capture-level priorities in :Inspect #35443 2025-08-23 12:01:38 -07:00
github-actions[bot]
faff3617ba docs: update version.c #35411
vim-patch:8.2.0082: when reusing a buffer listeners are not cleared
vim-patch:8.2.0446: listener with undo of deleting all lines not tested
vim-patch:8.2.1092: not checking if saving for undo succeeds
vim-patch:8.2.3174: Vim9: "legacy undo" finds "undo" variable
vim-patch:8.2.3426: crash when deleting a listener in a listener callback
vim-patch:8.2.4142: build failure with normal features without persistent undo

vim-patch:9.0.0361: removing a listener may result in a memory leak
2025-08-23 11:59:34 -07:00
zeertzjq
ed40d89d7c Merge pull request #35427 from zeertzjq/vim-9.1.1638
vim-patch: 'autocompletedelay'
2025-08-23 21:24:17 +08:00
zeertzjq
963ead29d9 vim-patch:9.1.1670: completion: autocomplete breaks second completion
Problem:  completion: autocomplete breaks second completion
          (gravndal)
Solution: Fix the autocomplete bug (Girish Palya)

fixes: vim/vim#18044
closes: vim/vim#18068

b4e0bd93a9

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-23 20:40:59 +08:00
zeertzjq
1c0465bec6 vim-patch:5ca1ea8: runtime(doc): Tweak documentation style
closes: vim/vim#18078

5ca1ea83ad

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-08-23 20:40:59 +08:00
zeertzjq
6ef996a082 vim-patch:9.1.1657: Autocompletion adds delay
Problem:  Autocompletion adds delay
          (gcanat, char101, after v9.1.1638)
Solution: Temporarily disable autocomplation (Girish Palya).

related: vim/vim#17960
fixes: vim/vim#18022
closes: vim/vim#18048

196c376682

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-23 20:40:59 +08:00
zeertzjq
4019d3050d vim-patch:9.1.1638: completion: not possible to delay the autcompletion
Problem:  completion: not possible to delay the autcompletion
Solution: add the 'autocompletedelay' option value (Girish Palya).

This patch introduces a new global option 'autocompletedelay'/'acl' that
specifies the delay, in milliseconds, before the autocomplete menu
appears after typing.

When set to a non-zero value, Vim waits for the specified time before
showing the completion popup, allowing users to reduce distraction from
rapid suggestion pop-ups or to fine-tune the responsiveness of
completion.

The default value is 0, which preserves the current immediate-popup
behavior.

closes: vim/vim#17960

a09b1604d4

N/A patch: vim-patch:9.1.1641: a few compiler warnings are output

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-23 20:40:58 +08:00
zeertzjq
639f9f4cda vim-patch:9.1.1667: Another outdated comment in eval.c (#35438)
Problem:  Another outdated comment in eval.c (after 9.1.1665).
Solution: Remove that comment as well. Add a few more tests for mapnew()
          that fail without patch 8.2.1672 (zeertzjq).

closes: vim/vim#18089

6b56711804
2025-08-23 10:35:18 +00:00
zeertzjq
b9699d5701 vim-patch:9.1.1665: Outdated comment in eval.c (#35436)
Problem:  Outdated comment in eval.c.
Solution: Remove the comment, which is no longer true after 8.2.1672.
          Also fix a typo in version9.txt (zeertzjq).

closes: vim/vim#18077

5d3c39af2a
2025-08-23 07:38:07 +08:00
glepnir
eeba0dc2ed fix: memory leak from double buffer initialization in read_stdin #35413
Problem: When stdin follows files, set_curbuf() initializes buffer via
enter_buffer(), then open_buffer() initializes again, causing memory leaks.

Solution: Use readfile() directly for new buffers already initialized by
enter_buffer(), only call open_buffer() for original buffer case.
2025-08-22 14:50:30 -07:00
Gregory Anders
586b1b2d9b feat(tui): add nvim_ui_send (#35406)
This function allows the Nvim core to write arbitrary data to a TTY
connected to a UI's stdout.
2025-08-22 15:05:43 -05:00
Justin M. Keyes
5d8e870c11 Merge #35429 vim.pack adjustments 2025-08-22 14:35:41 -04:00
bfredl
df9ff9cfa8 Merge pull request #35434 from bfredl/zigtag2
fix(build): workaround errors in zig build due to stale cache
2025-08-22 19:40:38 +02:00
bfredl
ec8a0c7340 fix(build): workaround errors in zig build due to stale cache
addDirectoryArg with a source dir is not enough to depend on changes
to invidiual files. as a workaround, mark this step as having
side-effects (always being run) for now.
2025-08-22 19:10:43 +02:00
Evgeni Chasnovski
1ffaaa06c5 docs(pack): document $XDG_DATA_HOME/nvim/site presence in 'packpath'
Problem: Some use cases might lead to `vim.pack.add()` failing to
`:packadd` a plugin because of missing entry in 'packpath'. Like with
`nvim --clean` or manually setting `$XDG_DATA_HOME` during startup.

Solution: Document it. A more proactive approach can be ensuring correct
'packpath' entry, but it is currently somewhat verbose to do (due to
having to adjust for Windows using `\` in 'packpath' entries).
2025-08-22 13:41:36 +03:00
Evgeni Chasnovski
7acfad226d test(pack): simplify tests for data field 2025-08-22 13:32:11 +03:00
Evgeni Chasnovski
92e7d5eaf2 perf(pack): reduce number of 'opt/' directory computations 2025-08-22 13:00:30 +03:00
tao
d73cfefed5 fix(folds): error when deleting lines at end of buffer #35396
Problem:
with `foldmethod=expr foldexpr=v:lua.vim.treesitter.foldexpr()
foldminlines=0`, deleting lines at the end of the buffer always
reports an invalid top error, because the top value (i.e. the
start line number of the deletion) is always 1 greater than
the total line number of the modified buffer.

Solution:
remove the ml_line_count validation
2025-08-21 19:55:45 -07:00
zeertzjq
12b6f65283 vim-patch:014d50d: runtime(systemverilog): Add syntax highlighting for 1800-2023 block strings (#35425)
closes: vim/vim#18056

014d50df80

Co-authored-by: Ayan Banerjee <ayanbanrj@gmail.com>
2025-08-22 09:26:47 +08:00
Igor Lacerda
8e48c02061 fix(lsp): handle array with empty string when checking empty hover (#35423) 2025-08-21 17:15:56 -07:00
zeertzjq
865a28155e vim-patch:8.2.1672: v_lock is used when it is not initialized (#35416)
Problem:    v_lock is used when it is not initialized. (Yegappan Lakshmanan)
Solution:   Initialize the typval in eval1().

4a091b9978

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-22 06:28:45 +08:00
Birdee
c522cb0e96 feat(pack): support user-defined data in plugin spec #35360
Problem:
The load function in opts was difficult to use if you wished to
customize based on the plugin being loaded.

You could get the name, but without some way to mark a spec, that was of
limited usefulness unless you wanted to hardcode a list of names in the
function, or write a wrapper around the whole thing

Solution:
Allow users to provide an arbitrary data field in plugin specs so that
they may receive info as to how to handle that plugin in load, get() and
events, and act upon it

Co-authored-by: BirdeeHub <birdee@localhost>
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
2025-08-21 10:08:29 -07:00
luukvbaal
9467731865 feat(extui): support paging in the dialog window (#35310)
Problem:  Unable to see e.g. `inputlist()` prompts that exceed the dialog
          window height.
          Multi-line prompts are not handled properly, and tracking
          is insufficient for messages in cmdline_block mode.
Solution: Add vim.on_key handler while the dialog window is open that
          forwards paging keys to the window.
          Properly render multi-line prompts. Keep track of both the start
          and end of the current cmdline prompt. Append messages after the
          current prompt in cmdline_block mode.
2025-08-21 14:56:59 +02:00
Cameron Ring
30dae87de4 fix(startup): file buf is lost if stdin is empty and "-" is last #35402
Problem:
Running `echo dummy | nvim file1 file2` closes the file1 buffer if
file1 doesn't exist.

Solution:
Logic changed in 43e8ec9 such that stdin buffer may now be created *after*
file args. Handle that case.
2025-08-20 20:34:49 -07:00
zeertzjq
a8dad46e1c Merge pull request #35352 from janlazo/vim-8.1.2008
vim-patch:8.1.2008,v8.2.{844,853,3348,3795,4379}
2025-08-21 11:31:31 +08:00
Jan Edmund Lazo
dc2d4b07a8 vim-patch:8.2.0853: ml_delete() often called with FALSE argument
Problem:    ml_delete() often called with FALSE argument.
Solution:   Use ml_delete_flags(x, ML_DEL_MESSAGE) when argument is TRUE.

ca70c07b72

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-20 21:46:35 -04:00
Jan Edmund Lazo
e77d15cc5d vim-patch:8.2.3348: line2byte() returns wrong value after adding textprop
Problem:    line2byte() returns wrong value after adding textprop. (Yuto
            Kimura)
Solution:   Reduce the length by the size of the text property. (closes vim/vim#8759)

14c7530c4f

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-20 21:46:35 -04:00
Jan Edmund Lazo
ed012b817d vim-patch:8.2.0844: text properties crossing lines not handled correctly
Problem:    Text properties crossing lines not handled correctly.
Solution:   When saving for undo include an extra line when needed and do not
            adjust properties when undoing. (Axel Forsman, closes vim/vim#5875)

ML_DEL_UNDO, ML_APPEND_UNDO are no-opt because textprop feature is N/A.

a9d4b84d97

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-20 21:45:49 -04:00
Jan Edmund Lazo
09964b7ef0 vim-patch:8.2.4379: an empty change is reported to a listener
Problem:    An empty change is reported to a listener.
Solution:   Do not report an empty change. (closes vim/vim#9768)  Remove unused
            return value.

55737c2a31

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-20 21:45:49 -04:00
Jan Edmund Lazo
15d3a83999 vim-patch:8.2.3795: too many #ifdefs
Problem:    Too many #ifdefs.
Solution:   Graduate the jumplist feature.

739f13a55b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-20 21:45:48 -04:00
Jan Edmund Lazo
d06fdecb97 vim-patch:8.1.2008: error for invalid range when using listener and undo
Problem:    Error for invalid range when using listener and undo. (Paul Jolly)
Solution:   Do not change the cursor before the lines are restored.
            (closes vim/vim#4908)

4544bd2f24

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-20 21:45:48 -04:00
zeertzjq
fbaead249b Merge pull request #35410 from zeertzjq/vim-308a313
vim-patch: doc updates
2025-08-21 09:15:20 +08:00
zeertzjq
7d53982b7f vim-patch:84a343a: runtime(doc): correct another problem in :h items()
The returned value is only in arbitrary order for a Dict.

closes: vim/vim#18050

84a343a6ed
2025-08-21 08:44:08 +08:00
zeertzjq
1fdacbb3e4 vim-patch:44c8072: runtime(doc): fix style and clarify items() function for String type
related: vim/vim#18021

44c8072ef6

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-08-21 08:44:08 +08:00
zeertzjq
049de6f119 vim-patch:partial:308a313: runtime(doc): Update help for the items() function
closes: vim/vim#18021

308a3130be

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2025-08-21 08:44:07 +08:00
Tiago Inaba
848c7a7894 fix(lsp): update window title when cycling through signatures #35407 2025-08-20 11:09:16 -07:00
github-actions[bot]
cd2d5de1f9 docs: update version.c #35201
vim-patch:8.1.1555: NOT_IN_POPUP_WINDOW is confusing
vim-patch:8.1.1586: error number used in two places
vim-patch:8.1.1599: compiler warning for uninitialized variable
vim-patch:8.1.1603: crash when using unknown highlighting in text property
vim-patch:8.1.1655: popup window border drawn wrong with multi-byte char
vim-patch:8.1.1675: listener list not correctly updated on listener_remove()
vim-patch:8.1.1710: Coverity found dead code
vim-patch:8.1.1844: buffer no longer unloaded when adding text properties
vim-patch:8.1.2071: when 'wincolor' is set text property changes highlighting
vim-patch:8.1.2211: listener callback "added" argument is not the total
vim-patch:8.1.2215: unreachable code in adjusting text prop columns
vim-patch:8.1.2216: text property in wrong place after :substitute
vim-patch:8.1.2298: missing part of 8.1.2296
vim-patch:8.1.2308: deleting text before zero-width textprop removes it
vim-patch:8.1.2369: cannot build with quickfix and without text properties


vim-patch:8.2.0124: compiler warnings for variable types
vim-patch:8.2.0126: textprop test fails
vim-patch:8.2.0967: unnecessary type casts for vim_strnsave()
vim-patch:8.2.1670: a couple of gcc compiler warnings
vim-patch:8.2.2429: :goto does not work correctly with text properties
vim-patch:8.2.2890: text property duplicated when data block splits
vim-patch:8.2.3062: internal error when adding several text properties
vim-patch:8.2.3372: line2byte() value wrong when adding a text property
vim-patch:8.2.3483: #ifdef for using sysinfo() is incomplete
vim-patch:8.2.4043: using int for second argument of ga_init2()
vim-patch:8.2.4144: cannot load libsodium dynamically
vim-patch:8.2.4960: text properties that cross lines not updated for deleted line
vim-patch:8.2.4961: build error with a certain combination of features
vim-patch:8.2.5014: byte offsets are wrong when using text properties
vim-patch:8.2.5041: cannot close a terminal popup with "NONE" job

vim-patch:9.0.0169: insufficient testing for line2byte() with text properties
vim-patch:9.0.0181: textprop test with line2byte() fails on MS-Windows


vim-patch:9.1.0633: Compilation warnings with `-Wunused-parameter`
vim-patch:9.1.0957: MS-Windows: conversion warnings
2025-08-20 09:43:26 -07:00
luukvbaal
61b6553ee9 fix(ui): proper event ordering for nested cmdline_block events (#35344)
Problem:  Wrong event order for nested cmdline in a conditional cmdline_block.
Solution: Emit all but the first cmdline_block event immediately after
          getting the next command, before executing it.
2025-08-20 15:02:55 +02:00
bfredl
4a1295c626 Merge pull request #34186 from bfredl/neotags
build: generate helptags without running "nvim" binary
2025-08-20 09:10:02 +02:00
zeertzjq
27bc7dcb01 Merge pull request #35399 from zeertzjq/vim-9.1.1647
vim-patch: runtime file updates
2025-08-20 08:09:14 +08:00
zeertzjq
3d511833ae vim-patch:2f7e4eb: runtime(python): optimize pythonSync pattern
Order the keywords by expected frequency: "def" and "class" are assumed
to be more likely than "async def" in the majority of Python code.

closes: vim/vim#18032

2f7e4eb335

Co-authored-by: Jon Parise <jon@indelible.org>
2025-08-20 07:24:35 +08:00
zeertzjq
ba25f3e4d4 vim-patch:9.1.1647: filetype: Cangjie files are not recognized
Problem:  filetype: Cangjie files are not recognized
Solution: Detect *.cj files as cangjie filetype, include a syntax plugin
          (WuJunkai2004)

This commit introduces a new syntax highlighting file for the Cangjie
programming language, includes 4 parts as required:
- The main syntax file: runtime/syntax/cangjie.vim
- The filetype detection rule in: runtime/filetype.vim
- The documentation update in: runtime/doc/syntax.txt
- Some menus

References:
- https://gitcode.com/Cangjie
- https://cangjie-lang.cn/

fixes: 18014
closes: vim/vim#18027

0c4405a6b2

Co-authored-by: WuJunkai2004 <wujunkai20041123@outlook.com>
2025-08-20 07:23:49 +08:00
Sean Dewar
3ec63cdab8 fix(treesitter): run FileType autocmds in the context of <abuf>
Problem: many FileType autocommands assume curbuf is the same as the target
buffer; this can cause &syntax to be restored for the wrong buffer in some cases
when TSHighlighter:destroy is called.

Solution: run nvim_exec_autocmds in the context of the target buffer via
nvim_buf_call.
2025-08-19 20:03:05 +01:00
TheBlob42
701258921e feat(snippet): highlight active tabstop (#35378) 2025-08-19 06:21:32 -07:00
bfredl
6b936002cc build: make build.zig generate helptags without running "nvim" binary
This is matters for cross-compiling where we might not
be able to run the "nvim" binary on the host.

Instead reimplement the helptags extractor as a small
lua script, which we can run on the host using the nlua0
helper already used for other generator scripts.
2025-08-19 11:14:02 +02:00
zeertzjq
25bc41847e vim-patch:9.1.1649: attrs allocation and fuzzy growarray could leak (#35383)
Problem:  attrs allocation and fuzzy growarray could leak on early
          returns
Solution: Ensure proper cleanup of allocated memory on exit paths
          (glepnir)

closes: vim/vim#18038

c7c10f8c11

Co-authored-by: glepnir <glephunter@gmail.com>
2025-08-19 08:45:15 +08:00
ite-usagi
1e20f31aa3 docs(tutor): update Japanese tutor #35379 2025-08-18 10:46:56 -07:00
ite-usagi
ddae46fba0 docs(l10n): building translation file #35380 2025-08-18 08:06:21 -07:00
Justin M. Keyes
1b2a6e0664 Merge #35018 refactor(lsp): centralized enable/is_enabled strategy 2025-08-18 10:57:57 -04:00
Yi Ming
f40162ba19 refactor(lsp): use vim.lsp._capability.enable internally 2025-08-18 19:41:55 +08:00
Yi Ming
050b04384e refactor(lsp): correct enable marker name 2025-08-18 19:41:55 +08:00
Yi Ming
2ace4089f8 refactor(lsp): no longer rely on LspDetach for detaching capabilities 2025-08-18 19:41:55 +08:00
Yi Ming
b3fbc8d6fa refactor(lsp): move util.enable to capability.enable 2025-08-18 19:41:53 +08:00
zeertzjq
052126b77a test(tui_spec): avoid race between server exit and new client (#35376)
Don't start a new client to check for server exit. Check for the server
socket being removed instead.
2025-08-18 15:24:22 +08:00
zeertzjq
f363ea8547 test(tui_spec): fix another case of flakiness (#35374) 2025-08-18 12:53:40 +08:00
Justin M. Keyes
960b33a9d8 docs: misc, dev-api-fast, $XDG_STATE_HOME #35138 2025-08-17 20:45:40 -07:00
Siddhant Agarwal
1d40f67776 feat(ssh): SSH configuration parser #35027 2025-08-17 20:40:28 -07:00
zeertzjq
37119ad0d2 vim-patch:9.1.1645: fuzzy.c can be further improved (#35371)
Problem:  fuzzy.c can be further improved
Solution: Fix memory leak and refactor it (glepnir).

Optimize performance and memory allocation:

- Fix memory leak in fuzzy_match_in_list.
- using single memory allocation in match_positions
- Improve has_match performance and add null pointer checks

closes: vim/vim#18012

59799f3afa

Co-authored-by: glepnir <glephunter@gmail.com>
2025-08-18 11:03:08 +08:00
zeertzjq
e4d3812c8b Merge pull request #35370 from zeertzjq/excmd
:connect fixes
2025-08-18 09:43:34 +08:00
zeertzjq
c1f142322b fix(excmd): correct :connect abbreviation 2025-08-18 09:22:42 +08:00
zeertzjq
f5cbf11644 fix(client): avoid :connect race with server detach
Also fix some warnings and flakiness in :restart/:connect tests.
2025-08-18 09:22:41 +08:00
Sean Dewar
2211953266 fix(api): on_detach consistently before buf_freeall autocmds
Problem: on_detach may be called after buf_freeall and other important things,
plus its textlock restrictions are insufficient. This can cause issues such as
leaks, internal errors and crashes.

Solution: disable buffer updates in buf_freeall, before autocommands (like the
order after #35355 and when do_ecmd reloads a buffer). Don't do so in
free_buffer_stuff; it's not safe to run user code there, and buf_freeall already
runs before then; just free them to avoid leaks if buf_freeall autocommands
registered more for some reason.

Fixes #28084
Fixes #33967
Fixes #35116
2025-08-17 22:32:53 +01:00
Justin M. Keyes
d8ed43c6a7 Merge #35109 vim.pos, vim.range 2025-08-17 16:37:56 -04:00
Corey Cole
4299837b44 docs(windows): WSL build instructions #35365 2025-08-17 13:07:03 -07:00
Justin M. Keyes
7eb9badd93 refactor(tests): remove redundant test #35364 2025-08-17 12:11:13 -07:00
Jaehwang Jung
285c04e2d0 fix(api,lsp): call on_detach before wiping out the buffer #35355
Problem:
Buffer-updates on_detach callback is invoked before buf_freeall(), which
deletes autocmds of the buffer (via apply_autocmds(EVENT_BUFWIPEOUT,
...)). Due to this, buffer-local autocmds executed in on_detach (e.g.,
LspDetach) are not actually invoked.

Solution:
Call buf_updates_unload() before buf_freeall().
2025-08-17 11:37:24 -07:00
zeertzjq
35a7642647 vim-patch:3cee950: runtime(diff): fix mixed translations in zh_CN (#35362)
some translations confused zh_CN and zh_TW

3cee950fc9

Co-authored-by: 毛逸宁 <mao.yining@outlook.com>
2025-08-17 18:33:29 +08:00
Yi Ming
a37e101dc7 refactor(lsp): change capability name to snake case 2025-08-17 12:37:34 +08:00
Yi Ming
7c3e579a90 refactor(lsp): register all derived Capability prototypes 2025-08-17 12:37:34 +08:00
Yi Ming
81d8198bda refactor(lsp): define Capability.on_attach 2025-08-17 12:37:34 +08:00
Yi Ming
a7fef170b7 refactor(lsp): check supported methods instead of tbl_get 2025-08-17 12:37:34 +08:00
Yi Ming
9f5b309d82 feat(lua): conversion between vim and lsp position/range 2025-08-17 12:13:24 +08:00
Yi Ming
98f8224c19 feat(lua): vim.pos/vim.range 2025-08-17 11:54:53 +08:00
zeertzjq
7e450aa383 vim-patch:b405c79: runtime(vim): set 'comments' based on script type (legacy/Vim9) (#35359)
fixes: vim/vim#18000

b405c79004

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-08-17 01:26:37 +00:00
zeertzjq
577f9fa1be vim-patch:9.1.1640: Unicode has deprecated some code-points (#35358)
Problem:  Unicode has deprecated some code-points
Solution: Update the digraph tables to align with the Unicode v16
          release (David Friant)

This commit updates the digraphs Left-Pointing Angle Bracket '</'
and Right-Pointing Angle Bracket '/>' to account for the fact that
the old Unicode codepoints for them (2329 and 232A, respectively)
have been deprecated. As per the Miscellaneous Technical code chart
(https://www.unicode.org/charts/PDF/U2300.pdf), the old digraphs
have been reassigned to the CJK Left Angle Bracket and Right Angle
Bracket (3008 and 3009) with their declaration moved to the
appropriate block.

This commit also introduces the new digraphs '<[' and ']>' to
represent the Mathematical Left Angle Bracket and Mathematical
Right Angle Bracket (27E8 and 27E9) to replace the deprecated code
points in the Technical block.

Tests have been added and, I believe, the documentation has been
updated accordingly.

closes: vim/vim#17990

c08b94b072

Co-authored-by: David Friant <friant@HPEnvyx360.friant.dev>
2025-08-17 08:52:05 +08:00
Michael Henry
5f8d4a248a feat(provider): detect venv python via "pynvim-python" tool #35273
Problem:
Detection of the pynvim module is currently done by finding the first
Python interpreter in the `PATH` and checking if it can import pynvim.
This has several problems:
- Activation of an unrelated Python virtual environment will break
  automatic detection, unless pynvim is also installed in that
  environment.
- Installing pynvim to the expected location is difficult. User
  installation into the system-wide or user-wide Python site area is now
  deprecated.  On Ubuntu 24.04 with Python 3.12, for example, the
  command `pip install --user pynvim` now fails with the error message
  `error: externally-managed-environment`.
- Users may create a dedicated virtual environment in which to install
  pynvim, but Nvim won't detect it; instead, they must either activate
  it before launching Nvim (which interferes with the user of other
  virtual environments) or else hard-code the variable
  `g:python3_host_prog` in their `init.vim` to the path of the correct
  Python interpreter.  Neither option is desirable.

Solution:
Expose pynvim's Python interpreter on the `PATH` under the
name `pynvim-python`.  Typical user-flow:

1. User installs either uv or pipx.
2. User installs pynvim via:
   ```
   uv tool install --upgrade pynvim
   # Or:
   pipx install --upgrade pynvim
   ```

With corresponding changes in pynvim https://github.com/neovim/pynvim/issues/593
the above user-flow is all that's needed for Nvim to detect the
installed location of pynvim, even if an unrelated Python virtual
environments is activated.  It uses standard Python tooling to automate
the necessary creation of a Python virtual environment for pyenv and the
publication of `pynvim-python` to a directory on `PATH`.
2025-08-16 14:48:08 -07:00
MinimalEffort07
77860f5418 build(deps): CMake generation fails when path contains spaces #35332
Problem:
Additional include directories in DEPS_INCLUDE_FLAGS variable are not
quoted. Paths with spaces break the resulting compile command.

Solution:
Enclose values in double quotes.
Note: normally we should avoid manual quoting, but in this case we can't
because of how `DEPS_INCLUDE_FLAGS` is used in `BuildLuv.cmake`
and `BuildLpeg.cmake`.
2025-08-16 12:25:34 -07:00
zeertzjq
013af17ed9 vim-patch:9.1.1623: Buffer menu does not handle unicode names correctly (#35353)
Problem:  Buffer menu does not handle unicode names correctly
          (after v9.1.1622)
Solution: Fix the BMHash() function (Yee Cheng Chin)

The Buffers menu uses a BMHash() function to generate a sortable number
to be used for the menu index. It used a naive (and incorrect) way of
encoding multiple ASCII values into a single integer, but assumes each
character to be only in the ASCII 32-96 range. This means if we use
non-ASCII file names (e.g. Unicode values like CJK or emojis) we get
integer underflow and overflow, causing the menu index to wrap around.
Vim's GUI implementations internally use a signed 32-bit integer for the
`gui_mch_add_menu_item()` function and so we need to make sure the menu
index is in the (0, 2^31-1) range.

To do this, if the file name starts with a non-ASCII value, we just use
the first character's value and set the high bit so it sorts after the
other ASCII ones. Otherwise, we just take the first 5 characters, and
use 5 bit for each character to encode a 30-bit number that can be
sorted.

This means Unicode file names won't be sorted beyond the first
character. This is likely going to be fine as there are lots of ways to
query buffers.

related: vim/vim#17403
closes: vim/vim#17928

8f9de4991e

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-08-16 13:20:36 +08:00
bfredl
c12701d4e1 Merge pull request #35329 from bfredl/uncrustify_all
fix(build): also check os_win sources with uncrustify in CI
2025-08-15 11:06:42 +02:00
zeertzjq
8d154e5927 vim-patch:9.1.1633: Search pattern shown incorrectly with negative offset (#35337)
Problem:  Search pattern shown incorrectly with negative offset.
          (lkintact)
Solution: Don't prepend a '+' sign to a negative offset (zeertzjq).

fixes: vim/vim#17993
closes: vim/vim#17994

ade0815856
2025-08-15 00:06:32 +00:00
zeertzjq
7afcfb6c9a vim-patch:9.1.1632: memory leak in fuzzy.c
Problem:  memory leak in fuzzy.c
Solution: Free fuzmatch, add a few minor refactors
          (glepnir)

fixes neovim CID 584055: fuzmatch leak when count becomes 0
Fix partial allocation failure cleanup in buffer expansion

closes: vim/vim#17996

03d6e06edd

Co-authored-by: glepnir <glephunter@gmail.com>
2025-08-15 07:17:24 +08:00
zeertzjq
e38e65b86c vim-patch:9.1.1630: tests: fuzzy bufname completion test doesn't match successfully
Problem:  tests: fuzzy buffer name completion test doesn't match
          successfully (after 9.1.1627).
Solution: Update pattern to account for the change in case sensitivity.
          Also mark Test_search_stat_option() as flaky as it can still
          sometimes fail (zeertzjq).

closes: vim/vim#17992

891353671a
2025-08-15 07:17:24 +08:00
Gregory Anders
218ff601c4 fix(tui): do not emit resize screen sequence after host terminal is resized (#35335)
Some terminals support the CSI 8 t sequence to resize their own window
area. Neovim will emit this sequence when the TUI is resized
programatically, but it should not be emitted when the TUI is resized
because the host terminal was resized, as that results in an infinite
resize loop.
2025-08-14 18:14:26 -05:00
Siddhant Agarwal
649bb372f6 feat(ui): :connect command #34586
Add the `:connect <address>` command which connects the currently
running TUI to the server at the given address.
2025-08-14 15:58:09 -07:00
Jalil David Salamé Messina
bd45e2be63 fix(checkhealth): wrong ABI version for treesitter parsers #35327
Don't print ABI version of duplicated parsers that are later in the
runtime path (see [#35326]).

Change the sorting from `name > path` to `name > rtpath_index`, this
ensures the first (loaded) parser is first in the list and any
subsequent parsers can be considered "not loaded".

This is fuzzy at best since `vim.treesitter.language.add` can take a
path to a parser and change the load order.

The correct solution is for `vim.treesitter.language.inspect` to return
the parser path so we can compare against it and/or for it to also be
able to take a path to a parser so we can inspect it without loading it
first.
2025-08-14 11:47:43 -07:00
bfredl
c26f989b2f fix(build): also check os_win sources with uncrustify in CI 2025-08-14 10:36:08 +02:00
bfredl
38986188ba Merge pull request #35206 from bfredl/nopreproc_cleanup
refactor(build): remove INCLUDE_GENERATED_DECLARATIONS guards
2025-08-14 10:02:57 +02:00
bfredl
442f297c63 refactor(build): remove INCLUDE_GENERATED_DECLARATIONS guards
These are not needed after #35129 but making uncrustify still play nice
with them was a bit tricky.

Unfortunately `uncrustify --update-config-with-doc` breaks strings
with backslashes. This issue has been reported upstream,
and in the meanwhile auto-update on every single run has been disabled.
2025-08-14 09:34:38 +02:00
zeertzjq
d19d2b4491 vim-patch:1ee1d9b: runtime(python): highlight "self" and "cls" in syntax script (#35328)
These are special names by convention, and giving them distinct
highlighting is a nice visual clue (using Identifier by default).

This group is named "pythonClassVar" to match the name used by
python-syntax. Some third-party color schemes are aware of this
name and customized their colors accordingly.

closes: vim/vim#17968

1ee1d9b43d

Co-authored-by: Jon Parise <jon@indelible.org>
2025-08-14 08:36:24 +08:00
zeertzjq
9843573a61 Merge pull request #35320 from zeertzjq/vim-9.1.1627
vim-patch:9.1.{1627,1628}
2025-08-14 07:18:05 +08:00
zeertzjq
2619a749a5 vim-patch:9.1.1628: fuzzy.c has a few issues
Problem:  fuzzy.c has a few issues
Solution: Use Vims memory management, update style
          (glepnir)

Problem:
- Missing cleanup of lmatchpos lists causing memory leaks
- Missing error handling for list operations
- Use of malloc() instead of Vim's alloc() functions
- Inconsistent C-style comments
- Missing null pointer checks for memory allocation
- Incorrect use of vim_free() for list objects

Solution:
- Add proper cleanup of lmatchpos in done section using list_free()
- Set lmatchpos to NULL after successful transfer to avoid confusion
- Add error handling for list_append_tv() failures
- Replace malloc() with alloc() and add null pointer checks
- Convert C-style comments to C++ style for consistency
- Fix vim_free() calls to use list_free() for list objects

closes: vim/vim#17984

17a6d696bd

Co-authored-by: glepnir <glephunter@gmail.com>
2025-08-14 06:48:31 +08:00
zeertzjq
6f0ef8a5f2 vim-patch:c93a2b3: runtime(doc): Adapt fuzzy doc to reflect 'fzy' algorithm
closes: vim/vim#17988

c93a2b3327

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-14 06:48:31 +08:00
zeertzjq
869000e7ce vim-patch:9.1.1627: fuzzy matching can be improved
Problem:  fuzzy-matching can be improved
Solution: Implement a better fuzzy matching algorithm
          (Girish Palya)

Replace fuzzy matching algorithm with improved fzy-based implementation

The
[current](https://www.forrestthewoods.com/blog/reverse_engineering_sublime_texts_fuzzy_match/)
fuzzy matching algorithm has several accuracy issues:

* It struggles with CamelCase
* It fails to prioritize matches at the beginning of strings, often
  ranking middle matches higher.

After evaluating alternatives (see my comments
[here](https://github.com/vim/vim/issues/17531#issuecomment-3112046897)
and
[here](https://github.com/vim/vim/issues/17531#issuecomment-3121593900)),
I chose to adopt the [fzy](https://github.com/jhawthorn/fzy) algorithm,
which:

* Resolves the aforementioned issues.
* Performs better.

Implementation details

This version is based on the original fzy
[algorithm](https://github.com/jhawthorn/fzy/blob/master/src/match.c),
with one key enhancement: **multibyte character support**.

* The original implementation supports only ASCII.
* This patch replaces ascii lookup tables with function calls, making it
  compatible with multibyte character sets.
* Core logic (`match_row()` and `match_positions()`) remains faithful to
  the original, but now operates on codepoints rather than single-byte
  characters.

Performance

Tested against a dataset of **90,000 Linux kernel filenames**. Results
(in milliseconds) show a **\~2x performance improvement** over the
current fuzzy matching algorithm.

```
Search String            Current Algo    FZY Algo
-------------------------------------------------
init                          131.759    66.916
main                          83.688     40.861
sig                           98.348     39.699
index                         109.222    30.738
ab                            72.222     44.357
cd                            83.036     54.739
a                             58.94      62.242
b                             43.612     43.442
c                             64.39      67.442
k                             40.585     36.371
z                             34.708     22.781
w                             38.033     30.109
cpa                           82.596     38.116
arz                           84.251     23.964
zzzz                          35.823     22.75
dimag                         110.686    29.646
xa                            43.188     29.199
nha                           73.953     31.001
nedax                         94.775     29.568
dbue                          79.846     25.902
fp                            46.826     31.641
tr                            90.951     55.883
kw                            38.875     23.194
rp                            101.575    55.775
kkkkkkkkkkkkkkkkkkkkkkkkkkkkk 48.519     30.921
```

```vim
vim9script

var haystack = readfile('/Users/gp/linux.files')

var needles = ['init', 'main', 'sig', 'index', 'ab', 'cd', 'a', 'b',
'c', 'k',
    'z', 'w', 'cpa', 'arz', 'zzzz', 'dimag', 'xa', 'nha', 'nedax',
'dbue',
    'fp', 'tr', 'kw', 'rp', 'kkkkkkkkkkkkkkkkkkkkkkkkkkkkk']
for needle in needles
    var start = reltime()
    var tmp = matchfuzzy(haystack, needle)
    echom $'{needle}' (start->reltime()->reltimefloat() * 1000)
endfor
```

Additional changes

* Removed the "camelcase" option from both matchfuzzy() and
  matchfuzzypos(), as it's now obsolete with the improved algorithm.

related: neovim/neovim#34101
fixes vim/vim#17531
closes: vim/vim#17900

7e0df5eee9

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-14 06:48:30 +08:00
TheBlob42
6f904cfef1 fix(snippet): adjacent tabstops without placeholders (#35167)
* fix(snippet): adjacent tabstops without placeholders

* test(snippet): add tests for directly adjacent tabstops
2025-08-13 14:51:43 -04:00
zeertzjq
7b9512e613 fix(api): fix not capturing output in cmdline mode (#35322) 2025-08-13 20:12:47 +08:00
bfredl
44fdbd6589 Merge pull request #34969 from bfredl/winbuild
feat(build): build.zig windows support.
2025-08-13 10:23:18 +02:00
bfredl
b70a6f3f3e Merge pull request #34394 from bfredl/shadamem
refactor(shada): A shada entry is a shada entry
2025-08-13 10:19:25 +02:00
zeertzjq
35be59cc7b vim-patch:9.1.1626: cindent: does not handle compound literals (#35319)
Problem:  C-indent does not handle compound literals
          (@44100hertz, @Jorenar)
Solution: Detect and handle compound literal and structure
          initialization (Anttoni Erkkilä)

match '=' or "return" optionally followed by &, (typecast), {
Fixes also initialization which begins with multiple opening braces.

fixes: vim/vim#2090
fixes: vim/vim#12491
closes: vim/vim#17865

5ba6e41d37

Co-authored-by: Anttoni Erkkilä <anttoni.erkkila@protonmail.com>
2025-08-12 23:21:09 +00:00
zeertzjq
50ceac4054 vim-patch:9.1.1625: Autocompletion slow with include- and tag-completion (#35318)
Problem:  Autocompletion slow with include- and tag-completion
Solution: Refactor ins_compl_interrupted() to also check for timeout,
          further refactor code to skip outputting message when
          performing autocompletion (Girish Palya).

Running `vim *` in `vim/src` was slower than expected when
'autocomplete' was enabled. Include-file and tag-file completion
sources were not subject to the timeout check, causing unnecessary
delays.

So apply the timeout check to these sources as well, improving
autocompletion responsiveness, refactor find_pattern_in_path() to take
an additional "silent" argument, to suppress any messages.

closes: vim/vim#17966

59e1d7f353

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-13 07:14:49 +08:00
argothiel
76a383bb7b docs: "git" is a prerequisite #35315
BUILD.md: Add git to prerequisites

The git command is literally the first one in the build instructions, therefore it's reasonable to treat it as one of the prerequisites. Void Linux already had git as one of the prerequisites; this commits adds git to all the other Unix systems.
2025-08-12 14:11:51 -07:00
glepnir
c7c3f9fc9c fix(api): fix crash in command preview with % #35228
Problem: parse_cmdline() sets eap->cmdlinep to address of local parameter,
causing invalid memory access when expand_filename() tries to modify it.
This leads to crashes when typing '%' in user commands with preview=true
and complete=file.

Solution: Change parse_cmdline() signature to accept char **cmdline,
allowing cmdlinep to point to caller's variable for safe reallocation.
2025-08-12 13:43:56 -07:00
Jaehwang Jung
3eab5bd38a fix(treesitter): set local values of window options 2025-08-12 16:26:11 +01:00
zeertzjq
e6e1e71abf vim-patch:dba9eb4: runtime(python): Also sync syntax at 'async def' (#35309)
A file containing only async functions (`async def func()`) wouldn't
previously match the pythonSync pattern.

Also, this pattern only matches at the beginning of the line, so it
won't ever match method definitions (which are indented within class
scopes). Update the comment accordingly.

closes: vim/vim#17963

dba9eb46e6

Co-authored-by: Jon Parise <jon@indelible.org>
2025-08-12 20:11:38 +08:00
bfredl
5e1c35509e refactor(shada): A shada entry is a shada entry
problem: most shada entries use weird `PossiblyFreedShadaEntry` type
solution: delet it

Shada entries can either be allocated by shada.c when reading,
or be constructed to represent the state of the current instance,
with direct references to live instance data to avoid extra allocations.
shada.c needs to carefully only free memory allocated by the first case,
and not free memory owned by other subsystems.

In some part of the code, this is inferred by the context but in others
we are mixing entries from different sources and need to indicate
the provenance by a `can_free_entry` flag. However constantly
frontloading this distinction  in the name of the type and with
extra nesting levels, cause extra cognitive overhead when trying
to understand the code in any other aspects than the specific detail
of avoiding leaks/double frees.

As we always know if the memory is owned or not for any entry, we
can just put `can_free_entry` directly on the ShadaEntry struct.
That only one state is possible in a given context, is indicated
by this neat little syntactical construct called a constant field
initializer.
2025-08-12 13:47:33 +02:00
bfredl
dc6cf3add9 feat(build): build.zig windows support
Tested using cross-compiling from linux:

    zig build -Dcross=true -Dtarget=x86_64-windows nvim_bin

Note: not fully functional without a runtime, which still has to be
fuddled with manually

Macos and windows builds require a recent zig 0.15+dev version
As this zig master branch is currently too much in flux, we can't make
our CI depend on zig master.

Revisit CI after zig 0.15 release or at least feature freeze.
2025-08-12 13:33:24 +02:00
tao
a26cdcb20e fix(inccommand): skip input() during preview #35272
Problem:
During preview, the `input` still prompts the user to enter something
that won't be used later, which could be a bit confusing.
e.g., `:s/a/\=input("")`.

Solution:
Make the input() return early during 'inccommand' preview.
2025-08-11 15:39:03 -07:00
Sergei Slipchenko
bc4bddbb21 fix: don't use logical diagnostic position in get_prev and get_next #35282
Problem: `vim.diagnostic.get_prev()` / `vim.diagnostic.get_next()` use
logical diagnostic positions and consider extmark validity.
`vim.diagnostic.get()` only uses original positions and doesn't care
about extmark validity. This results in inconsistency between these
APIs.

Solution: use original positions in `vim.diagnostic.get_prev()` and
`vim.diagnostic.get_next()` and don't consider extmark validity to match
previous behavior, which is consistent with `vim.diagnostic.get`.
2025-08-11 15:34:29 -07:00
Justin M. Keyes
3c7b698d61 Merge #35270 vim.pack: more control over "load" behavior 2025-08-11 18:20:25 -04:00
Shashwat Agrawal
67fede0fc9 fix(gen_help_html): ASCII art rendering in docs #35262
Problem:
gen_help_html.lua script misinterprets parts of ASCII diagrams as help tags
(e.g., `|_________|` in `usr_28.txt`). This incorrectly triggered
special alignment-fixing logic that is meant for columnar text.

Signed-off-by: Shashwat Agrawal <shashwatagrawal473@gmail.com>
2025-08-11 14:37:26 -07:00
skewb1k
7cc07e8383 feat(lsp): support signature help noActiveParameterSupport #34838 2025-08-11 14:31:57 -07:00
luukvbaal
be5a4851ea fix(extui): ensure temporary cmdline config is not restored #35301
Problem:  Temporary cmdline config is saved to be restored later.
Solution: Close the cmdline window so that it is recreated with the appropriate config.
2025-08-11 14:13:39 -07:00
Maria José Solano
f7802dd5d5 fix(lsp): deprecate vim.lsp.set_log_level, vim.lsp.get_log_path #35274 2025-08-11 13:51:40 -07:00
dependabot[bot]
b52f9a19b3 ci: bump actions/checkout from 4 to 5 #35305
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-11 13:43:53 -07:00
Riley Bruins
09f2c8d8ed docs(lsp): specify formatting_options type (#35302) 2025-08-11 14:36:35 -04:00
Maria José Solano
e94d8f03b9 fix(lsp): check for lens range in vim.lsp.codelens.run() (#35294) 2025-08-11 12:37:32 -04:00
zeertzjq
e3fd906b61 Merge pull request #35283 from janlazo/vim-8.1.0636
vim-patch:8.1.{636,1681,1700,1711},8.2.0115
2025-08-11 13:48:00 +08:00
Jan Edmund Lazo
7048c36ba8 vim-patch:8.2.0115: byte2line() does not work correctly with text properties
Problem:    Byte2line() does not work correctly with text properties. (Billie
            Cleek)
Solution:   Take the bytes of the text properties into account.
            (closes vim/vim#5334)

9df53b62de

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-11 01:06:42 -04:00
Jan Edmund Lazo
750c350be8 vim-patch:8.1.1711: listener callback called at the wrong moment
Problem:    Listener callback called at the wrong moment
Solution:   Invoke listeners before calling ml_delete_int(). (closes vim/vim#4657)

acf7544cf6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-10 23:35:10 -04:00
Jan Edmund Lazo
c9b35360ac vim-patch:8.1.1700: listener callback called for the wrong buffer
Problem:    Listener callback called for the wrong buffer.
Solution:   Invoke listeners before calling ml_append_int().

250e3112c6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-10 23:35:10 -04:00
Jan Edmund Lazo
83f38800e7 vim-patch:8.1.1681: insert stray "{" when listener gets buffer line
Problem:    Insert stray "{" when listener gets buffer line. (Paul Jolly)
Solution:   Flush the cached line after invoking listeners. (closes vim/vim#4455)

0fb286e82d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-10 22:22:44 -04:00
Jan Edmund Lazo
36fc266e86 vim-patch:8.1.0636: line2byte() gives wrong values with text properties
Problem:    line2byte() gives wrong values with text properties. (Bjorn Linse)
Solution:   Compute byte offsets differently when text properties were added.
            (closes vim/vim#3718)

b413d2e6a8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-10 22:22:44 -04:00
zeertzjq
03c953008c vim-patch:32d6bd6: runtime(doc): remove dead links (#35297)
related: vim/vim#17879

32d6bd6df2

N/A patch:
vim-patch:8b18345: runtime(doc): Fix 2 minor issues after 32d6bd6df

Co-authored-by: Damien Lejay <damien@lejay.be>
2025-08-11 00:04:30 +00:00
zeertzjq
d2cdfc413b Merge pull request #35296 from zeertzjq/vim-7270a5a
vim-patch: runtime file updates
2025-08-11 07:23:43 +08:00
zeertzjq
39af96c8ef vim-patch:a94a055: runtime(python): Highlight f-string replacement fields in Python
Highlight f-string replacement fields, including

- Comments
- Debugging flags
- Conversion fields
- Format specifications
- Delimiters

Syntax inside fields will be addressed in a separate commit.

related: vim/vim#10734
related: vim/vim#14033
closes: vim/vim#17784

a94a0555d9

Co-authored-by: Rob B <github@0x7e.net>
2025-08-11 07:01:27 +08:00
zeertzjq
82a54a772b vim-patch:48b7eb1: runtime(python): Highlight classes as structures
Class and function definitions previously shared a single highlight
group (pythonFunction). This change gives classes their own highlight
group (pythonClass) that's linked to Structure.

closes: vim/vim#17856

48b7eb1ceb

Co-authored-by: Jon Parise <jon@indelible.org>
2025-08-11 07:00:50 +08:00
zeertzjq
d395dc9d38 vim-patch:7270a5a: runtime(racket): update Racket runtime files
This brings the upstream files to commit 9dc3bd3 (ftplugin: escape Vim
special characters when opening docs, 2025-08-09). Note that not all
upstream files are included.

closes: vim/vim#17956

7270a5a843

Co-authored-by: D. Ben Knoble <ben.knoble+github@gmail.com>
2025-08-11 07:00:28 +08:00
Dietrich Moerman
47e3aecb78 vim-patch:9.1.1620: filetype: composer.lock and symfony.lock files not recognized (#35291)
Problem:  filetype: composer.lock and symfony.lock files not recognized
Solution: Detect composer.lock and symfony.lock files as json filetype
          (Dietrich Moerman)

closes: vim/vim#17945

4fca92faa2
2025-08-10 13:42:57 +00:00
zeertzjq
9d85f086d9 vim-patch:9.1.1622: Patch v9.1.1432 causes performance regressions (#35288)
Problem:  Patch v9.1.1432 causes performance regressions
Solution: Revert "patch 9.1.1432: GTK GUI: Buffer menu does not handle
          unicode correctly" (Yee Cheng Chin).

This reverts commit 08896dd330c6dc8324618fde482db968e6f71088.

The previous change to support Unicode characters properly in the
buffers menu resorted to removing all buffer menus and re-add the
buffers after doing a sort, per each buffer addition. This was quite
slow because if Vim is trying to load in multiple buffers at once (e.g.
when loading a session) this scales in O(n^2) and Vim can freeze for
dozens of seconds when adding a few hundred buffers.

related: vim/vim#17405
related: vim/vim#17928
fixes: vim/vim#17897

cda0d17f59

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-08-10 09:11:13 +00:00
zeertzjq
22d90217c6 vim-patch:partial:fc3c204: runtime(doc): Fix style and typos in builtin.txt and usr_41.txt (#35286)
- Reformat parts to fit into 80 column window.
- Fix example with mandatory call with a range.
  https://github.com/vim/vim/discussions/17950#discussioncomment-14055687
- Remove some duplicate information

closes: vim/vim#17949

fc3c204bbe

Function list changes only.

Co-authored-by: veotos <veotos@users.noreply.github.com>
2025-08-10 08:23:48 +00:00
zeertzjq
dae79f2b67 vim-patch:9.1.1619: Incorrect E535 error message (#35285)
Problem:  Incorrect E535 error message (after 9.1.1603).
Solution: Don't use transchar(), as the character is always printable
          (zeertzjq).

closes: vim/vim#17948

b362995430
2025-08-10 16:22:43 +08:00
zeertzjq
f0d8341984 vim-patch:9.1.1618: completion: incorrect selected index returned from complete_info() (#35284)
Problem:  completion: incorrect selected index returned from
          complete_info()
Solution: Return the index into "items" and restore the previous
          behaviour (Robert Muir).

complete_info() returned an incorrect selected index after
0ac1eb3555445f4c458c06cef7c411de1c8d1020 (Patch v9.1.1311). Effectively
it became an index into "matches" instead of "items". Return the index
into "items" by default to restore the previous behavior, unless
"matches" was requested.

closes: vim/vim#17952

8e2a229189

Co-authored-by: Robert Muir <rmuir@apache.org>
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-08-10 16:21:47 +08:00
bfredl
72969f1301 Merge pull request #35263 from bfredl/zig15
fix(build): remove deprecated aliases in build.zig removed for zig 0.15
2025-08-10 09:24:27 +02:00
zeertzjq
74511a98fd Merge pull request #35278 from zeertzjq/vim-9.1.1612
vim-patch:9.1.{1612,1613}
2025-08-10 09:05:41 +08:00
zeertzjq
9e8d551b1e vim-patch:9.1.1613: tests: test_search leaves a few swapfiles behind
Problem:  tests: test_search leaves a few swapfiles behind
Solution: Use :bw! instead of :close to close the swapfile at the end of
          the test.

related: vim/vim#17933

a2bb21a895

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-08-10 08:25:23 +08:00
zeertzjq
1eca030fb2 vim-patch:9.1.1612: Ctrl-G/Ctrl-T do not ignore the end search delimiter
Problem:  Ctrl-G/Ctrl-T does not ignore the end search delimiter
          (irisjae)
Solution: Check if the pattern ends with a search delimiter and ignore
          it, unless it is part of the pattern.

fixes: vim/vim#17895
closes: vim/vim#17933

c03990d30f

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-08-10 08:24:55 +08:00
zeertzjq
f79430e2ce vim-patch:9.1.1615: diff format erroneously detected (#35276)
Problem:  diff format erroneously detected
          (Tomáš Janoušek)
Solution: Make the regex to detect normal diff format a bit stricter,
          while at it, fix wrong test content from patch v9.1.1606

fixes: vim/vim#17946

887b4981e7

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-08-09 23:27:53 +00:00
zeertzjq
77500c5ad5 vim-patch:9.1.1611: possible undefined behaviour in mb_decompose() (#35275)
Problem:  possible undefined behaviour in mb_decompose(), when using the
          same pointer as argument several times
Solution: use separate assignments to avoid reading and writing the same
          object at the same time (Áron Hárnási)

closes: vim/vim#17953

c43a0614d4

Co-authored-by: Áron Hárnási <aron.harnasi@gmail.com>
2025-08-10 07:23:59 +08:00
Evgeni Chasnovski
acff86601e feat(pack): allow skip install confirmation in add()
Problem: No way to skip install confirmation in `add()`. Having install
  confirmation by default is a more secure design. However, users are
  usually aware of the fact that plugin will be installed and there is
  currently no way to skip confirmation.

  Plus it can introduce inconvenience on the clean config initialization
  if it is modularized with many `vim.pack.add()` calls (leads to
  confirming installation many times in a row).

Solution: Add `opts.confirm` option that can skip install confirmation.
2025-08-09 17:54:39 +03:00
Evgeni Chasnovski
dd828690c7 feat(pack): allow function opts.load in add()
Problem: No way to have full control over how plugin is loaded.
  Although `:packadd!` has small side effects (only adds plugin
  directory to 'runtimepath'; and maybe its 'after/' subdirectory), it
  still has side effects. For example, 'plugin/' directories are still
  loaded during startup (as part of `:h load-plugins`).

Solution: Allow function `opts.load` that has full control over how
  plugin is loaded.
2025-08-09 17:36:15 +03:00
Evgeni Chasnovski
b337c6e0fc fix(pack): update add() to have default load=false during startup
Problem: the `load=true` in `vim.pack.add()` means that `:packadd` is
  executed even during startup. This leads to force source of 'plugin/',
  which breaks the intended loading order (`:h load-plugins`) and
  results into sourcing them twice. This also makes it ignore
  `--noplugin` argument.

  Using `:packadd!` during startup is more appropriate, while `:packadd`
  afterwards is still more favorable to actually force 'plugin/' source
  (as there is no pre-defined mechanism that will load them later).

Solution: have `load=false` default during startup, `true` - afterwards.
2025-08-09 17:36:15 +03:00
zeertzjq
e3913c0fc2 vim-patch:9.1.1606: filetype: a few more files are not recognized (#35268)
Problem:  filetype: a few more files are not recognized
Solution: guess Mail, Info and Terminfo files by its content
          (lacygoill)

closes: vim/vim#17880

eb2aebeb79

Co-authored-by: lacygoill <lacygoill@lacygoill.me>
2025-08-09 13:38:20 +00:00
zeertzjq
f7e8efd2e9 Merge pull request #35267 from zeertzjq/vim-7132935
vim-patch: runtime updates
2025-08-09 21:31:26 +08:00
zeertzjq
7a07454867 vim-patch:3be4ad7: runtime(optwin): Fix E94 when searching for the option-window
Problem:  When the parameter debug=msg is set and the command :option is
          entered, error E94 will be displayed.
Solution: Add a check for the existence of the buffer before getting the
          buffer number “option-window”.

Reproduce:

vim --clean -c "set debug=msg" -c "option"

    Error detected while processing command line..script D:\Programs\Vim\vim91\optwin.vim:
    line 9: E94: No matching buffer for option-window

closes: vim/vim#17927

3be4ad76df

Co-authored-by: RestorerZ <restorer@mail2k.ru>
2025-08-09 21:04:28 +08:00
zeertzjq
acc55f6fed vim-patch:7132935: runtime(java): Manage byte limits for variable-width lookbehind assertions
Raise the byte limits from 80 to 120 for "javaFuncDef" and
"java*CommentTitle"; and support selecting other arbitrary
values with
------------------------------------------------------------
	let g:java_lookbehind_byte_counts = {
		\ 'javaMarkdownCommentTitle': 240,
	\ }
------------------------------------------------------------

for related groups of syntax definitions, referring to their
names with dictionary keys.

Over-80-Byte-Limit Lookbehind Examples:
https://raw.githubusercontent.com/openjdk/jdk/refs/tags/jdk-24%2B36/src/java.base/share/classes/sun/security/x509/NamedX509Key.java [Lines 43 & 44]
https://raw.githubusercontent.com/openjdk/jdk/refs/tags/jdk-24%2B36/src/jdk.compiler/share/classes/com/sun/tools/javac/util/GraphUtils.java [Line 154]

closes: vim/vim#17921

7132935413

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2025-08-09 21:03:56 +08:00
bfredl
a2b0be19bf fix(build): remove deprecated aliases in build.zig removed for zig 0.15
This makes the zig build compatible with the upcoming zig 0.15 release,
while still supporting the current stable 0.14 release still used in CI.
2025-08-09 12:02:07 +02:00
zeertzjq
2c3929624a Merge pull request #35260 from zeertzjq/vim-9.1.1603
vim-patch:9.1.{1603,1609}
2025-08-09 11:20:35 +08:00
zeertzjq
5f23aaba00 vim-patch:9.1.1609: complete: Heap-buffer overflow with complete function
Problem:  complete: Heap-buffer overflow with complete function
          (zeertzjq)
Solution: Do not let startcol become negative (Girish Palya).

fixes: vim/vim#17907
closes: vim/vim#17934

761ea77670

Co-authored-by: Girish Palya <girishji@gmail.com>
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-08-09 10:58:51 +08:00
zeertzjq
b1e35cbd7b vim-patch:9.1.1603: completion: cannot use autoloaded funcs in 'complete' F{func}
Problem:  completion: cannot use autoloaded funcs in 'complete' F{func}
          (Maxim Kim)
Solution: Make it work (Girish Palya)

fixes: vim/vim#17869
closes: vim/vim#17885

1bfe86a7d3

Cherry-pick Test_omni_autoload() from patch 8.2.3223.

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-09 10:58:51 +08:00
Mathias Fußenegger
1968029003 fix(snippet): sync tabstop text also if pmenu is visible (#35250)
Using a snippet like:

    ${1:name} :: ${2}\n${1:name} ${3}= ${4:undefined}${0}

The text for `${1:name}` stopped syncing if the completion popup menu
showed up. E.g. typing `par` where the `a` triggered completion resulted
in:

    pat ::
    pa = undefined

Instead of:

    pat ::
    pat = undefined
2025-08-08 18:56:54 -07:00
zeertzjq
fa92a0b9fe fix(cmdline): completion for command after :restart (#35256) 2025-08-09 01:25:14 +00:00
zeertzjq
5977bdba05 fix(cmdline): trigger CmdlineChanged after command preview (#35254) 2025-08-09 01:16:13 +00:00
zeertzjq
b2828af5b5 Merge pull request #35252 from zeertzjq/vim-9.1.1608
vim-patch:9.1.{0748,1608}
2025-08-09 08:25:09 +08:00
zeertzjq
fe42c81f2e vim-patch:9.1.1608: No command-line completion for :unsilent {command}
Problem:  No command-line completion for :unsilent {command}.
Solution: Add missing command arg completion (Doug Kearns).
          (author)

Add completion tests for all command modifiers.

closes: vim/vim#17524

126731c8fd

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-08-09 08:03:25 +08:00
zeertzjq
70bb7999f7 vim-patch:9.1.0748: :keep* commmands are sometimes misidentified as :k
Problem:  The :keep{alt,jumps,marks,patterns} commmands are sometimes
          misidentified as :k.
Solution: Make sure one_letter_cmd() only returns true for :k and not
          other :keep* commands (Doug Kearns).

This currently manifests as missing completion for :keep* commands and
incorrect results from fullcommand().

E.g., fullcommand("keepmarks") returns "k" rather than "keepmarks".

The correct command, however, is executed as command modifiers are
handled specially in do_one_cmd() rather than using find_ex_command().

Fix exists(':k') so that it returns 2 for a full match.

closes: vim/vim#15742

ea84202372

Cherry-pick Test_ex_command_completion() from patch 9.1.0624.

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-08-09 08:03:25 +08:00
Gregory Anders
a0d94ac469 docs(lsp): add reference to progress indicator protocol (#35215) 2025-08-08 09:59:14 -05:00
zeertzjq
1969f685af vim-patch:9.1.1610: completion: hang or E684 when 'tagfunc' calls complete() (#35243)
Problem:  completion: hang (after 9.1.1471) or E684 (after 9.1.1410)
          when 'tagfunc' calls complete().
Solution: Check if complete() has been called immediately after getting
          matches instead of in the next loop iteration (zeertzjq).

related: vim/vim#1668
related: neovim/neovim#34416
related: neovim/neovim#35163
closes: vim/vim#17929

982cda6976
2025-08-08 14:40:56 +00:00
zeertzjq
e7dfbf1343 vim-patch:9.1.1607: :apple command detected as :append (#35237)
Problem:  :apple command detected as :append (dai475694450)
Solution: Disallow to define a custom command with lower-case letter,
          correctly detect :insert/:change/:append ex commands
          (Hirohito Higashi).

fixes: vim/vim#17893
closes: vim/vim#17930

efd83d441b

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-08-08 13:58:55 +00:00
zeertzjq
798cb0f19a vim-patch:9.1.1605: cannot specify scope for chdir() (#35239)
Problem:  Cannot specify scope for chdir()
Solution: Add optional scope argument (kuuote)

closes: vim/vim#17888

8a65a49d50

Co-authored-by: kuuote <znmxodq1@gmail.com>
2025-08-08 13:50:41 +00:00
zeertzjq
36361d6e4a vim-patch:9.1.1604: completion: incsearch highlight might be lost (#35236)
Problem:  completion: incsearch highlight might be lost after search
          completion (Hirohito Higashi)
Solution: Restore incsearch highlight after dismissing pum with Ctrl-E
          (Girish Palya)

related: vim/vim#17870
closes: vim/vim#17891

04c9e78cd3

This change actually isn't needed as Nvim doesn't call update_screen()
to redraw pum, but it doesn't hurt either.

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-08 13:18:21 +00:00
zeertzjq
75d38bb844 vim-patch:d82c918: runtime(doc): Improve doc for cmdline-autocomplete (#35235)
Maybe this was unnecessary, but saw this:
https://github.com/vim/vim/issues/17854

d82c918e2f

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-08 21:01:54 +08:00
Gregory Anders
b1679f0ab6 fix(tui): do not remove SIGWINCH handler when resize events are enabled (#35221)
When Nvim is started in one terminal emulator,
suspended, and later resumed in a different terminal emulator (as can
happen when using e.g. a multiplexer), the new terminal emulator will
not have all of the same modes enabled that the original terminal
emulator had. This is a problem in particular for in-band resize events
because we were disabling the SIGWINCH signal handler when we determined
that the terminal supported this mode.

However, if the new terminal does not support this mode then the
SIGWINCH handler remains disabled, and Neovim no longer properly
resizes. Instead of disabling the SIGWINCH handler, we track the state
of the resize events mode internally. If the mode is enabled then we
return early from the SIGWINCH handler before performing any ioctls or
other system calls. But if the mode is not enabled we proceed as normal.
2025-08-08 07:51:22 -05:00
Phạm Bình An
69cc16d917 vim-patch:adfea9b: runtime(help): Unset 'comments' and 'cms' options (#35232)
Problem:  Vim's help file doesn't have any syntax for comments, but
          'comments' and 'commentstring' are still set in the help
          buffer.
Solution: Unset 'comments' and 'cms' in help buffer

closes: vim/vim#17889

adfea9b4e6
2025-08-08 09:31:47 +00:00
Christian Clason
ffeb334da0 vim-patch:66d8d28: runtime(typescript): Add syntax support for defer and arbitrary module identifiers
closes: vim/vim#17911

66d8d286cd

Co-authored-by: rhysd <lin90162@yahoo.co.jp>
2025-08-08 10:57:07 +02:00
Christian Clason
62f2b10db3 vim-patch:9.1.1602: filetype: requirements-*.txt files are not recognized
Problem:  filetype: requirements-*.txt files are not recognized
Solution: Detect requirements-*.txt files as requirements filetype
          (Xudong Zheng).

References:
- https://github.com/search?q=path%3Arequirements-*.txt&type=code
- https://github.com/zephyrproject-rtos/zephyr/tree/v4.2.0/scripts

closes: vim/vim#17894

d305729bc5

Co-authored-by: Xudong Zheng <7pkvm5aw@slicealias.com>
2025-08-08 10:23:45 +02:00
Maria José Solano
9139c4f90f fix(lsp): update capability maps (#35227) 2025-08-07 19:33:52 -07:00
zeertzjq
038eb01b41 Merge pull request #35225 from zeertzjq/vim-8.1.0425
vim-patch:{8.1.0425,9.1.1601}
2025-08-08 07:42:34 +08:00
zeertzjq
7230296bdb vim-patch:9.1.1601: Patch v8.1.0425 was wrong
Problem:  Patch v8.1.0425 was wrong
Solution: Revert that patch (Hirohito Higashi)

This is because the root cause was fixed in 8.1.0786 and a regression
occurred elsewhere.

related: vim/vim#3455
related: vim/vim#3830
fixes: vim/vim#11558
closes: vim/vim#17899

6abe5e4904

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-08-08 06:49:22 +08:00
zeertzjq
c6f0a19206 vim-patch:8.1.0425: ml_get error and crash with appendbufline()
Problem:    ml_get error and crash with appendbufline(). (Masashi Iizuka)
Solution:   Set per-window buffer info. (Hirohito Higashi, closes vim/vim#3455)

9cea87c577

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-08 06:49:22 +08:00
zeertzjq
53ac2ad20a vim-patch:9.1.1599: :bnext doesn't go to unlisted help buffers (#35216)
Problem:  :bnext doesn't go to unlisted help buffers when cycling
          through help buffers (after 9.1.0557).
Solution: Don't check if a help buffer is listed (zeertzjq).

From <https://github.com/vim/vim/issues/4478#issuecomment-498831057>:

> I think we should fix that, since once you get to a non-help buffer
> all unlisted buffers are skipped, thus you won't encounter another
> help buffer.

This implies that cycling through help buffers should work even if help
buffers are unlisted. Otherwise this part of :bnext isn't really useful,
as :h makes help buffers unlisted by default.

related: vim/vim#4478
related: vim/vim#15198
closes: vim/vim#17913

9662f33480
2025-08-07 15:57:55 +00:00
zeertzjq
52c2519095 vim-patch:9.1.1600: using diff anchors with hidden buffers fails silently (#35218)
Problem:  diff: using diff anchors with hidden buffers fails silently
Solution: Give specific error message for diff anchors when using hidden
          buffers (Yee Cheng Chin).

Diff anchors currently will fail to parse if a buffer used for diff'ing
is hidden. Previously it would just fail as the code assumes it would
not happen normally, but this is actually possible to do if `closeoff`
and `hideoff` are not set in diffopt. Git's default diff tool "vimdiff3"
also takes advantage of this.

This fix this properly would require the `{address}` parser to be
smarter about whether a particular address relies on window position or
not (e.g. the `'.` address requires an active window, but `'a` or `1234`
do not). Since hidden diff buffers seem relatively niche, just provide a
better error message / documentation for now. This could be improved
later if there's a demand for it.

related: vim/vim#17615
closes: vim/vim#17904

cad3b2421d

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-08-07 15:56:10 +00:00
Christian Clason
d994be44d7 vim-patch:93f6454: runtime(openscad): add a filetype plugin
closes: vim/vim#17902

93f6454724

Co-authored-by: Squibid <me@zacharyscheiman.com>
2025-08-07 17:16:22 +02:00
Christian Clason
6502dd43c4 vim-patch:589aa28: runtime(javascript): add "as" as a reserved keyword to syntax script
closes: vim/vim#17912

589aa284f6

Co-authored-by: Nir Lichtman <nir@lichtman.org>
2025-08-07 17:10:44 +02:00
Christian Clason
1f7ab25915 vim-patch:9.1.1598: filetype: waybar config file is not recognized
Problem:  filetype: waybar config file is not recognized
Solution: Detect */waybar/config file as jsonc filetype
          (Furkan Sahin)

closes: vim/vim#17915

a6e28b1d05

Co-authored-by: Furkan Sahin <furkan-dev@proton.me>
2025-08-07 16:35:48 +02:00
zeertzjq
7dbf347dda vim-patch:9c4de84: runtime(doc): Update ft-vim-syntax documentation (#35212)
g:vimsyn_folding and g:vimsyn_embed regexps need to match case.

closes: vim/vim#17914

9c4de84b2d

Co-authored-by: veotos <veotos@users.noreply.github.com>
2025-08-07 22:31:18 +08:00
zeertzjq
5aaee7d2af vim-patch:9.1.1596: tests: Test_search_wildmenu_iminsert() depends on help file (#35210)
Problem:  tests: Test_search_wildmenu_iminsert() depends on help file
          (after 9.1.1594).
Solution: Set buffer text using setline() instead of loading help file.
          Add a test for another bug fixed by 9.1.1594 (zeertzjq).

related: vim/vim#17870
closes: vim/vim#17922

615ad4ced1
2025-08-07 13:38:45 +00:00
zeertzjq
e12bfb4c70 vim-patch:54fb7ba: runtime(doc): remove mentioning of netrwSettings.vim (#35209)
closes: vim/vim#17925

54fb7ba256

Co-authored-by: Lane East <laneast@laneast.com>
2025-08-07 13:30:38 +00:00
zeertzjq
5f9f706462 fix(ui): check for cmdline mode properly (#35202) 2025-08-07 04:22:01 +00:00
github-actions[bot]
c47a69c1a6 docs: update version.c #35024
vim-patch:8.1.0710: when using timers may wait for job exit quite long
vim-patch:8.1.0969: message written during startup is truncated
vim-patch:8.1.1043: Lua interface does not support Blob
vim-patch:8.1.1389: changes are not flushed when end and start overlap
vim-patch:8.1.1395: saving for undo may access invalid memory
vim-patch:8.1.1534: modeless selection in popup window selects too much
vim-patch:8.1.1571: textprop highlight starts too early if just after a tab
vim-patch:8.1.1573: textprop test fails if screenhots do not work
vim-patch:8.1.1663: compiler warning for using size_t
vim-patch:8.1.1866: modeless selection in GUI does not work properly
vim-patch:8.1.1871: modeless selection in GUI still not correct
vim-patch:8.1.2085: MS-Windows: draw error moving cursor over double-cell char
vim-patch:8.1.2107: various memory leaks reported by asan
vim-patch:8.1.2146: build failure
vim-patch:8.1.2296: text properties are not combined with syntax by default
vim-patch:8.1.2299: ConPTY in MS-Windows 1909 is still wrong
vim-patch:8.1.2337: double-click time sometimes miscomputed

vim-patch:8.2.0300: Vim9: expression test fails without channel support
vim-patch:8.2.0414: channel connect_waittime() test is flaky
vim-patch:8.2.0501: Vim9: script test fails when channel feature is missing
vim-patch:8.2.0508: Vim9: func and partial types not done yet
vim-patch:8.2.0527: Vim9: function types insufficiently tested
vim-patch:8.2.0565: Vim9: tests contain superfluous line continuation
vim-patch:8.2.0640: Vim9: expanding  does not work
vim-patch:8.2.0700: Vim9: converting error message to exception not tested
vim-patch:8.2.0701: Vim9 test fails without job feature
vim-patch:8.2.1481: Vim9: line number reported with error may be wrong
vim-patch:8.2.1609: Vim9: test fails when build without +channel
vim-patch:8.2.1724: Vim9: assignment tests spread out
vim-patch:8.2.1759: Vim9: Some tests are still using :let
vim-patch:8.2.1865: Vim9: add() does not check type of argument
vim-patch:8.2.1867: Vim9: argument to add() not checked for blob
vim-patch:8.2.1965: Vim9: tests fail without the channel feature
vim-patch:8.2.2301: Vim9: cannot unlet a dict or list item
vim-patch:8.2.2304: Vim9: no test for unletting an imported variable
vim-patch:8.2.3006: crash when echoing a value very early
vim-patch:8.2.3007: Vim9: test for void value fails
vim-patch:8.2.3008: startup test may hang
vim-patch:8.2.3009: startup test may hang
vim-patch:8.2.3181: Vim9: builtin function test fails without channel feature
vim-patch:8.2.3242: Vim9: valgrind reports leaks in builtin function test
vim-patch:8.2.3382: crash when getting the type of a NULL partial
vim-patch:8.2.3845: Vim9: test fails when the channel feature is missing
vim-patch:8.2.4407: Vim9: some code not covered by tests
vim-patch:8.2.4410: Vim9: some code not covered by tests

vim-patch:9.0.0563: timer_info() test fails
vim-patch:9.0.2080: vim9_script test too large

vim-patch:9.1.1541: Vim9: error when last enum value ends with a comma
2025-08-06 20:26:50 -07:00
skewb1k
d26db4bfbf feat(lsp): improve signature help display #35190
- Add delimiter between function signature and documentation, matching hover formatting
- Show title only if there are multiple clients or multiple signatures
- Avoid duplicating the title inside the window if it's already shown in the border
2025-08-06 19:56:02 -07:00
skewb1k
d73f2d9657 build(emmyrc.json): use StyLua formatter in .emmyrc.json #35196 2025-08-06 19:52:46 -07:00
dependabot[bot]
c04e40d9f4 ci: bump actions/download-artifact from 4 to 5 (#35188)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-06 19:30:34 -07:00
zeertzjq
e40199c6c6 vim-patch:9.1.1594: completion: search completion throws errors (#35198)
Problem:  completion: search completion throws errors, wrong placement
          of pum menu with 'imi'=1 (berggeist)
Solution: Fix those errors (Girish Palya)

fixes: vim/vim#17858
closes: vim/vim#17870

66467cf5d8

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-06 23:56:58 +00:00
zeertzjq
c46641fea1 Merge pull request #35197 from zeertzjq/vim-bb0860a
vim-patch: doc updates
2025-08-07 07:15:25 +08:00
zeertzjq
654cde369d vim-patch:f7deb81: runtime(doc): fix typo at :h cmdline-autocompletion
The '?' needs to be escaped, because the autocommand is using
file-patterns (glob like) and not a regex). See :h file-pattern

closes: vim/vim#17890

f7deb815b0

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-07 06:33:51 +08:00
zeertzjq
cc25cd2cb7 vim-patch:bb0860a: runtime(doc): tweak option name notation further
related: vim/vim#17857
closes: vim/vim#17917

bb0860abc9

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-08-07 06:33:21 +08:00
bfredl
bc0b3f271c Merge pull request #35129 from bfredl/nopreproc
refactor(build): don't use the preprocessor when generating headers
2025-08-06 21:58:20 +02:00
glepnir
5b1b46ea5a fix(lsp): show title when global winborder is set (#35181)
Problem: make_floating_popup_options only shows when opts.border is explicitly set, ignoring global winborder setting

Solution: check both opts.border and vim.o.winborder when determining whether to show title
2025-08-06 08:25:55 -05:00
bfredl
79c8159f41 refactor(build): don't use the preprocessor when generating headers
Using the preprocessor before generating prototypes provides some
"niceties" but the places that rely on these are pretty few.
Vastly simplifying the BUILD SYSTEM is a better trade-off.

Unbalancing { } blocks due to the preprocessor is cringe anyway (think
of the tree-sitter trees!), write these in a different way.

Add some workarounds for plattform specific features.

INCLUDE_GENERATED_DECLARATIONS flag is now technically redundant,
but will be cleaned up in a follow-up PR as it is a big mess.
2025-08-06 15:10:25 +02:00
zeertzjq
b4c092a092 Merge pull request #35187 from zeertzjq/vim-85cd509
vim-patch: doc updates
2025-08-06 20:51:14 +08:00
Gregory Anders
851a622806 docs(lsp): include snippet to display progress using native indicator (#35176) 2025-08-06 07:31:02 -05:00
zeertzjq
5b3606b2c4 vim-patch:067adc1: runtime(doc): add back bars for the '' mark
this was erroneously changed in commit
85cd509885a05c3a6bb029fb378b1295f107f8f6

related: vim/vim#17857

067adc1ff2
2025-08-06 20:25:29 +08:00
zeertzjq
60dca47ae4 vim-patch:85cd509: runtime(doc): Use correct option-name tags
closes: vim/vim#17857

85cd509885

Omit 'completepopup' and v:colornames.

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-08-06 20:25:29 +08:00
zeertzjq
a3921d2be6 vim-patch:3769100: runtime(doc): fix mismatch between 'backspace' and |i_backspacing| (#35185)
closes: vim/vim#17867

3769100a8e

Co-authored-by: Emilien Breton <bricktech2000@gmail.com>
2025-08-06 11:41:43 +00:00
zeertzjq
72d3ffd716 vim-patch:a7a2a2b: runtime(doc): Tweak documentation style (#35184)
closes: vim/vim#17862

a7a2a2b5ae

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-08-06 10:52:53 +00:00
zeertzjq
0fa81578af Merge pull request #35174 from janlazo/vim-8.2.0512
vim-patch:8.2.{307,512,1123,1555,1912,3602},9.0.1689
2025-08-06 14:19:53 +08:00
Jan Edmund Lazo
b869cf8ddc vim-patch:9.0.1689: python 3.12 produces warnings and fails test
Problem: python 3.12 produces warnings and fails test
Solution: Make use of raw strings in python3 tests

closes: vim/vim#12765

288bf26c53

Co-authored-by: Zdenek Dohnal <zdohnal@redhat.com>
2025-08-06 01:09:05 -04:00
Jan Edmund Lazo
cba2f65ee4 vim-patch:8.2.3602: Python3 test fails with Python 3.10 on MS-Windows
Problem:    Python3 test fails with Python 3.10 on MS-Windows.
Solution:   Adjust the expected error. (Ken Takata, closes vim/vim#9118)

1be7e21583

Co-authored-by: K.Takata <kentkt@csc.jp>
2025-08-06 01:07:11 -04:00
skewb1k
820fb89172 fix(lsp): make thematic break parsing conform to GFM spec (#35162)
- Support for '_' and '*' as delimiters
- Allow spaces between delimiters
- Use more efficient implementation
2025-08-05 16:34:14 -04:00
Jan Edmund Lazo
7ae8860674 vim-patch:8.2.1912: with Python 3.9 some tests fail
Problem:    With Python 3.9 some tests fail.
Solution:   Take into account the different error message. (James McCoy,
            closes vim/vim#7210)

68a48ee55e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-05 13:33:59 -04:00
Jan Edmund Lazo
b95413f601 vim-patch:8.2.1555: not all tests are executed on Github Actions
Problem:    Not all tests are executed on Github Actions.
Solution:   Copy "src" to "src2" earlier. Recognize "src2" in a couple more
            places.  Add two tests to the list of flaky tests. (Ken Takata,
            closes vim/vim#6798)

7d6979608e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-05 13:33:52 -04:00
Jan Edmund Lazo
474c477134 vim-patch:8.2.1123: Python 3 test is old style
Problem:    Python 3 test is old style.
Solution:   Turn into new style test. (Yegappan Lakshmanan, closes vim/vim#6385)

effb0cd75d

Neovim has Lua context that conflict with asserted error message.
Disable incompatible tests due to unsupported features from
python3 provider (ie. LegacyVim bindings, vim.bindeval).

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-05 13:33:44 -04:00
Jan Edmund Lazo
d632ffa243 vim-patch:8.2.0307: Python 3 vim.eval not well tested
Problem:    Python 3 vim.eval not well tested.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#5680)

026270c01d

Amend float values to pass on Ubuntu.
Comment out failing cases (ie. v:none, blob).

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-05 13:33:10 -04:00
Jan Edmund Lazo
2a267d1cbf vim-patch:partial:8.2.1328: no space allowed before comma in list
Problem:    No space allowed before comma in list.
Solution:   Legacy Vim script allows it. (closes vim/vim#6577)

4d4d1cd5c8

Partial port to guard against v8.2.1326 regression.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-05 13:33:03 -04:00
Jan Edmund Lazo
758e6db06c vim-patch:8.2.0512: Vim9: no optional arguments in func type
Problem:    Vim9: no optional arguments in func type.
Solution:   Check for question mark after type.  Find function reference
            without function().

5deeb3f1f9

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-08-05 13:32:03 -04:00
Maria José Solano
a9a4c271b1 revert(lsp): compare to vim.NIL in lsp/buf.lua (#35156)
revert(lsp): "compare to `vim.NIL` in `lsp/buf.lua` #35154"

This reverts commit a5c598871b.
2025-08-03 18:20:17 -07:00
Maria José Solano
a5c598871b fix(lsp): compare to vim.NIL in lsp/buf.lua #35154 2025-08-03 15:39:49 -07:00
Maria José Solano
54bfd0de4f docs(lsp): mention default enablement of document colors (#35153) 2025-08-03 15:03:14 -07:00
Maria José Solano
c789d79966 fix(lsp): check if buffer is valid when resolving code lenses (#35092) 2025-08-03 14:11:18 -07:00
TheBlob42
ecded994c1 fix(snippet): early return for final tabstop #35115
The cursor movement autocommand can not detect when the final tabstop $0
is directly adjacent to another tabstop, which prevents ending the
snippet session. The fix is an early return when jumping.
2025-08-03 19:52:09 +00:00
Yi Ming
7ed8cbd095 feat(lua): vim.list.bisect() #35108 2025-08-03 07:45:49 -07:00
skewb1k
40aef0d02e fix(lsp): decode 'null' in server responses as vim.NIL #34849
Problem:
Previously, 'null' value in LSP responses were decoded as 'nil'.
This caused ambiguity for fields typed as '? | null' and led to
loss of explicit 'null' values, particularly in 'data' parameters.

Solution:
Decode all JSON 'null' values as 'vim.NIL' and adjust handling
where needed. This better aligns with the LSP specification,
where 'null' and absent fields are distinct, and 'null' should
not be used to represent missing values.

This also enables proper validation of response messages to
ensure that exactly one of 'result' or 'error' is present, as
required by the JSON-RPC specification.
2025-08-03 07:42:44 -07:00
bfredl
2ef48fc65c Merge pull request #35130 from bfredl/cringe
fix(options): make 'cdhome' take effect on any platform
2025-08-03 10:19:11 +02:00
bfredl
9910445125 fix(options): make 'cdhome' take effect on any platform
Platform specific options are cringe and should either be fixed or
deleted.

In this case, the platform difference can trivially be implemented
using a conditional default value. If the user overrides the value,
then it is because the user wants that value, regardless of the
corporation who manufactured the OS that the user is running.

Possible alternative: delete the option by making it always on.
2025-08-03 09:42:35 +02:00
Sathya Pramodh
78f4994627 feat: ":restart [cmd]" can run commands #35045
Problem:
Not easy for a user to tell ":restart" to "run this command(s) after restarting".

Solution:
All ":restart" args following the optional +cmd arg are treated as a big cmdline that is passed as a "-c" CLI arg when restarting nvim.
2025-08-02 22:50:45 -07:00
Justin M. Keyes
39e402caa5 docs: reorder sections #35140
Problem:
Generated docs sections are ordered randomly. This matters when showing
an outline or table of contents (e.g. `gO`).

Solution:
Specify which sections have an intentional ordering; sort the rest by
name.
2025-08-03 05:03:09 +00:00
zeertzjq
e23794b090 vim-patch:3add0d5: runtime(ccomplete): use complete_check() in ccomplete plugin (#35142)
Add complete_check() to ccomplete completion script to avoid UI hangs
and keep Vim responsive as ccomplete can be slow on huge files.

closes: vim/vim#17826

3add0d5e75

vim-patch:44309b9: runtime(ccomplete): return partial results on complete_check()

closes: vim/vim#17838

44309b9d08

Co-authored-by: Maxim Kim <habamax@gmail.com>
2025-08-03 11:49:13 +08:00
zeertzjq
f7af0cff35 vim-patch:9.1.1590: cannot perform autocompletion (#35141)
Problem:  cannot perform autocompletion
Solution: Add the 'autocomplete' option value
          (Girish Palya)

This change introduces the 'autocomplete' ('ac') boolean option to
enable automatic popup menu completion during insert mode. When enabled,
Vim shows a completion menu as you type, similar to pressing |i\_CTRL-N|
manually. The items are collected from sources defined in the
'complete' option.

To ensure responsiveness, this feature uses a time-sliced strategy:

- Sources earlier in the 'complete' list are given more time.
- If a source exceeds its allocated timeout, it is interrupted.
- The next source is then started with a reduced timeout (exponentially
  decayed).
- A small minimum ensures every source still gets a brief chance to
  contribute.

The feature is fully compatible with other |i_CTRL-X| completion modes,
which can temporarily suspend automatic completion when triggered.

See :help 'autocomplete' and :help ins-autocompletion for more details.

To try it out, use :set ac

You should see a popup menu appear automatically with suggestions. This
works seamlessly across:

- Large files (multi-gigabyte size)
- Massive codebases (:argadd thousands of .c or .h files)
- Large dictionaries via the `k` option
- Slow or blocking LSP servers or user-defined 'completefunc'

Despite potential slowness in sources, the menu remains fast,
responsive, and useful.

Compatibility: This mode is fully compatible with existing completion
methods. You can still invoke any CTRL-X based completion (e.g.,
CTRL-X CTRL-F for filenames) at any time (CTRL-X temporarily
suspends 'autocomplete'). To specifically use i_CTRL-N, dismiss the
current popup by pressing CTRL-E first.

---

How it works

To keep completion snappy under all conditions, autocompletion uses a
decaying time-sliced algorithm:

- Starts with an initial timeout (80ms).
- If a source does not complete within the timeout, it's interrupted and
  the timeout is halved for the next source.
- This continues recursively until a minimum timeout (5ms) is reached.
- All sources are given a chance, but slower ones are de-prioritized
  quickly.

Most of the time, matches are computed well within the initial window.

---

Implementation details

- Completion logic is mostly triggered in `edit.c` and handled in
  insexpand.c.

- Uses existing inc_compl_check_keys() mechanism, so no new polling
  hooks are needed.

- The completion system already checks for user input periodically; it
  now also checks for timer expiry.

---

Design notes

- The menu doesn't continuously update after it's shown to prevent
  visual distraction (due to resizing) and ensure the internal list
  stays synchronized with the displayed menu.

- The 'complete' option determines priority—sources listed earlier get
  more time.

- The exponential time-decay mechanism prevents indefinite collection,
  contributing to low CPU usage and a minimal memory footprint.

- Timeout values are intentionally not configurable—this system is
  optimized to "just work" out of the box. If autocompletion feels slow,
  it typically indicates a deeper performance bottleneck (e.g., a slow
  custom function not using `complete_check()`) rather than a
  configuration issue.

---

Performance

Based on testing, the total roundtrip time for completion is generally
under 200ms. For common usage, it often responds in under 50ms on an
average laptop, which falls within the "feels instantaneous" category
(sub-100ms) for perceived user experience.

| Upper Bound (ms) | Perceived UX
|----------------- |-------------
| <100 ms          | Excellent; instantaneous
| <200 ms          | Good; snappy
| >300 ms          | Noticeable lag
| >500 ms          | Sluggish/Broken

---

Why this belongs in core:

- Minimal and focused implementation, tightly integrated with existing
  Insert-mode completion logic.
- Zero reliance on autocommands and external scripting.
- Makes full use of Vim’s highly composable 'complete' infrastructure
  while avoiding the complexity of plugin-based solutions.
- Gives users C native autocompletion with excellent responsiveness and
  no configuration overhead.
- Adds a key UX functionality in a simple, performant, and Vim-like way.

closes: vim/vim#17812

af9a7a04f1

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-03 11:48:42 +08:00
Maria José Solano
26cc42e426 fix(lsp): handle nil response in references request #35139 2025-08-02 19:58:58 -07:00
glepnir
22df649210 fix(api): nvim_create_user_command addr option should allow ranges #35077
Problem: Using `addr` without `range` in nvim_create_user_command gives
"No range allowed" error, inconsistent with `:command -addr` behavior.

Solution: Set EX_RANGE flag when `addr` option is specified to match
`:command` behavior.
2025-08-02 19:52:54 -07:00
Justin M. Keyes
93f5bd0caf Merge #35052 test(pack): vim.pack 2025-08-02 19:35:42 -04:00
Phạm Bình An
3f416ef524 build: bump lua-bitop to 1.0.3 #35063
Source: https://bitop.luajit.org/download.html
2025-08-02 15:58:11 -07:00
Evgeni Chasnovski
6e27200901 test(pack): add vim.pack tests 2025-08-02 15:00:42 +03:00
Evgeni Chasnovski
52a596b0aa ci: enable integration tests on Release builds 2025-08-02 15:00:42 +03:00
Evgeni Chasnovski
2e62f3576f fix(pack): open confirmation buffer in tabpage after the current one 2025-08-02 15:00:42 +03:00
Evgeni Chasnovski
d3bea4ace9 fix(pack): ensure consistent order of changelog during update
Problem: Left (`<` prefix) and right (`>` prefix) parts of update
  changelog come in not fixed order: it can be left-right or right-left.

Solution: Ensure left-right order.
2025-08-02 15:00:42 +03:00
Evgeni Chasnovski
89a72f11e5 fix(pack): make newer version suggestions more robust
Problem: New version suggestions in update confirmation buffer might
  include semver tags that were committed later but for versions that
  are not greater than current. Like if versions committed in order
  `v0.2.0` - `v0.3.0` - `v0.2.1` - `v0.3.1`, then when on `v0.3.0` both
  `v0.2.1` and `v0.3.1` are suggested, but only the latter is newer as
  a version. This is because those tags are computed with post-processed
  `git tag --list --contains HEAD`.

Solution: Compute all semver tags and filter only those greater than the
  latest version available at HEAD.
2025-08-02 15:00:42 +03:00
Evgeni Chasnovski
6721128cc8 refactor(pack): use vim.cmd methods with structured input 2025-08-02 15:00:42 +03:00
Evgeni Chasnovski
ed73ed8283 fix(pack): ensure explicit default version in events (where possible)
Problem: Both `PackChangedPre` and `PackChanged` contain |event-data|
  with plugin's `spec`. It looks like a good idea to have all its
  triggers contain the same format across all kinds ("install",
  "update", "delete"). There are several choices:
    - Have it be as verbatim as supplied to `vim.pack.add()`, i.e. can
      be either string or table. A bit too ambiguous.
    - Have it be table with `src` and `name` inferred. This requires
      less work for "install", but more work for "update" and "delete"
      (since they use `vim.pack.get()` which already infers default
      `version`).
    - Have it be table with *all* defaults made explicit. This looks
      like the best approach, but requires extra care to only infer
      default `version` when needed (i.e. avoid inferring during regular
      load) because it is costly in terms of startup time.
      This might also introduce inconsistency when dealing with
      lockfile(s) as information there should be as close to what user
      supplied as possible. Address that when dealing with lockfile.

Solution: Ensure explicit `version` in all events where possible.
2025-08-02 15:00:42 +03:00
Evgeni Chasnovski
8200223ee7 fix(pack): use vim.pack: as message/progress prefix 2025-08-02 15:00:41 +03:00
Evgeni Chasnovski
267bbe64cb fix(pack): validate installed plugins in update() and del()
Problem: Currently `update()` and `del()` silently ignore input plugin
  names that are not for already installed plugin. This might lead to
  confusion because they are not explicitly reported.

Solution: Check that all input names are for installed plugins and error
  otherwise.
2025-08-02 15:00:41 +03:00
Evgeni Chasnovski
a203961535 feat(pack): use colored nvim_echo chunks to show progress report
Problem: using `print()` to show progress report writes to `stdout` when
  in `--headless` mode (interferes with the testing output) and doesn't
  allow coloring.

Solution: use `nvim_echo` with colored chunks.
2025-08-02 15:00:41 +03:00
Evgeni Chasnovski
3f34f083db fix(pack): ignore 'loadplugins' when sourcing 'after/plugin' scripts
Problem: Sourcing of 'after/plugin' scripts depends on the value of
  'loadplugins' option. It is redundant, as it has effect only during
  startup, while it is combined with `vim.v.vim_did_enter == 1` (i.e.
  "it is after starting up") condition.

Solution: Ignore it.
2025-08-02 15:00:41 +03:00
Evgeni Chasnovski
28e2a5c151 fix(pack): improve vim.pack.add() input validation 2025-08-02 15:00:41 +03:00
Evgeni Chasnovski
1ee18b4061 fix(pack): use 'coxpcall.lua' on non-LuaJIT
Problem: `attempt to yield across metamethod/C-call boundary` error when
  trying to use `vim.pack.add()`.

Solution: use `pcall()` variant from 'coxpcall' on non-LuaJIT version of
  Lua.
2025-08-02 15:00:41 +03:00
zeertzjq
1240d29f8f vim-patch:b88f9e4: runtime(vim): Update base syntax, fix :map termination in :command RHS (#35131)
Ensure :map (and :abbreviate) terminate at | when included in :command
replacement strings containing commands separated by line continuations.

b88f9e4a04

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-08-02 19:35:21 +08:00
bfredl
94d09d6627 Merge pull request #35135 from bfredl/lazystatus
fix(statusline): don't require'vim.diagnostic' unless already used
2025-08-02 11:51:41 +02:00
bfredl
1af5ec5b51 fix(statusline): don't require'vim.diagnostic' unless already used
This workarounds a bug likely in nvim__get_runtime, and fixes #35124

Though I'd argue it is more correct anyway as the point of
vim.SUBMODULE lazy loading is "only pay for what you use". If no one
has require'vim.diagnostic' yet in LSP or otherwise, there cannot
be any diagostics available and loading the lua module is wasteful.
2025-08-02 11:26:35 +02:00
Eisuke Kawashima
68eece8b84 fix(diagnostic): check if the buffer is loaded #35125
fix #35116

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-07-31 19:53:53 -07:00
Anton Kastritskii
c3a4d12529 fix(statusline): check buf valid before redraw #35123
fixes #35116
2025-07-31 13:03:45 -07:00
Anton Kastritskii
b79ff967ac feat(statusline): vim.diagnostic.status() #33723
Problem:
Not easy to get a status string for diagnostics.

Solution:
- Add vim.diagnostic.status().
- Add it to the default 'statusline'.
2025-07-29 18:53:57 -07:00
Shadman
807a65b2da fix(prompt): cursor on prompt line, disallow ":edit" #34736
* fix: ensure :edit can not be use on prompt buffer
* fix: starting editing on prompt-line doesn't put cursor at the end
2025-07-29 18:36:01 -07:00
luukvbaal
1256daeead fix(extui): ensure windows are valid in scheduled on_key (#35106) 2025-07-29 23:03:38 +00:00
glepnir
15d57ab0ba fix(api): single-line visual block insert triggers extra on_lines #35098
Problem: Visual block insert on a single line incorrectly triggers two
on_lines callbacks - one for the correct line (0-indexed) and another
for a non-existent additional line.

Solution: Only call changed_lines() in block_insert() when additional
lines beyond the first were actually modified (start.lnum < end.lnum).
2025-07-29 06:24:44 -07:00
Justin M. Keyes
029b7a149f Merge #35000 docs: lsp, ui events, dev guidance 2025-07-28 22:23:07 -04:00
Justin M. Keyes
dc3a30cfbb fix(messages): 'exrc' / secure messages 2025-07-28 22:00:25 -04:00
Justin M. Keyes
c81dc320b0 docs: vim.pack 2025-07-28 22:00:25 -04:00
Justin M. Keyes
56a4ef3c21 docs: lsp, ui events, dev guidance, osc7
fix #34981
2025-07-28 22:00:25 -04:00
nyngwang
dc67ba948e feat(exrc): user must view and explicitly run ":trust" #35069
Problem:
It's relatively easy to mispress key `a` to (a)llow arbitrary execution
of 'exrc' files. #35050

Solution:
- For exrc files (not directories), remove "allow" menu item.
  Require the user to "view" and then explicitly `:trust` the file.
2025-07-28 13:11:58 -07:00
Lewis Russell
cf9b36f3d9 feat(lua): add vim.list.unique()
Problem:
No way to deduplicate values in a list in-place

Solution:
Add `vim.list.unique()`
2025-07-28 09:34:06 +01:00
Sergei Slipchenko
7a051a4c38 fix(diagnostics): avoid jumping to diagnostics in deleted ranges #35088
Problem:
diagnostic extmark used for positioning continues to exist after
deleting a range containing it, so it's possible to jump to a
next/previous diagnositc, which isn't visible in any way, including not
being shown via `open_float`.

Solution:
enable `invalidate` flag when setting an extmark to be able to filter
out diagnostics based on `invalid` flag when looking for next/previous
diagnostic to jump to.
2025-07-28 05:24:10 +00:00
Siddhant Agarwal
5151f635ca feat: serverlist({peer=true}) returns peer addresses #34806
Problem:
serverlist() only lists servers that were started by the current Nvim.

Solution:
Look for other Nvim servers in stdpath("run").
2025-07-27 21:40:04 -07:00
Maria José Solano
d08b265111 feat(lsp): enable document_color by default #35086 2025-07-27 17:11:28 -07:00
TheBlob42
628d569a59 fix(snippet): jumping backwards to choice node (#35062)
Avoid duplicate text when jumping back to a choice node. Set cursor to
end of tabstop range and prioritize current choice in completion items.
2025-07-27 16:10:00 -04:00
TheBlob42
dff78f580d fix(snippet): setting end_right_gravity (#35061)
When right_gravity is set to true for deactivating tabstop expansion we
have to set end_right_gravity to false to avoid expanding the tabstop
region on the right side. Vice versa for activating tabstop expansion
again.
2025-07-27 12:19:01 -07:00
Maria José Solano
afebbd0f34 fix(lsp): don't override config.title in vim.lsp.buf.signature_help() #35075 2025-07-26 19:47:28 -07:00
Jaehwang Jung
b4ba27c238 fix(lsp): codelens extmark line out of range (#35070)
Problem:
When setting extmark for a codelens after it's asynchronously resolved,
the line may have been removed, raising "invalid 'line': out of range"
error. This is a regression from #34888.

Solution:
Re-introduce the line count check.
2025-07-26 12:58:51 -07:00
Christian Clason
8a7bfdc079 build(deps): bump luajit to 871db2c84 2025-07-26 11:54:09 +02:00
bfredl
af5ac7c7ea fix(unittests): use -1ULL to mean UNSIGNED MATH.MAX 2025-07-26 11:54:09 +02:00
zeertzjq
5de2ec76a3 fix(cmdline): :checkhealth completion with multiple args (#35060) 2025-07-26 07:04:32 +08:00
Sergei Slipchenko
0a113013fb fix(diagnostics): position diagnostics using extmarks #34014
Problem:
Diagnostic positions are not being updated after text changes, which
means `vim.diagnostic.open_float` and `vim.diagnostic.jump` will work
with outdated positions when text is changed until diagnostics are
updated again (if ever).

Solution:
Create extmarks in `vim.diagnostic.set` and use their positions for
`vim.diagnostic.open_float` and `next_diagnostic` (used by
`vim.diagnostic.jump`, `vim.diagnostic.get_next` and
`vim.diagnostic.get_prev`).
2025-07-25 07:56:50 -07:00
Mike
e4a100a1e1 fix(diagnostics): extend conversion support from/to quickfix format (#34006)
Use uppercase to check severity
Mark quickfix items as valid when converting from diagnostics
Support nr/code attribute between formats
2025-07-25 08:14:00 -05:00
zeertzjq
1f7432a272 vim-patch:714671d: runtime(misc): use :hor :term to ensure new term window is split horizontally (#35064)
Problem:  :term splits new window above in vim, but in nvim it change
          the buffer for current window
Solution: :hor term to ensure consistent splitting for Vim and Neovim

closes: vim/vim#17822

714671de35

Co-authored-by: phanium <91544758+phanen@users.noreply.github.com>
2025-07-25 18:44:56 +08:00
phanium
e512efe369 fix(extui): attempt to perform arithmetic on field 'last_emsg' (#35047)
Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
2025-07-24 11:45:41 +00:00
zeertzjq
6190b6bc1d Merge pull request #35023 from janlazo/vim-9.1.1453
vim-patch:8.2.{2905,2906,2927},9.0.{2023,2042},9.1.{63,1453}
2025-07-24 12:29:07 +08:00
Jan Edmund Lazo
3e655d3e42 vim-patch:9.1.0063: GTK code can be improved
Problem:  GTK code can be improved
Solution: Improve GTK code for initial Wayland support
          (lilydjwg)

related: vim/vim#9639

94ff09a093

vim-patch:9.1.1453: tests: Test_geometry() may fail

Problem:  tests: Test_geometry() may fail
          (Gary Johnson)
Solution: allow a slightly smaller value when checking the number of
          lines.

fixes: vim/vim#17491

e965b7ac5f

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: lilydjwg <lilydjwg@gmail.com>
2025-07-23 23:35:44 -04:00
Yochem van Rosmalen
35af766de6 refactor(lua): use vim.system #34707 2025-07-23 20:03:30 -07:00
Sathya Pramodh
54b8c99e51 feat: ":restart +cmd" #34788
Problem:
":restart" always executes ":qall" to exit the server.

Solution:
Support ":restart +cmd" so the user can control the command
used to exit the server.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-07-23 19:45:31 -07:00
Yochem van Rosmalen
0dcdd65dcc fix(shada): check return value is 0
Problem:
Vimscript functions return number to signal ok/error. Lua doesn't
convert these to be falsey.

Solution:
Explicitly check if the return value is 0.
2025-07-23 13:57:27 +02:00
Yochem van Rosmalen
61c4a6b3a9 refactor(shada): switch plugin/shada.vim to Lua #34725 2025-07-23 04:04:05 -07:00
zeertzjq
95dfb063da fix(clipboard): correct blockwise register width computation (#35038) 2025-07-23 10:46:15 +08:00
glepnir
4fe51dfdae fix(iter): ArrayIter:last returns nil when filtered to empty #34697
Problem: After filtering out all elements, ArrayIter:last still returns a stale element.
Solution: Add check for self._head == self._tail and return nil early.

Fix #34696
2025-07-22 17:40:24 -07:00
zeertzjq
1685c44dd4 Merge pull request #35032 from zeertzjq/vim-61cec2e
vim-patch: doc updates
2025-07-23 06:57:37 +08:00
zeertzjq
e28aee0c72 vim-patch:774fe9d: runtime(doc): remove mention of ftp.vim.org
fixes: vim/vim#17819

774fe9d8fc

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-07-23 06:28:35 +08:00
zeertzjq
d6704148bc vim-patch:5711d76: runtime(doc): Tweak documentation style
closes: vim/vim#17824

5711d76818

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-07-23 06:28:35 +08:00
zeertzjq
c93091395b vim-patch:61cec2e: runtime(doc): Fix typo in :help help-summary
fixes: vim/vim#17816
closes: vim/vim#17823

61cec2e761

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Co-authored-by: Alain Mosnier <alain@wanamoon.net>
2025-07-23 06:28:35 +08:00
Phạm Bình An
d591275db7 docs: update usr_02.txt #35031
Problem:
- There is reference to gVim in the usr_02.txt file, even though Nvim
  has no built-in GUI.
- `:h help-summary` has a section about optional features (e.g.
  `+conceal`) even though such thing does not exist in Nvim (`:h
  +conceal` will give E149 error).

Solution:
- Remove reference to gVim.
- Replace the section about optional features with a section about Lua.
2025-07-22 15:27:36 -07:00
zeertzjq
9377db2545 vim-patch:9.1.1576: cannot easily trigger wildcard expansion (#35022)
Problem:  cannot easily trigger wildcard expansion
Solution: Introduce wildtrigger() function
          (Girish Palya)

This PR introduces a new `wildtrigger()` function.

See `:h wildtrigger()`

`wildtrigger()` behaves like pressing the `wildchar,` but provides a
more refined and controlled completion experience:

- Suppresses beeps when no matches are found.
- Avoids displaying irrelevant completions (like full command lists)
  when the prefix is insufficient or doesn't match.
- Skips completion if the typeahead buffer has pending input or if a
  wildmenu is already active.
- Does not print "..." before completion.

This is an improvement on the `feedkeys()` based autocompletion script
given in vim/vim#16759.

closes: vim/vim#17806

b486ed8266

While at it, also make Ctrl-Z trigger search completion.

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-07-23 06:12:50 +08:00
Riley Bruins
8b5d8dfc73 fix(lsp): support containerName in symbol requests #35029
The field is present for SymbolInformation and WorkspaceSymbol.
2025-07-22 17:30:16 +00:00
luukvbaal
9fc985bc98 feat(ui2): more predictable routing #35028
Problem:  Routing based on message kinds can be perceived as unpredictable.
Solution: Implement phase 1 of #34281, always showing the full message
          in a window dismissed on any user input when it does not fit
          in the 'cmdheight'. Also show spill "[+n]" indicator if needed.
2025-07-22 15:32:17 +00:00
Sean Dewar
4fadc21e38 fix(window): disallow closing autocmd window in other tabpage
Problem: unlike win_close, win_close_othertab could be used to close the
autocommand window from a different tabpage. This causes aucmd_restbuf to close
the wrong window, potentially causing a crash.

Solution: disallow closing it. Also replace a deprecated use of exc_exec in the
test file.

Fixes #21409.
2025-07-22 13:36:33 +01:00
Sean Dewar
0bef1c88f3 fix(api): do not allow opening float to closing buffer
Problem: no check for nvim_open_win opening a new floating window into a closing
buffer, which can lead to crashes.

Solution: call check_split_disallowed; opening a new float semantically splits
from a window, so the same problems as regular splits apply. Also restore the
error if switch_win_noblock in win_set_buf fails (may not be possible to hit
this, but win_set_buf can silently succeed there since #31595).

As the lock check applies to curbuf (not the target buffer) this may feel a bit
restrictive, though this isn't different to how things like ":split" or
nvim_open_win with "split = true" works when targeting a different buffer. Only
checking the target buffer's lock will cause issues if win_set_buf doesn't end
up in the target buffer for whatever reason.

Maybe we could consider checking the lock of the buffer after win_set_buf and
close the window if it's locked (maybe a bit fiddly, especially as closing a
window can fail...), or make the open + switch operation more atomic, like how
Vim does for its popup windows..?

It also used to be the case that win_set_buf would set an error if autocommands
sent us to a different buffer than what was requested, but #31595 appears to
have also changed that... I haven't touched that here.
2025-07-22 13:36:33 +01:00
Sean Dewar
9813c00dd3 fix(window): restore b_nwindows if win_close_othertab keeps window
Problem: can't accurately know if close_buffer directly (e.g: not via autocmds)
decremented b_nwindows. This can cause crashes if win_close_othertab decides to
keep the window after calling close_buffer (if it did not free the buffer), as
b_nwindows may remain out-of-sync.

Solution: change the return value of close_buffer to accurately depict whether
it decremented b_nwindows. Check it in win_close_othertab to avoid a crash.

Similar issues may exist in other places that call close_buffer, but I've not
addressed those here (not to mention only one other place even checks its return
value...)
2025-07-22 13:36:33 +01:00
Sean Dewar
1d2d6e31a7 test(tabclose): remove deprecated calls, use testnvim helpers 2025-07-22 13:36:33 +01:00
Sean Dewar
05a83265f9 fix(autocmd): fire TabClosed after freeing tab page
Problem: TabClosed is fired after close_buffer is called (after b_nwindows is
decremented) and after the tab page is removed from the list, but before it's
freed. This causes inconsistencies such as the removed tabpage having a valid
handle and functions like nvim_tabpage_get_number returning nonsense.

Solution: fire it after free_tabpage. Try to maintain the Nvim-specific
behaviour of setting `<amatch>` to the old tab page number, and the
(undocumented) behaviour of setting `<abuf>` to the buffer it was showing
(close_buffer sets w_buffer to NULL if it was freed, so it should be OK pass it
to apply_autocmds_group, similar to before).
2025-07-22 13:36:33 +01:00
Sean Dewar
3a36df9b13 fix(window): handle closing the only non-float in other tabpage
Problem: No check for closing the only non-floating window in a non-current
tabpage that contains floats. This can lead to a tabpage that contains only
floats, causing crashes.

Solution: Copy the relevant check from win_close to win_close_othertab. Fix some
uncovered issues.

Closes #34943
Fixes #31236

Co-authored-by: glepnir <glephunter@gmail.com>
2025-07-22 13:36:33 +01:00
Justin M. Keyes
b0e8b0a35f Merge #34853 from ribru17/diag_related_docs
feat(lsp): diagnostic related documents support
2025-07-22 00:38:46 -04:00
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
Riley Bruins
371aa1c566 feat(lsp): diagnostic related documents support 2025-07-21 16:11:24 -07:00
Riley Bruins
1d8e9b5d07 fix(lsp): store result id for unchanged diagnostic reports
**Problem:** For unchanged document diagnostic reports, the `resultId`
is ignored completely, even though it should still be saved for the
request (in fact, the spec marks it as mandatory for unchanged reports,
so it should be extra important).

**Solution:** Always store the `resultId`.
2025-07-21 16:11:15 -07: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
zeertzjq
4fe6fcc5b7 Merge pull request #34979 from zeertzjq/vim-9.1.1552
vim-patch: tar plugin updates
2025-07-18 09:05:47 +08:00
zeertzjq
77c6cae25b vim-patch:9.1.1552: [security]: path traversal issue in tar.vim
Problem:  [security]: path traversal issue in tar.vim
          (@ax)
Solution: warn the user for such things, drop leading /, don't
          forcefully overwrite files when writing temporary files,
          refactor autoload/tar.vim

tar.vim: drop leading / in path names

A tar archive containing files with leading `/` may cause confusions as
to where the content is extracted.  Let's make sure we drop the leading
`/` and use a relative path instead.

Also while at it, had to refactor it quite a bit and increase the
minimum supported Vim version to v9. Also add a test for some basic tar
functionality

closes: vim/vim#17733

87757c6b0a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-07-18 08:40:23 +08:00
zeertzjq
ad0c21a445 vim-patch:470317f: runtime(tar): remove dependency on netrw#WinPath, include mapping doc
related: vim/vim#17124

470317f78b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-07-18 08:40:23 +08:00
zeertzjq
2efc84d005 vim-patch:a250738: runtime(tar): use readblob() instead of shelling out to file(1)
fixes: #vim/vim#16761
closes: vim/vim#16769

a250738303

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Jim Zhou <jimzhouzzy@gmail.com>
2025-07-18 08:40:23 +08:00
zeertzjq
5671b61327 vim-patch:partial:9.0.0877: using freed memory with :comclear while listing commands
Problem:    Using freed memory with :comclear while listing commands.
Solution:   Bail out when the command list has changed. (closes vim/vim#11440)

cf2594fbf3

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-07-18 08:40:23 +08:00
zeertzjq
4f0ab9877b vim-patch:9.1.1557: not possible to anchor specific lines in diff mode (#34967)
Problem:  not possible to anchor specific lines in diff mode
Solution: Add support for the anchoring lines in diff mode using the
          'diffanchor' option (Yee Cheng Chin).

Adds support for anchoring specific lines to each other while viewing a
diff. While lines are anchored, they are guaranteed to be aligned to
each other in a diff view, allowing the user to control and inform the
diff algorithm what the desired alignment is. Internally, this is done
by splitting up the buffer at each anchor and run the diff algorithm on
each split section separately, and then merge the results back for a
logically consistent diff result.

To do this, add a new "diffanchors" option that takes a list of
`{address}`, and a new "diffopt" option value "anchor". Each address
specified will be an anchor, and the user can choose to use any type of
address, including marks, line numbers, or pattern search. Anchors are
sorted by line number in each file, and it's possible to have multiple
anchors on the same line (this is useful when doing multi-buffer diff).
Update documentation to provide examples.

This is similar to Git diff's `--anchored` flag. Other diff tools like
Meld/Araxis Merge also have similar features (called "synchronization
points" or "synchronization links"). We are not using Git/Xdiff's
`--anchored` implementation here because it has a very limited API
(it requires usage of the Patience algorithm, and can only anchor
unique lines that are the same across both files).

Because the user could anchor anywhere, diff anchors could result in
adjacent diff blocks (one block is directly touching another without a
gap), if there is a change right above the anchor point. We don't want
to merge these diff blocks because we want to line up the change at the
anchor. Adjacent diff blocks were first allowed when linematch was
added, but the existing code had a lot of branched paths where
line-matched diff blocks were handled differently. As a part of this
change, refactor them to have a more unified code path that is
generalized enough to handle adjacent diff blocks correctly and without
needing to carve in exceptions all over the place.

closes: vim/vim#17615

0d9160e11c

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-07-18 08:04:32 +08:00
Gregory Anders
e0d179561d Merge pull request #34860 from gpanders/push-lorwmnmtysnt
feat(tui): use DA1 response to determine OSC 52 support
2025-07-17 18:47:33 -05:00
zeertzjq
9d1333a385 vim-patch:9.1.1563: completion: ruler may disappear (#34977)
Problem:  The ruler disappears after typing the second character during
          insert mode completion, even when completion messages are
          suppressed ('shortmess' includes "c"). This makes the UI
          appear inconsistent.
Solution: Ensure the ruler is restored during screen redraw when popup
          completion is active (Girish Palya).

Notes:
No new tests were added, as existing screen dump tests were updated to
reflect the corrected behavior.

closes: vim/vim#17770

824286c9a7

Nvim already behaves correctly as the popup menu is a separate grid in
the compositor.

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-07-17 23:37:17 +00:00
zeertzjq
1b6848c299 vim-patch:175662f: runtime(vim): Update base syntax, fix incorrect function error (#34975)
Don't match lower-case function names as errors when the qualifier
includes a dict/list accessor.

This is a less than perfect fix until qualified function call matching
is reworked.

fixes: vim/vim#17766
closes: vim/vim#17780

175662f4f2

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-07-17 23:06:51 +00:00
zeertzjq
0d0655f725 vim-patch:57300a2: runtime(doc): fix claim that 'CTRL-W CTRL-C' and 'CTRL-W c' are the same (#34976)
closes: vim/vim#17776

57300a22dc

Co-authored-by: Emilien Breton <bricktech2000@gmail.com>
2025-07-18 07:02:10 +08:00
zeertzjq
4a4e6a792a Merge pull request #34961 from zeertzjq/vim-9.1.1554
vim-patch:9.1.{1554,1559}
2025-07-18 06:29:47 +08:00
zeertzjq
be35864318 vim-patch:9.1.1559: tests: Test_popup_complete_info_01() fails when run alone
Problem:  tests: Test_popup_complete_info_01() fails when run alone.
Solution: Set buffer-local competeopt+=noinsert and add missing cleanup
          in Test_popup_complete() (zeertzjq).

closes: vim/vim#17773

12d274af44
2025-07-18 06:09:51 +08:00
zeertzjq
436ae1d23e vim-patch:9.1.1554: crash when omni-completion opens command-line window
Problem:  Vim crashes during omnifunc completion inside the command-line
          window ("q:") if the completion item attempts to open an "info"
          preview window. This leads to a failed assert during execution.
Solution: Avoid opening preview windows while inside the command-line
          window to prevent the crash (Girish Palya).

closes: vim/vim#17764

e4fdb1e4e7

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-07-18 06:09:51 +08:00
luukvbaal
a08d6a8ac1 test(screen): remove screen:get_default_attr_ids() (#34973)
Problem:  get_default_attr_ids() is used to get and change a subset of
          the current highlight definitions in {fold,popupmenu}_spec.lua,
          for which we have add_extra_attr_ids().
Solution: Use global highlight definitions and use add_extra_attr_ids to
          replace.
2025-07-17 22:57:34 +02:00
zeertzjq
e6ce067f02 vim-patch:9.1.1556: string handling in cmdexpand.c can be improved (#34966)
Problem:  string handling in cmdexpand.c can be improved
Solution: Improve string manipulation in cmdexpand.c (John Marriott).

This PR does the following:

In cmdline_fuzzy_completion_supported():
- replace the series of if tests with a switch

In expand_shellcmd_onedir():
- move the code to concatenate path and pattern to expand_shellcmd().
  This allows us to slightly simplify the argument list to pass the fully
  pathed pattern and the length of the path in the pattern (0 if no path)
- factor out calls to STRMOVE()

In expand_shellcmd():
- factor out calls to STRMOVE() in the first for loop.
- reorganise the second for loop by:
  a) only calling vim_strchr() if s is not at the end of the string
  b) making sure that when the path and pattern are concatenated they fit
     inside buf
  c) concatenating path and pattern and pass to expand_shellcmd_onedir()

In globpath():
- slightly improve logic that determines if the complete path will fit
  inside the buffer

In f_getcompletion():
- replace the series of if tests with a switch
- factor out calls to STRLEN()

In copy_substring_from_pos():
- factor out the call to STRLEN()

closes: vim/vim#17742

393d398247

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-07-17 02:45:37 +00:00
nikolightsaber
8bf99ddbac docs(lua): add vim.pack to _meta.lua #34957
Problem: Goto definition to pack.lua does not work

Solution: Add pack to _meta.lua

Co-authored-by: Nikolai Devolder <nikolai.devolder@yamabiko.eu>
2025-07-16 19:18:52 -07:00
luukvbaal
e946951f6a test(tui_spec): flakiness, global highlight definitions #34958 2025-07-16 18:54:22 -07:00
zeertzjq
1c6ddd9a5f build(vim-patch.sh): remove vim.pot (#34964)
This file is updated on almost every source change like version.c.
2025-07-17 09:27:41 +08:00
zeertzjq
fcec1610e7 vim-patch:9.1.1555: completion: repeated insertion of leader (#34962)
Problem:  completion: repeated insertion and deletion of complete
          functions
Solution: Remove unnecessary insertion and deletion of leader text
          ('compl_orig_text') during expansion of function present in
          'complete' option (Girish Palya).

closes: vim/vim#17738

78b10eab6c

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-07-16 23:17:50 +00:00
Christian Clason
8bccd07972 vim-patch:9.1.1549: filetype: pkl files are not recognized
Problem:  filetype: pkl files are not recognized
Solution: detect *.pkl files as pkl filetype, include
          a filetype plugin (Riley Bruins)

References:
https://pkl-lang.org/
https://github.com/apple/pkl

closes: vim/vim#17751

d128889b30

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-07-16 10:32:33 +02:00
Christian Clason
4195b82ec9 vim-patch:9.1.1548: filetype: OpenFGA files are not recognized
Problem:  filetype: OpenFGA files are not recognized
Solution: detect *.fga files as fga filetype, include an fga filetype
          plugin (Riley Bruins)

References:
https://github.com/openfga
https://marketplace.visualstudio.com/items?itemName=openfga.openfga-vscode

closes: vim/vim#17752

0992f62fc1

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-07-16 10:32:33 +02:00
Christian Clason
fa648731ec vim-patch:9a667b4: runtime(swig): add 'comments', 'commentstring' in filetype plugin
Reference:
https://www.swig.org/Doc1.3/SWIG.html#SWIG_nn5

closes: vim/vim#17753

9a667b4dba

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-07-16 10:32:33 +02:00
Christian Clason
694f634556 vim-patch:30df425: runtime(twig): include twig filetype plugin
closes: vim/vim#17754

30df42557c

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-07-16 10:32:33 +02:00
Christian Clason
83818b885a vim-patch:edce689: runtime(python2): Highlight b-strings in Python 2.7
related: vim/vim#14033
related: vim/vim#17726

closes: vim/vim#17757

edce68912e

Co-authored-by: Rob B <github@0x7e.net>
2025-07-16 10:32:33 +02:00
Donatas
ace254c9ff fix(lsp): close floating preview window correctly #34946
Problem:
After 28b7c2d (found with bisect) the hover preview window does not
close when :edit'ing another file, even when you move the cursor.

Solution:
Change the BufLeave to target the original buffer, not the preview
buffer.
2025-07-15 20:12:45 -07:00
zeertzjq
5cfdd4d8b9 vim-patch:9.1.1551: [security]: path traversal issue in zip.vim (#34951)
Problem:  [security]: path traversal issue in zip.vim (@ax)
Solution: drop leading ../ on write of zipfiles, don't forcefully
          overwrite existing files

A zip plugin which contains filenames with leading '../'  may cause
confusion as to where the content will be extracted.  Let's drop such
things and make sure we use a relative filename instead and don't
forcefully overwrite temporary files. Also, warn the user of such
things.

related: vim/vim#17733

586294a041

vim-patch:e1044fb: runtime(zip): raise minimum Vim version to v9.0
vim-patch:e2d9b0d: runtime(zip): zip plugin does not work with Vim 9.0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-07-16 01:08:57 +00:00
Phạm Bình An
9789a3b854 revert: "fix(runtime): set 'foldmethod' for Lua ftplugin #34929" (#34947)
This reverts commit 12276832ab.
2025-07-16 06:15:16 +08:00
Gregory Anders
112092271b refactor(vterm): update vterm DA1 response
Update vterm's DA1 response to the more modern version that indicates
level 1 support for VT100 emulation (61) as well as ANSI color support
(22).
2025-07-15 08:41:13 -05:00
Christian Clason
d4c8e8df1c vim-patch:a24f5be: runtime(python): highlight bytes in python
- Highlight bytes literals
- Do not highlight Unicode escape sequences in bytes literals

fixes: vim/vim#14033
fixes: vim/vim#17726
closes: vim/vim#17728

a24f5be86d

Co-authored-by: Rob B <github@0x7e.net>
2025-07-15 00:14:00 +02:00
Christian Clason
3eb597c999 vim-patch:baa781a: runtime(python2): highlight unicode strings in python2
fixes: vim/vim#14033
fixes: vim/vim#17726
closes: vim/vim#17729

baa781a4c3

Co-authored-by: Rob B <github@0x7e.net>
2025-07-15 00:14:00 +02:00
Christian Clason
73987a4301 vim-patch:e85a66a: runtime(erlang): Add support for triple-quoted strings and docstrings
Erlang recently added the `-moduledoc` attribute as well as triple
quoted strings and the `~` prefix for binary strings, see [1].

Erlang also added nominal types. See EEP-69 [2].

This commit removes the documentation of "g:erlang_highlight_bifs" and
"g:erlang_highlight_special_atoms", which are not longer supported.
"g:erlang_old_style_highlight" is kept undocumented (as it should not be
used by new users).

This commit contains the modifications in the following PR and commits:

- vim-erlang/vim-erlang-runtime#58
- vim-erlang/vim-erlang-runtime@43d18d3
- vim-erlang/vim-erlang-runtime@ac88ebf
- vim-erlang/vim-erlang-runtime@19c1be9
- vim-erlang/vim-erlang-runtime@7f5cefc
- vim-erlang/vim-erlang-runtime@976b10b

[1]: https://www.erlang.org/doc/system/documentation.html
[2]: https://www.erlang.org/eeps/eep-0069

closes: vim/vim#17687

e85a66a4d4

Co-authored-by: Csaba Hoch <csaba@cursorinsight.com>
Co-authored-by: Johannes Christ <jc@jchri.st>
2025-07-15 00:14:00 +02:00
Lewis Russell
a945686444 feat(term): increase max scrollback to 1000000
Problem:
Cannot use `nvim_open_term()` to pipe terminal scrollback > 100000

Solution:
Increase scrollback limit to 1000000

If there's no technical consequences of doing this, can be set even
higher in the future.
2025-07-14 16:41:18 +01:00
Phạm Bình An
12276832ab fix(runtime): set 'foldmethod' for Lua ftplugin #34929
Problem:
Neovim's Lua ftplugin doesn't set `'foldmethod'`, though Vim one sets it 1341176e7b/runtime/ftplugin/lua.vim (L66-L68)

Solution:
Set it
2025-07-14 05:28:30 -07:00
Justin M. Keyes
7bf04bc01f test(fold): flaky "doesn't open folds that are not touched" #34911 2025-07-13 17:05:01 -07:00
zeertzjq
9f16b598f9 vim-patch:1341176: runtime(vim): Update help syntax file, improve highlighting of included Vim examples (#34924)
- Take over as file maintainer.
- Improve highlighting of legacy script examples by using :syn-iskeyword
  with the default 'iskeyword' value. Vim9 script examples are not
  supported yet.
- Match admonition labels in more contexts.
- Match URLs in more contexts.

fixes vim/vim#17721
closes: vim/vim#17731

1341176e7b

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-07-13 23:11:22 +00:00
zeertzjq
f487ae90cf vim-patch:9.1.1539: completion: messages don't respect 'shm' setting (#34923)
Problem:  completion: messages don't respect 'shm' setting
Solution: Turn off completion messages when 'shortmess' includes "c"
          (Girish Palya).

`:set shortmess+=c` is intended to reduce noise during completion by
suppressing messages.
Previously, some completion messages still appeared regardless of this setting.

This change ensures that **all** completion-related messages are suppressed
when `'c'` is present in `'shortmess'`.

Not entirely sure if the original behavior was intentional. If there's a
reason certain messages were always shown, feel free to close this without
merging.

closes: vim/vim#17737

fe1d3c8af7

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-07-13 22:53:40 +00:00
Christian Clason
96ec4db3e9 build(deps): bump tree-sitter to v0.25.8 2025-07-13 23:00:50 +02:00
Tom Ampuero
7cd5356a6f feat(net): vim.net.request(), :edit [url] #34140
Problem:
Nvim depends on netrw to download/request URL contents.

Solution:
- Add `vim.net.request()` as a thin curl wrapper:
  - Basic GET with --silent, --show-error, --fail, --location, --retry
  - Optional `opts.outpath` to save to a file
  - Operates asynchronously. Pass an `on_response` handler to get the result.
- Add integ tests (requires NVIM_TEST_INTEG to be set) to test success
  and 404 failure.
- Health check for missing `curl`.
- Handle `:edit https://…` using `vim.net.request()`.

API Usage:
1. Asynchronous request:

    vim.net.request('https://httpbingo.org/get', { retry = 2 }, function(err, response)
      if err then
        print('Fetch failed:', err)
      else
        print('Got body of length:', #response.body)
      end
    end)

2. Download to file:

    vim.net.request('https://httpbingo.org/get', { outpath = 'out_async.txt' }, function(err)
      if err then print('Error:', err) end
    end)

3. Remote :edit integration (in runtime/plugin/net.lua) fetches into buffer:

    :edit https://httpbingo.org/get
2025-07-13 13:43:11 -07:00
Christian Clason
444a8b3ec6 vim-patch:6f85cec: runtime(python): update rendering of Unicode named literals in syntax script
This change:

* enforces that the alias starts with a letter
* allows the other words in an alias to be separated by either a space
  or a hyphen, but not both or double separators
* allows only a letter after space, possibly followed by letters or
  digits
* allows both letters and digits after a hyphen

Tested with:

    a = '\N{Cyrillic Small Letter Zhe} is pronounced as zh in pleasure'
    b = '\N{NO-BREAK SPACE} is needed here'
    # ... other tests here
    r = '\N{HENTAIGANA LETTER E-1} is a Japanese hiragana letter archaic ye'
    s = '\N{CUNEIFORM SIGN NU11 TENU} is a correction alias'
    t = '\N{RECYCLING SYMBOL FOR TYPE-1 PLASTICS} base shape is a triangle'
    print(a)
    print(b)
    print(r)
    print(s)
    print(t)

The tests confirm the behavior and are selected from real Unicode
tables/aliases to check these combinations based on the specification.

fixes: vim/vim#17323
closes: vim/vim#17735

6f85cec4fb

Co-authored-by: Zvezdan Petkovic <zpetkovic@acm.org>
2025-07-13 11:07:40 +02:00
zeertzjq
3e7f5d95aa vim-patch:ce1d196: runtime(vim): Update base syntax, improve :match highlighting (#34912)
- Match the range prefix separately as a count.
- Match an explicit count of 1, rarely used but seen in the wild.
- Allow whitespace between the count and command.

closes: vim/vim#17717

ce1d1969f3

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-07-13 16:39:19 +08:00
Yi Ming
73fbc693b5 refactor(lsp): drop vim.lsp.util._refresh() #33903
Problem:
- util._refresh() is only used by `inlay_hint.lua` and `document_color.lua`, and
  both have their own wrapper functions;
- util._refresh() provides unified parameters, but this layer of wrapping is
  almost meaningless because
  - document color does not need the range parameter;
  - inlay hint requires a range parameter, but it is not complicated

Therefore, it can be considered redundant.
ref https://github.com/neovim/neovim/pull/32887#discussion_r1996413602

Solution:
Remove it.
2025-07-12 22:00:10 -07:00
Justin M. Keyes
89b946aa87 fix(lua): vim.diff is nil in uv.new_work() thread #34909
Problem:
The "gitsigns" plugin runs `vim.diff` in a thread (`uv.new_work`), but
`vim.diff` is nil in that context:

    Lua callback:
    …/gitsigns.nvim/lua/gitsigns/diff_int.lua:30: bad argument #1 to 'decode' (string expected, got nil)
    stack traceback:
      [C]: in function 'decode'
      …/gitsigns.nvim/lua/gitsigns/diff_int.lua:30: in function <…/gitsigns.nvim/lua/gitsigns/diff_int.lua:29>
    Luv thread:
    …/gitsigns.nvim/lua/gitsigns/diff_int.lua:63: attempt to call field 'diff' (a nil value)

Solution:
Revert the `stdlib.c` change (set `vim.diff` instead of `vim._diff`).
2025-07-12 20:54:22 -07:00
Justin M. Keyes
5c4f9b05fa Merge #34797 refactor(lsp): enable()/is_enabled() 2025-07-12 23:44:21 -04:00
Yi Ming
7e8aa0585e refactor(lsp): rename vim.lsp.semantic_tokens start/stop to enable() 2025-07-13 11:03:22 +08:00
Yi Ming
a8d9f3331e test(lsp): remove the deprecated feed_command 2025-07-13 11:03:22 +08:00
Yi Ming
7ac4cbcd2e refactor(lsp): utility functions for enable()/is_enabled() 2025-07-13 11:03:22 +08:00
Jaehwang Jung
4778a4c201 fix(lsp): prevent flicker in codelens virtual text #34888
Problem:
Calling lsp.codelens.refresh() causes transient visual flicker because
codelens virtual texts are briefly replaced with "Unresolved lens ..."
before being resolved and redrawn. Since refresh() is triggered
frequently (e.g., on CursorHold or InsertLeave), this leads to redundant
and noisy virtual text updates, even when the final text hasn't changed.

Solution:
Do not update virtual text for a line if some lenses for that line are
not resolved yet.

A trade-off is that the user may temporarily see outdated virtual text.
However, that's preferable to spamming updates on every refresh.
2025-07-12 16:55:58 -07:00
Justin M. Keyes
815916b450 test: zig build thread_spec.lua failure after vim.text.diff rename
Problem:
Since renaming `vim.diff` to `vim.text.diff`, `thread_spec.lua` fails in
the zig build. Is `vim.text.diff` not available in the thread context?
Why does it only fail in the zig build?

    FAILED   ./test/functional/lua/thread_spec.lua @ 217: thread vim.* diff
    ./test/functional/lua/thread_spec.lua:229: Expected objects to be the same.
    Passed in:
    (nil)
    Expected:
    (table: 0x7f221d392218) {
      [1] = 'notification'
    E5113: Lua chunk:
      [2] = 'result'
      [3] = {
        [1] = '@@ -1 +1 @@
    -Hello
    +Helli
    ' } }

    stack traceback:
            ./test/functional/lua/thread_spec.lua:229: in function <./test/functional/lua/thread_spec.lua:217>

    FAILED   ./test/functional/lua/thread_spec.lua @ 372: threadpool vim.* work
    ./test/functional/lua/thread_spec.lua:384: Expected objects to be the same.
    Passed in:
    (table: 0x7f2225be2c30) {
      [1] = 'notification'
      [2] = 'result'
     *[3] = {
       *[1] = vim.NIL } }
    Expected:
    (table: 0x7f2225be25c0) {
      [1] = 'notification'
      [2] = 'result'
     *[3] = {
       *[1] = '@@ -1 +1 @@
    -Hello
    +Helli
    ' } }

    stack traceback:
            ./test/functional/lua/thread_spec.lua:384: in function <./test/functional/lua/thread_spec.lua:372>

Solution:
Use `vim._diff` in the test, until a root cause is found.
2025-07-12 18:58:17 -04:00
Justin M. Keyes
f3a54e7ccf refactor(lua): rename vim.diff => vim.text.diff #34864
Problem:
`vim.diff()` was introduced before we had the `vim.text` module, where
it obviously belongs.

Solution:
Move it.
2025-07-12 22:36:07 +00:00
Justin M. Keyes
430be9d01d ci(test): use ARM ubuntu linux for more CI jobs #34908
Problem:
We temporarily disabled linux arm ci because of stability issues with
the runner. #32339 Since then, the hardware was changed, so we can try
re-enabling ARM linux CI. https://github.com/actions/partner-runner-images/issues/47#issuecomment-2678170225

Solution:
- re-enable arm linux ci. reverts 8e4b77134a
- also use arm image for these jobs, where arm seems to run much faster:
- `lint` (step: `clang-tidy`)
    - master: 1m5s
    - this pr (linux ARM): 37s
- `clang-analyzer` (step: `cmake --build ...`)
    - master: 10m
    - this pr (linux ARM) 5m 55s
- `with-external-deps` (step: `Build`)
    - master: 26s
    - this pr (linux ARM): 21s
2025-07-12 14:32:59 -07:00
Christian Clason
3812cb1cd1 build(deps): bump tree-sitter to v0.25.7 2025-07-12 21:29:41 +02:00
Justin M. Keyes
2422fbdd5f fix(health): bad format() call #34904
Problem:
Bad format() call on PUC Lua #34901

    Error: Failed to run healthcheck for "vim.health" plugin. Exception:
    runtime/lua/vim/health/health.lua:89: bad argument #1 to 'format' (string expected, got nil)

Solution:
Avoid passing nil.
2025-07-12 11:27:51 -07:00
Christian Clason
eb5b4b9e57 build(deps): bump tree-sitter-vim to v0.7.0 2025-07-12 18:57:52 +02:00
luukvbaal
d2098057a7 docs(autocmd): generate events enum type #34883 2025-07-12 07:46:13 -07:00
Travis Finkenauer
34fbfa3586 refactor(build): use consistent cmake names #34893
CMake is functions/macros are case-insensitive (unlike variables), but
names differing only by case (e.g. "BuildLuaJit" instead of
"BuildLuajit") may look the same at a glance. This can be confusing if
you do a case-sensitive search, such as by using the * key in neovim to
search for other instances of the word under the cursor.
2025-07-12 07:00:36 -07:00
Phạm Bình An
f1babb322b refactor(qf): move syntax code for qf-toc to qf.lua #34879 2025-07-11 18:13:20 -07:00
luukvbaal
8c6ea76ebc fix(extui): disable cmdline highlighter when showing a message (#34887)
Problem:  When message is moved from message window to cmdline,
          the cmdline highlighter is not disabled.
Solution: Disable the highlighter (and only scroll to bottom when
          message was moved to pager).
2025-07-12 01:15:31 +02:00
zeertzjq
d4074b812d vim-patch:9.1.1538: tests: string options in gen_opt_test.vim not fully sorted (#34891)
Problem:  tests: string options in gen_opt_test.vim aren't fully sorted.
Solution: Sort the string options alphabetically.  Also make description
          of 'maxsearchcount' start with lower-case for consistency with
          other options, update documentation for searchcount().

closes: vim/vim#17720

7306e8fcdb
2025-07-11 22:56:43 +00:00
luukvbaal
7f5b5d34cf fix(window): don't store invalid height in window config (#34885)
Problem:  When 'winminheight' is zero and the window height is set to
          zero, the actual height is clamped whereas the stored config
          value is not. Reciprocal window configuration through
          nvim_win_get_config() then results in an error.
Solution: Also clamp the stored dimensions in the window config.
2025-07-11 16:53:30 +00:00
Tomasz N
9e968635ef fix(extui): check if buffers/windows exist before deleting (#34886)
Problem: Disabling vim._extui may try to delete non-existent windows/buffers.
Solution: Check that window/buffer is valid before deleting.
2025-07-11 17:31:30 +02:00
Justin M. Keyes
4f3aa7bafb Merge #34558 docs 2025-07-10 22:36:16 -04:00
jade
7a69fefdb9 fix(vim.json): loss of precision on integers >14 digits #34876
Problem: multiple DAP servers keep assuming they can have internal IDs
         up to 2**52, which get corrupted by the Neovim JSON encoder.
Solution: change (1) constant and add a test so nobody breaks it while
          updating the library.

Fixes: https://github.com/neovim/neovim/issues/24532
Fixes: https://github.com/mfussenegger/nvim-dap/issues/1534
Fixes: https://github.com/facebook/buck2/issues/1032
2025-07-10 19:07:56 -07:00
Justin M. Keyes
c3e2926f17 docs: deprecate :ownsyntax 2025-07-10 21:50:46 -04:00
Justin M. Keyes
e78c877688 docs: rename ui.txt => api-ui-events.txt 2025-07-10 21:50:46 -04:00
Justin M. Keyes
58df501913 docs: api, pack, events, develop 2025-07-10 21:50:46 -04:00
zeertzjq
00f8f94d5b vim-patch:9.1.1535: the maximum search count uses hard-coded value 99 (#34873)
Problem:  The maximum search count uses a hard-coded value of 99
          (Andres Monge, Joschua Kesper)
Solution: Make it configurable using the 'maxsearchcount' option.

related: vim/vim#8855
fixes: vim/vim#17527
closes: vim/vim#17695

b7b7fa04bf

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-07-11 09:17:05 +08:00
luukvbaal
54cde0674b test(ui/{cmdline,message}2_spec): reduce flakiness/runtime #34875
Problem:  Storing the configured 'cmdheight' value is scheduled and
          may happen after cmdline2_spec already entered block_mode.
          Excessive wait time for expected screen state due to delayed
          ruler after an error message.
Solution: Only schedule storing the user configured 'cmdheight' if
          v:vim_did_enter is unset. Use regular message instead of error.
2025-07-10 17:52:50 -07:00
zeertzjq
9809ce8b47 vim-patch:6ac2e4a: runtime(vim): Update base syntax, improve function call highlighting (#34874)
- Match more function calls.
- Contain function call syntax groups.
- Improve differentiation between Ex commands and builtin functions with
  the same name.  Remove special cases.  Command modifiers are not
  currently well differentiated from functions.

closes: vim/vim#17712

6ac2e4aa0a

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-07-11 07:20:25 +08:00
Riley Bruins
68e316e3f9 feat(diagnostic): jump to related info location from open_float #34837
This commit allows users to jump to the location specified in a
diagnostic's `relatedInformation`, using `gf` from within the
`open_float` window. The cursor need only be on line that displays the
related info.
2025-07-10 11:24:17 -07:00
Riley Bruins
7bd4dfd209 refactor(lsp): simplify multiline semantic token logic #34698
This commit makes it so that only one call to `vim.str_byteindex` is
needed, at the end of the `end_line`, `end_col` calculations.
2025-07-10 11:12:18 -07:00
Maria José Solano
4745270bf1 feat(lsp): support textDocument/colorPresentation (#34823)
feat(lsp): support for `textDocument/colorPresentation`
2025-07-10 08:51:26 -07:00
Sebastian Lyng Johansen
213360c389 fix(lsp): custom 'winborder' in make_floating_popup_options() #34868 2025-07-10 05:51:13 -07:00
glepnir
5803994a1c fix(highlight): preserve bg transparency with winblend=100 #34825
Problem: When winblend=100 is set on floating windows with transparent
background, the desktop background is not visible through the window.

Solution: Add special case to preserve transparency (-1) when blend
ratio is 100% and background was originally transparent.
2025-07-10 05:42:45 -07:00
Lewis Russell
e644038f06 docs: move vim.system to own section 2025-07-10 13:34:58 +01:00
zeertzjq
7f18811668 vim-patch:32a1b26: runtime(filetype): improve asm heuristics and move into FTasmsyntax() (#34863)
fixes: vim/vim#17474
closes: vim/vim#17683

32a1b26ef3

vim-patch:41ee98c: runtime(filetype): fix incorrect pattern and break early

- Using `\n` is incorrect, as result of getline() does not contain line
  breaks and only uses `\n` for NUL bytes.
- Return when b:asmsyntax is set, like many other filetypes.

closes: vim/vim#17706

41ee98c3c5

Co-authored-by: Wu Yongwei <wuyongwei@gmail.com>
2025-07-10 20:30:39 +08:00
Christian Clason
fccd016a0f vim-patch:bda55df: Revert "runtime(haskell): Add single quote to iskeyword in ftplugin (vim/vim#8191)"
This reverts commit 5e6e4042b1c9685bce86493e3ee6fe916a7f221c.

related: vim/vim#8191

bda55df3b8

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-07-10 09:29:15 +02:00
zeertzjq
e65c0a0810 fix(tui): check for title support correctly (#34866) 2025-07-10 14:17:20 +08:00
glepnir
fb0dc825e9 feat(option): custom chars in 'winborder' #33772
Problem: winborder option only supported predefined styles and lacked support for custom border characters.

Solution: implement parsing for comma-separated list format that allows specifying 8 individual border characters (topleft, top, topright, right, botright, bottom, botleft, left).
2025-07-09 18:15:08 -07:00
Sebastian Lyng Johansen
7526fb449d feat(extui): use winborder for msg window #34859
Problem:  The message window is essentially a regular floating window
          but does not use 'winborder'.
          Still some "scratch" buffer options unset after it was removed
          from its window.
Solution: Do not set the border when opening the window message.
          Forego passing `scratch = true` when opening a buffer,
          set the options manually when necessary.

Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
2025-07-09 17:42:47 -07:00
zeertzjq
8aed423072 vim-patch:3987eac: runtime(doc): clarify how ex ranges are adjusted when acting on folds (#34862)
closes: vim/vim#17696

3987eac572

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-07-09 22:55:35 +00:00
Gregory Anders
977e91b424 feat(tui): use DA1 response to determine OSC 52 support
Many terminals now include support for OSC 52 in their Primary Device
Attributes (DA1) response. This is preferable to using XTGETTCAP because
DA1 is _much_ more broadly supported.
2025-07-09 14:03:03 -05:00
phanium
76f6868e0a fix(runtime): no conceal in qf on :lopen #34854
Problem:
No conceal in qf on `lopen` since 74fcc945. Repro:

    nvim --clean +'tab Man ls' +'norm gO' +lclose +lopen

Solution:
Consider "Table of contents" title.
2025-07-09 09:36:10 -07:00
Leonhard Kipp
840cdb9589 feat(shada): shada should not store nobuflisted buffers #21818
Problem:  Shada jumplist entries still include entries from e.g. 'nobuflisted' buffers.
Solution: Check `ignore_buf()` before adding jumplist entries, followup to b98eefd8.

Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
2025-07-09 09:33:20 -07:00
luukvbaal
3a3484be29 test(messages/cmdline_spec): convert highlight IDs to name and format (#34845)
Problem:  Hardcoded highlight IDs for ext_messages/cmdline output need
          to be adjusted everytime a builtin highlight group is added.
Solution: Store a global map of default highlights through nvim_get_hl()
          and fetch missing (custom) highlight groups through synIDattr().
          Use more compact formatting for screen:expect().
2025-07-09 09:33:19 +00:00
luukvbaal
3c9484b550 feat(extui): show dismissed message in cmdline (#34745)
Problem:  An accidental key press can dismiss a routed message to be
          shown in full before the user was able to read it.
          'verbose' message routing based on an outdated condition results
          in "last_set" messages being separated from its message pair.
Solution: Show a message to be shown in full in the cmdline window instead
          of the pager. Keep it there and update the spill indicator when
          the message is dismissed.
          Remove the 'verbose' message routing.
2025-07-09 11:17:18 +02:00
Justin M. Keyes
88774965e5 feat(api): relax contract, allow return-type void => non-void #34811
Allow changing return-type from `void => non-void`.
2025-07-09 02:40:08 +00:00
zeertzjq
96aef50624 Merge pull request #34852 from zeertzjq/vim-9.1.1526
vim-patch:9.1.{1526,1528}
2025-07-09 08:55:08 +08:00
zeertzjq
5fe310c5e6 vim-patch:9.1.1528: completion: crash with getcompletion()
Problem:  completion: crash with getcompletion()
          (zeertzjq)
Solution: Don't set may_expand_pattern in f_getcompletion(),
          unset may_expand_pattern() once it is not longer needed
          (Girish Palya).

fixes: vim/vim#17680
closes: vim/vim#17686

f2ec8d4afc

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-07-09 08:06:23 +08:00
zeertzjq
ef0ec7edac vim-patch:9.1.1526: completion: search completion match may differ in case
Problem:  completion: search completion match may differ in case
          (techntools)
Solution: add "exacttext" to 'wildoptions' value (Girish Palya)

This flag does the following:

exacttext
      When this flag is present, search pattern completion
      (e.g., in |/|, |?|, |:s|, |:g|, |:v|, and |:vim|)
      shows exact buffer text as menu items, without
      preserving regex artifacts like position
      anchors (e.g., |/\<|). This provides more intuitive
      menu items that match the actual buffer text. However,
      searches may be less accurate since the pattern is not
      preserved exactly.
      By default, Vim preserves the typed pattern (with
      anchors) and appends the matched word. This preserves
      search correctness, especially when using regular
      expressions or with 'smartcase' enabled. However, the
      case of the appended matched word may not exactly
      match the case of the word in the buffer.

fixes: vim/vim#17654
closes: vim/vim#17667

93c2d5bf7f

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-07-09 08:06:23 +08:00
zeertzjq
db7c2acbc6 vim-patch:9.1.1532: termdebug: not enough ways to configure breakpoints (#34851)
Problem:  termdebug: not enough ways to configure breakpoints
Solution: add the termdebug_config['signs'] config setting, rework the
          termdebug test cases (Dimitry Ishenko)

Allow to configure custom breakpoint signs so one can do something like
this:

```vim
let g:termdebug_config['signs'] = ['>1', '>2', '>3', '>4', '>5', '>6', '>7', '>8', '>9']
let g:termdebug_config['sign'] = '>>'
```

where the first 9 breakpoints will have their own signs and the rest
will be the same (>>).

While at it, rework the test for the termdebug plugin:

- Added test for g:termdebug_config['signs'].
- Added test for g:termdebug_config['sign'].
- Moved test for g:termdebug_config['sign_decimal'] into
  Test_termdebug_basic()

closes: vim/vim#17694

c4bca1de0b

Co-authored-by: Dimitry Ishenko <dimitry.ishenko@gmail.com>
2025-07-08 22:38:58 +00:00
Phạm Bình An
435f03ee10 docs: tag of :EditQuery #34844
Problem:
- Running `:h :EditQuery` throws error `E149: Sorry, no help for
  :EditQuery`
- vim_diff.txt miss an entry for `:EditQuery`

Solution:
- Make tag `[:EditQuery]()` right-aligned, similar to command `:Open`
- Update vim_diff.txt
2025-07-08 05:28:12 -07:00
PilgrimLyieu
bb6422f1ad docs(tutor): Chinese (zh-CN) translation #34803
Co-authored-by: glepnir <glephunter@gmail.com>
2025-07-08 05:26:39 -07:00
glepnir
28b7c2df52 fix(health): floating window closes when opening TOC (gO) #34794
Problem: Health check floating window gets closed when pressing 'gO' to show TOC because LSP floating preview system auto-closes on BufEnter events triggered by :lopen.

Solution: Temporarily disable BufEnter event for the current window during TOC operations and adjust window layout to prevent overlap.
2025-07-08 05:21:09 -07:00
luukvbaal
f68a5c40f0 feat(messages): add "prev_cmd" argument to msg_history_show (#34779)
Problem:  Unable to tell whether msg_history_show event is emitted for a
          :messages or g< command.
Solution: Add "prev_cmd" argument that is set to true for g<.
2025-07-08 11:19:02 +02:00
phanium
f576b59a09 docs: type fixes #34831 2025-07-07 18:56:22 -07:00
Mathias Fußenegger
bf9d3e4bf8 fix(prompt): lnum update via nvim_buf_set_lines if buf != curbuf #34833
Fixes the case from https://github.com/neovim/neovim/issues/34561#issuecomment-3031536581
2025-07-07 17:42:45 -07:00
Phạm Bình An
d88bebfbc7 docs: misc #34834
Problems:
- Miss some entries in `vim_diff.txt` and `index.txt`.
- I want to learn about Vim register, but when I type `:h register`, it
  shows sponsor information instead. Note that unlike Nvim, Vim has a
  separate session for `*register*`

Solution:
- Add missing commands to `index.txt`, `vim_diff.txt`
- Remove tag `register` from `index.txt`
2025-07-07 17:31:37 -07:00
zeertzjq
27daeb0d68 vim-patch:9.1.1520: completion: search completion doesn't handle 'smartcase' well (#34840)
Problem:  When using `/` or `?` in command-line mode with 'ignorecase' and
          'smartcase' enabled, the completion menu could show items that
          don't actually match any text in the buffer due to case mismatches

Solution: Instead of validating menu items only against the user-typed
          pattern, the new logic also checks whether the completed item
          matches actual buffer content. If needed, it retries the match
          using a lowercased version of the candidate, respecting
          smartcase semantics.

closes: vim/vim#17665

af22007784

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-07-08 08:07:42 +08:00
zeertzjq
ed8b022633 Merge pull request #34841 from zeertzjq/vim-9.1.0877
vim-patch:9.1.{0877,1519}
2025-07-08 08:06:34 +08:00
zeertzjq
842ca1fd5c vim-patch:9.1.1519: tests: Test_termdebug_decimal_breakpoints() may fail
Problem:  Test_termdebug_decimal_breakpoints() fails with List index out
          of range, because when adding the second breakpoint, the
          cursor is still on the very first line (a header include line)
          and therefore gdb refuses to set the breakpoint with:
          `msg="No compiled code for line 1 in file XTD_decimal.c"`
Solution: Run the program, so that it will break at the very first
          defined breakpoint and then once we are in the program,
          set further breakpoints

closes: vim/vim#17689

faed074ab7

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-07-08 07:22:25 +08:00
zeertzjq
62822d750d vim-patch:9.1.0877: tests: missing test for termdebug + decimal signs
Problem:  tests: missing test for termdebug + decimal signs
Solution: Add a termdebug test (Ubaldo Tiberi)

closes: vim/vim#16081

b5c1557323

Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@volvo.com>
2025-07-08 07:22:25 +08:00
zeertzjq
5fd386a893 Merge pull request #34828 from ncrpy/fix-get_keymap-lhsrawalt
fix(api): populate `lhsrawalt` in `nvim_get_keymap` response
2025-07-08 07:22:02 +08:00
zeertzjq
0c973bf442 test(api): nvim_get_keymap returns correct lhsraw and lhsrawalt 2025-07-08 06:40:07 +08:00
ncrpy
d523750de0 fix(api): populate lhsrawalt in nvim_get_keymap response
Problem:
The `nvim_get_keymap()` function is missing the `lhsrawalt` field in its response for mappings with an alternate key representation. This makes its return value inconsistent with its documented `maparg()`-like structure and its formal type definition.

Solution:
Corrects the `keymap_array` function to pass the alternate mapping keys (`current_maphash->m_alt->m_keys`) to `mapblock_fill_dict`. The argument responsible for this was previously hardcoded to `NULL`.

For example, for a mapping of `<C-x>`, the API will now correctly return both `lhsraw` (`<80><fc>^DX`) and `lhsrawalt` (the alternate form, e.g., `^X`).
2025-07-08 06:40:07 +08:00
zeertzjq
c3c8d25293 vim-patch:9.1.1521: completion: pum does not reset scroll pos on reopen with 'noselect' (#34836)
Problem:  When 'wildmode' is set to include "noselect", the popup menu (pum)
          incorrectly retained its scroll position when reopened. This
          meant that after scrolling down through the menu with `<C-n>`,
          reopening the menu (e.g., by retyping the command and
          triggering completion again) would show the menu starting from
          the previously scrolled position, rather than from the top.
          This could confuse users, as the first visible item would not
          be the first actual match in the list.

Solution: Ensure that the popup menu resets its scroll position to the
          top when reopened (Girish Palya).

closes: vim/vim#17673

0cd7f3536b

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-07-08 06:37:30 +08:00
Riley Bruins
2031287e93 feat(lsp): support diagnostic related information (#34474) 2025-07-07 13:05:02 -04:00
Christian Clason
0d9bf5b89f vim-patch:244198f: runtime(autopkgtest): add ftplugin file for autopkgtest
closes: vim/vim#17679

244198f039

Co-authored-by: James McCoy <jamessan@jamessan.com>
2025-07-07 11:24:04 +02:00
Christian Clason
4310f3f580 vim-patch:e9d331d: runtime(autopkgtest): add syntax file for autopkgtest
related: vim/vim#17679

e9d331d173

Co-authored-by: James McCoy <jamessan@jamessan.com>
2025-07-07 11:24:04 +02:00
Christian Clason
d73788fad2 vim-patch:48c823c: runtime(debcontrol): move kernel/architecture definitions to shared/debarchitectures.vim
related: vim/vim#17679

48c823ca01

Co-authored-by: James McCoy <jamessan@jamessan.com>
2025-07-07 11:24:04 +02:00
Christian Clason
3177841bdf vim-patch:9.1.1517: filetype: autopkgtest files are not recognized
Problem:  filetype: autopkgtest files are not recognized
Solution: detect */debian/tests/control files as autopkgtest filetype
          (James McCoy)

Autopkgtest is a Debian tool for testing installed versions of packages
when other, related packages are updated.

Reference:
- https://www.debian.org/doc/debian-policy/autopkgtest.txt

related: vim/vim#17679

5bcc492649

Co-authored-by: James McCoy <jamessan@jamessan.com>
2025-07-07 11:24:04 +02:00
Yi Ming
8d5452c46d refactor(lsp): stateful data abstraction, vim.lsp.Capability #34639
Problem:
Closes #31453

Solution:
Introduce `vim.lsp.Capability`, which may serve as the base class for
all LSP features that require caching data. it
- was created if there is at least one client that supports the specific method;
- was destroyed if all clients that support the method were detached.

- Apply the refactor for `folding_range.lua` and `semantic_tokens.lua`.
- Show active features in :checkhealth.

Future:
I found that these features that are expected to be refactored by
`vim.lsp.Capability` have one characteristic in common: they all send
LSP requests once the document is modified. The following code is
different, but they are all for this purpose.

- semantic tokens:
fb8dba413f/runtime/lua/vim/lsp/semantic_tokens.lua (L192-L198)
- inlay hints, folding ranges, document color
fb8dba413f/runtime/lua/vim/lsp/inlay_hint.lua (L250-L266)

I think I can sum up this characteristic as the need to keep certain
data synchronized with the latest version computed by the server.
I believe we can handle this at the `vim.lsp.Capability` level, and
I think it will be very useful.

Therefore, my next step is to implement LSP request sending and data
synchronization on `vim.lsp.Capability`, rather than limiting it to the
current create/destroy data approach.
2025-07-07 03:51:30 +00:00
Yi Ming
55e3a75217 fix(lsp): convert the encoded position to line byte (#34824) 2025-07-06 20:39:05 -07:00
Shadman
5973328eda feat(options): per-buffer 'busy' status #34493
Problem:
Plugins cannot mark a buffer as "busy".

Solution:
- Add a buffer-local 'busy' option.
- Show a busy indicator in the default 'statusline'.
2025-07-06 16:17:06 -07:00
zeertzjq
6fd2a3040f vim-patch:9.1.1518: getcompletiontype() may crash (#34819)
Problem:  getcompletiontype() crashes when no completion is available
          (after v9.1.1509).
Solution: Don't call set_expand_context() (zeertzjq)

fixes: vim/vim#17681
closes: vim/vim#17684

e2c0f81dd0
2025-07-06 22:46:05 +00:00
Maria José Solano
2e2ac49c57 refactor(lsp): narrower hierarchy argument type (#34799) 2025-07-06 15:12:01 -07:00
zeertzjq
86a2ebd5fe vim-patch:f79695c: runtime(doc): fix a few typos introduced in 0ae9e19540dda5d (#34818)
f79695c2d8

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-07-07 06:01:51 +08:00
Artem
18e0301e1f fix(treesitter): inconsistent highlight of multiline combined injection #32619
Problem:
Combined injections not entirely highlighted.

Solution:
Reapply layer highlights on each line.
2025-07-06 11:05:41 -07:00
Phạm Bình An
12689c73d8 fix(vim.pack): add() stops unexpectedly on package load error #34787
Problem:
Error when adding a plugin will make all following plugins not
`:packadd`ed

Solution:
- add() should handle errors from :packadd with pcall()

Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-07-06 11:04:03 -07:00
Maria José Solano
957093da0d feat(lsp): handle deprecated document symbols (#34751) 2025-07-06 09:39:37 -07:00
Maria José Solano
580b8cfac7 refactor(lsp): consistent usage of vim.notify #34802 2025-07-06 07:07:30 -07:00
zeertzjq
4f141dca8c vim-patch:0ae9e19: runtime(doc): add a section for options influencing search (#34810)
0ae9e19540

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-07-06 20:47:11 +08:00
glepnir
09f9d72c24 fix(runtime): coverity STRING_NULL #569464 (#34795)
Problem:
Coverity reports string null termination issue:

    *** CID 569464:  Memory - string handling  (STRING_NULL)
    /src/nvim/runtime.c: 1374 in ExpandRTDir_int()
    1372         if (flags & DIP_START) {
    1373           memcpy(tail - 15, "pack/*/start/*/", 15);  // NOLINT
    >>>     CID 569464:  Memory - string handling  (STRING_NULL)
    >>>     Passing unterminated string "tail - 15" to "globpath", which expects a null-terminated string.
    1374           globpath(p_pp, tail - 15, gap, glob_flags, expand_dirs);

    Similar issues occur at lines 1376, 1381, and 1383 where memcpy()
    constructs strings passed to globpath() without null termination.

Solution:
Replace dangerous pointer arithmetic and memcpy() with direct snprintf()
construction of complete search paths. This eliminates the need for
buffer reuse through pointer offsets and ensures all strings passed to
globpath() are properly null-terminated.

vim-patch:9.1.1515: Coverity complains about potential unterminated strings
2025-07-06 20:27:20 +08:00
zeertzjq
cf5506f0fd vim-patch:9.1.1516: tests: no test that 'incsearch' is updated after search completion (#34808)
Problem:  tests: no test that 'incsearch' is updated after accepting
          search completion.
Solution: Add a test case (zeertzjq).

closes: vim/vim#17682

08e5b128b8
2025-07-06 09:41:59 +00:00
zeertzjq
5335d9991f Merge pull request #34807 from zeertzjq/vim-9.1.1511
vim-patch:{9.1.1511,7a734b7}
2025-07-06 17:35:05 +08:00
zeertzjq
8a4977e286 vim-patch:7a734b7: tests: fix typo in comment (after v9.1.1511)
related: vim/vim#17660

7a734b7148
2025-07-06 17:10:11 +08:00
zeertzjq
11e967d5af vim-patch:9.1.1511: tests: two edit tests change v:testing from 1 to 0
Problem:  tests: two edit tests change v:testing from 1 to 0.
Solution: Don't change v:testing in these two tests, since it's already
          set to 1 in runtest.vim (zeertzjq).

closes: vim/vim#17660

96076bf41e
2025-07-06 17:10:11 +08:00
zeertzjq
025c070312 Merge pull request #34801 from zeertzjq/vim-9.1.1505
vim-patch:9.1.{1505,1509}
2025-07-06 09:51:38 +08:00
zeertzjq
9c04eb02ad vim-patch:9.1.1509: patch 9.1.1505 was not good
Problem:  Patch 9.1.1505 was not good
Solution: Revert "patch 9.1.1505: not possible to return completion type
          for :ex command" and instead add the getcompletiontype()
          function (Hirohito Higashi).

related: vim/vim#17606
closes: vim/vim#17662

96b3ef2389

Cherry-pick Test_multibyte_expression() from Vim, as it passes.

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2025-07-06 08:55:32 +08:00
zeertzjq
6ebcb4a4d6 vim-patch:9.1.1505: not possible to return completion type for :ex command
Problem:  not possible to return command-line completion type for :ex
          command
Solution: make getcmdcompltype() accept an optional and return the
          command-line completion for that arg (Shougo Matsushita).

closes: vim/vim#17606

5d2354fc07

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2025-07-06 08:41:08 +08:00
zeertzjq
8fe4e120a2 Merge pull request #34800 from zeertzjq/vim-a9b5e4a
vim-patch: Vim syntax updates
2025-07-06 07:18:46 +08:00
zeertzjq
55f003671d vim-patch:5911ac5: runtime(vim): Update base-syntax, match :filetype in functions
closes: vim/vim#17671

5911ac5023

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-07-06 06:46:37 +08:00
zeertzjq
728b3e3d50 vim-patch:a8b8660: runtime(vim): Update base-syntax, match escape sequences in :command blocks
- Match escape sequences in :command replacement blocks.
- Match :substitute after escape sequences (a temporary fix until Ex
  commands are contained).

fixes: vim/vim#17326
closes: vim/vim#17663

a8b86605f3

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-07-06 06:45:13 +08:00
zeertzjq
0ea7a65299 vim-patch:c233c2e: runtime(vim): Update base-syntax and generator, match all default highlight groups
- Match Conceal, ComplMatchIns, MsgArea, Terminal, and User[1-9]
  highlight groups.
- Generate the vimGroup syntax group from runtime/syncolor.vim.
- Match :SynColor and :SynLink as special user commands.

fixes vim/vim#17467
closes: vim/vim#17556

c233c2e6a5

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-07-06 06:43:47 +08:00
zeertzjq
518f95e27e vim-patch:a9b5e4a: runtime(vim): Update base-syntax and generator, generate command modifiers
Generate Ex command modifiers from the modifier table in src/ex_docmd.c

closes: vim/vim#17564

a9b5e4af43

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-07-06 06:34:53 +08:00
zeertzjq
85e6feedb0 vim-patch:9.1.1512: completion: can only complete from keyword characters (#34798)
Problem:  completion: can only complete from keyword characters
Solution: remove this restriction, allow completion functions when
          called from i_CTRL-N/i_CTRL-P to be triggered from non-keyword
          characters (Girish Palya)

Previously, functions specified in the `'complete'` option were
restricted to starting completion only from keyword characters (as
introduced in PR 17065). This change removes that restriction.

With this change, user-defined functions (e.g., `omnifunc`, `userfunc`)
used in `'complete'` can now initiate completion even when triggered
from non-keyword characters. This makes it easier to reuse existing
functions alongside other sources without having to consider whether the
cursor is on a keyword or non-keyword character, or worry about where
the replacement should begin (i.e., the `findstart=1` return value).

The logic for both the “collection” and “filtering” phases now fully
respects each source’s specified start column. This also extends to
fuzzy matching, making completions more predictable.

Internally, this builds on previously merged infrastructure that tracks
per-source metadata. This PR focuses on applying that metadata to
compute the leader string and insertion text appropriately for each
match.

Also, a memory corruption has been fixed in prepare_cpt_compl_funcs().

closes: vim/vim#17651

ba11e78f1d

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-07-06 06:09:28 +08:00
Christian Clason
887255362f vim-patch:f9d87fa: runtime(go): fix b:undo_ftplugin
last `unmap` can cause the error "E31: No such mapping" when
`doaudocmd FileType go` if appending other commands to `b:undo_ftplugin` i.e.
the space and the next bar as `let b:undo_ftplugin .= ' | setl ...'`.

closes: vim/vim#17664

f9d87fa6ba

Co-authored-by: ichizok <gclient.gaap@gmail.com>
2025-07-05 16:51:53 +02:00
zeertzjq
c3f35a38fe Merge pull request #34761 from zeertzjq/vim-9.1.1490
vim-patch:9.1.{1490,1493,1510}: search completion
2025-07-05 22:48:23 +08:00
zeertzjq
46727a7feb vim-patch:9.1.1510: Search completion may use invalid memory
Problem:  Search completion may use invalid memory (after 9.1.1490).
Solution: Don't get two line pointers at the same time (zeertzjq).

closes: vim/vim#17661

5e34eec6f8
2025-07-05 21:58:38 +08:00
zeertzjq
9a44bbd574 vim-patch:9.1.1493: manually comparing positions on buffer
Problem:  manually comparing positions on buffer
          (after v9.1.1490)
Solution: use the LTOREQ_POS() macro, fix a few other minor style issues
          (glepnir)

closes: vim/vim#17629

7cf35bc1be

Co-authored-by: glepnir <glephunter@gmail.com>
2025-07-05 21:58:38 +08:00
zeertzjq
dd707246fd vim-patch:9.1.1490: 'wildchar' does not work in search contexts
Problem:  'wildchar' does not work in search contexts
Solution: implement search completion when 'wildchar' is typed
          (Girish Palya).

This change enhances Vim's command-line completion by extending
'wildmode' behavior to search pattern contexts, including:

- '/' and '?' search commands
- ':s', ':g', ':v', and ':vim' commands

Completions preserve the exact regex pattern typed by the user,
appending the completed word directly to the original input. This
ensures that all regex elements — such as '<', '^', grouping brackets
'()', wildcards '\*', '.', and other special characters — remain intact
and in their original positions.

---

**Use Case**

While searching (using `/` or `?`) for lines containing a pattern like
`"foobar"`, you can now type a partial pattern (e.g., `/f`) followed by
a trigger key (`wildchar`) to open a **popup completion menu** showing
all matching words.

This offers two key benefits:

1. **Precision**: Select the exact word you're looking for without
typing it fully.
2. **Memory aid**: When you can’t recall a full function or variable
name, typing a few letters helps you visually identify and complete the
correct symbol.

---

**What’s New**

Completion is now supported in the following contexts:

- `/` and `?` search commands
- `:s`, `:g`, `:v`, and `:vimgrep` ex-commands

---

**Design Notes**

- While `'wildchar'` (usually `<Tab>`) triggers completion, you'll have
to use `<CTRL-V><Tab>` or "\t" to search for a literal tab.
- **Responsiveness**: Search remains responsive because it checks for
user input frequently.

---

**Try It Out**

Basic setup using the default `<Tab>` as the completion trigger:

```vim
set wim=noselect,full wop=pum wmnu
```

Now type:

```
/foo<Tab>
```

This opens a completion popup for matches containing "foo".
For matches beginning with "foo" type `/\<foo<Tab>`.

---

**Optional: Autocompletion**

For automatic popup menu completion as you type in search or `:`
commands, include this in your `.vimrc`:

```vim
vim9script
set wim=noselect:lastused,full wop=pum wcm=<C-@> wmnu

autocmd CmdlineChanged [:/?] CmdComplete()

def CmdComplete()
  var [cmdline, curpos, cmdmode] = [getcmdline(), getcmdpos(),
expand('<afile>') == ':']
  var trigger_char = '\%(\w\|[*/:.-]\)$'
  var not_trigger_char = '^\%(\d\|,\|+\|-\)\+$'  # Exclude numeric range
  if getchar(1, {number: true}) == 0  # Typehead is empty, no more
pasted input
      && !wildmenumode() && curpos == cmdline->len() + 1
      && (!cmdmode || (cmdline =~ trigger_char && cmdline !~
not_trigger_char))
    SkipCmdlineChanged()
    feedkeys("\<C-@>", "t")
    timer_start(0, (_) => getcmdline()->substitute('\%x00', '',
'ge')->setcmdline())  # Remove <C-@>
  endif
enddef

def SkipCmdlineChanged(key = ''): string
  set ei+=CmdlineChanged
  timer_start(0, (_) => execute('set ei-=CmdlineChanged'))
  return key == '' ? '' : ((wildmenumode() ? "\<C-E>" : '') .. key)
enddef

**Optional: Preserve history recall behavior**
cnoremap <expr> <Up> SkipCmdlineChanged("\<Up>")
cnoremap <expr> <Down> SkipCmdlineChanged("\<Down>")

**Optional: Customize popup height**
autocmd CmdlineEnter : set bo+=error | exec $'set ph={max([10,
winheight(0) - 4])}'
autocmd CmdlineEnter [/?] set bo+=error | set ph=8
autocmd CmdlineLeave [:/?] set bo-=error ph&
```

closes: vim/vim#17570

6b49fba8c8

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-07-05 21:58:38 +08:00
zeertzjq
cc83854036 Merge pull request #34626 from zeertzjq/vim-74f0a77
vim-patch: :uniq Ex command
2025-07-05 21:56:11 +08:00
zeertzjq
023f157a60 vim-patch:26ebe21: runtime(doc): mismatch between the :uniq document's description and examples
closes: vim/vim#17612

26ebe21caa

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-07-05 21:36:45 +08:00
zeertzjq
3564e62426 vim-patch:1c471ac: runtime(doc): update description of :uniq command
The examples mention the [u] flag, so at least the [u] flag should be
introduced before the examples.

Slightly reword the sentence about trailing/leading white space.

closes: vim/vim#17604

1c471ac548

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-07-05 21:36:45 +08:00
zeertzjq
3bf27b2c74 vim-patch:9.1.1481: gcc complains about uninitialized variable
Problem:  gcc complains about uninitialized variable
          (Tony Mechelynck, after v9.1.1476)
Solution: initialize variable

42d2c5e803

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-07-05 21:36:45 +08:00
zeertzjq
d574f9479d vim-patch:ca793e6: runtime(vim): Update base-syntax, match :uniq command
closes: vim/vim#17601

ca793e60db

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-07-05 21:36:45 +08:00
zeertzjq
11f8e8eb63 vim-patch:9.1.1478: Unused assignment in ex_uniq()
Problem:  Unused assignment in ex_uniq() (after v9.1.1476)
Solution: Remove the assignment and the wrong comments above
          (zeertzjq).

closes: vim/vim#17596

fc378a88d8
2025-07-05 21:36:45 +08:00
zeertzjq
7138cdaef8 vim-patch:9.1.1477: no easy way to deduplicate text
Problem:  no easy way to deduplicate text
Solution: add the :uniq ex command
          (Hirohito Higashi)

closes: vim/vim#17538

74f0a77bb9

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-07-05 21:36:45 +08:00
Maria José Solano
d9465e984b Merge pull request #34789 from MariaSolOs/extra-notify
fix(lsp): consistent use of `vim.notify` in `lsp/buf.lua`
2025-07-04 14:46:14 -07:00
Maria José Solano
c30b93db93 ci: add Riley to Treesitter reviewers (#34791) 2025-07-04 14:44:04 -07:00
zeertzjq
0c02c9c70b refactor(getchar): rename test variable (#34769)
Also, test_disable_char_avail() is superseded by test_override() in Vim,
so remove that from vim_diff.txt.
2025-07-05 05:36:01 +08:00
Maria José Solano
52b9bab340 ci: LSP reviewers #34790 2025-07-04 14:30:52 -07:00
Maria José Solano
3342aead1d fix(lsp): consistent use of vim.notify/logging with unsupported methods 2025-07-04 14:15:23 -07:00
Maria José Solano
285ea2525f fix(lsp): remove extra notify on empty hover 2025-07-04 14:12:06 -07:00
Lewis Russell
e34e2289c2 fix(diagnostic): fix flaky error 2025-07-04 18:03:41 +01:00
Justin M. Keyes
cbfc3d1cdc Merge #34009 vim.pack 2025-07-04 06:32:55 -07:00
Evgeni Chasnovski
d21b8c949a feat(pack): add built-in plugin manager vim.pack
Problem: No built-in plugin manager

Solution: Add built-in plugin manager

Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2025-07-04 15:56:28 +03:00
Lewis Russell
cf0f90fe14 feat(async): add vim._async
Problem: no easy built-in way to do async

Solution: add `vim._async`
2025-07-04 15:53:29 +03:00
zeertzjq
3694fcec28 vim-patch:8.2.1983: ml_get error when using <Cmd> to open a terminal (#34759)
Problem:    ml_get error when using <Cmd> to open a terminal.
Solution:   If the window changed reset the incsearch state. (closes vim/vim#7289)

f4d61bc559

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-07-04 07:30:34 +00:00
Christian Clason
16001b4d84 vim-patch:0d50d60: runtime(postscr): Correct some standard font names in syntax
closes: vim/vim#17647

0d50d6089d

Co-authored-by: Mike Williams <mrmrdubya@gmail.com>
2025-07-04 08:55:53 +02:00
glepnir
bb75610d99 vim-patch:9.1.1507: symlinks are resolved on :cd commands (#34758)
Problem:  File paths change from symlink to target path after :cd command
          when editing files through symbolic links
Solution: Add "~" flag to 'cpoptions' to control symlink resolution.
          When not included (default), symlinks are resolved maintaining
          backward compatibility. When included, symlinks are preserved
          providing the improved behavior. (glepnir)

related: neovim/neovim#15695
closes: vim/vim#17628

4ade668fb6
2025-07-04 05:44:39 +00:00
zeertzjq
c48dea20f5 vim-patch:9.1.1508: string manipulation can be improved in cmdexpand.c (#34755)
Problem:  String manipulation can be improved in cmdexpand.c
Solution: Refactor cmdexpand.c to remove calls to
          STRLEN()/STRMOVE()/STRCAT() (John Marriott)

This commit does the following:

In function nextwild():
  - slightly refactor the for loop to remove an array access
  - call STRLEN() and store it's result for reuse
  - move some variables closer to where they are used, renaming some on
    the way

In function ExpandOne():
  - move some calculations outside of the for loops
  - factor out calls to STRCAT() (which has an inherent STRLEN() call) in
    the for loop
  - move some variables closer to where they are used

In function expand_files_and_dirs():
  - factor out calls to STRMOVE() (which has an inherent STRLEN() call)

In function get_filetypecmd_arg():
  - move declarations of the string arrays into the blocks where they are
    used

In function get_breakadd_arg():
  - move declaration of the string array into the block where it is
    used

In function globpath():
  - factor out calls to STRLEN() and STRCAT()
  - move some variables closer to where they are used

And finally some minor cosmetic style changes

closes: vim/vim#17639

a494ce1c64

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-07-04 12:12:41 +08:00
zeertzjq
5db833b475 Merge pull request #34744 from zeertzjq/test-override
test(old): emulate test_override('char_avail') using FFI
2025-07-04 12:07:15 +08:00
zeertzjq
f348c0ebba fix(incsearch): include compsing characters with Ctrl-L
Cherry-picked from Vim patch 8.1.0579.
2025-07-04 11:00:14 +08:00
zeertzjq
c925e7b8ba test(old): emulate test_override('char_avail') using FFI
Add a non-static variable for this, otherwise it'll be really hacky.
This avoid having to rewrite many incsearch tests in Lua.
2025-07-04 11:00:14 +08:00
zeertzjq
bfffe0d214 test(ui/messages_spec): fix flakiness (#34754) 2025-07-04 10:59:41 +08:00
zeertzjq
17ecb2b988 test(editor/defaults_spec): fix flakiness (#34752) 2025-07-04 10:35:15 +08:00
Luca Saccarola
14d8d11671 vim-patch:ba47934: runtime(netrw): remove netrwSettings.vim (#34747)
relevant commits:
- distribution: remove NetrwSettings.vim

closes: vim/vim#17635

ba479348d4
2025-07-03 22:47:34 +00:00
zeertzjq
eef62e815d vim-patch:9.1.1506: tests: missing cleanup in Test_search_cmdline_incsearch_highlight() (#34748)
Problem:  tests: missing cleanup test_override('char_avail', 0) in
          Test_search_cmdline_incsearch_highlight().
Solution: Add the missing cleanup (zeertzjq).

closes: vim/vim#17655

29b29c6b30
2025-07-04 06:28:55 +08:00
Mart-Mihkel Aun
f01419f3d5 feat(runtime): accept predicates in take and skip (#34657)
Make `vim.iter():take()` and `vim.iter():skip()`
optionally accept predicates to enable takewhile
and skipwhile patterns used in functional
programming.
2025-07-03 08:12:24 -05:00
zeertzjq
715c28d67f test(old): emulate test_override('starting') with FFI (#34742)
I was initially trying to port several cmdline tests from Vim involving
test_override('char_avail') without having to rewrite entire tests in
Lua, but haven't figured out a good way achieve that yet. Nevertheless
emulating test_override('starting') is easier.
2025-07-03 19:21:58 +08:00
Lewis Russell
ac75de0d2a test: add more structure to vim.bo/wo tests 2025-07-03 11:05:08 +01:00
Lewis Russell
a5e582dab6 test: move lua option/variable tests to a separate file 2025-07-03 11:05:08 +01:00
Lewis Russell
0a6a73fd25 refactor: option tests 2025-07-03 11:05:08 +01:00
Christian Clason
fc1be07d28 vim-patch:9.1.1504: filetype: numbat files are not recognized
Problem:  filetype: numbat files are not recognized
Solution: detect *.nbt files as numbat filetype (0xadk)

References:
- https://github.com/sharkdp/numbat
- https://github.com/sharkdp/numbat/tree/master/numbat/modules

closes: vim/vim#17643

20eb68a8f2

Co-authored-by: 0xadk <0xadk@users.noreply.github.com>
2025-07-03 09:18:18 +02:00
Christian Clason
0a14ac3261 vim-patch:9.1.1503: filetype: haxe files are not recognized
Problem:  filetype: haxe files are not recognized
Solution: detect *.hx files as haxe filetype (0xadk)

References:
- https://haxe.org/
- https://code.haxe.org/category/beginner/hello-world.html

closes: vim/vim#17644

b46e3aa0fa

Co-authored-by: 0xadk <0xadk@users.noreply.github.com>
2025-07-03 09:18:18 +02:00
Christian Clason
18cfbf8fb2 vim-patch:9.1.1502: filetype: quickbms files are not recognized
Problem:  filetype: quickbms files are not recognized
Solution: detect *.bms files as quickbms filetype
          (0xadk)

Reference:
- https://aluigi.altervista.org/quickbms.htm

closes: vim/vim#17645

fdcdded4d5

Co-authored-by: 0xadk <0xadk@users.noreply.github.com>
2025-07-03 09:18:18 +02:00
Christian Clason
da42f99eb4 vim-patch:9.1.1501: filetype: flix files are not recognized
Problem:  filetype: flix files are not recognized
Solution: detect *.flix files as flix filetype
          (0xadk)

References:
- https://flix.dev/
- https://doc.flix.dev/introduction.html

closes: vim/vim#17646

b211916e0a

Co-authored-by: 0xadk <0xadk@users.noreply.github.com>
2025-07-03 09:18:18 +02:00
Christian Clason
535e292436 vim-patch:5ecee30: runtime(go): add section movement mappings to ftplugin
closes: vim/vim#17641

5ecee30dcd

Co-authored-by: Rob B <github@0x7e.net>
2025-07-03 00:28:39 +02:00
Rodrigodd
168bf0024e fix(treesitter): ensure TSLuaTree is always immutable
Problem:

The previous fix in #34314 relies on copying the tree in `tree_root` to
ensure the `TSNode`'s tree cannot be mutated. But that causes the
problem where two calls to `tree_root` return nodes from different
copies of a tree, which do not compare as equal. This has broken at
least one plugin.

Solution:

Make all `TSTree`s on the Lua side always immutable, avoiding the need
to copy the tree in `tree_root`, and make the only mutation point,
`tree_edit`, copy the tree instead.
2025-07-02 17:05:17 +01:00
Rodrigodd
94f44d58fd test(treesitter): test tree:root() is idempotent
Test for regression #34605
2025-07-02 17:05:17 +01:00
Lewis Russell
4eebc46930 fix(vim.system): env=nil passes env=nil to uv.spawn
731e616a79 made it so passing `{env = nil, clear_env = true }` would
pass `{env = {}}` to `vim.uv.spawn`.

However this is not what `clear_env` is (arguably) supposed to do.
If `env=nil` then that implies the uses wants `vim.uv.spawn()` to use
the default environment. Adding `clear_env = true` simply prevents
`NVIM` (the base environment) from being added.

Fixes #34730
2025-07-02 17:01:29 +01:00
Alex Díaz
e91224bfaa build: support static build #34728 2025-07-02 07:54:17 -07:00
Maria José Solano
807bc00dd6 fix(lsp): use vim.notify with action-less showMessage requests (#34720) 2025-07-01 17:13:58 +00:00
Lewis Russell
38aac21083 fix: type of nvim_echo 2025-07-01 12:57:37 +01:00
Justin M. Keyes
f731766474 Merge #34715 vim.version improvements 2025-07-01 04:19:42 -07:00
Yochem van Rosmalen
99873296be test(exrc): lua exrc knows its location #34713
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-07-01 03:51:48 -07:00
zeertzjq
66f02ee1fe vim-patch:9.1.1498: completion: 'complete' funcs behave different to 'omnifunc' (#34718)
Problem:  completion: Functions specified in the 'complete' option did
          not have the leader string removed when called with findstart = 0,
          unlike 'omnifunc' behavior
Solution: update behaviour and make behaviour consistent (Girish Palya)

closes: vim/vim#17636

fa16c7ab3f

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-06-30 23:58:06 +00:00
zeertzjq
af6b3d6fec vim-patch:a5b744e: runtime(vim): Update base-syntax, improve :syn-sync line defaults (#34719)
Set minlines and maxlines to 100 and 200 respectively.  Set these after
the script interface syntax files have been loaded to ensure the values
set in those are overridden.

fixes vim/vim#17580
closes: vim/vim#17614

a5b744ef93

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-06-30 23:29:54 +00:00
Evgeni Chasnovski
773075b2bc feat(vim.version): add vim.version.intersect()
Problem: No way to compute intersection of two version ranges, which is
useful when computing version range that fits inside several reference
ranges.

Solution: Add `vim.version.intersect()`.
2025-06-30 20:59:44 +03:00
Evgeni Chasnovski
649ff924d9 fix(vim.version): improve construction of '<=a.b.c' and '>a.b.c' ranges
Problem: `vim.version.range('<=a.b.c')` is not precise when it comes to
its right hand side. This is due to version ranges using exclusive right
hand side. While `vim.version.range('>a.b.c')` is not precise when it
comes to its left hand side because left hand sides are inclusive.

Solution: For '>=a.b.c' increase `to` from 'a.b.c' to the smallest
reasonable version that is bigger than 'a.b.c'. For '<a.b.c' do the same
for `from`.
More proper solution is an explicit control over inclusivity of version
range sides, but it has more side effects and requires design decisions.
2025-06-30 20:59:12 +03:00
James Trew
4034476dd3 doc(vim.version): options formatting #34716 2025-06-30 09:55:29 -07:00
Gabriel Ford
d6d1bfd20d fix(term): terminal attr index may exceed TERM_ATTRS_MAX #34318
Problem: Currently terminal highlight attribute buffers are statically allocated
be the size of `TERM_ATTRS_MAX`. This unique case isn't respected in
some places in the ui_compositor. Due to this, when a terminal window
has lines longer them `TERM_ATTRS_MAX`, the compositor will go past the
end of the buffer causing a crash due to out of bounds access.

Solution: Add check to ensure we don't query terminal highlight attrs
past `TERM_ATTRS_MAX` in `win_line()`.

Fixes #30374
2025-06-30 06:22:42 -07:00
Evgeni Chasnovski
aeb8bca12d feat(vim.version): make tostring() return human-readable version range
Problem: `tostring()` applied to version range doesn't return
human-readable text with information about the range.

Solution: Add `__tostring()` method.
2025-06-30 16:08:56 +03:00
Evgeni Chasnovski
561021bacd docs(vim.version): document vim.VersionRange as a dedicated class 2025-06-30 16:08:30 +03:00
Shadman
ed7ff848a0 fix(prompt): prompt mark not placed after text edits correctly #34671 2025-06-30 03:19:43 -07:00
Yochem van Rosmalen
f7c939fa7a fix(exrc): exrc knows its own location (#34638)
fix(exrc): lua exrc files know their location

Problem:
'exrc' files are inherently bound to their location / workspace and
therefore require to "know" their location on the filesystem. However,
currently using `debug.getinfo(1, 'S')` returns `"<nvim>"`.

Solution:
Include the filepath as chunkname in `loadstring()` and `nlua_exec()`.
2025-06-29 10:19:10 -05:00
Tom Ampuero
2f95abddfa refactor(health): use vim.system():wait() #34702
Problem:
- The ripgrep probe still used the legacy `vim.fn.system()`

Solution:
- Replace `vim.fn.system()` with `vim.system({rg_path, '-V'}):wait()`
2025-06-29 14:56:44 +00:00
phanium
1c52e90cd5 fix(help): :help can focus unfocusable/hide window #34442
Problem:
:help/:helpgrep/:lhelpgrep can focus unfocusable/hide window

Solution:
Ignore unfocusable/hidden window when reusing help buffer.
2025-06-29 14:44:17 +00:00
zeertzjq
63a7b92e58 vim-patch:1fa3f0c: runtime(doc): fix :vmap example to avoid unwanted spaces with JJ (#34695)
fixes: vim/vim#17621
closes: vim/vim#17623

1fa3f0c215

Co-authored-by: Damien Lejay <damien@lejay.be>
2025-06-29 08:01:12 +08:00
Gabriel Ford
331de6afa6 fix(tui): don't crash when nvim__screenshot() is called with bad path (#34594)
Problem: Currently `vim.api.nvim__screenshot()` crashes when called with an
invalid path. This is because we don't check if `fopen()` returns a null
pointer.

Solution: Bail out if `fopen()` returns a null pointer.

Fixes: https://github.com/neovim/neovim/issues/34593
2025-06-28 23:12:42 +00:00
luukvbaal
10a03e83e3 fix(messages): only msg_clear for UPD_CLEAR #34688
Problem:  "msg_clear" is emitted after resizing the screen and during startup.
Solution: Only emit "msg_clear" when `redraw_type == UPD_CLEAR`.
2025-06-28 10:37:21 -07:00
Phạm Bình An
bff7d3fd9f fix(tutor): cannot find tutors in pack/*/start/* #34689
Problems:
- Unlike in Vim, Neovim does not report pack/*/start/* in the resolved value of 'rtp' (see `:help packages-runtimepath`)
- This means that the tutor plugin cannot find the tutors in pack/*/start/*

Solution:
- Use nvim_list_runtime_paths() instead of &rtp
2025-06-28 09:40:24 -07:00
Phạm Bình An
f1f106be3d vim-patch:9.1.1421: tests: need a test for the new-style tutor.tutor (#34267)
Problem:  tests: need a test for the new-style tutor.tutor, patch
          9.1.1384 broke the expected positions for the signs
Solution: Update all number keys in tutor.tutor.json to match the
          correct line numbers in tutor.tutor, replace tabs by spaces,
          add a screen-dump test to verify it does not regress
          (Pham Bình An)

closes: vim/vim#17416

a541f1de2b
2025-06-28 07:42:51 +00:00
Christian Clason
c752016976 vim-patch:0312527: runtime(pandoc): sync syntax script with upstream
closes: vim/vim#17598

03125277e9

Co-authored-by: Jake Zimmerman <zimmerman.jake@gmail.com>
2025-06-28 00:13:57 +02:00
Zie Mcdowell
4ee2e365a5 fix(lsp): fix workspace diagnostic request to follow spec (#34674)
* fix(lsp): fix workspace diagnostic request to follow spec

* refactor(lsp): add type annotation
2025-06-27 19:17:41 +00:00
luukvbaal
f2988e05db feat(extui): don't enter pager for routed message #34679
Problem:  Messages routed to the pager to be shown in full, enter the
          pager automatically, yielding another "press-q-prompt".

Solution: Only enter the pager when requested explicitly. Otherwise,
          close the pager on the next typed mapping, unless that mapping
          entered the pager.
2025-06-27 12:13:01 -07:00
luukvbaal
bfe42c84de perf(extui): delay creating windows, buffers and parser (#34665)
Problem:  vim._extui unconditionally creates windows, buffers and the
          Vimscript cmdline highlighter when it is first loaded.
Solution: Schedule first creation of the window so that first redraw
          happens sooner (still need to create at least the cmdline
          window asap as it can have a different highlight through
          hl-MsgArea; thus further delaying until the first event that
          needs a particular target seems redundant). Load the cmdline
          highlighter on the first cmdline_show event.
2025-06-27 15:54:32 +02:00
glepnir
64753b5c37 fix(highlight): spurious underline in 'winblend' floating window #34614
Problem: When a floating window with high winblend uses a highlight group
         with underline (but without guisp), the underline appears red.

Solution: Only blend the special color (for underline/undercurl) if the
          foreground highlight actually has underline or undercurl set.
          Otherwise, ignore the special color.
2025-06-27 02:52:28 -07:00
luukvbaal
0b91e9f83b vim-patch:9.1.1482: scrolling with 'splitkeep' and line() (#34670)
Problem:  Topline is preemptively updated by line() in WinResized
          autocmd with 'splitkeep' != "cursor".
Solution: Set `skip_update_topline` when 'splitkeep' != "cursor".
          (Luuk van Baal)

fe803c8c04
2025-06-27 11:16:23 +02:00
Christian Clason
e518666f1d vim-patch:5d14da3: runtime(diff): fix regex for matching no-eol match
closes: vim/vim#17610

5d14da3690

Co-authored-by: A4-Tacks <wdsjxhno1001@163.com>
2025-06-27 09:56:07 +02:00
luukvbaal
2b4c1127ad feat(ui): emit "msg_clear" event after clearing the screen (#34035)
Problem:  ext_messages cannot tell when the screen was cleared, which is
          needed to clear visible messages. An empty message is also
          never emitted, but clears messages from the message grid.
Solution: Repurpose the "msg_clear" event to be emitted when the screen
          was cleared. Emit an empty message with the `empty` kind to
          hint to a UI to clear the cmdline area.
2025-06-26 22:27:21 +00:00
Maria José Solano
6005bc68b2 fix(lsp): include context for each client in multi-handler results (#34669) 2025-06-26 15:18:20 -04:00
Gregory Anders
f0c0c24ed7 fix(lsp/health): always use vim.inspect to show root_markers (#34667)
In https://github.com/neovim/neovim/pull/34092 we changed the
healthcheck to display root markers as a concatenated list if the first
item in root_markers is a string (not a table). However, this does not
solve the general case, because root_markers can contain a string as the
first element, but a table as the 2nd element.

Because root_markers has a more complex structure we should always just
display it using vim.inspect, rather than adding a special case for when
all items are a string.
2025-06-26 10:22:45 -05:00
Caleb White
5d06eade25 feat(defaults): map "grt" to LSP type_definition #34642 2025-06-26 06:24:13 -07:00
Lewis Russell
76de3e2d07 docs(api): document types using LuaCATS types
- Render Lua types in api.txt.

- Added `DictAs(name)` API type which acts the same as `Dict` (no parens)
  when generating the dispatchers, but acts the same as `Dict(name)`
  when generating docs.

- Added `Tuple(...)` API type which is the treated the as `Array` for
  generating the dispatchers, but is used to document richer types.

- Added `Enum(...)` API type to better document enums

- Improve typing of some API functions.

- Improve c_grammar to properly parse API types and replace string pattern
  logic in the parsers.

- Removed all the hardcoded type overrides in gen_eval_files.lua
2025-06-26 13:54:04 +01:00
Maria José Solano
3eaa6c5a66 fix(lsp): add RequestFailed error code constant #34645
Also remove `serverErrorStart/End` as [the spec](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#errorCodes)
says that they're deprecated and don't even represent a real error code.
2025-06-26 02:23:31 -07:00
zeertzjq
b40e658717 fix(column): missing redraw with virt_lines_leftcol (#34650)
Problem:  Missing number column redraw with virt_lines_leftcol.
Solution: Set virt_line_index to -1 when skipping a virtual line.
2025-06-26 05:16:19 +00:00
Justin M. Keyes
f0757ee590 refactor(ui.c): deduplicate validation logic #34647 2025-06-26 00:15:04 +00:00
zeertzjq
e5dae58704 vim-patch:037c32e: runtime(vim): Update base-syntax, match unamed register alias (#34648)
The unamed register may be referenced as both @" and @@.

Remove the unused vimPlainRegister syntax group.

fixes: vim/vim#17603.
closes: vim/vim#17605

037c32e428

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-06-26 00:14:31 +00:00
zeertzjq
c730374d44 vim-patch:fa0b069: runtime(doc): improve documentation style in editing.txt (#34646)
Usually, Vim's document provides example code after explanations.
However some part of the editing.txt doesn't follow the style, therefore
this commit modifies it so that it follows the usual style.

closes: vim/vim#17607

fa0b069728

Co-authored-by: mityu <mityu.mail@gmail.com>
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-06-26 00:02:53 +00:00
Birdee
731e616a79 fix(vim.system): clear_env=true gives an invalid env to uv.spawn #33955
Problem:
In setup_env, some needed logic is bypassed when clear_env=true.

Solution:
Drop the early return in setup_env().

Co-authored-by: BirdeeHub <birdee@localhost>
2025-06-25 15:15:19 -07:00
luukvbaal
4369d7d9a7 fix(ui)!: decouple ext_messages from message grid #27963
Problem:  ext_messages is implemented to mimic the message grid
          implementation w.r.t. scrolling messages, clearing scrolled
          messages, hit-enter-prompts and replacing a previous message.
          Meanwhile, an ext_messages UI may not be implemented in a way
          where these events are wanted. Moreover, correctness of these
          events even assuming a "scrolled message" implementation
          depends on fragile "currently visible messages" global state,
          which already isn't correct after a previous message was
          supposed to have been overwritten (because that should not only
          happen when `msg_scroll == false`).

Solution: - No longer attempt to keep track of the currently visible
            messages: remove the `msg_ext(_history)_visible` variables.
            UIs may remove messages pre-emptively (timer based), or never
            show messages that don't fit a certain area in the first place.
          - No longer emit the `msg(_history)_clear` events to clear
            "scrolled" messages. This opens up the `msg_clear` event to
            be emitted when messages should actually be cleared (e.g.
            when the screen is cleared). May also be useful to emit before
            the first message in an event loop cycle as a hint to the UI
            that it is a new batch of messages (vim._extui currently
            schedules an event to determine that).
          - Set `replace_last` explicitly at the few callsites that want
            this to be set to true to replace an incomplete status message.
          - Don't store a "keep" message to be re-emitted.
2025-06-25 08:25:40 -07:00
phanium
0694ca8822 fix: map wincmd instead of remap #34635
Same issue: a59b052857
2025-06-25 06:33:58 -07:00
Christian Clason
684be736c1 ci: bump luals to 3.15.0 2025-06-25 12:27:00 +02:00
Shadman
5ae41ddde3 feat(prompt): prompt_getinput() gets current input #34491
Problem:
Not easy to get user-input in prompt-buffer before the user submits the
input. Under the current system user/plugin needs to read the buffer
contents, figure out where the prompt is, then extract the text.

Solution:
- Add prompt_getinput().
- Extract prompt text extraction logic to a separate function
2025-06-24 12:42:16 -07:00
luukvbaal
efd0fa55c8 fix(cmdline): validate 'incsearch' cursor for "cmdline_show" redraw (#34630)
Problem:  "cmdline_show" event may be emitted with an invalid cursor
          position, causing a redraw that will clear the match highlight.
Solution: Mark the cursor position as valid so that a "cmdline_show"
          callback that updates the screen does not clear the match highlight.
2025-06-24 16:37:51 +02:00
Shadman
25000be845 fix(prompt): "%" prefix repeated on newlines with formatoptions+=r #34584
Problem:
With `formatoptions+=r`, the prompt prefix "%" is treated as
comment-start (because of global default 'comments' option contains
"%"), so it gets added to the start of the line when a new line
is input in a prompt.

Solution:
Unset the 'comments' option in prompt buffers by default.
2025-06-24 06:52:24 -07:00
luukvbaal
5871d26779 fix(autocmd): 'cmdheight' OptionSet with valid window grids (#34619)
Problem:  OptionSet autocmd emitted with invalid grids after entering
          tabpage with different 'cmdheight'.
Solution: First call `tabpage_check_windows()` before changing 'cmdheight'.
          Add a test that exercises the `vim._extui` cmdline.
2025-06-24 10:25:46 +02:00
Christian Clason
6b6a4518c2 vim-patch:159d392: runtime(java): Complement the recognition of type parameter sections
In addition to matching type parameter sections of generic
classes and records and interfaces, match such sections of
generic methods and constructors.  As before, opt for it by
defining "g:java_highlight_generics"; the diamond form still
does not qualify for this kind of recognition.

And make section patterns agree with one another in syntax
items.

References:
https://docs.oracle.com/javase/specs/jls/se21/html/jls-4.html#jls-4.5
https://docs.oracle.com/javase/specs/jls/se21/html/jls-8.html#jls-8.4.4
https://docs.oracle.com/javase/specs/jls/se21/html/jls-8.html#jls-8.8.4

159d392427

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2025-06-24 10:23:00 +02:00
zeertzjq
7f3249fa0d vim-patch:9.1.1476: missing out-of-memory checks in cmdexpand.c (#34624)
Problem:  missing out-of-memory checks in cmdexpand.c
Solution: add missing out-of-memory checks, re-order code
          (John Marriott)

This commit does the following:
- in cmdline_pum_create() add out-of-memory check call of ALLOC_MULT()
- in expand_cmdline() move check for out-of-memory to cover both
  assignments of file_str
- in nextwild() don't free `p2` until after it's last use.

closes: vim/vim#17592

1be5b375c4

N/A patch:
vim-patch:9.1.1474: missing out-of-memory check in mark.c

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-06-24 07:51:20 +08:00
glepnir
69c379dc44 fix(quickfix): use correct lnume when appending (#34611)
Problem: ml_get error when updating quickfix buffer with nvim_buf_attach
Solution: use correct lnume parameter in changed_lines for append mode

Fix #34610
2025-06-23 23:48:55 +00:00
zeertzjq
92883b918c vim-patch:a931371: runtime(vim): Update base-syntax, match OR operator in :echo and :execute (#34623)
Don't match the OR operator in expressions as a trailing bar.

closes: vim/vim#17533

a931371694

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-06-23 23:17:43 +00:00
Maria José Solano
40c61bf205 refactor(lsp): use vim.lsp.buf_request_all internally (#34604) 2025-06-23 13:15:25 -04:00
Dmytro Meleshko
6942dec9b2 fix(health): highlight group conflicts with help #34616 2025-06-23 09:23:27 -07:00
Axel
fb5a51e775 fix(tui): avoid memory leak and compiler warning on Windows (#34225)
Problem:  On Windows, the value of `term` is overwritten without freeing
          the old allocated value, which may lead to a memory leak.
	  GCC also gives a "incompatible pointer type" warning about
	  passing `*term` to os_tty_guess_term().
Solution: Don't override the old allocated value, and copy the guessed
          value to `term` if its old value is NULL.
2025-06-23 22:07:52 +08:00
Maria José Solano
835f11595f feat(lsp): support annotated text edits (#34508) 2025-06-23 06:30:49 -07:00
glepnir
a5c55d200b fix(cmd): bar "|" not allowed after :fclose #34613
Problem: `:fclose` command failed when used with trailing `|` bar.
Solution: Add `TRLBAR` flag to fclose command to support trailing bar.
2025-06-23 05:41:31 -07:00
zeertzjq
462f7aaa8e vim-patch:a9b95c3: runtime(doc): remove wrong documentation of the :digraph command (#34608)
fixes: vim/vim#17583

a9b95c3d33

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-06-23 09:06:38 +08:00
zeertzjq
534ec8d447 vim-patch:9.1.1475: completion: regression when "nearest" in 'completeopt' (#34607)
Problem:  completion: regression when "nearest" in 'completeopt'
Solution: fix compare function (Girish Palya)

closes: vim/vim#17577

cd68f21f60

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-06-23 07:56:47 +08:00
zeertzjq
30f650420b Merge pull request #34606 from zeertzjq/vim-99b9847
vim-patch: Vim syntax updates
2025-06-23 07:44:26 +08:00
zeertzjq
233014f3ed vim-patch:dcff497: runtime(vim): Update base-syntax, match bare mark ranges
Remove unmatchable :normal {mark,register} matches. The arg to :normal
is now handled separately and contained marks and registers are no
longer matched.

closes: vim/vim#17571

dcff497373

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-06-23 07:23:21 +08:00
zeertzjq
69ef85a533 vim-patch:99b9847: runtime(vim): Update base-syntax, fix Vim9 :import expression comment handling
The required space in Vim9 continuation comments (#\ comment) was
accidentally removed in commit 6acca4b as trailing whitespace.

closes: vim/vim#17573

99b9847bd8

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-06-23 07:22:53 +08:00
Luis Calle
cfb4d3d2f2 docs(treesitter): fix parameter list for Query:iter_matches (#34553) 2025-06-22 10:38:00 +00:00
zeertzjq
ee2fc31b36 vim-patch:9.1.1473: inconsistent range arg for :diffget/diffput (#34588)
Problem:  inconsistent range arg for :diffget/diffput
Solution: fix the range specification, place the cursor for :diffput and
          :diffget consistently on the last line (Yee Cheng Chin)

Previously, `:<range>diffget` only allowed using 1 or above in the range
value, making it impossible to use the command for a diff block at the
beginning of the file. Fix the range specification so the user can now
use 0 to specify the space before the first line. This allows
`:0,$+1diffget` to work to retrieve all the changes from the other file
instead of missing the first diff block. Also do this for `:diffput`.

Also, make `:diffput` work more similar to `:diffget`. Make it so that
if the cursor is on the last line and a new line is inserted in the
other file, doing `:diffput` will select that diff block below the line,
just like `:diffget` would.

Also clean up the logic a little bit for edge cases and for handling
line matched diff blocks better.

closes: vim/vim#17579

d75ab0cbf5

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-06-22 08:00:17 +08:00
Gabriel Ford
0980617c0d build(msvc): suppress msvc build warning for different enum types (#34591)
Problem: Currently our CI is failing due to msvc warning 5287. This
warning tells us that we are performing a binary expression with enums
of two different types. In this case however, this is clearly intended
and valid.

Solution: Suppress warning 5287 on the line this occurs.
2025-06-22 06:54:51 +08:00
phanium
d0aedd36df fix(extui): set 'modifiable', 'noswapfile' for buffers (#34582)
Problem:  UI buffers may be 'unmodifiable' and use a 'swapfile'.
Solution: Set the 'modifiable' and 'noswapfile' options.

Co-authored-by:phanium <91544758+phanen@users.noreply.github.com>
2025-06-20 17:32:07 +02:00
Shadman
cacb4ceeb4 test(prompt): nvim_paste in prompt buffer #34583 2025-06-20 07:07:27 -07:00
zeertzjq
927dc3c2c4 vim-patch:476b65e: runtime(doc): mention using <script> instead of <sfile> in :autocmd (#34580)
fixes: vim/vim#17569

476b65ebac
2025-06-19 23:08:01 +00:00
Yi Ming
528381587b refactor(lsp): redesign LSP folding state #34469 2025-06-19 06:23:40 -07:00
Riley Bruins
0dc900d744 fix(lsp): clear document_color autocmds #34573
**Problem:** When enabling document_color multiple times for the same
buffer (or when toggling it on and off), duplicate autocmds are created
since the previous ones are not cleared.

**Solution:** Clear the appropriate buffer-local autocmds when
enabling/disabling document color functionality.
2025-06-19 03:48:12 -07:00
Oskar Haarklou Veileborg
150513a163 fix(lsp) type annotation for vim.lsp.Config.cmd #34574
The type annotation for `vim.lsp.ClientConfig.cmd` was changed,
but the update was not propagated to `vim.lsp.Config`.
2025-06-19 03:35:13 -07:00
Christian Clason
487112d674 vim-patch:9.1.1468: filetype: bright(er)script files are not recognized
Problem:  filetype: bright(er)script files are not recognized
Solution: detect *.bs files as brighterscript filetype and *.brs as
          brightscript filetype, include filetype plugins (Riley Bruins)

closes: vim/vim#17566

03e5ee25fd

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-06-19 11:10:38 +02:00
Christian Clason
2379fb053a vim-patch:8b92af6: runtime(hgcommit): set comments and commentstring options in filetype plugin
closes: vim/vim#17480

8b92af645c

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-06-19 11:10:26 +02:00
Christian Clason
255f313cf6 vim-patch:736cd18: runtime(ishd): set comments and commentstring options in filetype plugin
closes: vim/vim#17490

736cd18671

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-06-19 11:10:26 +02:00
Christian Clason
f038213617 vim-patch:e4c157b: runtime(nroff,groff): update commentstyle in filetype plugins
closes: vim/vim#17516

e4c157b9c1

Co-authored-by: jtmr05 <62111562+jtmr05@users.noreply.github.com>
2025-06-19 11:10:26 +02:00
zeertzjq
fb8dba413f vim-patch:9.1.1467: too many strlen() calls (#34572)
Problem:  too many strlen() calls
Solution: Change expand_env() to return string length
          (John Marriott)

This commit does the following changes:
- In expand_env_esc():
  - return the length of the returned dst string.
  - refactor to remove some calls to STRLEN() and STRCAT()
  - add check for out-of-memory condition.
- Change call sites in various source files to use the return value

closes: vim/vim#17561

fff0132399

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-06-19 02:21:33 +00:00
zeertzjq
8ed6f00ab0 vim-patch:9.1.1471: completion: inconsistent ordering with CTRL-P (#34571)
Problem:  completion: inconsistent ordering with CTRL-P
          (zeertzjq)
Solution: reset compl_curr_match when using CTRL-P (Girish Palya)

fixes: vim/vim#17425
closes: vim/vim#17434

5fbe72edda

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-06-19 09:24:13 +08:00
zeertzjq
0456d75517 vim-patch:8311e7d: runtime(vim): fix incorrect highlighting of User autocmds (#34570)
There is no pattern after the user event name. The user event name is
the pattern.

closes: vim/vim#17568

8311e7d6b4
2025-06-18 23:49:15 +00:00
Bruce Wen
3594c213a7 fix(diagnostics): validate opts.signs #34565 2025-06-18 10:26:28 -07:00
Phạm Bình An
8e17b72094 docs: vim_diff.txt #34502
Problem:
- Missing some important Vim features
- Since Nvim 0.5, package.path and package.cpath don't include
  `'runtimepath'` (thought `require()` can still find modules in
  `runtimepath`)

Closes #33938

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-06-18 06:19:00 -07:00
Eisuke Kawashima
5cf135f9a0 vim-patch:9.1.1466: filetype: not all lex files are recognized
Problem:  filetype: not all lex files are recognized
Solution: detect *.ll as lex, llvm or lifelines filetype, depending on
          the content (Eisuke Kawashima)

closes: vim/vim#17560

48295111e5

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-06-18 14:37:06 +02:00
Julian Visser
32f30c4874 feat(lsp): pass resolved config to cmd() #34550
Problem:
In LSP configs, the function form of `cmd()` cannot easily get the
resolved root dir (workspace). One of the main use-cases of a dynamic
`cmd()` is to be able to start a new server  whose binary may be located
*in the workspace* ([example](https://github.com/neovim/nvim-lspconfig/pull/3912)).

Compare `reuse_client()`, which also receives the resolved config.

Solution:
Pass the resolved config to `cmd()`.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-06-18 04:52:17 -07:00
Justin M. Keyes
aa8c86e8f3 Merge #34541 docs 2025-06-18 03:46:28 -07:00
Yi Ming
237bb9cb59 docs(ui): type annotations for options #33983 2025-06-18 03:20:18 -07:00
Justin M. Keyes
cb2367a1e2 docs: api, misc 2025-06-18 12:13:55 +02:00
Justin M. Keyes
c8e54bf49d docs: deprecate <sfile> 2025-06-18 12:12:23 +02:00
luukvbaal
3b85046ed5 fix(messages): "list_cmd" kind for :command, :version (#34529)
Problem:  No ext_messages kind for the :command, :version commands.
          :version is emitted as multiple events.
Solution: Assign them the "list_cmd" kind. Use `msg_put*` to properly
          format the message as a single event.
2025-06-18 07:54:49 +02:00
zeertzjq
8af2aea24f Merge pull request #34492 from nenahp/fix-append-cursor
fix: cursor shape don't resume after `:append`
2025-06-18 06:59:05 +08:00
Riley Bruins
17c18efbe5 fix(lsp): support v:count in selection_range() #34551
Co-authored-by: Yi Ming <ofseed@foxmail.com>
2025-06-17 14:10:57 -07:00
Riley Bruins
b3c78f4b3c test(lsp): return tables instead of deserializing strings #34554 2025-06-17 13:41:49 -07:00
phanium
2c9d21f722 fix: cursor shape don't resume after :append
Problem: cursor shape don't resume after `:append`.
e.g. `seq 1000 | nvim --clean +"se gcr+=c:ver25" -`

Solution: emit missing ui event.
2025-06-18 00:40:22 +08:00
Shadman
286371b4d2 feat(prompt): multiline prompt input #33371
Problem:
Cannot enter multiline prompts in a buftype=prompt buffer.

Solution:
- Support shift+enter (`<s-enter>`) to start a new line in the prompt.
- Pasting multiline text via OS paste, clipboard, "xp, etc.
- A/I in editable region works as usual.
- i/a/A/I outside of editable region moves cursor to end of current
  prompt.
- Support undo/redo in prompt buffer.
- Support o/O in prompt buffer.
- Expose prompt location as `':` mark.
2025-06-17 08:46:57 -07:00
phanium
496691f985 docs: vim.fs.dir.Opts type #34546
Follow the pattern of vim.fs.find.Opts
2025-06-17 07:14:25 -07:00
Maria José Solano
e74753a221 fix(docs): callback annotation for vim.ui.input #34507 2025-06-17 06:37:27 -07:00
glepnir
006361fc6b fix(api): buffer updates in quickfix buffer #31105
Problem: Buffer events (specifically on_bytes callbacks) weren't triggered when the
quickfix list was modified, preventing buffer change notifications.

Solution: Add code to send both bytes and lines change notifications after
quickfix buffer updates to properly trigger all attached callbacks.
2025-06-17 06:31:14 -07:00
someoneinjd
1bf9a07b3e build: slience new clang-tidy warnings #34539
Problem: The new cert-arr39-c and bugprone-tagged-union-member-count
checks introduced in clang-tidy 20 fail on Neovim's codebase, even
though the code is correct.

Solution: Disable these two checks by modifying the .clang-tidy
configuration file.
2025-06-17 02:19:57 -07:00
Christian Clason
6976ff57dd vim-patch:152a450: runtime(sh): reset g:sh_fold_enabled after outputting its value in syntax script
fixes: vim/vim#10701
closes: vim/vim#17557

152a450d88

Co-authored-by: hakkadaikon <hakkadaikon@yahoo.co.jp>
2025-06-17 10:44:37 +02:00
Maria José Solano
cd06e0c9d6 fix(lsp): include client ID when receiving unknown fold kind (#34535) 2025-06-16 19:36:06 -07:00
zeertzjq
ae0981070e vim-patch:9.1.1464: gv does not work in operator-pending mode (#34534)
Problem:  gv does not work in operator-pending mode
          (liushapku)
Solution: remove the check for checkclearop in nv_gv_cmd()
          (phanium)

fixes: vim/vim#3666
closes: vim/vim#17551

cb27992cda

Co-authored-by: phanium <91544758+phanen@users.noreply.github.com>
2025-06-17 00:27:41 +00:00
zeertzjq
3e984cf02b vim-patch:9.1.1463: Integer overflow in getmarklist() after linewise operation (#34532)
Problem:  Integer overflow in getmarklist() after linewise operation.
Solution: Don't add 1 to MAXCOL (zeertzjq)

related: neovim/neovim#34524
closes: vim/vim#17552

93318a9933
2025-06-16 23:24:52 +00:00
zeertzjq
5647b45e69 refactor(generator): use fmt() for string.format() more (#34528) 2025-06-17 06:50:51 +08:00
zeertzjq
24bb110588 vim-patch:f548ec4: runtime(keymaps): Add Azerbaijani keymap (#34527)
closes: vim/vim#17541

f548ec46e4

Co-authored-by: Rasul Samadzade <rasul.samadzade@protonmail.com>
2025-06-17 06:47:05 +08:00
Riley Bruins
35756022cb fix(lsp): advertise supported fold kinds (#34461)
This commit also makes it so that folds which have an unsupported fold
kind have their `kind` ignored.
2025-06-16 16:05:00 -04:00
Riley Bruins
492ea28612 feat(lsp): handle disabled code actions (#34453)
This commit also makes it so that disabled code actions are not
displayed unless the trigger kind is "Invoked".
2025-06-16 12:41:42 -04:00
Maria José Solano
9f99bf48ea fix(lsp): add missing argument validations (#34519) 2025-06-16 06:19:20 -07:00
someoneinjd
1d7823451e fix(lsp): use vim.notify for all message types #34489
Problem: Currently, vim.notify is only used to display messages when the
message type is Error.

Solution: Use vim.notify to display messages for all message types.
2025-06-16 05:02:59 -07:00
bfredl
6ad2a13054 Merge pull request #34495 from bfredl/debwithrelinfo
fix(build): disable problematic marktree assert in RelWithDebInfo builds
2025-06-16 12:27:41 +02:00
bfredl
576e8f62c2 fix(build): disable problematic marktree assert in RelWithDebInfo builds
Workaround (not a fix) for #27196 and for #33067

Asserts are meant to apply to debug builds but not release
builds for users. However the intermediate RelWithDebInfo
build type is quite often used by end users, so we might
want to disable certain problematic asserts there, while
still preserving them in Debug mode for CI.
2025-06-16 12:03:36 +02:00
luukvbaal
b2722181b0 fix(edit): clear showcmd after clearing last put char (#34517)
Problem:  Screen may be updated by a msg_showcmd event before '"' is
          cleared from the screen with register insertion.
Solution: Emit the msg_showcmd event before clearing the '"'.
2025-06-16 11:03:35 +02:00
Lewis Russell
5fe582448c fix(treesitter): enable a gc for wasmtime 2025-06-16 09:19:17 +01:00
Lewis Russell
8cfb993fdf docs: support overloads and async 2025-06-16 09:18:42 +01:00
zeertzjq
b92e3889fe vim-patch:631a50c: runtime(doc): mention cannot ignored events in eventignorewin (#34522)
closes: vim/vim#17545

631a50ceb9

Co-authored-by: glepnir <glephunter@gmail.com>
2025-06-16 02:14:20 +00:00
zeertzjq
4b2c2eb120 docs(meta): fix incorrect bar -> backtick replacement (#34520) 2025-06-16 09:06:07 +08:00
Maria José Solano
00ad477419 fix(lsp): use correct deprecation function (#34518) 2025-06-15 16:15:55 -07:00
luukvbaal
29f2cb89f0 fix(messages): add append parameter to history entries (#34467)
Problem:  The "append" parameter added in abb40ece is missing from
          history entries, resulting in different message formatting
          for "g<".
Solution: Add "append" field to message history entries.

Co-authored-by: phanium <91544758+phanen@users.noreply.github.com>
2025-06-15 23:36:41 +02:00
Christian Clason
5ea6a022c0 build(deps): bump tree-sitter-query to v0.6.2 2025-06-15 13:37:31 +02:00
luukvbaal
5046ef4c8f fix(extui): clear cmdline buffer for first message (#34490)
Problem:  Cmdline buffer is not cleared for a new message (since c973c7ae),
          resulting in an incorrect spill indicator. When the cmdline
          buffer is cleared, "msg_row" is not invalidated, resulting in
          an error. The extui module is untested.
          Return value of `vim.ui_attach()->callback` is undocumented.
Solution: Clear the cmdline buffer for the first message in an event
          loop iteration. Ensure msg_row passed as end_row does not
          exceed buffer length.
          Add `messages_spec2.lua` to test the extui module, keeping in
          mind that test coverage will greatly increase if this UI is made
          the default. As such, only tests for specific extui functionality
          unlikely to be covered by tests leveraging the current message grid.
          Document the return value of `vim.ui_attach()->callback`, it seems
          to make sense, and is also used to suppress remote UI events in
          `messages_spec2.lua`.
2025-06-15 12:55:01 +02:00
luukvbaal
0d658660c2 fix(window): don't enter unfocusable or hidden prevwin (#34486)
Problem:  When closing a floating window, the next window to be entered
          may be unfocusable or hidden.
Solution: Don't enter prevwin when it is unfocusable or hidden. Enter
          firstwin instead (like for when prevwin is no longer valid).
2025-06-14 23:42:23 +02:00
glepnir
c7f38e3bc8 fix(api): nvim_parse_cmd parses :map incorrectly #34068
Problem: nvim_parse_cmd() incorrectly splits mapping commands like
into three arguments instead of preserving whitespace in the RHS.

Solution: Add special handling for mapping commands to parse them as exactly
two arguments - the LHS and the RHS with all whitespace preserved.
2025-06-14 10:17:56 -07:00
dundargoc
4367441213 docs: misc
Co-authored-by: Jan Weinkauff <jan@weinkauff.cloud>
Co-authored-by: MeanderingProgrammer <meanderingprogrammer@gmail.com>
Co-authored-by: Yochem van Rosmalen <git@yochem.nl>
Co-authored-by: phanium <91544758+phanen@users.noreply.github.com>
2025-06-14 17:24:36 +02:00
zeertzjq
1deba926c4 vim-patch:1ded411: runtime(debcontrol): add hurd-amd64 architecture to syntax script (#34496)
closes: vim/vim#17525

1ded411a41

Co-authored-by: Yuqian Yang <crupest@crupest.life>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-06-14 19:44:46 +08:00
bfredl
17571bc4c0 Merge pull request #34494 from huaxk/update-deps-hash
update deps hash for zig 0.14.0
2025-06-14 11:54:45 +02:00
huaxk
d21e2463fd fix: update deps hash for zig 0.14.0 2025-06-14 17:19:33 +08:00
Riley Bruins
76d213efbe feat(lsp): support multiline semantic tokens #34458 2025-06-13 08:30:08 -07:00
Justin M. Keyes
8001276bd0 docs: vim.fs., diagnostics, lsp #34402 2025-06-13 07:49:21 -07:00
Riley Bruins
1d5b3b5b4c feat(treesitter)!: apply offset! directive to all captures #34383
This commit changes the `offset!` directive so that instead of setting a
`metadata.range` value for the entire pattern, it will set a
`metadata.offset` value. This offset will be applied to the range only
in `vim.treesitter.get_range()`, rather than at directive application
time. This allows the offset to be applied to any and all nodes captured
by the given pattern, and removes the requirement that `#offset!` be
applied to only a single node.

The downside of this change is that plugins which read from
`metadata.range` may be thrown off course, but such plugins should
prefer `vim.treesitter.get_range()` when retrieving ranges anyway.

Note that `#trim!` still sets `metadata.range`, and
`vim.treesitter.get_range()` still reads from `metadata.range`, if it
exists.
2025-06-13 06:42:10 -07:00
Luuk van Baal
9ec6c19c67 docs(extui): rename box->msg, more->pager, prompt->dialog
Includes breaking changes to the `opts` layout. "box" doesn't really
describe anything other than a floating window so was an unwanted synonym.
2025-06-13 14:28:01 +02:00
Luuk van Baal
76f76fb083 fix(extui): only append messages exceeding 'cmdheight' to "more"
Problem:  8defe1a declared the "more" window the most convenient place to
          route messages to if it is already open for msg.pos == 'cmd'.
          In usage, this doesn't appear to be the case. Appending messages
          as added in that commit is still useful, but should only be done
          for messages that spill 'cmdheight'.
Solution: Only append messages exceeding 'cmdheight' to the more window.
          To do this, instead of immediately writing to the more buffer,
          write to the cmd buffer and calculate its height. Then copy the
          text and its highlights to the more buffer.
2025-06-13 14:28:01 +02:00
luukvbaal
3e30323135 fix(coverity/554963): preallocate msg.items to avoid FORWARD_NULL #34484
*** CID 554963:           (FORWARD_NULL)
/src/nvim/memline.c: 3484             in findswapname()
3478                 if (swap_exists_action != SEA_NONE) {
3479                   kv_printf(msg, _("Swap file \""));
3480                   kv_printf(msg, "%s", fhname);
3481                   kv_printf(msg, _("\" already exists!"));
3482                   char *run_but = _("&Open Read-Only\n&Edit anyway\n&Recover\n&Quit\n&Abort");
3483                   char *but = _("&Open Read-Only\n&Edit anyway\n&Recover\n&Delete it\n&Quit\n&Abort");
>>>     CID 554963:           (FORWARD_NULL)
>>>     Passing null pointer "msg.items" to "do_dialog", which dereferences it.
3484                   choice = (sea_choice_T)do_dialog(VIM_WARNING, _("VIM - ATTENTION"), msg.items,
3485                                                    proc_running ? run_but : but, 1, NULL, false);
3486
3487                   // compensate for missing "Delete it" button
3488                   choice += proc_running && choice >= 4;
3489                   // pretend screen didn't scroll, need redraw anyway
/src/nvim/memline.c: 3492             in findswapname()
3486
3487                   // compensate for missing "Delete it" button
3488                   choice += proc_running && choice >= 4;
3489                   // pretend screen didn't scroll, need redraw anyway
3490                   msg_reset_scroll();
3491                 } else {
>>>     CID 554963:           (FORWARD_NULL)
>>>     Passing null pointer "msg.items" to "msg_outtrans", which dereferences it.
3492                   msg_outtrans(msg.items, 0, false);
3493                 }
3494                 no_wait_return--;
3495                 kv_destroy(msg);
3496                 xfree(fhname);
3497               }
2025-06-13 05:19:30 -07:00
luukvbaal
29c8dabd41 fix(insexpand): update showmode when updating the screen (#34466)
Problem:  Eagerly calling `showmode()` to update showmode where setting
          `redraw_showmode` to be updated later would suffice.
Solution: Set `redraw_showmode` instead of calling `showmode()` if not
          showing a busy message followed by a `ui_flush()`.
2025-06-13 10:37:19 +02:00
Christian Clason
1ede826e04 vim-patch:d296af9: runtime(masm): set 'com' and 'cms' options in ftplugin
closes: vim/vim#17484

d296af94d0

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-06-13 09:56:35 +02:00
Christian Clason
beee60f3a0 vim-patch:85f0711: runtime(zimbu): set 'commentstring' option in ftplugin
closes: vim/vim#17478

85f0711b4e

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-06-13 09:56:35 +02:00
zeertzjq
90b682891d vim-patch:91af4c4: runtime(doc): improve the wording of 'sts', 'varts' and 'varsts' values (#34480)
closes: vim/vim#17522

91af4c4180

Co-authored-by: Damien Lejay <damien@lejay.be>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-06-13 00:53:48 +00:00
Riley Bruins
82d0883c2d fix(lsp): correct diagnostic data support and related info capabilities (#34454) 2025-06-12 14:00:42 -04:00
Tiago Inaba
7486c2f6aa feat(lsp): <Plug> mapping for signature help cycling #34039
Replace direct function mappings with `<Plug>` mappings for cycling
through overloaded signatures, providing better customization options
for users. This change keeps the default mapping (`<C-s>`) for cycling
if `<Plug>(nvim.lsp.ctrl-s)` is not mapped.
2025-06-12 10:56:39 -07:00
Riley Bruins
f99e3a8a2a feat(lsp): incremental selection via "textDocument/selectionRange" #34011
Select outwards with "an" and inwards with "in" in Visual mode.
Ranges are reset when leaving Visual mode.
2025-06-12 09:25:19 -07:00
Andre Toerien
a9b8a8dc6c fix(lsp): _cancel_all_requests() tries to cancel completed requests #34105
Problem:
The cancel function returned by `vim.lsp.buf_request` tries to cancel
all the requests, including those that have already been completed,
causing "Cannot find request with id ... whilst attempting to cancel"
errors to be logged when it is called.

Solution:
Only cancel the requests that are present in `client.requests`.
2025-06-12 09:21:53 -07:00
Antoine
ac12dc49cc fix(clipboard): enable cache for function providers #34470
Problem:
With these settings, copy/pasting `blockwise-visual` (with `CTRL+V`)
incorrectly pastes as a `linewise` mode because `regtype` is ignored:

    vim.opt.clipboard = 'unnamedplus'
    vim.g.clipboard = 'osc52'

To reproduce: press `CTRL+V` and select some characters press `p` and
observe that it is pasted in `linewise` mode.

Solution:
Enable the [clipboard.vim](https://github.com/neovim/neovim/blob/master/runtime/autoload/provider/clipboard.vim#L281-L283))
cache for function providers, so that `regtype` is maintained for the OSC52
clipboard provider.
2025-06-12 09:18:23 -07:00
luukvbaal
d86d4bacc1 fix(messages): make swapfile attention message part of prompt (#34414)
Problem:  The swapfile attention message is not repeated after clearing
          the screen.
          After clearing the screen `msg_scrolled` is reset without
          clearing other related variables, causing an assert.
Solution: Make the attention message part of the confirm prompt.
          Call `msg_reset_scroll()`.
2025-06-12 11:57:17 +02:00
bfredl
221b6ddf1c Merge pull request #34412 from bfredl/ui_buf
fix(msgpack): flush incomplete big UI event before packing RPC event
2025-06-12 11:35:33 +02:00
bfredl
b8ee354f12 fix(msgpack): flush incomplete big UI event before packing RPC event
This might happen, e.g. if we send a fast RPC reply in a os_breakcheck()
in the middle of redrawing and big ui_ext events are produced.

fixes #31316
2025-06-12 11:05:38 +02:00
luukvbaal
dc05598d02 fix(cmdline): set search cursor after ui_flush() (#34418)
Problem:  vim.ui_attach cmdline events emitted with an ephemeral cursor
          position that is only used as the start of the search.
Solution: Delay setting the cursor position until after ui_flush().
2025-06-12 08:53:10 +02:00
luukvbaal
66e4784f5a fix(float): ensure relative window grid is allocated (#34459)
Problem:  Uninitialized grid for a "win" relative float when redrawing
          just after it has been opened.
Solution: Ensure window grid is allocated or assigned the default grid.
2025-06-12 08:51:29 +02:00
zeertzjq
5f00e6adaf vim-patch:5128920: runtime(vim): Update base-syntax, improve function definition matching (#34463)
- Fix highlighting of function names including /fu\%[nction]/ (E.g.,
  s:func(), foo.fu(), fu.func())
- Match :delfunction argument.

Reported by Aliaksei Budavei.

closes: vim/vim#17428

51289207f8

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-06-12 08:05:20 +08:00
zeertzjq
3a2ac2300b vim-patch:9.1.1454: tests: no test for pum at line break position (#34462)
Problem:  Missing test case for pum display on a wrapped line.
Solution: Add a test case to cover pum behavior at line break positions.
          (glepnir)

closes: vim/vim#17520

6cc9bd4001

Co-authored-by: glepnir <glephunter@gmail.com>
2025-06-12 08:04:36 +08:00
zeertzjq
47df8f5a4b vim-patch:053aee0: runtime(doc): add more pointers to 'completeopt' (#34460)
Before this commit, I had trouble finding information about configuring
the insert mode completion. In particular, it was not clear that the
'wildopt' config that I already had in my vimrc does not apply here.

Also, `insert.txt` barely mentioned 'completeopt' except when
describing popups (I was more interested in bash-like behavior
where the unique prefix of all completions is completed first).

I'm hoping these edits will make the relevant docs easier to find.

closes: vim/vim#17515

053aee01f7

Co-authored-by: Ilya Grigoriev <ilyagr@users.noreply.github.com>
2025-06-12 07:32:07 +08:00
glepnir
6bee2f686f fix(shada): prevent use-after-free when mapping file marks (#34446)
Problem: When ignore_buf skips buffers during initialization,
shada_read_when_writing uses entry.data.filemark.fname directly
as map key, but later frees the entry, leaving dangling pointers.

Solution: Always create independent copies of filenames as map keys
using xstrdup() for new items, and free all keys during cleanup.

Fix #34440
2025-06-11 22:31:48 +00:00
zeertzjq
6a71239cd5 fix(terminal): don't disable scrolloff for non-terminal buffers (#34451) 2025-06-11 14:47:06 +00:00
Gregory Anders
de87ceb3be feat(tui): support APC queries in TermResponse (#34426)
Add support for APC sequences to libtermkey and the TermResponse
autocommand event.
2025-06-11 08:26:58 -05:00
fortime
966b1da183 fix(editorconfig): a custom property is treated as a section (#34445)
Problem: A custom property containing a pair of square brackets will be
treated as a section.
Solution: Change the logic parsing a section, remove the first match
regex `%b[]`.

Signed-off-by: fortime <palfortime@gmail.com>
2025-06-11 08:26:38 -05:00
Christian Clason
7aafbca510 vim-patch:c413ac7: runtime(java): Match raw-, non-generic-, and generic-type names of "java.lang"
And only match innermost element types of parameterised
array types.

References:
https://docs.oracle.com/javase/specs/jls/se21/html/jls-4.html#jls-4.8
https://docs.oracle.com/javase/specs/jls/se21/html/jls-6.html#jls-6.1
https://docs.oracle.com/javase/specs/jls/se21/html/jls-10.html

closes: vim/vim#17499

c413ac7068

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2025-06-11 10:15:16 +02:00
Christian Clason
719c7e2312 vim-patch:138fb95: runtime(reva): set 'cms' option in ftplugin, update URL
closes: vim/vim#17488

138fb951e0

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-06-11 10:15:16 +02:00
Christian Clason
8cd0ef06bb vim-patch:a0316cd: runtime(abap): set 'comments' and 'commentstring' option in ftplugin
Reference:
https://en.wikipedia.org/wiki/ABAP#Comments

closes: vim/vim#17489

a0316cd299

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-06-11 10:15:16 +02:00
Christian Clason
b1aed2b40a vim-patch:572d460: runtime(gdshader): add comments and commentstring to ftplugin
closes: vim/vim#17500

572d46035f

Co-authored-by: Maxim Kim <habamax@gmail.com>
Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-06-11 10:15:16 +02:00
Christian Clason
677a50bb26 vim-patch:30cf017: runtime(8th): updated 8th syntax script
closes: vim/vim#17505

30cf017f2a

Co-authored-by: Ron Aaron <ron@aaron-tech.com>
2025-06-11 10:15:16 +02:00
Riley Bruins
bac133e4b6 fix(lsp): announce diagnostic tag support (#34436)
This commit also adds a type annotation to the returned client
capabilities table, because without it lua_ls does not provide
autocompletion for the fields within the table.
2025-06-10 21:26:06 -07:00
zeertzjq
fb7a234f01 test: value of has("gui_running") after :restart (#34439) 2025-06-11 10:41:56 +08:00
zeertzjq
37d6ac8a15 test(screen): still match by full row when {MATCH:} is present (#34437)
Add '^' and '$' around the pattern. This makes it less likely to make
mistakes of when writing tests with {MATCH:}, as most such tests have
text before and after {MATCH:}.
2025-06-11 01:56:12 +00:00
zeertzjq
1abcd9fe28 vim-patch:9.1.1452: completion: redundant check for completion flags (#34434)
Problem:  completion: redundant check for completion flags
Solution: refactor code slightly (glepnir)

refactor: nest fuzzy completion logic to avoid duplicate flag checks

- Combine COT_FUZZY checks into single nested condition
- Reduce redundant bitwise operations in ins_compl_new_leader()

closes: vim/vim#17494

ecf8f15884

Co-authored-by: glepnir <glephunter@gmail.com>
2025-06-11 00:06:48 +00:00
zeertzjq
79ce71430f vim-patch:bfa1636: runtime(doc): update documentation on tabstop settings (#34433)
Unify the treatment of tabstop, correct errors and deprecate smarttab
usage.

closes: vim/vim#17444

bfa16364f1

Co-authored-by: Damien Lejay <damien@lejay.be>
2025-06-10 23:53:35 +00:00
zeertzjq
8ea18de959 vim-patch:274efcc: runtime(vim): Update base-syntax, contain let-heredocs (#34431)
Limit heredoc matches to assignment statements.  Matching these at the
top level is very slow.

closes: vim/vim#17473

274efcc7e6

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-06-10 23:35:59 +00:00
zeertzjq
612f8e7c9e vim-patch:9.1.1450: Session has wrong arglist with :tcd and :arglocal (#34430)
Problem:  Session has wrong arglist with :tcd and :arglocal.
Solution: Also use absolute path for :argadd when there is tabpage-local
          directory (zeertzjq).

related: neovim/neovim#34405
closes: vim/vim#17503

a304e49790
2025-06-10 23:35:42 +00:00
zeertzjq
cbc9d9b9c7 Merge pull request #34429 from zeertzjq/vim-9.1.1447
vim-patch:9.1.{1447,1449}
2025-06-11 07:05:25 +08:00
zeertzjq
5075043823 vim-patch:9.1.1449: typo in pum_display()
Problem:  typo in pum_display()
Solution: update the comment, remove empty new lines
          (glepnir)

closes: vim/vim#17506

ed4eb74f7a

Co-authored-by: glepnir <glephunter@gmail.com>
2025-06-11 06:42:32 +08:00
zeertzjq
ac772706cc vim-patch:9.1.1447: completion: crash when backspacing with fuzzy completion
Problem:  completion: crash when backspacing with fuzzy completion
Solution: Don't dereference compl_first_match when it's NULL
          (zeertzjq).

related: neovim/neovim#34419
closes: vim/vim#17511

91782b4aeb
2025-06-11 06:42:28 +08:00
Gregory Anders
b5aef05b8f fix(terminal): fix OSC 8 parsing (#34424)
vterm does not send us the terminator in the string fragment. Our OSC 8
parser assumed that it was and therefore treated short strings as
invalid (as it assumed it was missing a terminator).
2025-06-10 15:52:45 -05:00
zeertzjq
228ff6e547 Merge pull request #34411 from zeertzjq/tui-crash
fix(tui): wait for embedded server's exit code
2025-06-10 23:27:14 +08:00
zeertzjq
c2aa5fd915 test: :restart works on Windows 2025-06-10 23:00:38 +08:00
zeertzjq
2dba5abcb2 fix(tui): wait for embedded server's exit code
Uses the undocumented "error_exit" UI event for a different purpose:
When :detach is used on the server, send an "error_exit" with 0 `status`
to indicate that the server shouldn't wait for client exit.
2025-06-10 23:00:21 +08:00
glepnir
b98eefd803 fix(shada): prevent 'nobuflisted' buffers in v:oldfiles #34373
Problem: 'nobuflisted' buffers are incorrectly added to v:oldfiles.

Solution: Use ignore_buf() consistently in shada_write() for buffer
marks processing.
2025-06-10 06:50:16 -07:00
Christian Clason
93925fe020 vim-patch:446a98f: runtime(rpl): set commentstring option in ftplugin
closes: vim/vim#17487

446a98f0b6

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-06-10 09:10:59 +02:00
Christian Clason
4387c26691 vim-patch:9e9fe66: runtime(postscr): set commentstring option in ftplugin
closes: vim/vim#17486

9e9fe66437

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-06-10 09:10:59 +02:00
Christian Clason
b7cb7fe51c vim-patch:de535cf: runtime(occam): set commentstring option in ftplugin
closes: vim/vim#17485

de535cfe77

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-06-10 09:10:59 +02:00
Christian Clason
5394320a67 vim-patch:df63097: runtime(lprolog): set com, cms options for lambda prolog
closes: vim/vim#17481

df630970bf

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-06-10 09:10:59 +02:00
Christian Clason
2f167c53ac vim-patch:aa9fc8e: runtime(vue): set 'com' and 'cms' options in ftplugin
closes: vim/vim#17479

aa9fc8eb94

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-06-10 09:10:59 +02:00
Christian Clason
2c80b05cbd vim-patch:9.1.1446: filetype: cuda-gdb config files are not recognized
Problem:  filetype: cuda-gdb config files are not recognized
Solution: detect .cuda-gdbinit and cuda-gdbinit files as gdb filetype
          (Wu Zhenyu)

closes: vim/vim#17471

601cfa9a23

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2025-06-10 09:10:47 +02:00
zeertzjq
bcba067dc2 vim-patch:9.1.1445: negative matchfuzzy scores although there is a match (#34409)
Problem:  negative matchfuzzy scores although there is a match
          (Maxim Kim)
Solution: reset the score if a match has been found but the score is
          negative (Girish Palya)

The fuzzy algorithm may miss some matches in long strings due to recursion
limits. As a result, the score can end up negative even when matches exist.
In such cases, reset the score to ensure it is non-negative.

fixes: #vim/vim#17449
closes: vim/vim#17469

328332b0b0

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-06-10 00:47:14 +00:00
zeertzjq
7a58cf4b96 vim-patch:9.1.1443: potential buffer underflow in insertchar() (#34408)
Problem:  potential buffer underflow in insertchar()
Solution: verify that end_len is larger than zero
          (jinyaoguo)

When parsing the end-comment leader, end_len can be zero if
copy_option_part() writes no characters. The existing check
unconditionally accessed lead_end[end_len-1], causing potential
underflow when end_len == 0.

This change adds an end_len > 0 guard to ensure we only index lead_end
if there is at least one character.

closes: vim/vim#17476

82a96e3dc0

Co-authored-by: jinyaoguo <guo846@purdue.edu>
2025-06-10 08:20:55 +08:00
zeertzjq
78e2f62516 vim-patch:9.1.1442: tests: Test_diff_fold_redraw() is insufficient (#34407)
Problem:  tests: Test_diff_fold_redraw() is insufficient
          (after v9.1.1439, Christ van Willegen)
Solution: improve the test (Gary Johnson)

The original Test_diff_fold_redraw() function, added 2025-06-08 at patch
9.1.1439, had a bug and didn't do a very good job of testing the fold
behavior.  This new version is simpler and more thorough.

The bug was that it checked the fold state of one window twice instead
of checking both windows.

closes: vim/vim#17492

69565e3618

Co-authored-by: Gary Johnson <garyjohn@spocom.com>
2025-06-10 08:20:45 +08:00
zeertzjq
4fb36ea95f Merge pull request #34381 from zeertzjq/vim-9.1.1441
vim-patch:9.1.{1441,1444}
2025-06-10 08:01:50 +08:00
zeertzjq
72f4bb9ae8 vim-patch:9.1.1444: Unused assignment in set_fuzzy_score()
Problem:  Unused assignment in set_fuzzy_score() (after 9.1.1441).
Solution: Remove it (zeertzjq).

closes: vim/vim#17472

de1c7ac432
2025-06-10 07:27:55 +08:00
zeertzjq
bcfc22853a vim-patch:9.1.1441: completion: code can be improved
Problem:  completion: code can be improved
Solution: remove reposition_match() and use mergesort_list(),
          for fuzzy completion, sort by fuzzy score immediately after
          setting a new leader (Girish Palya)

closes: vim/vim#17460

b8ee1cf56e

Co-authored-by: Girish Palya <girishji@gmail.com>
Co-authored-by: glepnir <glephunter@gmail.com>
2025-06-10 07:27:09 +08:00
Maria José Solano
cb4559bc32 feat(lsp): workspace diagnostic support (#34262)
* refactor(lsp): remove underscore prefix from local variables

* feat(lsp): workspace diagnostic support
2025-06-09 13:02:00 -04:00
Maria José Solano
d75ffa5934 feat(lsp): static registration support (#34371) 2025-06-09 13:01:26 -04:00
luukvbaal
a5f236291c fix(messages): single event for multi-expr :echo (#34393)
Problem:  Separate "msg_show" event for each expression in a multi-expr
          :echo(n) command.
Solution: Only set the kind when `atstart == true`.
2025-06-09 18:58:31 +02:00
luukvbaal
e876a739ee fix(messages): recognize cmdline one_key/number prompt State (#34206)
Problem:  Since 48e2a736, prompt messages are handled by an actual
          active cmdline, resulting in `State` no longer being equal
          to `MODE_CONFIRM` which is used in some places. E.g. to
          specify the current `mode()` or to re-emit a confirm message.
Solution: Replace `MODE_CONFIRM` with a new `MODE_CMDLINE` sub-mode when
          `ccline.one_key/mouse_used` is set. Use it to avoid clearing
          mouse_used prompt messages, and to re-emit one_key messages
          (when ext_messages is inactive, for which this is unnecessary).
2025-06-09 18:57:28 +02:00
Siddhant Agarwal
2f0fbdaa48 feat(vim.fs): root() can specify "equal priority" #34276 2025-06-09 09:31:37 -07:00
Mtende
2d980e37c8 docs(diagnostics): default keymaps #34400 2025-06-09 08:44:01 -07:00
glepnir
336b46a879 fix(highlight): preserve background transparency in 'winblend' #34302
Problem: When using 'winblend', transparent backgrounds (-1) are forced
to default colors (usually black) during attribute blending, breaking
the transparency effect.

Solution: Check original background colors before blending in
hl_blend_attrs(). If both background and foreground originally had
transparent backgrounds, preserve transparency instead of forcing
default colors.
2025-06-09 08:24:46 -07:00
Justin M. Keyes
8fadb80b3a Merge #34361 skip flaky tests on cirrus CI 2025-06-09 07:05:33 -07:00
glepnir
76d0206342 fix(api): count parameter in nvim_parse_cmd, nvim_cmd #34253
Problem:
- nvim_parse_cmd('copen', {}) returns count: 0, causing nvim_cmd to override default behavior
- nvim_cmd({cmd = 'copen', args = {10}}, {}) fails with "Wrong number of arguments"

Solution:
- Only include count field in parse result when explicitly provided or non-zero
- Interpret single numeric argument as count for count-only commands like copen
2025-06-09 06:50:26 -07:00
Justin M. Keyes
ca9689858d ci: skip flaky fold test on freebsd/cirrus
FAILED
    test/functional/treesitter/fold_spec.lua
     @
    720
    :
    treesitter foldexpr doesn't open folds that are not touched
    test/functional/treesitter/fold_spec.lua:767: Row 1 did not match.
    Expected:
      |*{1:-}^t1                                     |
      |*{1:-}# h2                                   |
      |*{1:│}t2                                     |
      |{3:~                                       }|
      |{3:~                                       }|
      |{3:~                                       }|
      |{3:~                                       }|
      |1 line less; before #2  {MATCH:.*}|
    Actual:
      |*{1: }^t1                                     |
      |*{1:+}{2:+--  2 lines: # h2·····················}|
      |*{3:~                                       }|
      |{3:~                                       }|
      |{3:~                                       }|
      |{3:~                                       }|
      |{3:~                                       }|
      |1 line less; before #2  0 seconds ago   |
    To print the expect() call that would assert the current screen state, use
    screen:snapshot_util(). In case of non-deterministic failures, use
    screen:redraw_debug() to show all intermediate screen states.
    Snapshot:
    screen:expect([[
      {1: }^t1                                     |
      {1:+}{2:+--  2 lines: # h2·····················}|
      {3:~                                       }|*5
      1 line less; before #2  0 seconds ago   |
    ]])
2025-06-09 15:46:58 +02:00
Justin M. Keyes
cbaca9fee7 ci: skip flaky cursor test on freebsd/cirrus
Problem:
Test often fails on cirrus CI (freebsd):

    buffer cursor position is correct in terminal with number column in a line with single-cell multibyte chars and no trailing spaces, before_each
    test/functional/terminal/cursor_spec.lua:805: Row 5 did not match.
    Expected:
      |{7:  1 }                                                                  |
      |{7:  2 }                                                                  |
      |{7:  3 }                                                                  |
      |{7:  4 }                                                                  |
      |*{7:  5 }Entering Ex mode.  Type "visual" to go to Normal mode.            |
      |{7:  6 }:^                                                                 |
      |{3:-- TERMINAL --}                                                        |
    Actual:
      |{7:  1 }                                                                  |
      |{7:  2 }                                                                  |
      |{7:  3 }                                                                  |
      |{7:  4 }                                                                  |
      |*{7:  5 }                                                                  |
      |{7:  6 }:^                                                                 |
      |{3:-- TERMINAL --}                                                        |

Solution:
Skip it. Ex mode isn't that important.
2025-06-09 15:46:58 +02:00
luukvbaal
6f632a8615 fix(compositor): don't blend uninitialized background cells #34364
Problem:  A 'winblend' window floating over uninitialized cells loses
          its highlighting.

Solution: Return the front attribute for uninitialized background cells.
2025-06-09 05:43:33 -07:00
bfredl
811e12cebc Merge pull request #34217 from bfredl/shadajump
refactor(shada): expand macros taking macros and code fragments
2025-06-09 09:54:30 +02:00
bfredl
680d3770b1 refactor(shada): replace macros taking macros and code fragments
I guess these kinds of DRY techniques are kinda cutesy but unfortunately
I cannot expand macros invoking macros with various kind of syntax
fragments and back-references to local variables, at the same time
as I try to understand what is actually going on when you :wshada or :rshada
your jump marks, some of which having fname:s in them and some not.

This replaces it with four spelled out loops, although it is fine to
keep the memmove() related code generic in the item size just by passing a
runtime parameter (we have generics at home). Galaxy brain -03 -flto compilers
are gonna inline it anyway if it is worth it.
2025-06-09 09:33:20 +02:00
phanium
f2e60d000e fix: fn.exists() typos (#34390)
Problem:  `exists()` checks should test for being equal to 1 rather than truthy, and extui check can be more restrictive.
Solution:  Adjust `exists()` guards to equal 1 and use `matchparen#CursorMoved`.
2025-06-09 09:07:38 +02:00
notomo
58d85cd03d fix(treesitter): ensure window is valid in async parsing #34385
Problem: Error occurs if window is invalid in the middle of parsing.

Solution: Check if window is valid in parsing.

- Error
```
vim.schedule callback: ...im/share/nvim/runtime/lua/vim/treesitter/highlighter.lua:485: Invalid window id: 1037
stack traceback:
	[C]: in function 'nvim__redraw'
	...im/share/nvim/runtime/lua/vim/treesitter/highlighter.lua:485: in function 'cb'
	...m/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:494: in function '_run_async_callbacks'
	...m/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:550: in function <...m/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:529>
```

- Reproduce script
```lua
local bufnr = vim.api.nvim_create_buf(false, true)
local many_lines = vim.fn["repeat"]({ "local test = 'a'" }, 100000)
vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, many_lines)
local window = vim.api.nvim_open_win(bufnr, true, {
  relative = "editor",
  row = 0,
  col = 0,
  width = 10,
  height = 10,
})
vim.bo.filetype = "lua"
vim.schedule(function()
  vim.api.nvim_win_close(window, true)
end)
```
2025-06-08 16:44:40 -07:00
zeertzjq
d2dad30898 vim-patch:9.1.1439: Last diff folds not merged (#34380)
Problem:  Last diff folds not merged (after v8.1.1922)
Solution: loop over all windows in the current tabpage and update all
          folds (Gary Johnson)

This commit fixes a bug where the last two folds of a diff are not
merged when the last difference between the two diff'd buffers is
resolved.

Normally, when two buffers are diff'd, folding is used to show only the
text that differs and to hide the text that is the same between the two
buffers.  When a difference is resolved by making a block of text the
same in both buffers, the folds are updated to merge that block with the
folds above and below it into one closed fold.

That updating of the folds did not occur when the block of text was the
last diff block in the buffers.

The bug was introduced by this patch on August 24, 2019:

    patch 8.1.1922: in diff mode global operations can be very slow

    Problem:    In diff mode global operations can be very slow.
    Solution:   Do not call diff_redraw() many times, call it once when
		redrawing.  And also don't update folds multiple times.

Unfortunately, folds were then not updated often enough.

The problem was fixed by adding a short loop to the ex_diffgetput()
function in diff.c to update all the folds in the current tab when the
last difference is removed.

A test for this was added to test_diffmode.vim.  Two of the reference
screen dumps for another test in that file,
Test_diffget_diffput_linematch(), had to be changed to have all the
folds closed rather than to have the last diff block remain open.

closes: vim/vim#17457

3fa0d3514b

Co-authored-by: Gary Johnson <garyjohn@spocom.com>
2025-06-09 06:57:54 +08:00
zeertzjq
2b79d9ba1a vim-patch:9.1.1437: MS-Windows: internal compile error in uc_list() (#34379)
Problem:  MS-Windows: internal compile error in uc_list() with VS 17.14
          (ibear)
Solution: refactor code slightly (Mike Williams)

fixes: vim/vim#17402
closes: vim/vim#17464

0174d8f386

Co-authored-by: Mike Williams <mrmrdubya@gmail.com>
2025-06-09 06:57:31 +08:00
Riley Bruins
8b41df185c fix(treesitter): support multiple @injection.content captures
Before, only the last capture's range would be counted for injection.
Now all captured ranges will be counted in the ranges array. This is
more intuitive, and also provides a nice solution/alternative to the
"scoped injections" issue.
2025-06-08 18:23:22 +02:00
Christian Clason
775e845d59 vim-patch:80a7921: runtime(nginx): Add NGINX directive for background cache updates
Docs: https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_background_update

closes: vim/vim#17458

80a7921a02

Co-authored-by: S0AndS0 <strangerthanbland@gmail.com>
2025-06-08 16:53:50 +02:00
glepnir
e21c54000e test: remove unnecessary line breaks #34369
Problem: The test included too many unnecessary line breaks.
Solution: Remove the extra line breaks to make the test code more concise.
2025-06-08 03:26:45 -07:00
zeertzjq
00bec1fd90 vim-patch:partial:8f7256a (#34368)
vim-patch:partial:8f7256a: runtime(doc): fix some style issues and remove obsolete docs

8f7256a5ee

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-06-08 09:59:02 +08:00
zeertzjq
03bfc4e8d3 Merge pull request #34366 from zeertzjq/vim-1cccdeb
vim-patch: Vim syntax updates
2025-06-08 09:57:49 +08:00
zeertzjq
a1fc8bc17c vim-patch:834bb85: runtime(vim): vimHLGroup is not highlighted correctly
Problem: vimHLGroup is not highlighted in "hi def link"
          and "hi clear" commands
Solution: highlight vimHLGroup similarly to vimGroup
          (Eisuke Kawashima)

closes: vim/vim#17450

834bb85172

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-06-08 08:42:17 +08:00
zeertzjq
a118597290 vim-patch:6acca4b: runtime(vim): remove trailing whitespace in Vim syntax generator
related: vim/vim#17450

6acca4bc59

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-06-08 08:39:03 +08:00
zeertzjq
21a2411763 vim-patch:1cccdeb: runtime(vim): Update base-syntax, improve Vim9 block start pattern
The opening curly brace must be followed by whitespace, comment or
trailing bar.

closes: vim/vim#17454

1cccdebc0f

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-06-08 08:38:32 +08:00
zeertzjq
52c61d9690 feat: make :restart work for remote UI (#34354) 2025-06-07 22:10:34 +00:00
Riley Bruins
faae1e72a2 fix(treesitter): scope highlight state per window #34347
**Problem:** There is a lot of distracting highlight flickering when
editing a buffer with multiple open windows. This is because the
parsing/highlighting state is shared across all windows.

**Solution:** Greatly reduce flicker in window splits by scoping the
highlighter state object and the `parsing` state object to each
individual window, so there is no cross-window interference.
2025-06-07 09:27:46 -07:00
Justin M. Keyes
96a0e5f265 docs: lua, UI events #34261 2025-06-07 07:49:04 -07:00
luukvbaal
c8c78b531b fix(startup): make startup windows if there are only floating windows (#34349)
Problem:  If user init creates a floating window, startup windows
          (e.g. to accomodate arglist files) are no longer created.
Solution: Check that firstwin->w_next is not floating when deciding
          whether to make startup windows.
2025-06-07 11:24:51 +02:00
luukvbaal
af82f36108 fix(api): update topline when flushing with nvim__redraw() (#34346)
Problem:  nvim__redraw may update the screen with an invalid topline.
Solution: Update the topline before calling `update_screen()` (as
          :redraw does).
2025-06-07 11:24:24 +02:00
zeertzjq
22389159f5 test(tui_spec): avoid dangling process in OSC 52 test (#34356) 2025-06-07 16:53:00 +08:00
luukvbaal
bf1d4e9793 fix(messages): capture execute("messages") with ext_messages (#34342)
Problem:  "msg_history_show" event is emitted when `msg_silent > 0`.
          E.g. when capturing its output with `execute()`, which also
          doesn't work with ext_messages.
Solution: Don't emit the "msg_history_show" event when `msg_silent > 0`.
          Call regular messaging functions when `redirecting()`, to
          execute `redir_write()` while ensuring the message itself
          is not emitted.
2025-06-06 16:45:30 +02:00
Lewis Russell
3b6084ddf4 fix: type fixes
Type fixes caught by emmylua
2025-06-06 15:36:48 +01:00
Rodrigodd
4c333fdbb7 test(treesitter): test node access after tree edit 2025-06-06 15:35:52 +01:00
Rodrigodd
744674900f refactor(treesitter): avoid unnecessarily copying tree
node:tree() now already copies the tree before returning it, for memory
safety reasons.
2025-06-06 15:35:52 +01:00
Rodrigodd
99e6294819 fix(treesitter): ensure TSNode's tree is immutable
Problem:

TSNode contains a `const TSTree*` and a `const void *id`. The `id`
points to Tree-sitter's internal type `Subtree`, which resides inside
the `TSTree` but may be deallocated if the `TSTree` is mutated (which
is likely why it is `const`).

The Lua method `TSTree:edit()` mutates the tree, which can deallocate
`id`.

See #25254 and #31758.

Solution:

To avoid this, we now make a copy of the tree before pushing its root to
the Lua stack. This also removes the fenv from TSLuaTree, as it was only
used when pushing the tree root to the Lua stack.

We also copy the tree in `node_tree`.

`ts_tree_copy()` just increments a couple of reference counters, so it's
relatively cheap to call.
2025-06-06 15:35:52 +01:00
luukvbaal
cb036cae5f fix(extui): use visible to determine active "more" (#34327)
Problem:  Current window is checked to determine whether "more" window
          is open. Making it the current window is scheduled in case the
          cmdwin is open so this can be too late.
          "cmdline_hide" may be emitted when the topline is
          temporarily invalid (after incsearch->restore_viewstate()).
Solution: Use the window visibility to determine an active "more"
          window instead.
          Don't nvim__redraw->flush the "cmdline_hide" event (a normal
          will already happen).
2025-06-06 16:04:45 +02:00
Kai-Hsiang Hsu
e5c5b563ec fix(lsp): only auto-detach lsp.config enabled clients #34325
Problem: A custom server (initialized through `vim.lsp.start`) gets
         unexpectedly detached.

Solution: Only auto-detach the clients enabled through `vim.lsp.enable`
          to prevent unexpected behavior.
2025-06-06 06:26:50 -07:00
luukvbaal
3165e94a64 fix(api): ensure win_get_config() "border" is reciprocal (#34322)
fix(api): ensure win_get_config() is reciprocal

Problem:  win_get_config() does not include a 'none' border field,
          causing nvim_open_win() to apply the 'winborder' value.
Solution: Include a 'none' border field in the returned config,
          such that it can be used reciprocally in nvim_open_win()
          to yield the same window layout.
2025-06-06 12:40:57 +02:00
zeertzjq
9f505b4d0f refactor: make two functions used only in memory.c static (#34339)
After #29450 try_to_free_memory() is only used in memory.c.
Also move do_outofmem_msg() closer to where it's used.
2025-06-06 13:49:22 +08:00
zeertzjq
60d0b7d0c3 fix(diff): fix incorrect item size of dout_ga (#34338)
Related 267494151b
2025-06-06 04:34:28 +00:00
zeertzjq
552983515f vim-patch:9.1.1435: completion: various flaws in fuzzy completion (#34335)
Problem:  completion: various flaws in fuzzy completion
Solution: fix the issues (Girish Palya)

- Remove the brittle `qsort()` on `compl_match_array`.
- Add a stable, non-recursive `mergesort` for the internal doubly
  linked list of matches.
- The sort now happens directly on the internal representation (`compl_T`),
  preserving sync with external structures and making sorting stable.
- Update fuzzy match logic to enforce `max_matches` limits after
  sorting.
- Remove `trim_compl_match_array()`, which is no longer necessary.
- Fixe test failures by correctly setting `selected` index and
  maintaining match consistency.
- Introduce `mergesort_list()` in `misc2.c`, which operates generically
  over doubly linked lists.
- Remove `pum_score` and `pum_idx` variables

fixes: vim/vim#17387
closes: vim/vim#17430

8cd42a58b4

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-06-06 02:46:01 +00:00
Phạm Bình An
4e71d3bfab vim-patch:eb59129: runtime(typescript): remove Fixedgq() function from indent script (#34334)
Problem:
1. The `Fixedgq()` function is broken (see vim/vim#17412)
2. The `'formatexpr'` for Typescript is not documented, which causes
   confusion to users when they try to set `'formatprg'`, since
   `'formatexpr'` always takes precedence over `'formatprg'`. See also
   https://github.com/HerringtonDarkholme/yats.vim/issues/209
3. Typescript already has a very good and popular formatter called
   `prettier`, that can be easily integrated to Vim via `'formatprg'`
   (see vim/vim#16989). I don't think there are any good reasons to reinvent a
   half-baked version in Vim.

Solution:  Remove the Fixedgq() 'formatexpr' function.

fixes: vim/vim#17412
closes: vim/vim#17452

eb59129d2c
2025-06-06 07:47:55 +08:00
zeertzjq
a9f544b712 Merge pull request #34333 from zeertzjq/vim-9.1.1431
vim-patch:9.1.{1431,1433}

N/A patch:
vim-patch:002548b: runtime(doc): Add missing 'wfb' (winfixbuf) tag
2025-06-06 06:57:51 +08:00
zeertzjq
6171ab7f4e vim-patch:9.1.1433: Unnecessary :if when writing session
Problem:  Unnecessary :if in session where both branches have the same
          effect (after 9.1.1431).
Solution: Remove the superfluous :if (zeertzjq).

closes: vim/vim#17448

8f751d56f4
2025-06-06 06:37:36 +08:00
zeertzjq
f89381e05c vim-patch:9.1.1431: Hit-Enter Prompt when loading session files
Problem:  Hit-Enter Prompt when loading session files
Solution: use set+= for 'shortmess' to keep the existing flags
          (Miguel Barro)

closes: vim/vim#17445

0ca5966196

Co-authored-by: Miguel Barro <miguel.barro@live.com>
2025-06-06 06:36:47 +08:00
Lewis Russell
2b21c9c23f fix(diagnostic): ensure autocmd always is always sent diagnostics 2025-06-05 13:02:56 +01:00
Christian Clason
b6b35cb557 vim-patch:bb78ea2: runtime(mbsync): Add support for TLSType in syntax script
closes: vim/vim#17438

bb78ea23c6

Co-authored-by: Filippo Bonazzi <filippo.bonazzi@suse.com>
2025-06-05 09:16:38 +02:00
zeertzjq
1c417b565e vim-patch:9.1.1432: GTK GUI: Buffer menu does not handle unicode correctly (#34313)
Problem:  GTK GUI: Buffer menu does not handle unicode correctly
Solution: Get rid of the BMHash() function (SUN Haitao)

fixes: vim/vim#17403
closes: vim/vim#17405

08896dd330

Co-authored-by: SUN Haitao <sunhaitao@devtaste.com>
2025-06-05 09:19:22 +08:00
zeertzjq
5e470c7af5 fix(menu): fix listing of submenus (#34315)
Problem:  Listing submenus with :menu doesn't work.
Solution: Don't go to the parent of the return value of find_menu(), and
          handle empty path at the caller.

Related #8194, which actually only fixed the problem for menu_get(), not
for :menu Ex command.
2025-06-05 01:18:00 +00:00
zeertzjq
b16dc698cf Merge pull request #34312 from zeertzjq/vim-d6c9ac9
vim-patch: doc updates
2025-06-05 07:05:27 +08:00
zeertzjq
a5bbdbb5d5 vim-patch:dfed077: runtime(doc): fix small errors from rev 2090405de5bb66facc29c74
- update the netrw window to current version (and trim it slightly to 80
  chars)
- remove a trailing double quote

dfed077e06

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Antonio Giovanni Colombo <azc100@gmail.com>
2025-06-05 06:32:13 +08:00
zeertzjq
038fb30ece vim-patch:d6c9ac9: runtime(doc): clarify the effect of 'smarttab'
closes: vim/vim#17426

d6c9ac97a0

Co-authored-by: Damien Lejay <damien@lejay.be>
2025-06-05 06:31:09 +08:00
luukvbaal
5e4700152b fix(extui): copy window config to new tabpage (#34308)
Problem:  When opening a new tabpage, extui windows are initialized with
          their default config. Window visiblity/dimensions on other
          tabpages may get out of sync with their buffer content.
Solution: Copy the config of the window to the new tabpage.
          No longer keep track of the various windows on each tabpage.
          Close windows on inactive tabpages instead (moving them could
          be more efficient but is currently not supported in the API).
2025-06-04 19:59:36 +02:00
Christian Clason
03832842d5 build(deps): bump tree-sitter to v0.25.6 2025-06-04 19:31:08 +02:00
phanium
f577bb024e docs: getreg() type #34215
```lua
---@type string
local _a = vim.fn.getreg('a', 1)

---@type string[]
local _b = vim.fn.getreg('a', 1, 1)
```
2025-06-04 09:26:56 -07:00
Christian Clason
442dade5be ci(release): drop manual shasum collection
This is now included for all GH release assets out-of-the-box, see
https://github.blog/changelog/2025-06-03-releases-now-expose-digests-for-release-assets/

These can be accessed programmatically through
  `gh release view --json assets <release tag>`
and then looking at the `digest` key.
2025-06-04 18:22:09 +02:00
Emanuel Krollmann
7e393ff4f2 refactor(windows): redundant icon messages #34274
Problem:  Two separate window messages are used to get
          the original console icon and set a new
          one on windows, although the `WM_SETICON`
          message returns the original icon itself.

Solution: Replace the two `WM_GETICON` messages with
          two `WM_SETICON` messages, save the return
          values and remove the call to `os_icon_set`.
          Also, replace `os_icon_set` with `os_icon_reset`
          as its only usage is now resetting the
          icon to the original one.
2025-06-04 07:11:01 -07:00
zeertzjq
dd9ac565d8 Merge pull request #34294 from glepnir/vim-9.1.1426
vim-patch:9.1.{1426,1428}: register completion improve
2025-06-04 13:46:19 +08:00
glepnir
97ca92f9dd vim-patch:9.1.1428: completion: register completion needs cleanup
Problem:  completion: register completion needs cleanup
Solution: slightly refactor get_register_completion()
          (glepnir)

closes: vim/vim#17432

86d46a7018

Co-authored-by: glepnir <glephunter@gmail.com>
2025-06-04 13:27:38 +08:00
Yochem van Rosmalen
3d1f907912 vim-patch:2090405: runtime(doc): make examples verbatim to prevent conceal/tag parsing (#34299)
closes: vim/vim#17437

2090405de5
2025-06-04 05:55:24 +08:00
Lewis Russell
533cc0ab35 fix(vim.diagnostic): improve typing
Problem:

`vim.diagnostic.set()` doesn't actually accept a list of
`vim.Diagnostic` as internally `vim.diagnostic.set()` normalizes the
diagnostics and this normalization is assumed throughout the module.

Solution:

- Add a new type `vim.Diagnostic.Set` which is the input to `vim.diagnostic.set()`

- `col` is now an optional field and defaults to `0` to be consistent
  with `vim.diagnostic.match()`.

- Change `table.insert(t, x)` to `table[#table + 1] = x` for improved
  type checking.
2025-06-03 20:25:07 +01:00
Sergei Slipchenko
9641ad9369 fix(diagnostics): diagnostic just after EOL is not highlighted #34085
Fixes #34013

Problem:
when diagnostic is set right after EOL, underline handler looks
inconsistent compared to other handlers, visually underline is shown
starting from the next line. On top of that it's also inconsistent with
open_float and jump.

Solution:
clamp starting column position in underline handler to be right before
EOL to make it visible and consistent with other handlers, open_float
and jump.
2025-06-03 07:22:36 -07:00
Brynne Taylor
3991f14621 fix(glob): handling commas in letter pattern #34170 2025-06-03 06:36:44 -07:00
luukvbaal
eeacd7bd71 fix(api): adjust fix for reconfiguring float "relative" (#34287)
Problem:  "win" is cleared in float config after 96330843, even with
          unchanged "relative".
Solution: Don't clear "win". Avoid erroring for deleted "win" by setting
          the parent win to curwin directly when "win" is zero or not
          present in config.
2025-06-03 13:27:07 +02:00
glepnir
eb10852804 vim-patch:9.1.1426: completion: register contents not completed
Problem:  CTRL-X CTRL-R only completes individual words from registers,
          making it difficult to insert complete register content.
Solution: Add consecutive CTRL-X CTRL-R support - first press completes
          words, second press completes full register lines, similar to
          CTRL-X CTRL-L and CTRL-X CTRL-P behavior (glepnir).

closes: vim/vim#17395

d5fdfa5c9c

Co-authored-by: glepnir <glephunter@gmail.com>
2025-06-03 16:25:49 +08:00
zeertzjq
ee84518b94 fix(excmd): don't allow range or args for :detach/:restart (#34280)
Also remove the CMDWIN and LOCK_OK flags, so that there is no need to
check for text_locked() and curbuf_locked().
2025-06-03 01:03:43 +00:00
zeertzjq
049877d379 fix(tui): make :restart use new size after terminal resize (#34282) 2025-06-03 00:18:04 +00:00
zeertzjq
304a9baebd vim-patch:3993cd6: runtime(vim): Update base-syntax, bug fixes (#34288)
- Contain :profdel arguments.
- Fix string highlighting immediately after lambda -> operators.

Reported by Aliaksei Budavei.

closes: vim/vim#17427

3993cd619a

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-06-02 23:58:11 +00:00
zeertzjq
aa4fa24963 vim-patch:bfeefc4: runtime(doc): clarify the effect of exclusive single char selections (#34289)
closes: vim/vim#17410

bfeefc474a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-06-02 23:54:29 +00:00
zeertzjq
9c9c7ae30f Merge pull request #34247 from zeertzjq/vim-9.1.1301
vim-patch: various 'complete' features
2025-06-03 07:00:25 +08:00
zeertzjq
525c02a89f vim-patch:9.1.1424: PMenu selection broken with multi-line selection and limits
Problem:  PMenu selection broken with multi-line selection and limits
          (Maxim Kim)
Solution: update completion match index when limiting the completion
          sources (Girish Palya)

fixes: vim/vim#17394
closes: vim/vim#17401

6c40df09e0

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-06-03 06:30:47 +08:00
zeertzjq
9bfd0162dc vim-patch:9.1.1422: scheduling of complete function can be improved
Problem:  scheduling of complete function can be improved
Solution: call user completion functions earlier when just determining
          the insertion column (Girish Palya)

This change improves the scheduling behavior of async user-defined
completion functions (such as `F{func}`, `F`, or `'o'` values in the
`'complete'` option), particularly benefiting LSP clients.

Currently, these user functions are invoked twice:

1. First with `findstart = 1` to determine the completion start
   position.
2. Then with `findstart = 0` to retrieve the actual matches.

Previously, both calls were executed back-to-back. With this change, the
first call (`findstart = 1`) is performed earlier—before any matches are
gathered from other sources.

This adjustment gives event-driven completion sources (e.g., LSP
clients) more time to send their requests while Vim concurrently
collects matches from other sources like the current buffer.

Not sure about the real-world performance gains, but this approach
should, in theory, improve responsiveness and reduce latency for
asynchronous completions.

To test, try using yegappan LSP client:

```vim
set cpt+=o^10
autocmd VimEnter * g:LspOptionsSet({ autoComplete: false, omniComplete: true })
```

If you prefer to use 'native' auto-completion (without plugins), try the
following configuration:

```vim
set cot=menuone,popup,noselect,nearest
autocmd TextChangedI * InsComplete()
def InsComplete()
  if getcharstr(1) == '' && getline('.')->strpart(0, col('.') - 1) =~ '\k$'
    SkipTextChangedI()
    feedkeys("\<c-n>", "n")
  endif
enddef
inoremap <silent> <c-e> <c-r>=<SID>SkipTextChangedI()<cr><c-e>
inoremap <silent> <c-y> <c-r>=<SID>SkipTextChangedI()<cr><c-y>
def SkipTextChangedI(): string
  set eventignore+=TextChangedI
  timer_start(1, (_) => {
    set eventignore-=TextChangedI
  })
  return ''
enddef
inoremap <silent><expr> <tab> pumvisible() ? "\<c-n>" : "\<tab>"
inoremap <silent><expr> <s-tab> pumvisible() ? "\<c-p>" : "\<s-tab>"
```

closes: vim/vim#17396

98c29dbfd1

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-06-03 06:30:47 +08:00
zeertzjq
bec1449cc5 vim-patch:9.1.1416: completion limits not respected for fuzzy completions
Problem:  completion limits not respected when using fuzzy completion
          (Maxim Kim)
Solution: trim completion array (Girish Palya)

fixes: vim/vim#17379
closes: vim/vim#17386

19ef6b0b4b

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-06-03 06:30:47 +08:00
zeertzjq
2411f924a3 vim-patch:9.1.1410: out-of-bounds access with 'completefunc'
Problem:  out-of-bounds access with 'completefunc' (csetc)
Solution: check if it is safe to advance cpt_sources_index
          (Girish Palya)

fixes: vim/vim#17363
closes: vim/vim#17374

7c621052c3

Co-authored-by: Girish Palya <girishji@gmail.com>
Co-authored-by: @csetc
2025-06-03 06:30:47 +08:00
zeertzjq
eeff6ca8ff vim-patch:9.1.1409: using f-flag in 'complete' conflicts with Neovim
Problem:  using f-flag in 'complete' conflicts with Neovims filename
          completion (glepnir, after v9.1.1301).
Solution: use upper-case "F" flag for completion functions
          (Girish Palya).

fixes: vim/vim#17347
closes: vim/vim#17378

14f6da5ba8

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-06-03 06:30:47 +08:00
zeertzjq
13aec582b4 vim-patch:fa8b7db: runtime(doc): tweak documentation style in options.txt
closes: vim/vim#17229

fa8b7db99a

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-06-03 06:30:47 +08:00
zeertzjq
857ff5cae9 vim-patch:9.1.1313: compile warning about uninitialized value
Problem:  compile warning about uninitialized value
          (Tony Mechelynck, after v9.1.1311)
Solution: initialize variable on declaration

b53d4fb63e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-06-03 06:30:47 +08:00
zeertzjq
b6acf6112b vim-patch:9.1.1311: completion: not possible to limit number of matches
Problem:  completion: not possible to limit number of matches
Solution: allow to limit the matches for 'complete' sources by using the
          "{flag}^{limit}" notation (Girish Palya)

This change extends the 'complete'  option to support limiting the
number of matches returned from individual completion sources.

**Rationale:** In large files, certain sources (such as the current
buffer) can generate an overwhelming number of matches, which may cause
more relevant results from other sources (e.g., LSP or tags) to be
pushed out of view. By specifying per-source match limits, the
completion menu remains balanced and diverse, improving visibility and
relevance of suggestions.

A caret (`^`) followed by a number can be appended to a source flag to
specify the maximum number of matches for that source. For example:
```
  :set complete=.^9,w,u,t^5
```
In this configuration:
- The current buffer (`.`) will return up to 9 matches.
- The tag completion (`t`) will return up to 5 matches.
- Other sources (`w`, `u`) are not limited.

This feature is fully backward-compatible and does not affect behavior
when the `^count` suffix is not used.

The caret (`^`) was chosen as the delimiter because it is least likely
to appear in file names.

closes: vim/vim#17087

0ac1eb3555

Cherry-pick test_options.vim change from patch 9.1.1325.

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-06-03 06:30:47 +08:00
zeertzjq
c249389adb vim-patch:9.1.1302: Coverity warns about using uninitialized value
Problem:  Coverity warns about using uninitialized value
          (Coverity, Tony Mechelynck, after v9.1.1301)
Solution: initialize callback pointer to NULL

d2079cff48

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-06-03 06:30:47 +08:00
zeertzjq
7651c43252 vim-patch:9.1.1301: completion: cannot configure completion functions with 'complete'
Problem:  completion: cannot configure completion functions with
          'complete'
Solution: add support for setting completion functions using the f and o
          flag for 'complete' (Girish Palya)

This change adds two new values to the `'complete'` (`'cpt'`) option:
- `f` – invokes the function specified by the `'completefunc'` option
- `f{func}` – invokes a specific function `{func}` (can be a string or `Funcref`)

These new flags extend keyword completion behavior (e.g., via `<C-N>` /
`<C-P>`) by allowing function-based sources to participate in standard keyword
completion.

**Key behaviors:**

- Multiple `f{func}` values can be specified, and all will be called in order.
- Functions should follow the interface defined in `:help complete-functions`.
- When using `f{func}`, escaping is required for spaces (with `\`) and commas
  (with `\\`) in `Funcref` names.
- If a function sets `'refresh'` to `'always'`, it will be re-invoked on every
  change to the input text. Otherwise, Vim will attempt to reuse and filter
  existing matches as the input changes, which matches the default behavior of
  other completion sources.
- Matches are inserted at the keyword boundary for consistency with other completion methods.
- If finding matches is time-consuming, `complete_check()` can be used to
  maintain responsiveness.
- Completion matches are gathered in the sequence defined by the `'cpt'`
  option, preserving source priority.

This feature increases flexibility of standard completion mechanism and may
reduce the need for external completion plugins for many users.

**Examples:**

Complete matches from [LSP](https://github.com/yegappan/lsp) client. Notice the use of `refresh: always` and `function()`.

```vim
set cpt+=ffunction("g:LspCompletor"\\,\ [5]). # maxitems = 5

def! g:LspCompletor(maxitems: number, findstart: number, base: string): any
    if findstart == 1
        return g:LspOmniFunc(findstart, base)
    endif
    return {words: g:LspOmniFunc(findstart, base)->slice(0, maxitems), refresh: 'always'}
enddef
autocmd VimEnter * g:LspOptionsSet({ autoComplete: false, omniComplete: true })
```

Complete matches from `:iabbrev`.

```vim
set cpt+=fAbbrevCompletor

def! g:AbbrevCompletor(findstart: number, base: string): any
    if findstart > 0
        var prefix = getline('.')->strpart(0, col('.') - 1)->matchstr('\S\+$')
        if prefix->empty()
            return -2
        endif
        return col('.') - prefix->len() - 1
    endif
    var lines = execute('ia', 'silent!')
    if lines =~? gettext('No abbreviation found')
        return v:none  # Suppresses warning message
    endif
    var items = []
    for line in lines->split("\n")
        var m = line->matchlist('\v^i\s+\zs(\S+)\s+(.*)$')
        if m->len() > 2 && m[1]->stridx(base) == 0
            items->add({ word: m[1], info: m[2], dup: 1 })
        endif
    endfor
    return items->empty() ? v:none :
        items->sort((v1, v2) => v1.word < v2.word ? -1 : v1.word ==# v2.word ? 0 : 1)
enddef
```

**Auto-completion:**

Vim's standard completion frequently checks for user input while searching for
new matches. It is responsive irrespective of file size. This makes it
well-suited for smooth auto-completion. You can try with above examples:

```vim
set cot=menuone,popup,noselect inf

autocmd TextChangedI * InsComplete()

def InsComplete()
    if getcharstr(1) == '' && getline('.')->strpart(0, col('.') - 1) =~ '\k$'
        SkipTextChangedIEvent()
        feedkeys("\<c-n>", "n")
    endif
enddef

inoremap <silent> <c-e> <c-r>=<SID>SkipTextChangedIEvent()<cr><c-e>

def SkipTextChangedIEvent(): string
    # Suppress next event caused by <c-e> (or <c-n> when no matches found)
    set eventignore+=TextChangedI
    timer_start(1, (_) => {
        set eventignore-=TextChangedI
    })
    return ''
enddef
```

closes: vim/vim#17065

cbe53191d0

Temporarily remove bufname completion with #if 0 to make merging easier.

Co-authored-by: Girish Palya <girishji@gmail.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: glepnir <glephunter@gmail.com>
2025-06-03 06:30:46 +08:00
zeertzjq
0af6d6ff5e vim-patch:9.1.1147: preview-window does not scroll correctly
Problem:  preview-window does not scroll correctly
Solution: init firstline = 0 for a preview window
          (Girish Palya)

The 'info' window, which appears during insert-mode completion to display
additional information, was not scrolling properly when using commands like:
	win_execute(popup_findinfo(), "normal! \<PageDown>")
This issue made it impossible to navigate through info window contents using
keyboard-based scrolling.
The fix correctly updates the w_firstline value of the popup window, ensuring
proper scrolling behavior. Mouse scrolling was already working as expected and
remains unaffected.

closes: vim/vim#16703

12b1eb58ab

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-06-03 06:30:46 +08:00
Luuk van Baal
33b0a004eb fix(extui): properly setup "more" window for changed buffer
Problem:  Buffer setup after moving the message buffer to the "more"
          window after ff95d7ff is incomplete.
Solution: Adjust and invoke tab_check_wins() to do the setup instead.
2025-06-02 16:32:48 +02:00
Luuk van Baal
5e83d0f5ad fix(extui): reposition "more" window after entering cmdwin
Problem:  Closing the "more" window for an entered cmdwin in ff95d7ff9
          still requires special casing to properly handle "more" visibility.
Solution: Reposition the "more" window instead; anchoring it to the
          cmdwin.
2025-06-02 16:32:48 +02:00
luukvbaal
963308439a fix(api): reconfiguring float "relative" does not clear "win" (#34271)
Problem:  Unable to change the "relative" of a flag after its target
          "win" no longer exists.
Solution: Unset target window if it is not present in config and
          reconfigured "relative" no longer expects a target window.
2025-06-02 14:59:19 +02:00
Sathya Pramodh
86835b3db3 feat(editor): ":restart" command #33953
Problem:
Developing/troubleshooting plugins has friction because "restarting"
Nvim requires quitting and manually starting again. #32484

Solution:
- Implement a `:restart` command which emits `restart` UI event.
- Handle the `restart` UI event in the builtin TUI client: stop the
  `nvim --embed` server, start a new one, and attach to it.
2025-06-02 05:54:17 -07:00
Christian Clason
236243029d vim-patch:b577ad5: runtime(java): Match annotation- and interface-type names of "java.lang"
Complement the documented support for the recognition of all
public types of the "java.lang" package (":help java.vim").
(The original syntax item generator may have, inadvertently,
contributed via suppressing "NullPointerException"s to not
having annotation and interface types qualify in general.)

Also, re-link usage instructions for the alternative syntax
item generator to a rolling "master"'s version.

closes: vim/vim#17419

b577ad50d0

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2025-06-02 10:03:12 +02:00
zeertzjq
5fd03508aa vim-patch:95ea0b0: runtime(doc): make 'shiftwidth' setting more precise (#34266)
closes: vim/vim#17414

95ea0b0f8d

Co-authored-by: Damien Lejay <damien@lejay.be>
2025-06-02 08:26:34 +08:00
zeertzjq
06f07a104b vim-patch:0aaf6f8: runtime(vim): Update base-syntax, improve :profile highlighting (#34265)
Match full :profile and :profdel commands.

closes: vim/vim#17420

0aaf6f8bbb

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-06-02 00:11:36 +00:00
Emanuel Krollmann
52991d8728 fix(windows): don't set window icon on SIGHUP #34260
Problem:  When using conhost and pressing the 'x' button
          to close it while nvim is open, nvim hangs up
          while trying to reset the window icon, causing a big
          delay before the terminal actually closes. #34171

Solution: Set the window handle to NULL after receiving SIGHUP
          so that nvim will not try resetting the icon.
2025-06-01 15:23:42 -07:00
luukvbaal
981d4ba45e fix(eval): winnr('$') counts non-current hidden/unfocusable windows #34207
Problem:  Non-visible/focusable windows are assigned a window number,
          whereas commands that use this window number skip over them.

Solution: Skip over non-visible/focusable windows when computing
          the window number, unless it is made the current window
          through the API in which case an identifiable window number
          is still useful. This also ensures it matches the window
          number of the window entered by `<winnr>wincmd w` since
          403fcacf.
2025-06-01 15:12:12 -07:00
glepnir
5cfbc35aa8 fix(api): add missing nargs field to user command Lua callbacks #34210
Problem: nvim_create_user_command() Lua callbacks were missing the documented nargs field in the options table passed to the callback function.

Solution: Add nargs field derivation from command argument type flags in nlua_do_ucmd(), using the same logic as nvim_parse_cmd().
2025-06-01 15:03:35 -07:00
Justin M. Keyes
80753332d1 docs: news, intro, lsp, api #33687 2025-06-01 14:13:50 -07:00
luukvbaal
ff95d7ff9a fix(extui): adjust "more" window routing (#34251)
Problem:  Message lines from multiple message events that end up
          spilling 'cmdheight' end up spread out over the cmdline
          and "more" window.
          Messages emitted as feedback to a typed :command (rather than
          its sole purpose like :echo/:=) are routed to the more window.
          The more window isn't closed when entering the cmdwin, and
          doesn't allow `vim.hl.on_yank()`.
Solution: When first opening the "more" window for spilled messages,
          move the message buffer to the more window.
          Restrict routing of typed commands to echo kinds.
          Ignore all events but WinLeave and TextYankPost.
2025-06-01 20:54:38 +02:00
zeertzjq
b95189b7e3 Merge pull request #34244 from brianhuster/vim-6fea0a5
vim-patch: document on how to write lang annotation for codeblock in help file
2025-06-01 23:11:52 +08:00
zeertzjq
84c7785546 vim-patch:055cca8: runtime(java): Reference a modern syntax item generator for type names (#34256)
And generalise the sourcing of "javaid.vim" for Java
buffers.

Resolves zzzyxwvut/java-vim#10.
closes: vim/vim#17411

055cca88c4

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2025-06-01 21:33:32 +08:00
zeertzjq
b77666e6f9 Merge pull request #34252 from zeertzjq/vim-7b5550f
vim-patch: Vim syntax updates
2025-06-01 08:58:32 +08:00
zeertzjq
7384cf015e vim-patch:086b3b5: runtime(vim): Update base-syntax, improve :mark and :substitute highlighting
- Match full :mark and :k commands.
- Match 2 and 3 letter :s repeat commands.
- Match :s [count] argument.

closes: vim/vim#17408

086b3b5b79

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-06-01 08:33:56 +08:00
zeertzjq
4091f2c740 vim-patch:7b5550f: runtime(vim): Update base-syntax, improve :import highlighting
- Match "autoload" as a keyword in :import commands.
- Match an expression argument for the filename.

closes: vim/vim#15375

7b5550fac7

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-06-01 08:32:28 +08:00
zeertzjq
7a8b0cd0f8 Merge pull request #34239 from e-kwsm/vim-9.1.1342
vim-patch:9.1.{1342,1420}
2025-06-01 08:31:00 +08:00
Maria José Solano
f72c13341a feat(lsp)!: pass entire entry to format function (#34166)
* feat(lsp)!: pass entire entry to format function

* refactor(lsp): deprecate `vim.lsp.log.should_log()`
2025-05-31 08:47:32 -07:00
Eisuke Kawashima
0471cc7595 vim-patch:9.1.1420: tests: could need some more tests for shebang lines
Problem:  tests: could need some more tests for shebang lines
Solution: add more shebang patterns to test_filetype.vim
          (Eisuke Kawashima)

closes: vim/vim#17409

54a09e7e86

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-06-01 00:03:02 +09:00
Eisuke Kawashima
41179a6bc1 vim-patch:9.1.1342: Shebang filetype detection can be improved
Problem:  Shebang filetype detection can be improved
Solution: Improve detection logic (Eisuke Kawashima)

Vim does not correctly detect filetype from
  - `#!/usr/bin/env --split-string=awk -f`
  - `#!/usr/bin/env -S -i awk -f`
  - `#!/usr/bin/env -S VAR= awk -f`
So update the current detection logic to detect those cases.

closes: vim/vim#17199

f102f4c2e8

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-05-31 23:57:37 +09:00
brianhuster
7082367b3a vim-patch:b9ea0a8: runtime(doc): tweak documentation style in helphelp.txt
closes: vim/vim#16302

b9ea0a89fa

Co-authored-by: h-east <h.east.727@gmail.com>

I removed some parts that are not applicable to Nvim, like HelpTOC
2025-05-31 20:21:59 +07:00
brianhuster
60b866049c vim-patch:5ddcecf: runtime(help): Add better support for language annotation highlighting
closes: vim/vim#16238

5ddcecf05f

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: h_east <h.east.727@gmail.com>
2025-05-31 19:57:53 +07:00
luukvbaal
2763d06100 vim-patch:9.1.1419: It is difficult to ignore all but some events (#34245)
Problem:  It is difficult to ignore all but some events.
Solution: Add support for a "-" prefix syntax in '(win)eventignore' that
          subtracts an event from the ignored set if present
          (Luuk van Baal).

8cc6d8b187
2025-05-31 14:51:29 +02:00
brianhuster
11ae879ebd vim-patch:6fea0a5: runtime(help): Add Vim lang annotation support for codeblocks
closes: vim/vim#16215

6fea0a5480

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-05-31 17:25:27 +07:00
zeertzjq
5ebaf83256 Merge pull request #34243 from zeertzjq/vim-a4a3f71
vim-patch: doc updates
2025-05-31 09:01:23 +08:00
zeertzjq
eb6ca14248 vim-patch:77959dc: runtime(doc): CI fails with trailing whitespace error in usr_30.txt
77959dc644

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-05-31 08:18:28 +08:00
zeertzjq
d29b800515 vim-patch:a4a3f71: runtime(doc): clarify tabstop settings and guidance
closes: vim/vim#17381

a4a3f712e2

Co-authored-by: Damien Lejay <damien@lejay.be>
Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-05-31 08:15:25 +08:00
zeertzjq
7ed8e96994 fix(redraw): update curswant for Visual selection (#34241)
Problem:  Blockwise Visual selection not redrawn correctly when moving
          cursor for more than 1 cells with 'virtualedit'.
Solution: Restore the curswant update removed in 6679687bb3.
2025-05-30 23:47:13 +00:00
zeertzjq
ade64c3ca3 vim-patch:570e71a: runtime(vim): Update base-syntax, improve :set highlighting (#34240)
- Match comments and trailing bar after :set without args.
- Match the <...> form for key code options.
- Remove orphaned vim_ex_python[3x]* dump files (Aliaksei Budavei).

closes: vim/vim#17397

570e71a277

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-05-30 22:59:42 +00:00
Christian Clason
9e81408b69 ci(release): bump windows runner to windows-2022
Windows-20219 runner will be retired June 30, 2025 and receive several
brownouts before then.
2025-05-30 18:41:00 +02:00
Phạm Bình An
9d5eb3eda5 docs: rename builtin.txt, eval.txt #34212
Problem:
Despite the name, `builtin.txt` only includes Vimscript functions, which
is confusing, especially to people who only use Lua to configure Nvim

Solution: From justinmk's suggestion
- Rename `builtin.txt` to `vimfn.txt`
- Rename `eval.txt` to `vimeval.txt`
- The tags `*builtin.txt*` and `*eval.txt*` should be kept for Vim-patches

Closes #33743
2025-05-30 08:57:58 -07:00
phanium
756751afa3 fix(terminal): stack overflow when too many csi args (#34012)
fix: stack overflow when too many csi args

Problem:
Crash when csi contains > 16 args. It's easy to trigger
when you attempt to pipe external terminal scrollback buffer.
```sh
nvim --clean --cmd "term printf
'\e[38:2:59:66:97;48:2:36:40:59;58:2:224:175:104;4:3m'"
```

Solution:
Increase buffer size.
2025-05-30 06:57:07 -05:00
Gabriel Ford
b28bbee539 fix(terminal): skip setting string_initial to false on no-op (#34176)
Problem:

Currently undefined behavior can occur when `string_fragment()` is
called with `OSC_COMMAND`. This is because when the state changes to
`OSC_COMMAND`, `string_initial` is set to true. Then in some cases,
directly after this `string_initial` will be set back to false before
the on_osc callback is called, this leads to `term_settermprop()` never
initializing the title.

Solution:

In all of the no-op cases in `string_fragment()` currently, we continue
to the end of the function where `vt->parser.string_initial` is set to
false. This change returns in the no-op cases instead since in these
cases the string has not yet been terminated and sent to the callback.

Note:

This change also adds a test with a byte sequence from the file
in #34028 that caused nvim to crash. This byte sequences is the shortest
sequence I could trim down from that file that still would trigger the
crash. There are also two other tests I added which validate that
setting the title with OSC-0 and OSC-2 still works.

Fixes: #34028
2025-05-29 13:29:16 -05:00
Christian Clason
f82219c490 fix(treesitter): parser metadata annotations
Problem: `TSLangInfo` annotation does not reflect the structure returned
by `vim.treesitter.language.inspect()`.

Solution: Move version information under new (optional since ABI 15 only)
`TSLangMetadata` field.
2025-05-29 16:57:51 +02:00
Lewis Russell
532610388b fix(vim.system): improve error message when cwd does not exist
Problem:
vim.uv.spawn will emit ENOENT for either when the cmd or cwd do not
exist and does not tell you which.

Solution:
If an error occurs, check if cwd was supplied and included in the error
message if it does not exist.
2025-05-29 13:59:33 +01:00
Riley Bruins
cc264d51ab test(treesitter): coverage for comments with combined injections (#33975) 2025-05-29 12:10:07 +02:00
zeertzjq
6c4ddf607f vim-patch:9.1.1417: missing info about register completion in complete_info() (#34219)
Problem:  missing info about register completion in complete_info()
          (after v9.1.1408)
Solution: update documentation and mention that register is used as
          source, add a test (glepnir)

closes: vim/vim#17389

49864aecd0

Co-authored-by: glepnir <glephunter@gmail.com>
2025-05-29 07:09:50 +08:00
zeertzjq
03933fe4c0 vim-patch:0bc8709: runtime(doc): Correct allowed flags after :substitute repeat (#34218)
closes: vim/vim#17391

0bc8709a63

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-05-29 07:04:38 +08:00
glepnir
f2373a89d7 vim-patch:9.1.1408: not easily possible to complete from register content (#34198)
Problem:  not easily possible to complete from register content
Solution: add register-completion submode using i_CTRL-X_CTRL-R
          (glepnir)

closes: vim/vim#17354

0546068aae
2025-05-28 09:10:00 +00:00
Christian Clason
a4f318574a build(deps): bump tree-sitter to v0.25.5 2025-05-28 09:28:36 +02:00
phanium
8af28ab9cb fix(filetype): error when vim.filetype.match{buf=fn.bufadd('a.sh')} #34155
Problem: Error when `vim.filetype.match` a buffer with suffix `sh`.

Solution: fallback to an empty string as buffer content.
2025-05-27 06:56:29 -07:00
RedHolger
70697417c4 docs(ui): cmdline_hide parameters #34049 2025-05-27 06:50:20 -07:00
altermo
d22fcf2917 fix(gO): use non-breaking space #34197 2025-05-27 05:38:45 -07:00
luukvbaal
85d33514f9 feat(api): set nvim_echo() kind for ext_messages (#33998)
Problem:  Unable to emit a message with arbitrary kind.
Solution: Add a "kind" opts field to nvim_echo().
          Use it to set the "list_cmd" kind for vim.show_pos().
2025-05-27 13:01:10 +02:00
luukvbaal
3828856233 fix(extui): incorrect cmdline cursor position (#34201)
Problem:  Calculated cmdline cursor position can be smaller than 0.
          Prompt part of the cmdline is translated, while it should
          support "\t" characters.
Solution: Remove prompt part from the stored "cmdbuff" and get rid of
          dubious +/-1 from cmdline cursor calculation.
2025-05-27 12:38:18 +02:00
luukvbaal
8defe1afb2 feat(extui): route to "more" window if it is open (#34190)
Problem:  An already open "more" window is the most convenient place
          to route messages to with `cfg.msg.pos == 'cmd'`. Instead we
          route to the cmdline (unless that message also exceeds
          'cmdheight').
Solution: Route to "more" window while it is open and scroll to bottom
          to show the newest message. This is more convenient and more
          efficient due to not writing to the target buffer first (which
          is done to calculate the height of the message).
          (Ensure message highlights are deleted when text is replaced.)
2025-05-27 11:27:00 +02:00
Sean Dewar
66dddd8b51 fix(folds): adjust filler text drawing for transparent folds
Problem: Search highlighting is applied strangely to the filler text of
transparent folds, and EOL list characters are not shown.

Solution: Don't apply search highlighting to the last column of the window row
if the last text char on the line is highlighted. Display the EOL list char if
needed. Don't highlight the entire filler text when matching EOL, just highlight
the EOL list char or the first filler char.
2025-05-27 08:54:59 +01:00
zeertzjq
c4e52d604c vim-patch:9.1.1413: spurious CursorHold triggered in GUI on startup (#34195)
Problem:  spurious CursorHold triggered in GUI on startup
Solution: init global did_cursorhold flag to true
          (Gary Johnson)

When Vim is started in GUI mode, the CursorHold autocommand event is
triggered 'updatetime' milliseconds later, even when the user has not
pressed a key.  This is different from the behavior of Vim in terminal
mode, which does not trigger a CursorHold autocommand event at startup,
and contradicts the description of the CursorHold event in ":help
CursorHold", which states that the event is "[n]ot triggered until the
user has pressed a key".

The fix is to change the initial value of did_cursorhold from FALSE to
TRUE.  While it is true that the CursorDone event has not been done yet
at startup, it should appear to have been done until the user presses
a key.

fixes vim/vim#17350
closes: vim/vim#17382

318ff9c362

Co-authored-by: Gary Johnson <garyjohn@spocom.com>
2025-05-27 09:16:46 +08:00
zeertzjq
8c5bd841ed build: lint decorations_spec etc. with lintlua (#34182)
Follow-up to #33274
2025-05-27 00:14:42 +00:00
zeertzjq
092e49d020 build: unset $TMUX when running tests (#34178)
This prevents Nvim TUI running in tests from thinking it's inside tmux.

Another solution is make :terminal unset $TMUX instead, but I'm not sure
if that'll break some other use cases.
2025-05-27 07:47:28 +08:00
zeertzjq
a2daa3c0c0 Merge pull request #34193 from zeertzjq/vim-a6172f8
vim-patch: Correct allowed characters at :help 'filetype'
2025-05-27 07:46:13 +08:00
zeertzjq
fbf5fbacc2 vim-patch:f0c7090: runtime(doc): trailing whitespace in options.txt, delete it.
f0c7090a38

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-05-27 07:24:56 +08:00
zeertzjq
e35a7d4782 vim-patch:a6172f8: runtime(doc): Correct allowed characters at :help 'filetype'
closes: vim/vim#17366

a6172f8c5c

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-05-27 07:24:18 +08:00
monkoose
5e64d92411 perf(runtime): vim.trim for long only whitespace strings 2025-05-26 22:41:12 +01:00
Christian Clason
ba1cc9e10c vim-patch:69c3493: runtime(doc): clarify license conditions for distributed runtime files
related: vim/vim#17372

69c3493adc

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-05-26 17:51:24 +02:00
Christian Clason
aa9fd08034 vim-patch:c8b7e61: runtime: Add license information for HCL and Terraform runtime files
fixes: vim/vim#17372
closes: vim/vim#17377

c8b7e6129a

Co-authored-by: Gregory Anders <greg@gpanders.com>
2025-05-26 17:51:24 +02:00
luukvbaal
c973c7ae6f fix(extui): write each message chunk pattern separately (#34188)
Problem:  Bulking message lines to write in a single API call is
          complicated and still not correct w.r.t. overwriting
          highlights.
Solution: Write each chunk pattern separately with it's highlight
          such that it will be spliced correctly for message chunks
          that contain a carriage return. Go with correctness over
          performance until this proves to be too inefficient.
          Also add an identifying name to the various extui buffers.
2025-05-26 16:25:45 +02:00
Gabriel Ford
a6e2c22347 test: format decoration_spec.lua (#34181)
Problem: Currently when I run `make format` this is the one file outside
of my changes that isn't currently formatted.

Solution: Format this file.
2025-05-26 09:24:45 +08:00
zeertzjq
bd01bd6564 vim-patch:9.1.1407: Can't use getpos('v') in OptionSet when using setbufvar() (#34177)
Problem:  Can't use getpos('v') in OptionSet when using setbufvar().
Solution: Don't reset Visual selection when switching to the same
          buffer (zeertzjq).

closes: vim/vim#17373

5717ee33db
2025-05-25 22:51:15 +00:00
Maria José Solano
4db58f78b4 fix(lsp): announce normalizesLineEndings capability (#34175) 2025-05-25 15:04:38 -07:00
Maria José Solano
52868977ae refactor(lsp): use vim.validate in vim.lsp.log (#34165) 2025-05-25 15:04:23 -07:00
zeertzjq
8b9500c886 fix(system): don't treat NUL at start as no input (#34167) 2025-05-25 09:28:11 +08:00
bfredl
06043af27d Merge pull request #34054 from bfredl/looking_glass
build.zig: LuaJIT / unittests
2025-05-24 22:05:32 +02:00
bfredl
af947f0107 ci: bump zig to 0.14.1 2025-05-24 21:05:24 +02:00
bfredl
e25b99c5b6 feat(build): make build.zig run unittests 2025-05-24 21:05:24 +02:00
bfredl
c4501e98f2 feat(build): make build.zig use luajit on main plattforms 2025-05-24 21:05:24 +02:00
luukvbaal
a96665cf48 fix(extui): using tracked message column in cleared buffer (#34154)
Problem:  Using tracked message column as column in cleared buffer.
Solution: Ensure column does not exceed current line length.
          Further work to ensure carriage return and cmdline block mode
          work properly.
2025-05-24 20:31:20 +02:00
Christian Clason
8a207b3e19 build(deps): bump tree-sitter-c to v0.24.1 2025-05-24 20:02:29 +02:00
Riley Bruins
baabc35987 fix(treesitter): properly clip nested injections 2025-05-24 11:51:11 +01:00
phanium
a59b052857 fix(extui): map wincmd instead of remapped key (#34151)
Problem: "q" cannot close window when `<c-w>` is mapped.
Solution: Map q to `<Cmd>wincmd c<CR>`.
2025-05-24 12:02:11 +02:00
Christian Clason
c9d8468020 feat(search): increase MAX_COUNT to 999
Problem: "99 searchcount ought to be enough for anyone."

Solution: Increase `SEARCH_STAT_DEF_MAX_COUNT` to 999, which I'm sure
will suffice for the next twenty years.

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2025-05-24 10:55:43 +02:00
Luuk van Baal
9784bc1346 fix(extui): append consecutive :echon messages
Problem:  Consecutive `:echon` messages are printed on separate lines.
Solution: Implement the new msg_show->append parameter.
2025-05-24 01:02:22 +02:00
Luuk van Baal
abb40ecedd feat(ui): "append" parameter for "msg_show" UI events
Problem:  Consecutive "msg_show" events stemming from an `:echon`
          command are supposed to be appended without a newline, this
          information is not encoded in the "msg_show" event.
Solution: Add an "append" parameter to the "msg_show" event that is set
          to true to indicate the message should not start on a new line.
Considered alternative: Emit a newline for the common case instead at the
start of a new message. That way UIs can more closely follow the logic
as it is implemented for the message grid currently. This would be a
breaking change. The "append" parameter seems OK.
2025-05-24 01:02:22 +02:00
zeertzjq
7c2b4a0eaf Merge pull request #34137 from brianhuster/vim-2323f22
vim-patch: add chapter 2 of beginner tutor
2025-05-24 06:48:34 +08:00
luukvbaal
6ce2877327 fix(move): consume skipcol before revealing filler lines (#34143)
Problem:  When scrolling (the text) down with 'smoothscroll', filler
          lines are revealed before the text skipped with `w_skipcol`.
Solution: Check `w_skipcol` before filler lines.
2025-05-24 00:45:00 +02:00
zeertzjq
071dcab68f vim-patch:9.1.1405: tests: no test for mapping with special keys in session file (#34146)
Problem:  tests: no test for mapping with special keys in session file.
Solution: Add a special keys to an existing test.  Also test with UTF-8
          characters containing 0x80 or 0x9b bytes (zeertzjq).

closes: vim/vim#17360

9ff1e598e8
2025-05-23 22:38:12 +00:00
brianhuster
f791ae82e5 vim-patch:9.1.1404: wrong link to Chapter 2 in new-tutor
Problem:  wrong link to Chapter 2 in vim-01-beginner.tutor
Solution: Fix the link to Chapter 2, add test for links in tutor files
          (Phạm Bình An)

In order to write the test, I exposed the function `s:GlobTutorials` as
`tutor#GlobTutorials` and make it also accept a `locale` argument.

closes: vim/vim#17356

e8302da74a

Co-authored-by: Phạm Bình An <111893501+brianhuster@users.noreply.github.com>
2025-05-23 09:59:43 +07:00
brianhuster
41c850e2c8 vim-patch:2323f22: runtime(new-tutor): add chapter two to the interactive tutorial
closes: vim/vim#16803

2323f225ca

Co-authored-by: RestorerZ <restorer@mail2k.ru>
2025-05-23 09:34:39 +07:00
Brahmajit Das
079e7d2b11 vim-patch:df68419: runtime(doc): clarify the use of change marks when writing a buffer (#34132)
related: vim/vim#17008

df68419ba0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-05-22 23:52:12 +00:00
zeertzjq
153a910897 vim-patch:9.1.1402: multi-byte mappings not properly stored in session file (#34131)
Problem:  multi-byte mappings not properly stored in session file
Solution: unescape the mapping before writing out the mapping, prefer
          single-byte mapping name if possible (Miguel Barro)

closes: vim/vim#17355

5b07aff2f6

Co-authored-by: GuyBrush <miguel.barro@live.com>
2025-05-23 07:42:30 +08:00
zeertzjq
f0fb6d448a vim-patch:f4b2fce: runtime(vim): Update base-syntax, fix missing luaParenError error (#34130)
We shouldn't assume that the luaParenError syntax group is present in
the, possibly custom, included file or that it hasn't already been
removed.  However, issue vim/vim#11277 has been fixed so it no longer needs to
be cleared.

Fixes comment https://github.com/vim/vim/pull/15375#issuecomment-2899791944

related: vim/vim#15375
closes: vim/vim#17357

f4b2fce71c

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-05-22 23:12:17 +00:00
Evan Hahn
927927e143 fix(lsp): fix error with InsertReplaceEdit events #33973
Problem:
Some LSPs cause the following completion error (reformatted slightly):

    Error executing vim.schedule lua callback:
    .../runtime/lua/vim/lsp/completion.lua:373
    attempt to index field 'range' (a nil value)

This is because an internal function assumes edits are either missing
or of type `TextEdit`, but there's a third [possibility][0] that's not
handled: the `InsertReplaceEdit`.

This was previously reported in at least two issues:

- https://github.com/neovim/neovim/issues/33142
- https://github.com/neovim/neovim/issues/33224

Solution:
Don't assume the edit is a `TextEdit`. This implicitly handles
`InsertReplaceEdit`s.

Also, add a test case for this, which previously caused an error.

[0]: 2c07428966/runtime/lua/vim/lsp/_meta/protocol.lua (L1099)
2025-05-22 06:22:47 -07:00
bfredl
27bb814cb1 Merge pull request #34100 from bfredl/billions
fix(tests): fix unittests so they don't have hidden errors
2025-05-22 13:15:40 +02:00
Yochem van Rosmalen
62ba6e8a76 fix: use nvim namespace convention #34010 2025-05-22 03:40:08 -07:00
Yi Ming
fed9069b8d fix(lsp): avoid foldclose() after current window-buffer changed #33901
Problem:
Because the buffer in the window may change before the request is completed, foldclose() might be executed on the wrong buffer.

Solution:
Avoid that.
2025-05-22 03:16:28 -07:00
bfredl
2d4b028d02 fix(tests): use correct include path for unittest
Copy whatever was made to work for generated headers:

(1) we need to consider all cmake targets not just main_lib
(2) we need to add the sysroot for macOS
2025-05-22 11:56:46 +02:00
bfredl
c81af9428c fix(tests): use uv.spawn instead of io.popen for unittest helpers
The old implementation of repeated_read_cmd would attempt to run the
command multiple times to handle racyness of async output. Code
like this should not be written. Instead, use the libuv event
loop to read until the process has exited and the pipe has been closed.

This causes some previous discarded errors to be propagated. Fix these
as well.
2025-05-22 11:56:46 +02:00
altermo
0412527a40 feat(outline): smaller indentation #34005 2025-05-22 02:21:34 -07:00
bfredl
272e041780 fix(tests): don't surpress stderr output
This is a diabolical anti-pattern and is hiding errors which exist
currently in unittests. Also we want to see _where_ in the process
stderr was emitted, stashing it away at the end erases important
context.
2025-05-22 11:20:35 +02:00
Brynne Taylor
322a6d305d feat(glob): new Glob implementation based on Peglob #33605
|vim.glob.to_lpeg()| uses a new LPeg-based implementation (Peglob) that
provides ~50% speedup for complex patterns. The implementation restores
support for nested braces and follows LSP 3.17 specification with
additional constraints for improved correctness and resistance to
backtracking edge cases.
2025-05-22 00:24:49 -07:00
Christian Clason
172a90c245 vim-patch:b0691b4: runtime(sh): Fix various syntax highlighting problems in ksh93 scripts
- Fixed syntax highlighting for ksh93 namespace variables starting
  with '${.'
- Added support for the alarm, eloop, fds, mkservice, pids, poll and
  sha2sum builtins (which are indeed ksh93 builtins, albeit whether or
  not they are available depends on the ksh release and the compiled
  SHOPT options).
- Added support for the many Unix commands provided by ksh93's libcmd
  as builtin commands (since these are general commands, scripts for
  other shells like bash will also highlight these).
  - The dumps for the sh_0{2,5,6,8,9}.sh were recreated due to this
    change affecting commands those scripts call (e.g. 'wc').
- Enabled ${parameter/pattern/string} and friends for ksh syntax.
- Enabled case modification for ksh. See also:
  https://github.com/ksh93/ksh/commit/c1762e03
- Enabled ;;& support for ksh. See also:
  https://github.com/ksh93/ksh/commit/fc89d20a
- Added many special ksh variables using 93u+m's data/variables.c
  as a reference.

If vim can't figure out which ksh release is in play using e.g.
the hashbang path, in such a case a generic default that enables
everything and the kitchen sink will be used. Otherwise, features will
be disabled if it's absolutely known a certain feature will not be
present. Examples:
   - ERRNO is ksh88 specific, so that is locked to ksh88.
   - Only 93u+m (assumed for generic) has SRANDOM, and only 93u+m
     and 93v- have case modification support.
   - 93u+ and 93v- have VPATH and CSWIDTH variables (the latter
     is vestigal, but still present in the hardcoded variable table).
   - 93v- and ksh2020 have (buggy and near unusable) implementations
     of compgen and complete.
   - Only mksh provides function substitutions, i.e. ${|command;}.

This took the better part of my day to implement. It seems to work well
enough though. (Also had to regenerate the dumps again while testing
it, as now there are dup scripts with mere hashbang differences, used
solely for testing syntax highlighting differences.)

closes: vim/vim#17348

b0691b46bd

Co-authored-by: Johnothan King <johnothanking@protonmail.com>
2025-05-22 08:56:01 +02:00
luukvbaal
7077c59295 fix(extui): reset message state after "search_cmd" message (#34119)
Problem:  A "search_cmd" message alters the message state (since 8e8f4523),
          unnecessarily affecting logic for messages that follow.
Solution: Reset the appropriate variables after a "search_cmd" message.
          Don't show "search_cmd" message with zero 'cmdheight'.
2025-05-21 23:34:09 +02:00
Maria José Solano
2e0158650a fix(diagnostic): accept multiple namespace in open_float() (#34073) 2025-05-21 10:54:43 -07:00
Rijul Kapoor
19efabafc5 fix(diagnostics): fixed virtual_text cursormoved autocmd error (#34017) 2025-05-21 10:20:37 -05:00
Phạm Bình An
dd43eb445a docs(tutor): move lesson 7.2 below lesson 7.3 #33662
Problem:

- Lesson 7.3 (Cmdline Completion) teaches an important way to discover
  Nvim features. I think users should learn it before they start
  configuring Nvim
- Nvim can be configured in Lua as well, but lesson 7.2 (Configuring
  Nvim) only mentions init.vim. And I think Nvim is promoting Lua more

Solution:

- Move lesson 7.2 to be after lesson 7.3
- Lesson 7.2 should teach about init.lua

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-05-21 02:26:57 -07:00
Gregory Anders
cd9d8469b2 Merge pull request #34090 from yochem/exrc-search-parent
feat(exrc): unset 'exrc' to stop searching parent directories
2025-05-20 12:06:08 -05:00
Gregory Anders
5ad01184f3 fix(lsp/health): ensure valid table before concatenating (#34092)
The root_markers field can now contain a table of tables (as of
https://github.com/neovim/neovim/pull/33485) and :checkhealth will show
an error in that case since Lua cannot concatenate a table of tables.

Ensure that tables contain strings before concatenating and if not, fall
back to using vim.inspect().
2025-05-20 12:05:20 -05:00
Christian Clason
849e24f3cd vim-patch:719ec0f: runtime(tar): preserve pwd when reading and writing tar files
While at it, use `:lcd` to temporarily set the window local directory
instead of `:cd` for the global working directory.

fixes: vim/vim#17334
closes: vim/vim#17339

719ec0fe15

Co-authored-by: Michele Sorcinelli <michelesr@autistici.org>
2025-05-20 08:15:27 +02:00
Christian Clason
14631e2264 vim-patch:5ad53ca: runtime(muttrc): fix mangled keywords in syntax script
Regression introduced in commit 10f23e10a9 ("Update syntax/muttrc.vim to
latest mutt (vim/vim#12797)", 2023-08-15)

Affected keywords:
  invresume_draft_files
  invresume_edited_draft_files
  mailcap_path
  mark_macro_prefix

closes: vim/vim#17344

5ad53ca99f

Co-authored-by: Markus Heidelberg <markus.heidelberg@web.de>
2025-05-20 08:15:27 +02:00
v1nh1shungry
dbe17da120 fix(diagnostic): deprecate float in vim.diagnostic.Opts.Jump (#34037) 2025-05-19 19:44:26 -07:00
Phạm Bình An
1524868711 vim-patch:5a8f995: runtime(doc): remove outdated Contribution section in pi_tutor (#34094)
Problem:  The Github repo link in the Contribution section has been
          archived for 5 years. So people who want to contribute to the
          tutor plugin should just send PR to Vim repo, similar to most
          other Vim features, so there is no need for a Contribution
          section in the plugin doc.

Solution: Replace it with an Original Author note at the beginning of
          the help document.

closes: vim/vim#17341

5a8f9958e2
2025-05-20 00:21:30 +00:00
Yochem van Rosmalen
8d397fa458 feat(exrc): stop searching in parent directories by unsetting 'exrc'
Problem:
No way for a user to limit 'exrc' search in parent directories (compare
editorconfig.root).

Solution:
A configuration file can unset 'exrc', disabling the search for its
parent directories.
2025-05-20 00:03:14 +02:00
Fionn Fitzmaurice
2045e9700c Don't set manwidth wider than the window (#34078)
fix: set manwidth to not exceed the window width

If we set the MANWIDTH variable to a value wider than the window, the
contents wrap and formatting breaks. A more sensible way to handle this
is to interpret MANWIDTH as a maximum width, but to set the width to the
window size if smaller.

See also: #9023, #10748.
2025-05-19 12:37:03 -05:00
bfredl
dfad613813 Merge pull request #33884 from neovim/dependabot/github_actions/mlugg/setup-zig-2
ci: bump mlugg/setup-zig from 1 to 2
2025-05-19 16:07:58 +02:00
Yochem van Rosmalen
dc6fc11b87 fix(defaults): start exrc search from parent directory
Problem:
The exrc file in the current directory is executed twice, here and in
`do_exrc_initalization()`.

Solution:
Start search from parent directory. Let core handle exrc in current
directory.
2025-05-19 15:16:36 +02:00
zeertzjq
dc6885dc24 vim-patch:9.1.1398: completion: trunc does not follow Pmenu highlighting attributes (#34084)
Problem:  When items are combined with user-defined highlight attributes
          (e.g., strikethrough), trunc inherits these attributes, making
          the text difficult to read.
Solution: trunc now uses the original Pmenu and PmenuSel highlight
          attributes (glepnir)

closes: vim/vim#17340

0816f17e9a

Co-authored-by: glepnir <glephunter@gmail.com>
2025-05-19 08:11:54 +08:00
Fredrik Foss-Indrehus
3a35fdc347 feat(clipboard): wayclip primary clipboard and correct mimetype (#33990)
* Don't specify wayclip mimetype

Problem:  Since wayclip 0.2, wayclip assumes UTF-8
          (text/plain;charset=utf-8) in absence of an explicit mimetype.
	  Since Neovim sets the mimetype to "text/plain" without
	  specifying UTF-8, you will also have to use `-t text/plain`
	  when using waypaste or wayclip outside of Neovim.

Solution: Don't specify mimetype when using wayclip, thereby using the
          default "text/plain:charset=utf-8".

* Add primary clipboard support to wayclip

wayclip have had support for primary clipboard for some time now.

---------

Co-authored-by: Fredrik Foss-Indrehus <fred@ffoss.net>
2025-05-19 07:44:13 +08:00
bfredl
a87aa68ed0 Merge pull request #34071 from bfredl/tagutf
refactor(helptags): remove useless homegrown encoding check
2025-05-18 11:36:12 +02:00
Christian Clason
23c214ed4a build(deps): bump uncrustify to 0.81.0 2025-05-18 09:59:21 +02:00
zeertzjq
5661f74ab2 Merge pull request #34075 from zeertzjq/vim-a577e42
vim-patch: Vim syntax updates
2025-05-18 07:06:55 +08:00
zeertzjq
ba237ce96c vim-patch:a577e42: runtime(vim): Update base-syntax, improve script-interface command highlighting
- Normalise interface heredoc highlighting with that used for
  :let-heredocs.
- Remove interface feature testing.  The Lua and Python interface
  command scripts are now highlighted by default.  Loading all syntax
  files incurs an undesirable load-time burden so highlighting of the
  less popular MzScheme, Perl, Ruby and Tcl interfaces is disabled by
  default.  g:vimsyn_embed can still be used to customise the supported
  interfaces.
- Always highlight interface ex-commands as valid commands, even when
  the corresponding command-script highlighting is disabled.
- Highlight simple command-script statements as well as heredocs.
- Remove error highlighting of heredoc and statement command-script
  regions when an interface is disabled.  These are now highlighted as
  plain text.
- Allow indented heredoc end tokens when "trim" is specified.
- Match interface heredocs in :def functions.
- Fix runaway vimEmbedError regions.  These regions have been removed.
- Use python2 syntax for :python, and :pythonx when 'pyxversion' is
  appropriately set.

closes: vim/vim#15522

a577e4289c

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-05-18 06:44:49 +08:00
zeertzjq
913e4c6010 vim-patch:e957cba: runtime(vim): Update base-syntax, match quote separated numbers
closes: vim/vim#17250

e957cba081

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-05-18 06:14:16 +08:00
Christian Clason
4a6f017bc1 build(deps): bump tree-sitter-markdown to v0.5.0 2025-05-17 19:26:34 +02:00
Anakin Childerhose
4eed85f9bd feat(logs): show full paths in lsp logs (#33886)
feat(logs): show full path of short_src in lsp logs

Problem:
- Cannot gf to info.short_src printed in the logs since only the last 16
  characters are printed

Solution:
- Print full info.short_src and remove ...
2025-05-17 09:57:22 -07:00
bfredl
9a322f8103 refactor(helptags): remove useless homegrown encoding check
This check was always broken. it will "detect" a file as
other-than-UTF-8 if the first line of a help file only is ASCII.

This only works by accident, as all our help files are UTF-8 (or
ASCII-only, which is fully compatible), but are all ASCII-only
on the first line of every help file which means that all helpfiles
gets detected as not-UTF8 which makes the "consistency" test pass
by accident even though the actual consistency is that every single
file is UTF-8 compatible. This means that the
"!_TAG_FILE_ENCODING\tutf-8\t" meta-tag already did not get emitted
but YAGNI in either case as no encoding tag just means that 'encoding'
is used which in neovim always is UTF-8 anyway.

An alternative approach would be to integrate the real encoding
detection already present in the codebase (an editor which edits text of
various encodings) which checks the entire file instead of a weird
first-line-only-hack, but as it happens to be 2025 the resolution of
encoding trouble is to just use UTF-8 everywhere. And if you use something
else you have to keep track yourself anyway it is not like we can detect
if one helpfile of your plugin is latin-1 and another is latin-2 or
whatever. Also, Nvim will detect the encoding of the file when you open
the file as a :help buffer anyway.
2025-05-17 17:01:09 +02:00
Christian Clason
81bb7613f9 build(deps): bump tree-sitter-lua to v0.4.0 2025-05-17 13:20:31 +02:00
luukvbaal
8e8f4523c6 fix(extui): translate <Tab> in cmdline text (#34055)
Problem:  <Tab> is not translated on the cmdline, and exposes a wrong
          assumption in search messages that may contain multiple chunks.
Solution: Translate unprintable characters in the cmdline content.
          Extract the 'search_count' from the last chunk and route
          'search_cmd' to cmdline to handle multiple chunks.
2025-05-17 11:24:05 +02:00
Christian Clason
f40e140083 build(deps): bump luv to 1.51.0-1 2025-05-17 10:59:14 +02:00
zeertzjq
99384fcd9c vim-patch:9.1.1396: 'grepformat' is a global option (#34060)
Problem:  The 'grepformat' option is global option, but it would be
          useful to have it buffer-local, similar to 'errorformat' and
          other quickfix related options (Dani Dickstein)
Solution: Add the necessary code to support global-local 'grepformat',
          allowing different buffers to parse different grep output
          formats (glepnir)

fixes: vim/vim#17316
closes: vim/vim#17315

7b9eb6389d

Co-authored-by: glepnir <glephunter@gmail.com>
2025-05-17 00:20:20 +00:00
zeertzjq
ec5f054dc9 vim-patch:9.1.1395: search_stat not reset when pattern differs in case (#34058)
Problem:  search_stat not reset when pattern differs in case
          (tahzibijafar)
Solution: use STRNCMP instead of MB_STRNICMP macro

There was a long standing todo comment, that using MB_STRNICMP is wrong.
So let's change it to STRNCMP() instead. Even if it not handle
multi-byte characters correctly, then Vim will rather recompute the
search stat, instead of re-using the old (and possibly wrong) value.

fixes: vim/vim#17312
closes: vim/vim#17314

670d0c1468

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-05-16 23:47:20 +00:00
zeertzjq
6af1b7e5e8 fix(:print): don't use schar_from_ascii() for illegal byte (#34046) 2025-05-17 06:35:20 +08:00
Christian Clason
3659058e80 build(deps): bump tree-sitter-vimdoc to v4.0.0 2025-05-16 19:39:44 +02:00
Christian Clason
9d1996ac61 build(deps): bump tree-sitter-query to v0.6.1 2025-05-16 18:42:56 +02:00
bfredl
37cac18787 Merge pull request #34038 from bfredl/tui_mode
refactor(tui): don't use pseudo-terminfo for custom modes
2025-05-16 11:45:49 +02:00
bfredl
82027fd6bd refactor(tui): don't use pseudo-terminfo for custom modes
This just cleans up some old definitions from before tui_set_term_mode
existed. There is no need to represent custom modes in a different
format just because they are safe without feature detection.
2025-05-16 11:02:53 +02:00
bfredl
6e3eb6663e Merge pull request #34016 from bfredl/tui_scroll_shame
fix(tui): don't disable vsplit scrolling in all xterm-like terminals
2025-05-16 10:59:50 +02:00
Christian Clason
1be2fdb910 vim-patch:6451e5f: runtime(gleam): add @Spell clusters to syntax script
closes: vim/vim#17324

6451e5f517

Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
2025-05-16 10:49:40 +02:00
Christian Clason
469541c415 vim-patch:1aa68df: runtime(pandoc): update YAML metadata block parsing in compiler runtime
Previously the incorrect regexp forced title to be a single letter
because of using '+' instead of the '\+' regexp modifier.

closes: vim/vim#17321

1aa68dffbf

Co-authored-by: Alexander Abrosimov <alexander.n.abrosimov@gmail.com>
2025-05-16 10:49:40 +02:00
Sean Dewar
2fda267faf vim-patch:9.1.1393: missing test for switching buffers and reusing curbuf
Problem:  The check in buf_freeall that restores curwin subtly prevents
          leaving an unloaded buffer in a window when reusing curbuf, if
          autocommands switch to a different buffer.
Solution: Add a test case that covers this. Also ensure splitting isn't
          possible, as that could do the same (Sean Dewar)

closes: vim/vim#17325

31be82e66d

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2025-05-15 21:05:07 +01:00
bfredl
763e7428e2 refactor(tui): remove obsolete can_set_left_right_margin duplicate
According to terminfo(5), these are obsolete:

Except for very old terminal descriptions, e.g., those developed
for SVr4, the scheme just described should be considered obsolete.
An improved set of capabilities was added late in the SVr4
releases (smglr and smgtb), which explicitly use two parameters
for setting the left/right or top/bottom margins.
2025-05-15 19:02:10 +02:00
bfredl
142f914089 fix(tui): feature detect vsplit scrolling in xterm-like terminals
Current "patch" asserts that EVERY terminal claiming to be an xterm has
broken vertical split scrolling which is far too an aggressive
workaround.

Instead, as left-right margins for scrolling regions use a
private DEC mode, we can use feature detection to use them in supported
terminals only. This way, users who use properly implemented terminals
can enjoy hardware accelerated scrolling even with vertical split
windows.
2025-05-15 18:56:45 +02:00
luukvbaal
70eb416459 fix(extui): better message highlighting after carriage return (#34034)
Problem:  Incorrect message highlighting for highlighted message
          chunks containing carriage returns.
Solution: Add a highlight for each substring ending in a newline or
          carriage return separately.
2025-05-15 17:23:01 +02:00
zeertzjq
17e13ce3b6 fix(tui): clear primary device callback before invoking it (#34032)
A primary device callback may set a new callback (e.g. when suspending),
so clearing it after invoking it is too late.

While at it, add missing reset of did_set_grapheme_cluster_mode in
terminfo_start().
2025-05-15 20:42:49 +08:00
luukvbaal
f87b6230f1 vim-patch:9.1.1388: Scrolling one line too far with 'nosmoothscroll' page scrolling (#34023)
Problem:  One-off error in "count" to make "w_skipcol" zero with
          'nosmoothscroll' page scrolling when last virtual line
          in a buffer line is exactly the entire window width.
          (Hirohito Higashi)
Solution: Properly compute the smallest integer value necessary
          to make "w_skipcol" zero (Luuk van Baal)

c6c72d165c
2025-05-15 10:01:34 +02:00
Sean Dewar
6b9665a507 vim-patch:9.1.1387: memory leak when buflist_new() fails to reuse curbuf
Problem:  buflist_new() leaks ffname and fails to reuse curbuf when
          autocommands from buf_freeall change curbuf. Plus, a new
          buffer is not allocated in this case, despite what the comment
          above claims.
Solution: Remove the condition so ffname is not leaked and so a new
          buffer is allocated like before v8.2.4791. It should not be
          possible for undo_ftplugin or buf_freeall autocommands to
          delete the buffer as they set b_locked, but to stay consistent
          with other uses of buf_freeall, guard against that anyway
          (Sean Dewar).

Note that buf is set to NULL if it was deleted to guard against the (rare)
possibility of messing up the "buf != curbuf" condition below if a new buffer
happens to be allocated at the same address.

closes: vim/vim#17319

0077282c82

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2025-05-15 08:47:49 +01:00
glepnir
f2aec4bc05 vim-patch:9.1.1389: completion: still some issue when 'isexpand' contains a space (#34026)
Problem:  Cannot get completion startcol when space is not the first
          trigger character (after v9.1.1383)
Solution: Detect the next comma followed by a space in the option string
          and use in next compare loop (glepnir)

closes: vim/vim#17311

08db2f4f28
2025-05-15 06:15:29 +00:00
Luuk van Baal
d25eb246ef revert: show "g<" hint when message spills 'cmdheight'
Problem:  Hint message to press "g<" for message that spills
          'cmdheight' is too intrusive.
Solution: Remove the hint message. Document the meaning of the spill
          indicator instead.
2025-05-14 15:36:42 +02:00
Luuk van Baal
4d56dc43c0 fix(extui): handle carriage return in messages
Problem:  Carriage return should place the "write cursor" at the start of a line.
Solution: Construct the to be printed line by iterating over carriage returns.
2025-05-14 15:36:42 +02:00
bfredl
b0bb3cccf9 Merge pull request #34015 from bfredl/tui_scroll_state
refactor(tui): remove scroll_region_is_full_screen global state
2025-05-14 10:54:19 +02:00
bfredl
2bfb12ef46 refactor(tui): remove scroll_region_is_full_screen global state
This is a left-over for when we ported to state-less scrolling events
(e.g. no scrolling regions as part of the ext_linegrid state).

We always reset the scrolling region after performing a non-fullscreen
scroll. Thus the extra check in tui_grid_resize() is not needed.
2025-05-14 10:32:14 +02:00
Maria José Solano
570e62d0f9 docs(diagnostic): add on_jump example (#33933) 2025-05-13 19:39:05 -07:00
Maria José Solano
4fae013a21 feat(diagnostic): add enabled filter (#33981) 2025-05-13 19:32:00 -07:00
Lewis Russell
40b64e9100 refactor(treesitter): move functions from executor.c to treesitter.c 2025-05-13 15:44:42 +01:00
Luuk van Baal
cc78f88201 fix(extui): adjust which messages are sent to "more" window
Problem:  Decision whether message is sent to "more" window is based on
          the number of newlines present in a message, rather than the
          actual text height.
          With the "box" target, messages that come from a cmdline
          entered command are not always routed to the more window.
Solution: Still write the message to the target buffer, and calculate
          the actual text height. Postpone updating several state
          variables until after the decision to re-route is made.
          With the "box" target, only consider the text height of the
          message if it is not a message from a cmdline entered command.
2025-05-13 08:45:08 +02:00
Luuk van Baal
a62e55d407 feat(extui): show "g<" hint when message spills 'cmdheight'
Problem:  Extui shows a spill indicator to hint to the user to press "g<"
          to show the output of the last command. The user may be
          unaware of this mapping.
Solution: Route a hint message to the message "box" window.
2025-05-13 08:45:08 +02:00
luukvbaal
d539a952da vim-patch:9.1.1385: inefficient loop for 'nosmoothscroll' scrolling (#33992)
Problem:  Loop that ensures "w_skipcol" is zero with 'nosmoothscroll'
	  for (half)-page scrolling is inefficient.
Solution: Calculate the required "count" instead of looping until
	  "w_skipcol" is zero (Luuk van Baal).

acf0ebe8a8
2025-05-13 08:39:34 +02:00
glepnir
e4c4d672b5 vim-patch:9.1.1383: completion: 'isexpand' option does not handle space char correct (#33999)
Problem:  When a space character is used as a trigger in 'isexpand' option
          it doesn't get recognized because skip_to_option_part() skips
          spaces after a comma, treating them as option separators
          rather than option value (after v9.1.1341)
Solution: manually set the part to a space character (glepnir).

closes: vim/vim#17305

8d0e42b710
2025-05-13 14:29:07 +08:00
zeertzjq
cc6ee59f5a Merge pull request #33994 from brianhuster/vim-3704b5b
vim-patch:37045b5,9.1.1384 && fix(tutor): `l:lang` is undefined
2025-05-13 10:07:51 +08:00
Maria José Solano
2f24ae8de4 feat(diagnostic): add format option to setloclist/setqflist (#33977) 2025-05-12 20:50:37 -04:00
Maria José Solano
c681336e3c fix(diagnostic): accept multiple namespaces when setting loclist/qflist (#33982) 2025-05-12 20:13:26 -04:00
brianhuster
e5665754d1 fix(tutor): l:lang is undefined
Problem:
The scope `elseif $LC_MESSAGES =~ '\a\a' || $LC_MESSAGES ==# "C"` in
function `s:Locale` in file `runtime/autoload/tutor.vim` leaves a case
when l:lang is not defined.

Solution:
Define `l:lang` at function scope instead of `if` scope
2025-05-13 06:54:48 +07:00
brianhuster
e01f196e44 vim-patch:9.1.1384: still some problem with the new tutors filetype plugin
Problem:  still some problem with the new tutors filetype plugin
Solution: refactor code to enable/disable tutor mode into
          tutor#EnableInteractive() function, include a test
          (Phạm Bình An)

I find it annoying that Tutor's interactive mode is always on (or debug
mode is off) even when I open a tutor file with :edit command.
I think it makes more sense to make this "interactive mode":

- Always on when it is opened with :Tutor command
- Off otherwise

For more references, see `:help` feature, it is a much better than
:Tutor, since I don't have to run `:let g:help_debug = 1` just to be able
to edit and save a help file

Therefore, I remove `g:tutor_debug`

closes: vim/vim#17299

13bea589a2

Co-authored-by: Phạm Bình An <phambinhanctb2004@gmail.com>
2025-05-13 06:54:32 +07:00
brianhuster
238e1d6ecc vim-patch:3704b5b: runtime(tutor): improve tutor.vim plugin and filetype plugin
- Set g:tutor_debug on startup if it doesn't exist so that users can get
  cmdline completion when interactively setting it.
- set b:undo_ftplugin in filetype plugin
- set default runtime file headers

closes: vim/vim#17274

3704b5b58a

Co-authored-by: Phạm Bình An <phambinhanctb2004@gmail.com>
2025-05-13 04:38:55 +07:00
bfredl
69d04ee99f Merge pull request #33987 from bfredl/bump2
fix(scripts): use right syntax for choosing ref in "zig fetch"
2025-05-12 19:14:26 +02:00
bfredl
d04cbb65b9 fix(scripts): use right syntax for choosing ref in "zig fetch" 2025-05-12 13:24:38 +02:00
Christian Clason
9c0afc8873 build(deps): bump tree-sitter-query to v0.6.0 2025-05-12 11:25:07 +02:00
Riley Bruins
7369f80b19 refactor(treesitter): remove empty parse callback
Now that we have bumped to tree-sitter 0.25.4, we no longer need to do
this since upstream does it for us when calling the regular parse
method.
2025-05-11 20:14:08 +02:00
Sean Dewar
ef5c5dc99b vim-patch:9.1.1380: 'eventignorewin' only checked for current buffer
Problem:  When an autocommand executes for a non-current buffer,
          'eventignorewin' is only checked from the buffer's last
          wininfo (overwrites win_ignore in the loop), not from the
          value of 'eventignorewin' in all windows showing the buffer as
          described (after v9.1.1084)

Solution: Fix the check and don't use wininfo, as that may only contain
          windows that recently showed the buffer. Consider all the
          buffer's windows in all tabpages (Sean Dewar).

closes: vim/vim#17294

d4110e0695

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2025-05-11 17:12:54 +01:00
Yochem van Rosmalen
23bf4c0531 feat(exrc): search in parent directories (#33889)
feat(exrc): search exrc in parent directories

Problem:
`.nvim.lua` is only loaded from current directory, which is not flexible
when working from a subfolder of the project.

Solution:
Also search parent directories for configuration file.
2025-05-11 11:00:51 -05:00
Christian Clason
2c07428966 build(deps): bump tree-sitter to v0.25.4 2025-05-11 16:49:06 +02:00
Sean Dewar
d95b0a5396 vim-patch:9.1.1376: quickfix dummy buffer may remain as dummy buffer
Problem:  when failing to wipeout a quickfix dummy buffer, it will
          remain as a dummy buffer, despite being kept.
Solution: clear its dummy BF_DUMMY flag in this case (Sean Dewar).

closes: vim/vim#17283

270124f46a

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2025-05-11 15:31:37 +01:00
Sean Dewar
05dab80d8d vim-patch:9.1.1375: [security]: possible heap UAF with quickfix dummy buffer
Problem:  heap use-after-free possible when autocommands switch away from the
          quickfix dummy buffer, but leave it open in a window.
Solution: close its windows first before attempting the wipe.
          (Sean Dewar)

related: vim/vim#17283

b4074ead5c

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2025-05-11 15:31:37 +01:00
glepnir
4b3a9ac413 vim-patch:9.1.1381: completion: cannot return to original text (#33966)
Problem:  Cannot return to the original text after selecting the next
          item when the currently selected item is the last one.
Solution: When continuing to move down past the last item, locate the
          original completion at the head/tail nodes of the completed
          linked list (glepnir).

closes: vim/vim#17300

5a18ccf490
2025-05-11 12:36:20 +00:00
Christian Clason
59c45b22d9 fix(runtime): remove erroneously added syntax tests
fixup for a2c3591720
2025-05-11 11:54:58 +02:00
Christian Clason
73e7e7631c build(deps): bump luv to 1.51.0-0 2025-05-11 11:08:33 +02:00
Christian Clason
1889c351fd vim-patch:7344024: runtime(java): Search type and method declarations with "&inc" and "&def"
=============== LIMITATIONS AND OBSERVATIONS ===============

* Remember that external-type names can only be found when
  they match filenames resolvable in "&path" with "import"
  declarations; load the source file of an external type to
  look up its nested types and sibling top types, if any.

* Strive to narrow the search by assigning only relevant
  pathnames for directories *or* an archive to "&path", e.g.
  ":set path-=/usr/include".

* Use "{Visual}gf" on fully-qualified names.

* Accept the fact that "&define" cannot contain end-of-line
  characters (":help definition-search").  A declaration
  whose matchable header is not contained within a line can
  be found iff all of its non-optional components belong to
  the same line; for types, such components are a keyword,
  e.g. "class", followed by a run of blank characters and
  an identifier, e.g. "Test"; for methods: a return type,
  e.g. "String", or a keyword "void", followed by a run of
  blank characters and an identifier, e.g. "toString", that
  is followed by "(".

* The members of the "java.lang" package are usually not
  associated with "import" declarations; to look up their
  declarations, load a source file for a member of that
  package, and then use, on a simple name of interest for
  a member, either "[-Ctrl-d" etc. for local declarations
  or "gf" for external declarations, assuming that "." *or*
  the appropriate pathname for a JDK archive is assigned to
  "&path".

* Follow the above instruction made for the "java.lang"
  members for any type whose simple name is not associated
  with an "import" declaration, i.e. a member type of the
  same package that is declared in another compilation unit.

* Append the "$" character to "&iskeyword" when looking up
  declarations of generated code.

See zzzyxwvut/java-vim#4.

closes: vim/vim#17281

7344024536

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2025-05-11 10:47:39 +02:00
Christian Clason
a2c3591720 vim-patch:dc7ed8f: runtime(html): Optionally fold tags with the "expr" method
Tag folding poses a few difficulties.  Many elements, e.g.
"blockquote", are always delimited by start and end tags;
end tags for some elements, e.g. "p", can be omitted in
certain contexts; void elements, e.g. "hr", have no end tag.
Although the rules for supporting omissible end tags are
ad-hoc and involved, they apply to elements in scope.
Assuming syntactical wellformedness, an end tag can be
associated with its nearest matching start tag discoverable
in scope and towards the beginning of a file, whereas all
unbalanced tags and inlined tags can be disregarded.

For example:
------------------------------------------------------------
<!DOCTYPE html>
<html lang="en">		<!-- >1 : 1 -->
  <body>			<!-- >2 : 2 -->
    <p>Paragraph vim/vim#1.		<!--  = : 2 -->
    <p>				<!-- >3 : 3 -->
      Paragraph vim/vim#2.		<!--  = : 3 -->
    </p>			<!-- <3 : 3 -->
    <p>Paragraph vim/vim#3.</p>	<!--  = : 2 -->
  </body>			<!-- <2 : 2 -->
</html>				<!-- <1 : 1 -->
------------------------------------------------------------

(HTML comments here, "<!-- ... -->", record two values for
each folded line that are separated by ":", a value obtained
from "&foldexpr" and a value obtained from "foldlevel()".)

Innermost foldedable tags will be flattened.  For example:
------------------------------------------------------------
<!DOCTYPE html>
<html lang="en">		<!-- >1 : 1 -->
  <body>			<!-- >2 : 2 -->
    <div class="block">		<!-- >3 : 3 -->
      <pre><code>		<!-- >4 : 4 -->
[CODE SNIPPET]			<!--  = : 4 -->
      </code></pre>		<!-- <4 : 4 -->
    </div>			<!-- <3 : 3 -->
  </body>			<!-- <2 : 2 -->
</html>				<!-- <1 : 1 -->
------------------------------------------------------------

No folding will be requested for the "<code>"-"</code>" tag
pair and reflected by "&foldexpr" because such a fold would
have claimed the same lines that the immediate fold of the
"<pre>"-"</pre>" tag already claims.

Run-on folded tags may confuse Vim.  When a file such as:
------------------------------------------------------------
<!DOCTYPE html>
<html lang="en">		<!-- >1 : 1 -->
  <body>			<!-- >2 : 2 -->
    <div class="block">		<!-- >3 : 3 -->
      <pre>			<!-- >4 : 4 -->
	<code>			<!-- >5 : 5 -->
[CODE SNIPPET vim/vim#1]		<!--  = : 5 -->
	</code>			<!-- <5 : 5 -->
      </pre>			<!-- <4 : 4 -->
    </div>			<!-- <3 : 3 -->
				<!--  = : 3 -->
    <div class="block">		<!-- >3 : 3 -->
      <pre>			<!-- >4 : 4 -->
	<code>			<!-- >5 : 5 -->
[CODE SNIPPET vim/vim#2]		<!--  = : 5 -->
	</code>			<!-- <5 : 5 -->
      </pre>			<!-- <4 : 4 -->
    </div>			<!-- <3 : 3 -->
  </body>			<!-- <2 : 2 -->
</html>				<!-- <1 : 1 -->
------------------------------------------------------------

is reformatted as follows:
------------------------------------------------------------
<!DOCTYPE html>
<html lang="en">		<!-- >1 : 1 -->
  <body>			<!-- >2 : 2 -->
    <div class="block">		<!-- >3 : 3 -->
      <pre>			<!-- >4 : 4 -->
	<code>			<!-- >5 : 5 -->
[CODE SNIPPET vim/vim#1]		<!--  = : 5 -->
	</code>			<!-- <5 : 5 -->
      </pre>			<!-- <4 : 4 -->
    </div><div class="block"><pre><code> <!-- <3 : 3 -->
[CODE SNIPPET vim/vim#2]		<!--  = : 2 ? -->
	</code>			<!-- <5 : 2 ? -->
      </pre>			<!-- <4 : 2 ? -->
    </div>			<!-- <3 : 2 ? -->
  </body>			<!-- <2 : 2 -->
</html>				<!-- <1 : 1 -->
------------------------------------------------------------

"&foldexpr" values will not be used as is for the lines
between (and including) "[CODE SNIPPET vim/vim#2]" and "</div>".
(Cf. v9.1.0002.)

Having syntax highlighting in effect, tag folding using the
"fold-expr" method can be enabled with:
------------------------------------------------------------
	let g:html_expr_folding = 1
------------------------------------------------------------

By default, tag folding will be redone from scratch after
each occurrence of a TextChanged or an InsertLeave event.
Such frequency may not be desired, especially for large
files, and this recomputation can be disabled with:
------------------------------------------------------------
	let g:html_expr_folding_without_recomputation = 1
        doautocmd FileType
------------------------------------------------------------

To force another recomputation, do:
------------------------------------------------------------
	unlet! b:foldsmap
	normal zx
------------------------------------------------------------

References:
https://web.archive.org/web/20250328105626/https://html.spec.whatwg.org/multipage/syntax.html#optional-tags
https://en.wikipedia.org/wiki/Dangling_else

closes: vim/vim#17141

dc7ed8f946

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2025-05-11 10:47:39 +02:00
Christian Clason
1826ad16af vim-patch:839b79e: runtime(sh): Update syntax, improve wildcard character class matching
- Default to POSIX supported classes.
- Add a KornShell specific class list.
- Remove "or" from the Bash class list, presumably a typo.

closes: vim/vim#17293

839b79eeb3

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-05-11 10:47:39 +02:00
Riley Bruins
de45b8e275 fix(treesitter): proper tree contains() logic with combined injections
**Problem:** `LanguageTree:contains()` considers any range within the
start of the first tree and end of the last tree as "within" the
language tree. In the case of combined injections, this is problematic
because we only want to consider ranges within any of the combined trees
as "contained" (as opposed to any range within the entire range spanned
by all combined trees).

**Solution:** Use a more discriminative check in
`LanguageTree:contains()`.
2025-05-11 08:04:57 +01:00
Maria José Solano
bee45fc0e7 refactor(docs): remove unnecessary @private/@nodoc annotations (#33951)
* refactor(docs): remove `@private` annotations from local functions

* refactor(docs): remove unnecessary `@nodoc` annotations
2025-05-10 14:42:48 -07:00
zeertzjq
8605f5655b vim-patch:9.1.1378: sign without text overwrites number option (#33942)
Problem:  When 'signcolumn' is set to `number` but a line has a sign
          without text, the line number disappears (finite-state-machine)
Solution: Verify that a sign actually contains text before rendering the
          line number (glepnir)

fixes: vim/vim#17169
closes: vim/vim#17282

1b186833c1

Co-authored-by: glepnir <glephunter@gmail.com>
2025-05-10 22:12:07 +08:00
zeertzjq
f38f92931a vim-patch:0553f2f: runtime(doc): clarify single/multibyte support for 'fillchars' (#33941)
closes: vim/vim#17287

0553f2ff0d

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-05-10 22:11:55 +08:00
Christian Clason
44a6e5ea99 vim-patch:6b7637e: runtime(lf): use syn iskeyword in syntax script
Sets 'syn iskeyword' in syntax/lf.vim to fix the missing lf keyword
highlighting in lines like 'map e :open; open' (first 'open' not
highlighted).

applies PR andis-sprinkis/lf-vim#21 by @joelim-work
closes: andis-sprinkis/lf-vim#14

6b7637e6bb

Co-authored-by: Andis Spriņķis <andis@sprinkis.com>
Co-authored-by: Joe Lim <50560759+joelim-work@users.noreply.github.com>
2025-05-10 15:16:19 +02:00
bfredl
1c96b72dfa fix(deps): make script/bump_deps.lua update build.zig.zon versions in sync
Also bring luv version in build.zig.zon up to date

This skips some deps not currently managed/used by build.zig
2025-05-10 10:34:40 +02:00
zeertzjq
1d9990daac fix(folds): avoid unnecessary loop with horizontal scrolling (#33932)
Fix #33931
2025-05-10 10:36:33 +08:00
zeertzjq
9b11746d80 Merge pull request #33930 from zeertzjq/vim-17ad852
vim-patch: doc updates
2025-05-10 08:40:14 +08:00
zeertzjq
cb12c8fa47 vim-patch:9973b39: runtime(doc): remove duplicate sentence in builtin.txt
9973b39a17

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-05-10 07:29:41 +08:00
zeertzjq
1bfb8dd338 vim-patch:17ad852: runtime(doc): update return types for builtin functions
fixes: vim/vim#17273

credit: Github user @msoyka2024

17ad852a62

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-05-10 07:29:37 +08:00
luukvbaal
db702782e0 fix(extui): close cmdwin to enter "more" window (#33860)
Problem:  Cannot enter "more" window while cmdwin is open since it is a
          regular window and changing windows is disallowed.
Solution: Close cmdwin to enter the "more" window. Minor regression
          w.r.t. the current message grid. Resolving that will require
          somehow bypassing textlock for the "more" window.
2025-05-09 23:54:39 +02:00
Natanael Copa
c2d218d0c6 test(treesitter): add flaky test to TEST_SKIP_FRAGILE #33912
ref: https://github.com/neovim/neovim/issues/33910#issuecomment-2863276239
2025-05-09 12:26:17 -07:00
Sean Dewar
e56292071a fix(terminal): check size when switching buffers
Problem: terminal not always resized when switching to its buffer.
Solution: add missing calls to terminal_check_size.
2025-05-09 17:49:57 +01:00
luukvbaal
302e59f734 feat(extui): assign 'filetype' to extui windows (#33924)
Problem:  Unable to discern windows used by the extui interface
          to configure their local options.
          'winblend' may be detrimental to legibility depending on the
          colorscheme and 'background'.
Solution: Assign the "cmdline", "msgmore", "msgprompt" and "msgbox" 
          'filetype' to the respective windows.
          Don't set 'winblend' for the message "box" window.
2025-05-09 14:47:36 +02:00
Artem
6adf48b66d fix(decor): extmark highlight not applied (#33858)
Problem: If the only highlight present in the buffer is an extmark, and its end
position is outside the screen, redraws that start on lines after the
first line of the mark will consider the buffer as not having any highlights,
and skip drawing the mark's highlight.
Solution: Check the updated number of decor ranges.
2025-05-09 12:37:43 +02:00
luukvbaal
7e787f6a4f fix(extui): route interactive messages to more-window (#33885)
Problem:  Extui does not route messages emitted as a result of a typed
          command to the "more" window.
          Command message leading shell messages is missing a kind.
          Messages not routed to 'cmdheight' area after it was 0.
Solution: Route messages that were emitted in the same event loop as an
          entered command to the "more" window. Also append multiple
          messages in an already open more-window.
          Assign it the `shell_cmd` kind.
          Change message position when 'cmdheight' changes from 0.
2025-05-09 12:17:26 +02:00
zeertzjq
3121e02ae0 Merge pull request #33918 from zeertzjq/vim-9.1.1373
vim-patch:9.1.{1373,1374}
2025-05-09 07:21:21 +08:00
zeertzjq
15d31fe7a6 vim-patch:9.1.1374: completion: 'smartcase' not respected when filtering matches
Problem:  Currently, 'smartcase' is respected when completing keywords
          using <C-N>, <C-P>, <C-X><C-N>, and <C-X><C-P>. However, when
          a user continues typing and the completion menu is filtered
          using cached matches, 'smartcase' is not applied. This leads
          to poor-quality or irrelevant completion suggestions, as shown
          in the example below.
Solution: When filtering cached completion items after typing additional
          characters, apply case-sensitive comparison if 'smartcase' is
          enabled and the typed pattern includes uppercase characters.
          This ensures consistent and expected completion behavior.
          (Girish Palya)

closes: vim/vim#17271

dc314053e1

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-05-09 06:48:18 +08:00
zeertzjq
6b955af875 vim-patch:9.1.1373: 'completeopt' checking logic can be simplified
Problem:  Flag checking logic uses a temporary variable and multiple
          bitwise operations in insexpand.c
Solution: Consolidate into a single equality check using bitwise OR and
          comparison (glepnir)

closes: vim/vim#17276

c3fbaa086e

Co-authored-by: glepnir <glephunter@gmail.com>
2025-05-09 06:48:18 +08:00
zeertzjq
ab5c15610f vim-patch:partial:9.1.1371: style: indentation and brace issues in insexpand.c
Problem:  style: indentation issue in insexpand.c
Solution: update style (glepnir)

closes: vim/vim#17278

19e1dd6b6a

Co-authored-by: glepnir <glephunter@gmail.com>
2025-05-09 06:48:05 +08:00
Maria José Solano
50c200fcd4 Merge pull request #33850 from MariaSolOs/on-jump
feat(diagnostic): add `on_jump` callback option
2025-05-08 11:42:24 -05:00
Maria José Solano
ee1d389fa6 Merge pull request #33905 from seandewar/doc-color-nil
fix(lsp): nil error in ColorScheme autocmd
2025-05-08 11:41:49 -05:00
luukvbaal
7c43f8e433 fix(messages): messages added to history missing from ext_messages "g<" #33907
Problem:  Messages that are already added to the history are not emitted
          as part of the "g<" msg_history_show event.

Solution: Move clearing the history for temporary messages to before
          adding a message to the history, rather than after emitting
          a message.
2025-05-08 05:50:25 -07:00
Sean Dewar
d976834864 fix(lsp): nil error in ColorScheme autocmd
Problem: nil error possible if a loaded buffer hasn't been drawn in a window:

```vim
lua vim.lsp.document_color.is_enabled() -- Load module
badd foo
call bufload('foo')
colo default
```

Solution: Skip _buf_refresh branch also if bufstates[bufnr] is nil.
2025-05-08 09:28:20 +01:00
zeertzjq
1b8ae4336d test(swapfile): don't check for line with full file path (#33896)
Wrapping can happen anywhere where in the full file path, breaking the
matching. Match a line with the "Xswaptest" line instead.
2025-05-08 07:51:23 +08:00
dependabot[bot]
2f2cba24f9 ci: bump mlugg/setup-zig from 1 to 2
Bumps [mlugg/setup-zig](https://github.com/mlugg/setup-zig) from 1 to 2.
- [Release notes](https://github.com/mlugg/setup-zig/releases)
- [Commits](https://github.com/mlugg/setup-zig/compare/v1...v2)

---
updated-dependencies:
- dependency-name: mlugg/setup-zig
  dependency-version: '2'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-07 12:13:10 +00:00
luukvbaal
6dee1672cc fix(extui): "box" window width calculated on last line (#33881)
Problem:  The "box" window width is calculated on the last line when
          applying "last" virt_text. There may be longer lines
          part of the same message.
Solution: Don't decrease box width if the calculated width is smaller.
          Minor unrelated changes.

Co-authored-by: Eike <eike.rackwitz@mail.de>
2025-05-07 10:02:53 +02:00
zeertzjq
27311b0b5c Merge pull request #33879 from zeertzjq/vim-fe22867
vim-patch: runtime file updates
2025-05-07 11:11:03 +08:00
zeertzjq
186851b1bd vim-patch:87947a9: runtime(sh): Update syntax, match KornShell compound arrays
closes: vim/vim#17268

87947a9a76

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-05-07 09:46:01 +08:00
zeertzjq
d8621a53ac vim-patch:adfeb4a: runtime(spec): add more local macro names according to rpm 4.20
closes: vim/vim#17258

adfeb4ad95

Co-authored-by: fundawang <fundawang@yeah.net>
2025-05-07 09:45:43 +08:00
zeertzjq
45e9054813 vim-patch:fe22867: runtime(sh): Update syntax, fix single-quoted strings in parameter expansions
Ignore single-quoted backslash escape sequences in parameter expansions.

\' is not an escaped single quote in ${foo:-'word\'}.

closes: vim/vim#17261

fe22867ef5

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-05-07 09:45:34 +08:00
luukvbaal
ac67098998 fix(messages): "list_cmd" kind for mark commands #33874
Problem:  `:marks/jumps/changes` are missing a message kind.

Solution: Assign the "list_cmd" kind to them.
2025-05-06 18:23:38 -07:00
luukvbaal
2aa7948266 fix(treesitter): invalidate conceal_lines cache earlier #33875
Problem:  conceal_lines cache is invalidated in `on_buf`
          which is too late for code calculating text height after a
          buffer change but before a redraw (like `lsp/util.lua`).

Solution: Replace `on_buf` with `on_bytes` handler that invalidates
          the cache and clears the marks.
2025-05-06 18:03:54 -07:00
Phạm Bình An
fb59188b6d vim-patch:0fb6cea: runtime(lua): update 'path' option in filetype plugin #33876
Problem:  Lua doesn't support importing module in path related to current
          file like JS does (https://www.reddit.com/r/lua/comments/wi0bau/whats_the_correct_way_to_run_a_lua_file_that_uses/)
Solution: Remove `.` from Lua buffer-local option `'path'`

closes: vim/vim#17267

0fb6ceac4c
2025-05-06 18:02:06 -07:00
Justin M. Keyes
f5b5f2095e refactor(tests): lint decorations_spec, float_spec, multigrid_spec #33274
Problem:
decorations_spec.lua, float_spec.lua, multigrid_spec.lua are not
auto-formatted.

Solution:
Add a special `formatlua2` cmake target, which invokes `stylua` with
an alternative `.stylua2.toml` config.
2025-05-06 18:00:20 -07:00
Christian Clason
a81d2b6703 docs(luv): replace bundled LuaCATS meta files with upstream
Synced from https://github.com/luvit/luv/blob/master/meta.lua
2025-05-06 18:47:33 +02:00
gcrtnst
8707ec2644 fix(termkey): out-of-bounds write in array #33868
Problem:
termkey crashes due to an out-of-bounds write in an array when it
received a CSI sequence with 17 or more arguments. This could be
observed on startup with certain terminal emulators like [RLogin], which
send a response to the `CSI c` query containing 17 parameters.

The termkey code has a boundary check, but its comparison operator is
incorrect.

Solution:
Correct the comparison operator to ensure proper boundary checking.

With this change, I have confirmed that the crash no longer occurs on
RLogin. https://github.com/kmiya-culti/RLogin

Fixes #24356
2025-05-06 05:20:03 -07:00
Phạm Bình An
db2b774a16 fix(runtime): 'includeexpr' with non-Nvim-style Lua modules #33867
Closes #33862
2025-05-06 05:15:31 -07:00
Maria José Solano
c65817774d feat(diagnostic): add on_jump callback option 2025-05-05 19:59:22 -07:00
Riley Bruins
8d75910ef9 fix(treesitter): eliminate flicker for single windows #33842
This commit will eliminate flicker while editing one open window. It
works by querying previously calculated trees for highlight marks, in
the case that we are still asynchronously parsing in `on_win`.

It will not fully solve the case of flicker when there are multiple open
windows, since the parser will drop previously parsed injection trees
whenever it receives a call to parse a different region of the buffer.
This will require a refactor of `languagetree.lua`.
2025-05-05 19:05:16 -07:00
luukvbaal
9efdd4fe98 fix(extui): drop "more" window that is no longer floating #33861
Problem:  Moving the "more" (or any extui)-window to a split with
          `wincmd L` does not invalidate it as a tracked window.

Solution: Drop an extui window that is no longer floating.
2025-05-05 11:28:02 -07:00
glepnir
1e7406fa38 feat(api): nvim_cmd supports plus ("+cmd", "++opt") flags #30103
Problem:
nvim_cmd does not handle plus flags.

Solution:
In nvim_cmd, parse the flags and set the relevant `ea` fields.
2025-05-05 05:58:36 -07:00
luukvbaal
912388f517 fix(messages): list_cmd kind for buffer line messages (#33855)
Problem:  Missing kind and separate event for each line for message
          containing buffer lines for e.g. `:print`.
Solution: Set the `list_cmd` kind and only `msg_start()` for the first
          message, print a newline instead.
2025-05-05 12:04:09 +00:00
bfredl
2d75ea6afe Merge pull request #33753 from bfredl/hotgrid
fix(grid): don't scroll on an invalid grid
2025-05-05 11:20:13 +02:00
bfredl
1ad9cdd403 fix(grid): check allocated grid size when suspicious scrolling
fixes #33749
2025-05-05 10:50:18 +02:00
Justin M. Keyes
40351bbbbe fix(lua): vim.validate message param #33675
Problem:
vim.validate does not handle `message` param.

Solution:
Add the missing logic.
2025-05-04 16:36:32 -07:00
Eike
0862c1036a fix(lsp): check if client is stopping before reuse #33796
Problem:
Stopping a language server and then calling vim.lsp.start() with the same name/root will return the old language server that's in the middle of shutting down. vim.lsp.start() won't return a new server until the old process has terminated.

Solution:
Introducing a client._is_stopping field that tracks the shutdown phase, preventing the client from being reused.
2025-05-04 14:38:01 -07:00
Maria José Solano
df345503eb refactor(lua): swap value params in tbl_extend behavior callback #33847 2025-05-04 14:28:03 -07:00
bfredl
0402f5a76b Merge pull request #33848 from psnszsn/master
fix(build): musl libc build.zig
2025-05-04 23:21:37 +02:00
Vlad Panazan
3268f51d20 fix(build): musl libc build.zig 2025-05-04 22:55:19 +02:00
luukvbaal
d4ecfc4234 fix(extui): message may overwrite active cmdline #33846
Problem:  Active cmdline may be overwritten by a message.

Solution: Check if cmdline is active before writing message.
2025-05-04 20:02:02 +00:00
bfredl
ba2a5a7787 Merge pull request #33837 from bfredl/cmakeversion
fix(build): use correct cmake expression for $<CONFIG>

fixes #33835
2025-05-04 19:35:07 +02:00
Justin M. Keyes
72ec410134 Merge #33789 cleanup error messages 2025-05-04 08:53:29 -07:00
Justin M. Keyes
fc2dee1736 feat(messages): cleanup Lua error messages
"Error" in error messages is redundant. Just provide the context, don't
say "Error ...".
2025-05-04 11:22:57 -04:00
Justin M. Keyes
af4f7f1618 test: multiline assert_log()
Problem:
assert_log() only matches single lines. This was never an intentional
decision, it was merely a result of using read_file_list().

Note: any tests that indiscriminately match `.*` should be rewritten to
avoid (unlikely) "false positives". I checked all existing tests.

Solution:
Change assert_log() to match the concatenated lines instead of matching
per-line.
2025-05-04 10:35:07 -04:00
Maria José Solano
8f5bd569c5 feat(lsp): support documentColor dynamic registration #33800 2025-05-04 07:00:21 -07:00
glepnir
5c15df449a fix(lsp): improve error completion message #33812
problem: Error notifications from LSP responses were difficult to read due to
inconsistent formatting and missing critical information like client name and error codes.

solution: Implemented a more structured error notification format using pipe separators to
clearly display client name, error code (when available), and error message.
2025-05-04 06:40:35 -07:00
glepnir
91e116f3a6 fix(lsp): only auto-detach lsp.config clients #33834
Problem:
enable() routine detaches clients even if they were manually started
and not managed by vim.lsp.config.

Solution:
Skip clients that aren't managed by vim.lsp.config.
2025-05-04 06:07:11 -07:00
Shougo
cb2ca54331 fix(display): cursor moves when searching with "n", "*" #29446
Problem:
When searching for the next pattern via n/N/*/#, cursor
moves to cmdline, perceived as "flicker".

Solution:
Can ui_busy_start() and ui_busy_stop().
2025-05-04 05:53:25 -07:00
luukvbaal
f1295fe76f fix(extui): hide inactive "more" window (#33831)
Problem:  More-window is left visible after leaving it. Cursor may be
          hidden behind it and it is hard to re-enter afterwards.
Solution: Close the more-window when another window is entered.
2025-05-04 13:39:07 +02:00
bfredl
921f8b0df7 fix(build): use correct cmake expression for $<CONFIG>
${CONFIG} is an empty string even when configuration is known at
configuration time. $<CONFIG> has to be used at "generation time"

Currently zig's reimplementation of cmake config headers does not
support $<CONFIG> so use a branch to pick the one which works.
2025-05-04 09:49:10 +02:00
Sean Dewar
627c648252 vim-patch:9.1.1361: [security]: possible use-after-free when closing a buffer (#33820)
Problem:  [security]: Possible to open more windows into a closing
          buffer without splitting, bypassing existing "b_locked_split"
          checks and triggering use-after-free
Solution: Disallow switching to a closing buffer. Editing a closing
          buffer (via ":edit", etc.) was fixed in v9.1.0764, but add an
          error message and check just "b_locked_split", as "b_locked"
          is necessary only when the buffer shouldn't be wiped, and may
          be set for buffers that are in-use but not actually closing.
          (Sean Dewar)

closes: vim/vim#17246

6cb1c82840
2025-05-04 03:15:51 +01:00
Phạm Bình An
2c1f5a6aa5 docs: default mappings #33706
Problem:
Docs don't mention that `gc` is just a mapping, not
a builtin normal-mode command.

Solution:
Update docs for all "default mappings".
2025-05-03 15:47:59 -07:00
luukvbaal
9274532615 fix(treesitter): invalidate conceal_lines marks #33828
Problem:  Spliced conceal_lines marks after changing the buffer text are
          left valid, concealing lines that shouldn't be.

Solution: Set the `invalidate` extmark property.
2025-05-03 22:37:02 +00:00
Jeremy Fleischman
b877aa34cf feat(lsp): detach LSP clients when 'filetype' changes #33707
Problem:
When the buffer 'filetype' changes, invalid or non-applicable LSP
clients are not detached.

https://github.com/neovim/neovim/issues/33443
https://github.com/neovim/nvim-lspconfig/issues/3326

Solution:
In the enable() routine, check can_start() on _existing_ clients.
2025-05-03 14:57:59 -07:00
Maria José Solano
047a10bfde feat(lua): function behavior for tbl_extend, tbl_deep_extend #33819 2025-05-03 14:53:44 -07:00
luukvbaal
8305af9bd2 fix(statusline): clear ruler when it is no longer drawn #33765
Problem:  Ruler is not cleared from the screen/ext_messages state when
          it is no longer drawn after e.g. `set noruler` or when moving
          from a floating to a regular window.
Solution: Remember if ruler was drawn and clear it.
2025-05-03 14:24:11 -07:00
luukvbaal
6256adde2f fix(quickfix): always split from current window #33807
Problem:  `:copen` opens at the bottom by switching to `lastwin`,
           needlessly changing the window it inherits context from.

Solution:  Use the `WSP_BOT` flag to `win_split()` to open at the bottom.
2025-05-03 13:38:20 -07:00
luukvbaal
b2a5105c66 fix(extui): search highlighting in extui "more" pager #33792
Problem:  No search highlighting in extui "more" pager window.
Solution: Only use custom highlight namespace in cmdline window.
2025-05-03 12:30:08 -07:00
joe
d0867574bd refactor(tui): redundant input->in_fd assignment #33756
Problem:
`input->in_fd = STDIN_FILENO;` was set twice during TUI initialization.

Solution:
Remove the duplicate assignment for clarity and better performance
2025-05-03 11:37:14 -07:00
PRIZ ;]
902b689c4d docs(lua): typing for vim.fn.winlayout #33817
Problem:
`any[]` means nothing, and the return value is not the same as what's
documented in the comment (eg, Lua returns `{ "row", { { "leaf", 1000 },
{ "leaf", 1001 } } }`, not `{ "row", { "leaf", 1000, "leaf", 1001 } }`)

Solution:
Create two classes (vim.fn.winlayout.leaf and vim.fn.winlayout.branch)
and one alias that links the two together.

Also: Due to LuaLS limitations, there is an empty class,
vim.fn.winlayout.empty

Signed-Off-By: VoxelPrismatic <voxelprismatic@pm.me>
2025-05-03 11:34:25 -07:00
Sean Dewar
403fcacfc1 fix(window): skip unfocusable and hidden floats with "{count}<C-W>w" #33810
Problem: Using `<C-W>w`, `<C-W>W` or the ":wincmd" variants with a count can
enter unfocusable or hidden floating windows. This is especially problematic
when using the new in-development extui, which creates many unfocusable floats
for various UI elements.

Solution: Skip unfocusable and hidden floating windows. Instead, skip to the
next focusable, non-hidden window in the current tabpage's window list. Reword
the documentation a bit (hopefully an improvement?)
2025-05-03 11:30:24 -07:00
Jeremy Fleischman
03d378fda6 feat(lsp): vim.lsp.is_enabled() #33703
Problem:
No way to check if a LSP config is enabled without causing it to
resolve. E.g. `vim.lsp.config['…'] ~= nil` will resolve the config,
which could be an unwanted and somewhat expensive side-effect.

Solution:
Introduce `vim.lsp.is_enabled()`.
2025-05-03 10:25:58 -07:00
Christian Clason
2e35161fa1 docs: treesitter parse errors #33811 2025-05-03 10:08:53 -07:00
Sean Dewar
94bc7f47bf docs: fixups (#33815)
- Add missing diagnostics virtual lines hl groups.
- Fix LSP dynamic registration example; curbuf may not actually be attached to
  the client, and it may be attached to many such buffers.
2025-05-03 16:45:32 +01:00
Michele Campeotto
f048298e9a fix(runtime): conceal paths in help, man ToC loclist #33764
Problem:
The check for concealing paths in TOCs in the qf syntax file fails
because the TOC tile has changed.

Solution:
Force the qf syntax file to be reloaded after the qf_toc variable
has been set, so that the it can apply the correct settings.

Using the explicit qf_toc key, already used in the syntax file, instead
of the title is less prone to breaking.

It was also already being set for man pages but it had no effect because
the syntax file had already been loaded when the variable was set.

Fixes #33733
2025-05-03 07:06:22 -07:00
Christian Clason
6b233cd1a1 build(deps): bump tree-sitter-vim to v0.6.0 2025-05-03 11:29:34 +02:00
Riley Bruins
5d1fd4aca5 fix(lsp): improper diagnostic end_col computation
**Problem:** For multiline diagnostics, the end column was improperly
calculated by checking the byte index of the character position on the
*start* line.

**Solution:** Calculate the byte index for end_col using the *end* line.
2025-05-03 10:01:20 +02:00
zeertzjq
adbd33027f fix(tui): don't try to add unsupported modifiers (#33799)
Problem:  The TUI doesn't forward a key properly when it has unsupported
          modifiers like NumLock.
Solution: Don't try to add modifiers when only unsupported modifiers are
          present.

Related #33791
2025-05-03 12:09:28 +08:00
zeertzjq
862e676efc docs: add missing change to getcharstr() signature (#33797) 2025-05-03 08:10:13 +08:00
Christian Clason
5a2edc483d fix(treesitter): close :InspectTree with q
Problem: `:InspectTree` window does not follow precedent for focused
"info windows" (like `checkhealth`, `Man`, etc.).

Solution: Map `q` to `<C-w>c`.
2025-05-02 21:39:11 +02:00
Maria José Solano
34c769dd89 fix(lsp): use bufnr when getting clients in symbols_to_items (#33760) 2025-05-02 14:30:02 -05:00
luukvbaal
39a5b7f239 fix(extui): cmdline visibility, cmdheight cursor position (#33774)
Problem:  The cmdline popupmenu is hidden behind extui windows.
          'showmode' message is drawn over the cmdline.
          Changing the 'cmdheight' to accommodate space for the text in
          the cmdline may change the current cursor position.
Solution: Ensure kZIndexMessages < zindex < kZIndexCmdlinePopupMenu.
          Clear the 'showmode' message when the cmdline level is negative.
          Temporarily set 'splitkeep' = "screen" when changing the 'cmdheight'.
2025-05-02 19:46:30 +02:00
Christian Clason
c916bdf329 fix(extui): close message window with q
Problem: Using `<c-c>` does not follow precedent (from `checkhealth`
etc.) for closing "information windows".

Solution: Use `q` for close mapping.
2025-05-02 19:09:56 +02:00
Christian Clason
8d6f016345 vim-patch:c3f48e3: runtime(abnf): include ABNF filetype plugin
closes: vim/vim#17239

c3f48e3a76

Co-authored-by: A4-Tacks <wdsjxhno1001@163.com>
2025-05-02 17:12:18 +02:00
zeertzjq
53b41ec7c2 Merge pull request #33776 from zeertzjq/vim-9.1.1359
vim-patch:9.1.{1359,1360}
2025-05-02 22:17:01 +08:00
zeertzjq
da3eeb4b32 vim-patch:9.1.1360: filetype: GNU Radio companion files are not recognized
Problem:  filetype: GNU Radio companion files are not recognized
Solution: detect *.grc files as xml or yaml filetype depending on the
          first line (zeertzjq).

Ref:
- https://wiki.gnuradio.org/index.php/XML_GRC
- https://wiki.gnuradio.org/index.php/YAML_GRC

closes: vim/vim#17241

af4a5d6e2a
2025-05-02 21:53:18 +08:00
zeertzjq
074a6abd55 vim-patch:9.1.1359: filetype: GNU Radio config files are not recognized
Problem:  filetype: GNU Radio config files are not recognized.
Solution: detect GNU Radio config files as confini filetype.  Only
          allow '#' as start of comment in confini syntax (zeertzjq).

Ref:
- https://wiki.gnuradio.org/index.php/Configuration_Files

closes: vim/vim#17242

9c9200d1ea
2025-05-02 21:53:15 +08:00
Sathya Pramodh
0741d2520d feat(messages): hl-StderrMsg, hl-StdoutMsg #33429
Problem:
stderr messages from executing ":!cmd" show up with
highlight hl-ErrorMsg. But some shell utilites use stderr for debug
logging, progress updates, etc.

Solution:
Highlight shell command outputs hl-StderrMsg and hl-StdoutMsg.
2025-05-02 06:06:55 -07:00
luukvbaal
3c7c824bdc fix(extui): check option values after VimEnter (#33768)
Problem:  Not picking up configured option values when enabling _extui after startup.
Solution:  Check option values when enabing _extui.

Fix https://github.com/neovim/neovim/issues/33767
2025-05-02 13:13:12 +02:00
zeertzjq
4b5364b423 fix(tui): forward C0 control codes literally (#33759)
This fixes the problem that sending a raw C0 control code to trigger a
mapping for it does not work in Terminal mode.

Note: this isn't done for 00 or 7F, as that'll be backward-incompatible.
2025-05-02 17:40:24 +08:00
Phạm Bình An
1fb0126a08 fix(vim.lsp.enable): don't eagerly enable LSP configs during startup #33762
closes #33761
2025-05-02 02:05:18 -07:00
luukvbaal
2c1c0b7af5 feat(ui): ext_cmdline/messages for the TUI #27855
Problem:  We have an unmaintained Vimscript parser and cmdline
highlighting mechanism, with which it is hard to leverage the
treesitter highlighter. Long messages result in a hit-enter-prompt.

Solution: Implement a vim.ui_attach() UI, that replaces the message
grid (orphaning some 3000+ LOC core C code). Introduce an experimental
vim._extui module, because removing the message grid at the same time is
too risky. The new UI leverages the bundled treesitter highlighter and
parser for Vimscript, as well as the matchparen plugin, to highlight the
cmdline. Messages are truncated in the cmdline area, or placed in a
floating message box in the bottom right corner. Special ("list_cmd")
messages and the message history are shown in a, "more prompt" (now a
fully interactive regular window). Various default UI elements ('showcmd',
'ruler') are also placed in the cmdline area, as virtual text.

`require('vim._extui').enable({})` enables the experimental UI.
`{ msg.pos = 'box' }` or `:set cmdheight=0` enables the message
box variant.

Followup:
  - Come to a consensus for how best to represent messages (by default).
  - Start removing message grid when this is deemed a successful replacement.
    When that is finished, make this new UI the default and update a lot of tests.
2025-05-02 02:02:02 -07:00
bfredl
da401ca25b Merge pull request #28344 from bfredl/wonderland
feat(build): build.zig MVP: build and run functionaltests on linux
2025-05-02 10:34:25 +02:00
bfredl
1f004970f0 feat(build): build.zig MVP: build and run functionaltests on linux
NEW BUILD SYSTEM!

This is a MVP implementation which supports building the "nvim" binary,
including cross-compilation for some targets.
As an example, you can build a aarch64-macos binary from
an x86-64-linux-gnu host, or vice versa

Add CI target for build.zig currently for functionaltests on linux
x86_64 only

Follow up items:

-  praxis for version and dependency bumping
-  windows 💀
-  full integration of libintl and gettext (or a desicion not to)
-  update help and API metadata files
-  installation into a $PREFIX
-  more tests and linters
2025-05-02 09:28:50 +02:00
zeertzjq
ce8b755a86 vim-patch:1c58019: runtime(vim): Update base-syntax, improve enum highlighting (#33758)
Match enum values and missing class keywords.

fixes: vim/vim#15970

1c58019a82

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-05-02 07:26:38 +08:00
zeertzjq
dd71a21463 vim-patch:f57c065: runtime(sh): Update syntax, highlight escaped chars in test expressions (#33757)
Highlight escape characters in unquoted test expression operands.

E.g., [[ foo == \[bar\] ]]

fixes vim/vim#17221

f57c065e75

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-05-02 07:25:58 +08:00
brianhuster
0b3c76502c vim-patch:83cb817: runtime(doc): update example ctags program and links
- :helptags is also a tags generating program, it deserves mentioning
- JTags seems too dead: its website has been sold, the source, binary
  can't be found anywhere.
- update link of ptags

closes: vim/vim#17233

83cb8174c8

Co-authored-by: Phạm Bình An <phambinhanctb2004@gmail.com>
2025-05-02 07:05:22 +08:00
brianhuster
65a4c8f3ca vim-patch:9.1.1357: Vim incorrectly escapes tags with "[" in a help buffer
Problem:  Vim incorrectly escapes tags containing "[" in a help buffer
Solution: check if the buffer has the "help" filetype set, instead of
          already being a help buffer (Phạm Bình An)

fixes: vim/vim#17224
closes: vim/vim#17232

6af20a9be3

Co-authored-by: Phạm Bình An <phambinhanctb2004@gmail.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-05-02 07:05:22 +08:00
Maria José Solano
abc96ba0ce fix(lsp): handle nil buffer state in documentColor clear (#33746) 2025-05-01 18:15:32 +01:00
Gregory Anders
d1fed989f2 refactor: move StringBuilder to types_defs.h (#33745) 2025-05-01 10:06:08 -05:00
Michael Clayton
d567f899ef fix(diagnostic): allow virtual_{lines,text} cursor exclusivity #33517
Problem:
virtual_text diagnostics are great when skimming a file, and
virtual_lines are great when "zooming in" on a particular problem.
Having both enabled results in duplicate diagnostics on-screen.

Solution:
This PR expands the behavior of `current_line` for virtual_text and
virtual_lines by making `virtual_text.current_line = false` distinct
from `nil`.  If you set:

    vim.diagnostic.config({
      virtual_text = { current_line = false },
      virtual_lines = { current_line = true },
    })

With this configuration, virtual_text will be used to display
diagnostics until the cursor reaches the same line, at which point they
will be hidden and virtual_lines will take its place.
2025-05-01 03:54:39 -07:00
luukvbaal
97a6259442 fix(display): adjust setting winline info for concealed lines (#33717)
Problem:  Wrong winline info after partial redraw. Setting
          `conceal_cursor_used` is unnecessarily spread out.
Solution: Rather than adjusting `wl_lastlnum` for the previous
          winline, adjust it when setting the current winline.
          Set `conceal_cursor_used` when the current window is redrawn.
2025-05-01 09:51:51 +02:00
zeertzjq
edc8e9f40a Merge pull request #33738 from zeertzjq/vim-fa8b7db
vim-patch: doc updates
2025-05-01 08:07:14 +08:00
Jeremy Fleischman
4bc7bac884 feat(lsp): start/stop LSPs as necessary during vim.lsp.enable() #33702
Problem:
enable() could be more flexible, so that it works even if called "late".

Solution:
- enable(true) calls `doautoall nvim.lsp.enable FileType`.
- enable(false) calls `client:stop()` on matching clients.

This will be useful for e.g. :LspStop/:LspStart also.
2025-04-30 16:57:29 -07:00
zeertzjq
fae4abd2f4 vim-patch:ff3d4b2: runtime(doc): document that :b cannot handle buffer names starting with "+"
closes: vim/vim#17229

ff3d4b2d49

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-05-01 07:45:31 +08:00
zeertzjq
b38525f65c vim-patch:fb08192: runtime(doc): clarify the use of 'tagfunc', update a comment in tags.c
related: vim/vim#17228

fb08192ca7

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-05-01 07:45:01 +08:00
zeertzjq
ad48cccaa8 vim-patch:partial:fa8b7db: runtime(doc): tweak documentation style in options.txt
closes: vim/vim#17229

fa8b7db99a

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-05-01 07:42:41 +08:00
Gregory Anders
71f3a9c590 feat(terminal): parse current buffer contents in nvim_open_term() (#33720)
When nvim_open_term() is called with a non-empty buffer, the buffer
contents are piped into the PTY.
2025-04-30 21:34:23 +00:00
Lorenzo Bellina
6577d72d81 feat(lsp): root_markers can control priority #33485
Problem:
root_markers cannot specify "equal priority filenames.

Solution:
Support nesting:

    {
      ...
      root_markers = { { ".stylua.toml", ".luarc.json" }, { ".git "} }
      ...
    }


Co-authored-by: Maria José Solano <majosolano99@gmail.com>
Co-authored-by: Gregory Anders <github@gpanders.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-04-30 06:43:32 -07:00
bfredl
f27fb737ce Merge pull request #33727 from bfredl/bordergrid
fix(ui): correct condition for "wrap" flag in a floating grid
2025-04-30 13:56:32 +02:00
luukvbaal
0015a105ca fix(cmdline): do not move UI cursor when entering cmdline #33729
Problem:  Cursor is still moved to curwin when entering cmdline (after d41b8d47).

Solution: Remove call to `setcursor()`.
2025-04-30 04:51:14 -07:00
Jeremy Fleischman
272dba7f07 fix(trust): support for trusting directories #33617
Problem:
Directories that are "trusted" by `vim.secure.read()`, are not detectable later
(they will prompt again). https://github.com/neovim/neovim/discussions/33587#discussioncomment-12925887

Solution:
`vim.secure.read()` returns `true` if the user trusts a directory.

Also fix other bugs:

- If `f:read('*a')` returns `nil`, we treat that as a successful read of
  the file, and hash it. `f:read` returns `nil` for directories, but
  it's also documented as returning `nil` "if it cannot read data with the
  specified format". I reworked the implementation so we explicitly
  treat directories differently. Rather than hashing `nil` to put in the
  trust database, we now put "directory" in there explicitly*.
- `vim.secure.trust` (used by `:trust`) didn't actually work for
  directories, as it would blindly read the contents of a netrw buffer
  and hash it. Now it uses the same codepath as `vim.secure.read`, and
  as a result, works correctly for directories.
2025-04-30 04:20:39 -07:00
bfredl
f02484118c fix(ui): correct condition for "wrap" flag in a floating grid
In a floating window grid, "wrap" flag should not
be set when vertical borders are used, as the the wrapped
text will be broken up by border chars.

fixes #33719
2025-04-30 12:29:03 +02:00
zeertzjq
0ab0cdb2da vim-patch:910bfd5: runtime(java): Consent to HTML tags folding in Javadoc comments (#33718)
HTML tags in Javadoc comments can additionally be folded
after applying
------------------------------------------------------------
	let g:html_syntax_folding = 1
	set foldmethod=syntax
------------------------------------------------------------

and giving explicit consent with
------------------------------------------------------------
	let g:java_consent_to_html_syntax_folding = 1
------------------------------------------------------------

Do not default to this kind of folding unless ALL start tags
and optional end tags are balanced in Javadoc comments;
otherwise, put up with creating runaway folds that break
syntax highlighting.

resolves: zzzyxwvut/java-vim#8.
closes: vim/vim#17216

910bfd5d38

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2025-04-30 06:29:10 +08:00
Gregory Anders
99e754ae02 fix(terminal): remove condition that buf is curbuf (#33721) 2025-04-29 21:35:27 +00:00
luukvbaal
08c484f2ca feat(ui): use builtin completion popupmenu with ext_cmdline (#31269)
Problem:  UIs implementing ext_cmdline/message must also implement
          ext_popupmenu in order to get cmdline completion with
          wildoptions+=pum.
Solution: Allow marking a window as the ext_cmdline window through
          nvim_open_win(), including prompt offset. Anchor the cmdline-
          completion popupmenu to this window.
2025-04-29 15:55:00 +02:00
luukvbaal
9bbbeb60e3 feat(ui): no delay for errors with ext_messages (#33693)
Problem:  Delay for reading a message may be unwanted for ext_messages,
          and can be done by the implementation. Empty completion source
          error message is not distinguishable as such.
Solution: Only delay without ext_messages enabled. Emit empty completion
          source message as an error.
2025-04-29 15:45:40 +02:00
zeertzjq
c35dde03c8 fix(tui): don't process UI events when suspending or stopping (#33710)
When the TUI is suspending or stopping, redraw events should not be
processed, as when it next processes redraw events it's already waiting
for a DA1 response after having disabled some terminal modes.

Fix #33708
2025-04-29 09:37:54 +00:00
zeertzjq
ffb93d9883 Merge pull request #33667 from glepnir/vim-9.1.1341
vim-patch: 9.1.{1341,1344}
2025-04-29 14:59:32 +08:00
glepnir
e7e665b489 vim-patch:ffc89e4 runtime(doc): clarify complete_match() and 'isexpand' option
clarify complete_match() documentation to better explain its backward
search behavior, argument handling, and return value format and add an
example of isexpand

closes: https://github.com/vim/vim/pull/17212

ffc89e47d0
2025-04-29 14:11:55 +08:00
zeertzjq
c489b5a3e3 test(lua/secure_spec): avoid magic number (#33700)
Avoid magic number in skipping condition by moving the expected message
to a variable.
2025-04-29 01:44:54 +00:00
zeertzjq
7692a62b75 Merge pull request #33698 from zeertzjq/vim-9.1.1349
vim-patch:9.1.{1349,1350,1351,1353}
2025-04-29 07:48:18 +08:00
zeertzjq
d107375f0c vim-patch:9.1.1353: missing change from v9.1.1350
Problem:  missing change from v9.1.1350
Solution: update the test Test_CmdlineTrigger() (Girish Palya)

related: vim/vim#17217

612f63bf81

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-04-29 07:15:22 +08:00
zeertzjq
afcc4e95d5 vim-patch:9.1.1351: Return value of getcmdline() inconsistent in CmdlineLeavePre
Problem:  Return value of getcmdline() inconsistent in CmdlineLeavePre
          when leaving cmdline in different ways (after v9.1.1329).
Solution: Trigger CmdlineLeavePre before calling abandon_cmdline() so
          that getcmdline() can return the command line (zeertzjq).

closes: vim/vim#17218

9240369774
2025-04-29 07:15:22 +08:00
zeertzjq
c64cada12e vim-patch:9.1.1350: tests: typo in Test_CmdlineLeavePre_cabbr()
Problem:  tests: typo in Test_CmdlineLeavePre_cabbr()
          (after v9.1.1349)
Solution: fix typo, disable failing test on Windows for now
          (Girish Palya)

closes: vim/vim#17217

6220bbad4e

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-04-29 07:15:22 +08:00
zeertzjq
d75410b091 vim-patch:9.1.1349: CmdlineLeavePre may trigger twice
Problem:  CmdlineLeavePre may trigger twice
          (after v9.1.1329)
Solution: check that the key was typed, trigger it when it wasn't before
          (Girish Palya)

There are two problems:
- CmdlineLeavePre may be triggered twice when a cabbr is present.
- CmdlineLeavePre fails to trigger when exiting the command-line via
  <Backspace>.

Check if the Carriage Return (Enter) key was actually typed.
Trigger the event when the command-line is exited using Backspace and
other keys.

closes: vim/vim#17214

46755e6b52

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-04-29 07:15:21 +08:00
bfredl
43f3c4a48f Merge pull request #33481 from bfredl/gridview
refactor(ui): separate types for allocated grids and viewports
2025-04-28 12:07:54 +02:00
bfredl
bd413a2f55 refactor(ui): separate types for allocated grids and viewports 2025-04-28 10:10:11 +02:00
zeertzjq
317a897c46 vim-patch:b9ffbf5: runtime(vim): Update base-syntax, fix inline Vim9 dict comments at SOL (#33686)
Match Vim9 comments at start-of-line (no leading whitespace) in
dictionaries, lists and parenthesised expressions and argument lists.

Addresses https://github.com/vim/vim/pull/14975#issuecomment-2832643115

Report and fix by Aliaksei Budavei.

closes: vim/vim#17211

b9ffbf57f8

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-04-28 08:14:42 +08:00
Justin M. Keyes
ce097c5091 Merge #33542 shada improvements
* feat(shada): don't store jumplist if '0 in 'shada'
* fix(shada): don't store search and sub patterns if /0 in 'shada'
* fix(shada): don't store empty replacement string
* fix(shada): don't add '0' mark if f0 in 'shada'
2025-04-27 16:15:30 -07:00
Justin M. Keyes
07a207a5f1 Revert "fix(desktop): cannot open filename with spaces using OS file manager" #33684
This reverts commit 6e12ef4a7b

> Paths with spaces were already working. The original bug is most
> likely with user's terminal desktop entry, file manager or DE, and has
> nothing to do with nvim.desktop.

These are 3 different implementations that work correctly with unquoted %F and spaces:
```
$ DE=generic xdg-open "D I R/F I L E.txt" # pure bash
$ gio open "D I R/F I L E.txt" # glib2
$ handlr open "D I R/F I L E.txt" # rust
```
2025-04-27 15:49:00 -07:00
Justin M. Keyes
644c618825 docs: lsp, lua #33682
- sort fields alphabetically.
- in the `vim.lsp.Client` docs, reference `vim.lsp.ClientConfig` instead
  of duplicating its docs.
- cleanup lots of redundant-yet-drifted field docs.
2025-04-27 15:44:11 -07:00
Andre Toerien
36dbd2686f fix(shada): don't add '0' mark if f0 in 'shada' 2025-04-27 23:03:32 +02:00
Andre Toerien
1f503ac7c0 fix(shada): don't store empty replacement string 2025-04-27 23:03:30 +02:00
Justin M. Keyes
52a4bc4548 docs: lsp, emoji, startup #33446
Co-authored-by: Maria José Solano <majosolano99@gmail.com>
2025-04-27 13:40:46 -07:00
Andre Toerien
a6591950f6 fix(shada): don't store search and sub patterns if /0 in 'shada' 2025-04-27 22:14:10 +02:00
Andre Toerien
71455173b4 feat(shada): don't store jumplist if '0 in 'shada' 2025-04-27 22:14:09 +02:00
Maria José Solano
82b844fefe fix(lsp): fallback to empty capability_path in supports_registration 2025-04-27 18:49:50 +01:00
Maria José Solano
181df60533 fix(lsp): remove unused ns field 2025-04-27 18:49:50 +01:00
Justin M. Keyes
63323a9c81 feat(checkhealth): trigger FileType event after showing report #33677
Problem:
`FileType` event is fired before checkhealth report is finished, so
user can't override report settings or contents.
https://github.com/neovim/neovim/pull/33172#issuecomment-2833513916

Solution:
- Trigger FileType event later.
- Document how to remove emojis.
2025-04-27 10:32:25 -07:00
Maria José Solano
b98aefc584 fix(lsp): properly handle documentColor from multiple servers #33656 2025-04-27 16:58:10 +00:00
Justin M. Keyes
ef16a02a76 test: feed_command is deprecated #33674 2025-04-27 09:46:53 -07:00
Maria José Solano
e991133058 fix: remove unnecessary nvim -l from gen command #33676 2025-04-27 09:46:19 -07:00
Phạm Bình An
86b34ad073 docs: provide example_init.lua #33524
Problem:
There are some "boilerplate" steps for new users. Although we are
constantly improving defaults and lifting patterns into core, users
eventually want to know how to start their own config, add plugins, etc.

Solution:
Add `runtime/example_init.lua` and refer to it from docs.
2025-04-27 08:11:02 -07:00
zeertzjq
a167800f1c vim-patch:partial:fbe4a8f: runtime(doc): Fix notation of "Vim script" and "Vim9 script" (#33673)
closes: vim/vim#17213

fbe4a8f5c0

Cherry-pick Test_source_ignore_shebang() change from patch 9.0.0363.

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-04-27 22:06:16 +08:00
Phạm Bình An
923efaea28 fix(runtime): cpoptions is reset in Lua file #33671
closes #33670
2025-04-27 04:55:15 -07:00
Justin M. Keyes
c2fc867843 Merge #33660 from MariaSolOs/supports-dynamic 2025-04-27 04:34:05 -07:00
glepnir
31e31273bc vim-patch:9.1.1344: double free in f_complete_match() (after v9.1.1341)
Problem:  double free in f_complete_match() (after v9.1.1341)
Solution: remove additional free of trig pointer, correctly free
          regmatch.regprog and before_cursor in the error case

closes: https://github.com/vim/vim/pull/17203

3accf046ec

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-04-27 15:57:11 +08:00
glepnir
fcabbc2283 vim-patch:9.1.1341: cannot define completion triggers
Problem:  Cannot define completion triggers and act upon it
Solution: add the new option 'isexpand' and add the complete_match()
          function to return the completion matches according to the
          'isexpand' setting (glepnir)

Currently, completion trigger position is determined solely by the
'iskeyword' pattern (\k\+$), which causes issues when users need
different completion behaviors - such as triggering after '/' for
comments or '.' for methods. Modifying 'iskeyword' to include these
characters has undesirable side effects on other Vim functionality that
relies on keyword definitions.

Introduce a new buffer-local option 'isexpand' that allows specifying
different completion triggers and add the complete_match() function that
finds the appropriate start column for completion based on these
triggers, scanning backwards from cursor position.

This separation of concerns allows customized completion behavior
without affecting iskeyword-dependent features. The option's
buffer-local nature enables per-filetype completion triggers.

closes: vim/vim#16716

bcd5995b40

Co-authored-by: glepnir <glephunter@gmail.com>
2025-04-27 15:00:31 +08:00
Maria José Solano
d6fffe6b32 fix(lsp): access correct client capability path in supports_registration 2025-04-26 18:40:55 -07:00
Maria José Solano
66339e0641 feat(lsp): generate method to client capability map 2025-04-26 18:24:39 -07:00
zeertzjq
c1d21492a6 vim-patch:c29b533: runtime(vim): Update base-syntax, match continued strings and tail comments (#33659)
Continued strings are currently only matched after operators, in
parenthesised expressions and in function call argument lists.

closes: vim/vim#14975

c29b533cf1

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-04-27 01:17:39 +00:00
zeertzjq
2c3488c52e vim-patch:c5cb6b2: runtime(doc): tagfunc should refer to 'complete' option (#33658)
fixes: vim/vim#17205

c5cb6b2ee4

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-04-27 01:06:08 +00:00
fredizzimo
1999c4cdc1 fix: screenchar()/screenstring() with multigrid #32494
Problem:
- When multigrid is enabled, screenchar()/screenstring() functions return wrong
  results. See https://github.com/neovide/neovide/issues/2569
- `screenstring()` executed via RPC in child Nvim process, doesn't recognize
  floating windows.

Solution:
In ui_comp_get_grid_at_coord(), also iterate window grids.
2025-04-26 13:39:12 -07:00
Justin M. Keyes
dd18ab1691 test: drop redundant clear() #33654
followup to #33647 after overlapping merge
2025-04-26 09:42:13 -07:00
Justin M. Keyes
e7410048fa test: drop redundant clear() #33647
Problem:
Tests call `clear()` even though `clear_notrace()` is already called in
a `before_each()` handler, wasting precious milliseconds!

Solution:
Remove redundant `clear()` calls.
2025-04-26 09:39:32 -07:00
Andre Toerien
d927a87ed6 fix(health): checkhealth float opens extra empty buffer #33648 2025-04-26 09:10:06 -07:00
Yi Ming
f486f1742e perf(lsp): include previousResultId in DocumentDiagnosticParams #32887
Problem:
Users of the Roslyn (C#) LSP have encountered significant delays when
retrieving pull diagnostics in large documents while using Neovim. For
instance, diagnostics in a 2000-line .cs file can take over 20 seconds
to display after edits in Neovim, whereas in VS Code, diagnostics for
the same file are displayed almost instantly.

As [mparq noted](https://github.com/seblj/roslyn.nvim/issues/93#issuecomment-2508940330)
in https://github.com/seblj/roslyn.nvim/issues/93, VS Code leverages
additional parameters specified in the [LSP documentation for
textDocument/diagnostic](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#documentDiagnosticParams),
specifically:

- previousResultId
- identifier

Solution:
When requesting diagnostics, Neovim should include the
`previousResultId` and `identifier` parameters as part of the request.
These parameters enable the server to utilize caching and return
incremental results.

Support for maintaining state is already present in the
[textDocument/semanticTokens implementation](8f84167c30/runtime/lua/vim/lsp/semantic_tokens.lua (L289)).
A similar mechanism can be implemented in `textDocument/diagnostic` handler.
2025-04-26 09:09:20 -07:00
Bartłomiej Maryńczak
8315697449 fix(lsp): detect if Client:request resolved synchronously #33624
Problem:
In cases when the (in-process) LSP server responds to the request
immediately and calls `notify_reply_callback` the request will still be
marked as pending, because the code assumes that the response will occur
asynchronously. Then the request will be pending forever, because it was
already set as "completed" before we even set it as "pending".

A workaround is to wrap `notify_replay_callback` in `vim.shedule` ([like
so](https://github.com/neovim/neovim/pull/24338#issuecomment-2809568617)]
but that seems counterintuitive.

Solution:
Handle this case in Client:request().
2025-04-26 07:08:03 -07:00
Justin M. Keyes
e45ec5a852 Merge #33642 from ofseed/lsp-fix-signature 2025-04-26 06:30:23 -07:00
Christian Clason
e324ab2b6b vim-patch:35cfc3d: runtime(debversions): Add questing (25.10) as Ubuntu release name
closes: vim/vim#17201

35cfc3d3c4

Co-authored-by: James McCoy <jamessan@jamessan.com>
2025-04-26 10:43:12 +02:00
Yi Ming
342974773c fix(lsp): cycling signatures with the default config.focusable 2025-04-26 16:12:25 +08:00
Yi Ming
9e93bfdb5f fix(lsp): prioritize showing active signature 2025-04-26 15:44:30 +08:00
zeertzjq
8090dcf494 test(pum): check RightRelease in outside pum with winbar (#33640) 2025-04-26 09:44:21 +08:00
zeertzjq
766cd01ff2 vim-patch:9.1.1346: missing out-of-memory check in textformat.c (#33639)
Problem:  missing out-of-memory check in textformat.c
Solution: add out-of-memory check, add small optimizations to
          internal_format() and same_leader() (John Marriott)

closes: vim/vim#17200

c25368ba14

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-04-26 07:42:24 +08:00
Luuk van Baal
d01b2611a6 fix(ui): exclude unfocusable windows from 'complete' "w" completion
Problem:  As in f85bc41, assume unfocusable windows to be UI windows
          whose buffer content is unexpectedly included in 'complete'
          "w" completion.
Solution: Exclude unfocusable windows when looping over windows.
2025-04-25 17:45:57 +02:00
zeertzjq
d9353bd442 test(pum): fix passing incorrect grid (#33635) 2025-04-25 22:51:25 +08:00
Christian Clason
06613989a6 build(deps): bump libuv to v1.51.0 2025-04-25 13:01:29 +02:00
Christian Clason
1fed4412e4 vim-patch:e36a931: runtime(groff,nroff): improve ftplugin
- set options in ftplugin but not in syntax
- implement ftplugin/groff.vim (wrapper of ftplugin/nroff.vim)

closes: vim/vim#17174

e36a931d9b

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-04-25 10:58:49 +02:00
Christian Clason
9e450000d3 vim-patch:32f4973: runtime(gleam): update filetype plugin, include new compiler and syntax script
closes: vim/vim#17172

32f49738d1

Co-authored-by: Kirill Morozov <mail2kirill@gmail.com>
2025-04-25 10:58:49 +02:00
Christian Clason
4ddd31de14 vim-patch:9.1.1343: filetype: IPython files are not recognized
Problem:  filetype: IPython files are not recognized
          (user202729)
Solution: detect *.ipy files as python filetype

fixes: vim/vim#17163

e380b5cbba

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-04-25 10:35:32 +02:00
zeertzjq
533ce0e807 test(pum): remove two more duplicate screen states (#33628) 2025-04-25 15:19:09 +08:00
zeertzjq
7d569abb20 fix(pum): handle RightDrag on parent grid properly (#33626) 2025-04-25 06:37:42 +00:00
Stephan Seitz
1670fbee0f fix(docs) fix syntax error in Lua snippet for vim.lsp.document_color #33612
9ff1239634 added support for 'textDocument/documentColor' but the
text snippet in the Lua docs seem to contain a syntax error.
2025-04-24 19:21:23 +00:00
luukvbaal
276860b538 fix(messages): clear 'showmode' message after insert_expand #33607
Problem:  'showmode' ext_messages state is not cleared after insert_expand mode.
Solution: Replace empty message with more idiomatic way to clear the showmode.
2025-04-24 12:11:49 -07:00
Maria José Solano
18e8839c80 fix(lsp): don't create an 'LspAttach' document_color autocommand 2025-04-24 21:03:44 +02:00
Maria José Solano
8495d96238 fix(lsp): ensure bufstate when calling vim.lsp.document_color.is_enabled 2025-04-24 21:03:44 +02:00
Maria José Solano
9ff1239634 feat(lsp): support textDocument/documentColor
test(lsp): add tests form `vim.lsp.document_color`
2025-04-24 18:48:19 +02:00
Maria José Solano
ca47cc39f8 refactor(lsp): add handler to vim.lsp.util._refresh options 2025-04-24 18:48:19 +02:00
zeertzjq
ac8ae1596c vim-patch:9.1.1340: cannot complete :filetype arguments (#33602)
Problem:  cannot complete :filetype arguments (Phạm Bình An)
Solution: add :filetype ex command completion, add "filetypecmd"
          completion type for getcompletion()

fixes: vim/vim#17165
closes: vim/vim#17167

a3422aa317

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-04-24 00:50:33 +00:00
zeertzjq
63689deb45 vim-patch:9.1.1337: Undo corrupted with 'completeopt' "preinsert" when switching buffer (#33600)
Problem:  Undo corrupted with 'completeopt' "preinsert" when switching
          buffer or window.
Solution: Do not delete preinsert text when switching buffer or window.
          (zeertzjq)

related: neovim/neovim#33581
closes: vim/vim#17193

1343681aba
2025-04-24 07:35:11 +08:00
zeertzjq
921752d3e2 Merge pull request #33565 from zeertzjq/vim-9.1.1329
vim-patch:9.1.{1329,1331,1338}
2025-04-24 07:34:37 +08:00
zeertzjq
3d126ec89f vim-patch:9.1.1338: Calling expand() interferes with cmdcomplete_info()
Problem:  Calling expand() interferes with cmdcomplete_info()
          (after 9.1.1329).
Solution: Only clear cmdline_orig when starting/ending cmdline mode
          (zeertzjq).

closes: vim/vim#17192

ec270a5f55
2025-04-24 06:53:26 +08:00
zeertzjq
07d60e8f19 vim-patch:9.1.1331: Leaking memory with cmdcomplete()
Problem:  Leaking memory with cmdcomplete()
          (zeertzjq, after v9.1.1329)
Solution: free the memory (Girish Palya)

closes: vim/vim#17190

5c3d1e3258

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-04-24 06:53:26 +08:00
zeertzjq
a9f810b203 vim-patch:31b78cc: runtime(doc): update documentation
closes: vim/vim#17180

31b78cce6e

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-04-24 06:53:26 +08:00
zeertzjq
f3c4fec43f vim-patch:9.1.1329: cannot get information about command line completion
Problem:  cannot get information about command line completion
Solution: add CmdlineLeavePre autocommand and cmdcomplete_info() Vim
          script function (Girish Palya)

This commit introduces two features to improve introspection and control
over command-line completion in Vim:

- Add CmdlineLeavePre autocmd event:

  A new event triggered just before leaving the command line and before
  CmdlineLeave. It allows capturing completion-related state that is
  otherwise cleared by the time CmdlineLeave fires.

- Add cmdcomplete_info() Vim script function:

  Returns a Dictionary with details about the current command-line
  completion state.

These are similar in spirit to InsertLeavePre and complete_info(),
but focused on command-line mode.

**Use case:**

In [[PR vim/vim#16759](https://github.com/vim/vim/pull/16759)], two examples
demonstrate command-line completion: one for live grep, and another for
fuzzy file finding. However, both examples share two key limitations:

1. **Broken history recall (`<Up>`)**
   When selecting a completion item via `<Tab>` or `<C-n>`, the original
pattern used for searching (e.g., a regex or fuzzy string) is
overwritten in the command-line history. This makes it impossible to
recall the original query later.
   This is especially problematic for interactive grep workflows, where
it’s useful to recall a previous search and simply select a different
match from the menu.

2. **Lack of default selection on `<CR>`**
   Often, it’s helpful to allow `<CR>` (Enter) to accept the first match
in the completion list, even when no item is explicitly selected. This
behavior is particularly useful in fuzzy file finding.

----
Below are the updated examples incorporating these improvements:

**Live grep, fuzzy find file, fuzzy find buffer:**

```vim
command! -nargs=+ -complete=customlist,GrepComplete Grep VisitFile()
def GrepComplete(arglead: string, cmdline: string, cursorpos: number):
list<any>
    return arglead->len() > 1 ? systemlist($'grep -REIHns "{arglead}"' ..
       ' --exclude-dir=.git --exclude=".*" --exclude="tags" --exclude="*.swp"') : []
enddef
def VisitFile()
    if (selected_match != null_string)
        var qfitem = getqflist({lines: [selected_match]}).items[0]
        if qfitem->has_key('bufnr') && qfitem.lnum > 0
            var pos = qfitem.vcol > 0 ? 'setcharpos' : 'setpos'
            exec $':b +call\ {pos}(".",\ [0,\ {qfitem.lnum},\ {qfitem.col},\ 0]) {qfitem.bufnr}'
            setbufvar(qfitem.bufnr, '&buflisted', 1)
        endif
    endif
enddef
nnoremap <leader>g :Grep<space>
nnoremap <leader>G :Grep <c-r>=expand("<cword>")<cr>
command! -nargs=* -complete=customlist,FuzzyFind Find
execute(selected_match != '' ? $'edit {selected_match}' : '')
var allfiles: list<string>
autocmd CmdlineEnter : allfiles = null_list
def FuzzyFind(arglead: string, _: string, _: number): list<string>
    if allfiles == null_list
        allfiles = systemlist($'find {get(g:, "fzfind_root", ".")} \! \(
-path "*/.git" -prune -o -name "*.swp" \) -type f -follow')
    endif
    return arglead == '' ? allfiles : allfiles->matchfuzzy(arglead)
enddef
nnoremap <leader><space> :<c-r>=execute('let
fzfind_root="."')\|''<cr>Find<space><c-@>
nnoremap <leader>fv :<c-r>=execute('let
fzfind_root="$HOME/.vim"')\|''<cr>Find<space><c-@>
nnoremap <leader>fV :<c-r>=execute('let
fzfind_root="$VIMRUNTIME"')\|''<cr>Find<space><c-@>
command! -nargs=* -complete=customlist,FuzzyBuffer Buffer execute('b '
.. selected_match->matchstr('\d\+'))
def FuzzyBuffer(arglead: string, _: string, _: number): list<string>
    var bufs = execute('buffers', 'silent!')->split("\n")
    var altbuf = bufs->indexof((_, v) => v =~ '^\s*\d\+\s\+#')
    if altbuf != -1
        [bufs[0], bufs[altbuf]] = [bufs[altbuf], bufs[0]]
    endif
    return arglead == '' ? bufs : bufs->matchfuzzy(arglead)
enddef
nnoremap <leader><bs> :Buffer <c-@>
var selected_match = null_string
autocmd CmdlineLeavePre : SelectItem()
def SelectItem()
    selected_match = ''
    if getcmdline() =~ '^\s*\%(Grep\|Find\|Buffer\)\s'
        var info = cmdcomplete_info()
        if info != {} && info.pum_visible && !info.matches->empty()
            selected_match = info.selected != -1 ? info.matches[info.selected] : info.matches[0]
            setcmdline(info.cmdline_orig). # Preserve search pattern in history
        endif
    endif
enddef
```

**Auto-completion snippet:**

```vim
set wim=noselect:lastused,full wop=pum wcm=<C-@> wmnu
autocmd CmdlineChanged : CmdComplete()
def CmdComplete()
    var [cmdline, curpos] = [getcmdline(), getcmdpos()]
    if getchar(1, {number: true}) == 0  # Typehead is empty (no more pasted input)
            && !pumvisible() && curpos == cmdline->len() + 1
            && cmdline =~ '\%(\w\|[*/:.-]\)$' && cmdline !~ '^\d\+$'  # Reduce noise
        feedkeys("\<C-@>", "ti")
        SkipCmdlineChanged()  # Suppress redundant completion attempts
        # Remove <C-@> that get inserted when no items are available
        timer_start(0, (_) => getcmdline()->substitute('\%x00', '', 'g')->setcmdline())
    endif
enddef
cnoremap <expr> <up> SkipCmdlineChanged("\<up>")
cnoremap <expr> <down> SkipCmdlineChanged("\<down>")
autocmd CmdlineEnter : set bo+=error
autocmd CmdlineLeave : set bo-=error
def SkipCmdlineChanged(key = ''): string
    set ei+=CmdlineChanged
    timer_start(0, (_) => execute('set ei-=CmdlineChanged'))
    return key != '' ? ((pumvisible() ? "\<c-e>" : '') .. key) : ''
enddef
```

These customizable snippets can serve as *lightweight* and *native*
alternatives to picker plugins like **FZF** or **Telescope** for common,
everyday workflows. Also, live grep snippet can replace **cscope**
without the overhead of building its database.

closes: vim/vim#17115

92f68e26ec

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-04-24 06:53:22 +08:00
Au.
652c3e76c7 fix(api): nvim_parse_cmd "range" when ea.addr_count=0 #33536
Problem:
nvim_parse_cmd returns invalid 'range' field for cmd like `:bdelete`.

Solution:
Add the condtion `ea.add_count > 0` as required to put 'range'
into result.

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-04-23 07:56:17 -07:00
Skoh
bc814cfb2c fix(winblend): treat braille blank (\u2800) as whitespace #32741
Problem:
'winblend' does not display text behind blank unicode characters other than 0x20 ascii space.

Solution:
In ui_compositor.c -> compose_line() check for either 0x20 or 0x80A0E2 (utf8 \u2800).
2025-04-23 05:27:21 -07:00
glepnir
d4f2b9050d fix(float): cursor visible in "hidden" floating window #30866
Problem:
Cursor is visible in "hidden" floating window.

Solution:
Hide cursor when curwin is a hidden floating window.
Show cursor after returning to a normal (non-hidden) window.
2025-04-23 05:22:43 -07:00
Lewis Russell
70d7979439 feat: render tuple types for API methods 2025-04-23 11:58:30 +01:00
Luuk van Baal
019b2050e1 fix(snippet): use <cmd>call cursor() for visual range
Problem:  Change applied in d3e495ce uses a byte-offset where a virtual
          column is expected.
Solution: Set the cursor directly through a <Cmd> mapping, while making
          sure the commands are ordered correctly by adding them to the
          type-ahead buffer.
2025-04-23 10:58:22 +02:00
Christian Clason
8d68dbf906 vim-patch:229f79c: runtime(yaml): fix wrong order of undo_ftplugin suboptions
This commit fixes the following error message:
```
Compiler not supported: make inc< sw< sts<
```

1. orginal value: `setl com< cms< et< fo<| compiler make inc< sw< sts<`
2. correct value: `setl com< cms< et< fo< inc< sw< sts< | compiler make`

While at it, let's also document the g:yaml_recommended_style variable.

closes: vim/vim#17179

229f79c168

Co-authored-by: Vincent Law <vlaw@users.noreply.github.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-04-23 08:37:36 +02:00
Christian Clason
2ea14c0cf4 vim-patch:7bc9880: runtime(make): do not automatically indent after a special target
prevent indentation if the previous line starts with e.g. `.PHONY:`

closes: vim/vim#17183

7bc988067e

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-04-23 08:37:36 +02:00
zeertzjq
1dbede5b93 fix(events): avoid superfluous CursorMovedI on first autocmd (#33588) 2025-04-23 03:20:21 +00:00
zeertzjq
803649da11 vim-patch:fa3b104: runtime(vim): Update base-syntax, improve :autocmd highlighting (#33586)
- Match full :autocmd, :doautocmd and :doautoall commands.
- Add filename pattern (wildcard) highlighting.

fa3b1043c6

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-04-23 01:31:08 +00:00
Gregory Anders
82f08f33c1 fix(tui): ensure all pending escape sequences are processed before exiting #32151
Problem:
Neovim disables a number of terminal modes when it exits, some of which
cause the terminal to send asynchronous events to Neovim. It's possible
that Neovim exits before the terminal has received and processed all of
the sequences to disable these modes, causing the terminal to emit one
of these asynchronous sequences after Neovim has already exited. If this
happens, then the sequence is received by the user's shell (or some
other program that is not Neovim).

Solution:
When Neovim exits, it now emits a Device Attributes request (DA1)
after disabling all of the different modes. When the terminal responds
to this request we know that it has already received all of our other
sequences disabling the other modes. At that point, it should not be
emitting any further asynchronous sequences. This means the process of
exiting Neovim is now asynchronous as well since it depends on receiving
the DA1 response from the terminal.
2025-04-22 05:18:34 -07:00
luukvbaal
d3e495ce03 perf(snippet): use "[count]|" to move cursor #33571
Problem:
Flicker when using vim.snippet.jump().

Solution:
Pass count instead of multiple <right> keys.
2025-04-22 04:34:41 -07:00
Christian Clason
8c81ed8678 feat(runtime): revert cfilter, ccomplete to legacy Vim
Problem: Transpiled Lua code from vim9script is not amenable to static
analysis, requiring manual cleanup or ignoring parts of our codebase.

Solution: Revert to pre-rewrite version of (low-impact) legacy plugins
and remove the vim9jit shim.
2025-04-22 11:03:05 +02:00
luukvbaal
65170e8dad fix(api): wrong return value with reverse range + overlap #32956
Problem:  When iterating in reverse with {start} > {end} in
          `nvim_buf_get_extmarks()`, marks that overlap {start} and are
          greater than {end} are included in the return value twice.
          Marks that overlap {end} and do not overlap {start} are not
          not included in the return value at all. Marks are not
          actually returned in a meaningful "traversal order".

Solution: Rather than actually iterating in reverse, (also possible but
          requires convoluted conditions and would require fetching
          overlapping marks for both the {start} and {end} position,
          while still ending up with non-traversal ordered marks),
          iterate normally and reverse the return value.
2025-04-21 16:18:03 -07:00
Shadman
28e31f5d3d feat(options): default statusline expression #33036
Problem:
Default 'statusline' is implemented in C and not representable as
a statusline expression. This makes it hard for user configs/plugins to
extend it.

Solution:
- Change the default 'statusline' slightly to a statusline expression.
- Remove the C implementation.
2025-04-21 15:05:34 -07:00
Nathaniel Poppe
ab72799841 fix(coverity/530026,530028): free resources on early exit in nlua_exec_file #33502
Problem: The stdin reading path does not close `stdin_dup` or free `sb`
upon early exit.

Solution: Free the resources before returning false.
2025-04-21 08:43:38 -07:00
luukvbaal
986b92eb07 fix(messages): single msg_show event for multiple :set options #33555
Problem:  :set opt1 opt2... emits a separate event for each option.

Solution: Only set the kind for the first printed option value.
2025-04-21 07:51:47 -07:00
Luuk van Baal
7ba0f623d7 feat(ui): avoid setting 'cmdheight' with vim.ui_attach()
Problem:  We allow setting 'cmdheight' to 0 with ext_messages enabled
          since b72931e7. Enabling ext_messages with vim.ui_attach()
          implicitly sets 'cmdheight' to 0 for BWC. When non-zero
          'cmdheight' is wanted, this behavior make it unnecessarily
          hard to keep track of the user configured value.
Solution: Add set_cmdheight to vim.ui_attach() opts table that can be
          set to false to avoid setting 'cmdheight' to 0.
2025-04-21 15:38:23 +02:00
zeertzjq
de7306a250 docs(news): fix incorrect placements (#33566) 2025-04-21 12:20:05 +00:00
luukvbaal
7ba043f0f3 feat(api): add "max_height" argument to nvim_win_text_height (#32835)
Useful to e.g. limit the height to the window height, avoiding unnecessary
work. Or to find out how many buffer lines beyond "start_row" take up a
certain number of logical lines (returned in "end_row" and "end_vcol").
2025-04-21 19:48:26 +08:00
zeertzjq
98ec3fdf74 vim-patch:9.1.1328: too many strlen() calls in indent.c (#33563)
Problem:  too many strlen() calls in indent.c
Solution: refactor indent.c slightly and remove strlen() calls
          (John Marriott)

closes: vim/vim#17156

eac45c558e

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-04-21 19:16:29 +08:00
zeertzjq
e3c3f4730d vim-patch:7938c40: runtime(keymaps): update Brazilian keymaps (#33562)
closes: vim/vim#17161

7938c40b34

Co-authored-by: LuMarquesIlva <luismarques0504@proton.me>
2025-04-21 19:16:17 +08:00
zeertzjq
8051092414 Merge pull request #33561 from zeertzjq/vim-9.1.1304
vim-patch:9.1.{1304,1327}: filetype: some man files are not recognized
2025-04-21 19:09:29 +08:00
zeertzjq
9fafdcb99c vim-patch:9.1.1327: filetype: nroff detection can be improved
Problem:  filetype: nroff detection can be improved
Solution: improve nroff detection (Eisuke Kawashima)

- explicitly check roff comments and macros typically found in manpages
- do not try to detect alphabetically-sectioned files, except for n, as
  nroff
    - l: > 'l' happens to be a section for historical reasons
         <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=391977>
    - n: e.g. /usr/share/man/mann/Tcl.n.gz
    - o: unsure (perhaps fedora-specific)
    - p: unsure (perhaps fedora-specific)

closes: vim/vim#17160

2cb42efc18

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-04-21 18:40:58 +08:00
zeertzjq
7da1639a14 vim-patch:9.1.1304: filetype: some man files are not recognized
Problem:  filetype: some man files are not recognized
          (e.g. 1p (POSIX commands))
Solution: update the filetype detection pattern and detect more man
          files as nroff (Eisuke Kawashima)

- sections are revised referring to
    - debian-12:/etc/manpath.config
    - fedora-41:/etc/man_db.conf
- detection logic is improved
- detection test is implemented

closes: vim/vim#17117

babdb0554a

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-04-21 18:40:58 +08:00
Christian Clason
1437144740 vim-patch:e125ee4: runtime(pov): deprecate #render and #statistics in syntax script
- 3.1g: active
  https://www.povray.org/ftp/pub/povray/Old-Versions/Official-3.1g/Docs/povuser.pdf#page=172
- 3.5 or later: deprecated
  https://www.povray.org/ftp/pub/povray/Old-Versions/Official-3.5/Linux/povlinux.tgz
  ─ povray-3.50c/html/povdoc_172.html
  - https://www.povray.org/documentation/3.7.0/r3_3.html#r3_3_2_7_1

closes: vim/vim#17177

e125ee4b9f

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-04-21 12:38:27 +02:00
Maria José Solano
d55330bcd1 refactor(lsp): use method type annotations for parameters 2025-04-21 11:35:29 +02:00
zeertzjq
351613bc1f vim-patch:187df69: runtime(doc): cross-link :| meaning :p and explain E749 (#33559)
E749 is given when :print (with any range) is issued on an empty buffer,
like the one you get with :new or :enew. Furthermore, due to Vi
compatibility :| is a synonym.

As a result, mappings intended to include a <bar> separator (esp. in the
case of boolean or "||") between commands can generate E749 on startup
when placed in a vimrc if the bars are not properly encoded or escaped.
[1]. Document this failure mode and synonym near the generated error,
and cross link with :help :bar. Note that one must read or scroll quite
a bit to find the mention of :| behaving like :print!

[1]: https://vi.stackexchange.com/q/46625/10604

closes: vim/vim#17173

187df69fd1

Co-authored-by: D. Ben Knoble <ben.knoble+github@gmail.com>
2025-04-21 08:56:05 +00:00
Luuk van Baal
4b02d1f6f6 fix(gen_vimdoc): unnecessary assert for non-source files
Problem:  The presence of non-source files breaks `make doc`.
Solution: Replace assert with if statement to skip non-matching files.
2025-04-21 10:15:33 +02:00
zeertzjq
d3cded796c vim-patch:9.1.1326: invalid cursor position after 'tagfunc' (#33556)
Problem:  invalid cursor position after 'tagfunc'
          (gandalf4a)
Solution: call check_cursor() after executing the 'tagfunc'

9919085491

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-04-20 23:04:02 +00:00
zeertzjq
c7d8812ca7 vim-patch:2398460: runtime(doc): clarify 'includeexpr' is not used for <cfile> (#33540)
fixes: vim/vim#17139

2398460232

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-04-19 19:10:43 +08:00
zeertzjq
e4516a90b1 vim-patch:54081f0: runtime(nix): set iskeyword and b:match_words in ftplugin (#33541)
closes: vim/vim#17154

54081f0ce0

Co-authored-by: Arnie97 <arnie97@gmail.com>
2025-04-19 10:59:12 +00:00
Christian Clason
255bf6e5b1 vim-patch:9.1.1320: filetype: alsoft config files are not recognized
Problem:  filetype: alsoft config files are not recognized
Solution: detect alsoft config files as dosini filetype
          (David Mandelberg)

References:
* code with paths to config: ReadALConfig() in
  https://github.com/kcat/openal-soft/blob/master/alc/alconfig.cpp
* example config:
  https://github.com/kcat/openal-soft/blob/master/alsoftrc.sample

closes: vim/vim#17140

1d96caaa4b

Co-authored-by: David Mandelberg <david@mandelberg.org>
2025-04-19 10:52:12 +02:00
Christian Clason
1b0dedb81c vim-patch:9.1.1321: filetype: MS ixx and mpp files are not recognized
Problem:  filetype: MS ixx and mpp files are not recognized
Solution: detect *.mpp and *.ixx files as c++ filetype
          (Hampus Avekvist)

closes: vim/vim#17155

aee34ef23e

Co-authored-by: Hampus Avekvist <hampus.avekvist@hey.com>
2025-04-19 10:52:12 +02:00
zeertzjq
df96276b19 test(api/window_spec): check start_vcol on folded line (#33535) 2025-04-19 05:14:34 +00:00
zeertzjq
ed5e70465a test(api): nvim_win_text_height with virt_lines around fold (#33529) 2025-04-19 01:00:46 +00:00
zeertzjq
7380f8ec71 vim-patch:cb3b752: runtime(doc): clarify "nearest" value for 'completeopt' (#33534)
closes: vim/vim#17146

cb3b752f95

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-04-19 08:42:48 +08:00
phanium
dca8b3fede vim-patch:9.1.1322: small delete register cannot paste multi-line correctly (#33531)
Problem:  small delete register cannot paste multi-line correctly
          (after v8.2.2189)
Solution: caused by 032a2d050b82b146d70d6ff714838ee62c07d8ad, so make
          this logic handle charwise only (phanium)

closes: vim/vim#17151

7e93d4c617
2025-04-19 08:01:51 +08:00
zeertzjq
c67398d31b vim-patch:9.1.1319: Various typos in the code, issue with test_inst_complete.vim (#33527)
Problem:  Various typos in the code, redundant and strange use of
          :execute in test_ins_complete.vim (after 9.1.1315).
Solution: Fix typos in the code and in the documentation, use the
          executed command directly (zeertzjq).

closes: vim/vim#17143

98800979dc

Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
2025-04-19 07:23:20 +08:00
zeertzjq
9397fdafe1 Merge pull request #33519 from zeertzjq/vim-9.1.1314
vim-patch:9.1.{1314,1318}: max allowed string width too small
2025-04-19 07:22:39 +08:00
Au.
44f1dbee0d fix(spell): save spell files to stdpath('data')/site/spell #33528 2025-04-18 08:56:20 -07:00
zeertzjq
0251a25541 vim-patch:9.1.1318: tests: test_format fails
Problem:  tests: test_format fails (after 9.1.1314).
Solution: Increase the string size.  Add missing test_format.res in
          NEW_TESTS_RES (zeertzjq).

closes: vim/vim#17144

e9a27ef373
2025-04-18 17:00:34 +08:00
zeertzjq
ccdb37b075 vim-patch:9.1.1314: max allowed string width too small
Problem:  max allowed string width too small
Solution: increased MAX_ALLOWED_STRING_WIDTH from 6400 to 1MiB
          (Hirohito Higashi)

closes: vim/vim#17138

06fdfa11c5

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-04-18 16:58:10 +08:00
zeertzjq
34791f7988 Merge pull request #33526 from zeertzjq/vim-3dca512
vim-patch: Vim syntax updates
2025-04-18 15:25:11 +08:00
zeertzjq
9045656014 vim-patch:9b171bd: runtime(vim): Update-base-syntax, match full :*grep, :make, :sort and :filter commands
closes: vim/vim#17082

9b171bdfd6

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-04-18 14:59:20 +08:00
zeertzjq
67d6f2baa4 vim-patch:520a2c7: runtime(vim): Update base-syntax, improve :command highlighting
- Match multiline :command definitions.
- Match custom completion funcref var names.

fixes: vim/vim#17001
closes: vim/vim#17067

520a2c7852

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-04-18 14:57:09 +08:00
zeertzjq
5662bdafc2 vim-patch:2f5a8c0: runtime(vim): Update base-syntax, match full :redir command
closes: vim/vim#17057

2f5a8c0b5b

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-04-18 14:55:45 +08:00
zeertzjq
3ee144aa95 vim-patch:2a6be83: runtime(vim): Update base-syntax, improve :set backslash handling
Improve backslash handling in :set option values. There is no special
handling for options supporting Windows path separators yet.

See :help option-backslash.

Remove the vimSetString syntax group. Option string values cannot be
specified with a quoted string, this is a command terminating tail
comment.

fixes: vim/vim#16913
closes: vim/vim#17034

2a6be83512

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-04-18 14:52:50 +08:00
zeertzjq
234be4aebc vim-patch:722fbd1: runtime(vim): Update base-syntax, match tuples
Tuples were introduced in commit 9cb865e.  See PR vim/vim#16776.

fixes: vim/vim#16965
closes: vim/vim#16935

722fbd1554

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-04-18 14:50:05 +08:00
zeertzjq
1e2f86394a vim-patch:adb703e: runtime(vim): Update base-syntax, match protected constructors
Support for protected constructors was added in commit 7e89800.

closes: 16618

adb703e1b9

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-04-18 14:46:06 +08:00
zeertzjq
700840f4b7 vim-patch:dd3f1c0: runtime(vim): Update base-syntax, match multiline return types
fixes vim/vim#14442.
closes: vim/vim#16914

dd3f1c0dda

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-04-18 14:45:36 +08:00
zeertzjq
e2fa151f9c vim-patch:0fab891: runtime(vim): Update base-syntax, improve :syntax highlighting
- Highlight missing :syntax subcommands.
- Don't highlight user specified syntax group names.

closes: vim/vim#16847

0fab89117f

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-04-18 14:41:39 +08:00
zeertzjq
8e5ef60540 vim-patch:3dca512: runtime(vim): Update base-syntax and generator, only match valid predefined variables
- Only match valid predefined and option variables.
- Match scope dictionaries.
- Highlight scope prefixed variables as a scope dictionary accessor. The
  vimVarScope syntax group can be linked to vimVar to disable this.
- Include support for Neovim-only predefined and option variables.

Temporary collateral damage - scope dictionaries match instead of keys
in dictionary literals.

closes: vim/vim#16727

3dca512939

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-04-18 14:31:34 +08:00
ash
118759aa6b vim-patch:8f09684: runtime(jjdescription): Don't require a space to start comments (#33523)
Since jj v0.24.0 (December 2024), `JJ:` comments are recognised even
when not followed by a space.

closes: vim/vim#17130

8f09684569
2025-04-18 01:05:10 +00:00
zeertzjq
fe7cd80cbc Merge pull request #33521 from zeertzjq/vim-9.0.1653
vim-patch:9.0.{1653,1654},9.1.{0721,1317}
2025-04-18 08:30:21 +08:00
zeertzjq
e2e6c159d3 vim-patch:9.1.1317: noisy error when restoring folds from session fails
Problem:  noisy error when restoring folds from session fails
Solution: ignore errors silently when sourcing session file.
          (Igor Lacerda)

fixes: vim/vim#15813
closes: vim/vim#17127

cca5dea76e

Co-authored-by: Igor Lacerda <igorlfs@ufmg.br>
2025-04-18 08:11:41 +08:00
zeertzjq
0eb708aa8a vim-patch:9.1.0721: tests: test_mksession does not consider XDG_CONFIG_HOME
Problem:  tests: test_mksession does not consider XDG_CONFIG_HOME
Solution: allow to match $HOME/.vim/ and $HOME/.config/vim for &viewdir
          (John M Devin)

closes: vim/vim#15639

5b9237c2e7

Co-authored-by: John M Devin <john.m.devin@gmail.com>
2025-04-18 08:11:41 +08:00
zeertzjq
bd0555ecd4 vim-patch:9.0.1654: MS-Windows: test for default 'viewdir' fails
Problem:    MS-Windows: test for default 'viewdir' fails.
Solution:   Escape the pattern.

813b7a85f2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-04-18 08:11:41 +08:00
zeertzjq
827cfe4a76 vim-patch:9.0.1653: Amiga: default 'viewdir' may not work
Problem:    Amiga: default 'viewdir' may not work.
Solution:   Use "home:" instead of "$VIM". Add a test. (Christian Brabandt,
            closes vim/vim#12576)

b8b1c8ebd4

Cherry-pick Test_mkview_manual_fold() changes from 9.0.{0363,0626}.

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-04-18 08:11:35 +08:00
zeertzjq
b4c759716a vim-patch:9.1.1315: completion: issue with fuzzy completion and 'completefuzzycollect' (#33520)
Problem:  chain complete does not work when 'cot' includes fuzzy
          and 'completefuzzycollect' collects wrong next word.
          (Konfekt)
Solution: compl_startpos is not set correctly, remove next word check
          in search_for_fuzzy_match (glepnir).

fixes vim/vim#17131
fixes vim/vim#16942
closes: vim/vim#17136

cfe502c575

Co-authored-by: glepnir <glephunter@gmail.com>
2025-04-18 07:22:50 +08:00
Au.
6926fc1615 fix(lsp): opts.reuse_win does not jump if buf is already open #33476
Problem:
`vim.lsp.buf.[implementation|definition|...]({ reuse_win = true })` does not
jump cursor to existing window if buffer is already open.

Steps to reproduce:
1. `nvim repro.lua`
2. Insert anything that lsp can read to open the library definition/implementation, e.g., `vim.keymap.set`
3. open `repro.lua` buffer and the library buffer side by side.
4. type `gd` over `set` to jump to the library definition.

The open buffer is scrolled to the target line, but cursor does not jump.

Solution:
Call nvim_set_current_win if necessary.
2025-04-17 07:46:18 -07:00
Lewis Russell
2fcdeb0128 refactor(lsp): gen_lsp
- Simplify usage:
  - Instead of `nvim -l src/gen/gen_lsp.lua gen` now just
    run `./src/gen/gen_lsp.lua`

- Removed `--methods` and `--capabilities` options.

- Improved rendering code in various areas.
2025-04-17 15:44:46 +01:00
Lewis Russell
d7e0d46ffa feat(lsp): use stricter types for methods
This change modifies gen_lsp.lua so alias types are generated for
various types of lsp methods to distinguish between notifications
and requests:
 - vim.lsp.protocol.Method.ServerToClient.Request
 - vim.lsp.protocol.Method.ServerToClient.Notification
 - vim.lsp.protocol.Method.ClientToServer.Request
 - vim.lsp.protocol.Method.ClientToServer.Notification

 These types are then used instead of `string` where appropriate.
2025-04-17 11:40:45 +01:00
Christian Clason
34b4df774d vim-patch:fbbaa6e: runtime: set 'cpoptions' for line-continuation in various runtime files
closes: vim/vim#17121

fbbaa6ebe9

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-04-17 09:25:41 +02:00
Christian Clason
5aa35691ab vim-patch:40daa13: runtime(gleam): Update ftplugin, use recommended_style config variable
Wrap the setting of basic whitespace formatting options in a conditional
block, following the de facto standard.

Setting 'et', 'sts' and 'sw' can be disabled by setting
"gleam_recommended_style" to false.

Follow up to PR vim/vim#17086.

closes: vim/vim#17128

40daa1358c

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-04-17 09:25:41 +02:00
zeertzjq
95a255a548 vim-patch:9.1.1312: tests: Test_backupskip() fails when HOME is defined (#33504)
Problem:  tests: Test_backupskip() fails when HOME is defined
Solution: unset $HOME temporarily

ad503fe927

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-04-17 07:44:42 +08:00
zeertzjq
f9f6dc4262 vim-patch:9.1.1310: completion: redundant check for preinsert effect (#33505)
Problem:  Duplicate check for preinsert effect, particularly for Ctrl_w
          and Ctrl_U.
Solution: Remove the specific check for Ctrl_w and Ctrl_U to eliminate
          redundancy (glepnir).

closes: vim/vim#17129

1c2b258250

Co-authored-by: glepnir <glephunter@gmail.com>
2025-04-16 23:44:12 +00:00
zeertzjq
e3e8dfe99c vim-patch:9.1.1307: make syntax does not reliably detect different flavors (#33498)
Problem:  GNU extensions, such as `ifeq` and `wildcard` function, are
          highlighted in BSDmakefile
Solution: detect BSD, GNU, or Microsoft implementation according to
	  filename, user-defined global variables, or file contents

closes: vim/vim#17089

f35bd76b31

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Co-authored-by: Roland Hieber <rohieb@users.noreply.github.com>
2025-04-17 07:13:05 +08:00
zeertzjq
95e29dab70 Merge pull request #33383 from zeertzjq/vim-9.1.1284
vim-patch:9.1.{1262,1284,1296,1306,1309}
2025-04-17 07:05:19 +08:00
zeertzjq
afca5b564e vim-patch:9.1.1309: tests: no test for 'pummaxwidth' with non-truncated "kind"
Problem:  tests: no test for 'pummaxwidth' with non-truncated "kind".
Solution: Add a test with "kind" and larger 'pummaxwidth' (zeertzjq).

closes: vim/vim#17126

031919c7ac
2025-04-17 06:46:34 +08:00
zeertzjq
54d6055098 vim-patch:9.1.1306: completion menu rendering can be improved
Problem:  Parts of the popup menu were rendered twice when the popup was
          at maximum width because the truncation flag was being set too
          liberally.
Solution: Make the truncation condition more precise by only setting it
          when there's exactly one character of space remaining
          (glepnir).

closes: vim/vim#17108

32f2bb6e1e

Co-authored-by: glepnir <glephunter@gmail.com>
2025-04-17 06:46:34 +08:00
zeertzjq
6e5671b00d vim-patch:9.1.1296: completion: incorrect truncation logic
Problem:  completion: incorrect truncation logic (after: v9.1.1284)
Solution: replace string allocation with direct screen rendering and
          fixe RTL/LTR truncation calculations (glepnir)

closes: vim/vim#17081

d4dbf822dc

Co-authored-by: glepnir <glephunter@gmail.com>
2025-04-17 06:46:34 +08:00
zeertzjq
1c723b2e6f vim-patch:9.1.1284: not possible to configure pum truncation char
Problem:  not possible to configure the completion menu truncation
          character
Solution: add the "trunc" suboption to the 'fillchars' setting to
          configure the truncation indicator (glepnir).

closes: vim/vim#17006

b87620466c

Co-authored-by: glepnir <glephunter@gmail.com>
2025-04-17 06:46:34 +08:00
zeertzjq
b64c2d763e vim-patch:9.1.1262: heap-buffer-overflow with narrow 'pummaxwidth' value
Problem:  heap-buffer-overflow occurs with narrow 'pummaxwidth' value
          (after v9.1.1250)
Solution: test that st_end points after st pointer (Hirohito Higashi)

closes: vim/vim#17005

f13c856154

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-04-17 06:46:32 +08:00
yuukibarns
284b0e4fa2 fix(treesitter): fix :InspectTree incorrect injections 2025-04-16 15:03:28 +01:00
Justin M. Keyes
223ac7782e fix(vim.system): unclear non-executable message #33455
Problem:
When a command is not found or not executable, the error message gives
no indication about what command was actually tried.

Solution:
Always append the command name to the error message.

BEFORE:

    E5108: Error executing lua …/_system.lua:248: ENOENT: no such file or directory

AFTER:

    E5108: Error executing lua …/_system.lua:249: ENOENT: no such file or directory: "foo"

fix #33445
2025-04-16 05:06:39 -07:00
Judit Novak
fd973c0a4e fix(env.c): drop envmap, free os_getenv() result #32683
Problem:
vim.uv.os_setenv gets "stuck" per-key. #32550
Caused by the internal `envmap` cache. #7920

    :echo $FOO  <-- prints nothing
    :lua vim.uv.os_setenv("FOO", "bar")
    :echo $FOO  <-- prints bar (as expected)
    :lua vim.uv.os_setenv("FOO", "fizz")
    :echo $FOO  <-- prints bar, still (not expected. Should be "fizz")
    :lua vim.uv.os_unsetenv("FOO")
    :echo $FOO  <-- prints bar, still (not expected. Should be nothing)
    :lua vim.uv.os_setenv("FOO", "buzz")
    :echo $FOO  <-- prints bar, still (not expected. Should be "buzz")

Solution:
- Remove the `envmap` cache.
  - Callers to `os_getenv` must free the result.
- Update all call-sites.
- Introduce `os_getenv_noalloc`.
- Extend `os_env_exists()` the `nonempty` parameter.
2025-04-16 03:36:07 -07:00
Dmitry Torokhov
7432781e71 fix(mouse): do not fetch clipboard twice when pasting with middle button #33494
Problem:
When doing paste operation mouse code tries to figure out it it is
dealing with a multi-line register by calling yank_register_mline(),
which fetches register data and checks its type. Later the code calls
either do_put() or insert_reg() which fetch register data again. This is
unnoticeable when working with internal neovim registers, but starts
hurting when dealing with clipboards, especially remote one (forwarded X
or socket tunnel or similar).

Solution:
Change yank_register_mline() to also return pointer to the
register structure prepared for pasting, and insert_reg() to accept
such register pointer and use it if it is supplied. do_put() already
has support for accepting a register structure to be used for pasting.

Fixes #33493
2025-04-16 03:08:41 -07:00
Eisuke Kawashima
07d06dd396 docs(man): fix mandoc warnings, prettify #33484
Problem:
mandoc warnings:

    $ cd src/man
    $ mandoc -Tlint -Wall nvim.1
    mandoc: nvim.1:83:95: STYLE: input text line longer than 80 bytes: Remaining arguments ...
    mandoc: nvim.1:251:8: WARNING: undefined escape, printing literally: \+
    mandoc: nvim.1:283:46: WARNING: new sentence, new line
    mandoc: nvim.1:330:115: STYLE: input text line longer than 80 bytes: When supplied with -...
    mandoc: nvim.1:44:2: WARNING: skipping paragraph macro: Pp before Bl
    mandoc: nvim.1:114:7: STYLE: no blank before trailing delimiter: Ic :w!
    mandoc: nvim.1:313:12: STYLE: no blank before trailing delimiter: Ic :source!

Solution:
- wrap text lines (80 at maximum)
- new sentence, new line
- fix inconsistency in macro usage

see
- mandoc_char(7)
- mandoc_man(7)
- mandoc_mdoc(7)

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-04-16 03:03:36 -07:00
zeertzjq
1de276bbcd vim-patch:9.1.1308: completion: cannot order matches by distance to cursor (#33491)
Problem:  During insert-mode completion, the most relevant match is often
          the one closest to the cursor—frequently just above the current line.
          However, both `<C-N>` and `<C-P>` tend to rank candidates from the
          current buffer that appear above the cursor near the bottom of the
          completion menu, rather than near the top. This ordering can feel
          unintuitive, especially when `noselect` is active, as it doesn't
          prioritize the most contextually relevant suggestions.

Solution: This change introduces a new sub-option value "nearest" for the
          'completeopt' setting. When enabled, matches from the current buffer
          are prioritized based on their proximity to the cursor position,
          improving the relevance of suggestions during completion
          (Girish Palya).

Key Details:
- Option: "nearest" added to 'completeopt'
- Applies to: Matches from the current buffer only
- Effect: Sorts completion candidates by their distance from the cursor
- Interaction with other options:
  - Has no effect if the `fuzzy` option is also present

This feature is helpful especially when working within large buffers where
multiple similar matches may exist at different locations.

You can test this feature with auto-completion using the snippet below. Try it
in a large file like `vim/src/insexpand.c`, where you'll encounter many
potential matches. You'll notice that the popup menu now typically surfaces the
most relevant matches—those closest to the cursor—at the top. Sorting by
spatial proximity (i.e., contextual relevance) often produces more useful
matches than sorting purely by lexical distance ("fuzzy").

Another way to sort matches is by recency, using an LRU (Least Recently Used)
cache—essentially ranking candidates based on how recently they were used.
However, this is often overkill in practice, as spatial proximity (as provided
by the "nearest" option) is usually sufficient to surface the most relevant
matches.

```vim
set cot=menuone,popup,noselect,nearest inf

def SkipTextChangedIEvent(): string
    # Suppress next event caused by <c-e> (or <c-n> when no matches found)
    set eventignore+=TextChangedI
    timer_start(1, (_) => {
        set eventignore-=TextChangedI
    })
    return ''
enddef

autocmd TextChangedI * InsComplete()

def InsComplete()
    if getcharstr(1) == '' && getline('.')->strpart(0, col('.') - 1) =~ '\k$'
        SkipTextChangedIEvent()
        feedkeys("\<c-n>", "n")
    endif
enddef

inoremap <silent> <c-e> <c-r>=<SID>SkipTextChangedIEvent()<cr><c-e>

inoremap <silent><expr> <tab>   pumvisible() ? "\<c-n>" : "\<tab>"
inoremap <silent><expr> <s-tab> pumvisible() ? "\<c-p>" : "\<s-tab>"
```

closes: vim/vim#17076

b156588eb7

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-04-16 02:48:08 +00:00
zeertzjq
b0f97177d4 vim-patch:9.1.1305: completion menu active after switching windows/tabs (#33488)
Problem:  When switching to another window or tab page while the
          completion menu is active, the menu stays visible, although it
          belongs to the previous window/tab page context (Evgeni
          Chasnovski).
Solution: Track the window and tab page where completion started. Detect
          changes in the main editing loop and cancel completion mode if
          the current window or tab page differs from where completion
          started.

fixes: vim/vim#17090
closes: vim/vim#17101

cf7f01252f

Co-authored-by: glepnir <glephunter@gmail.com>
2025-04-16 07:50:08 +08:00
zeertzjq
d2d1b5e944 vim-patch:9.1.1303: missing out-of-memory check in linematch.c (#33487)
Problem:  missing out-of-memory check in linematch.c
Solution: return early in case of memory allocation failure, move the
          pow() calculation ouside of the for() loop
          (John Marriott)

closes: vim/vim#17118

2137710b43

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-04-16 06:47:51 +08:00
João Bettencourt
5333d6371b fix(man.lua): E95 when piping to :Man #33068
Problem: When piping raw manpage content into `:Man!`, buf name is
set to 'man://.. ref', but the check only matches the prefix.
Allows duplicate buffers to be created, triggering E95.

Solution: Match full buf name instead of only 'man://' prefix.
If the buffer already exists, generate a unique name with
'man://' .. 'ref' .. '?new=' format.

Refs: #30132
2025-04-15 06:27:51 -07:00
bfredl
07b33c3266 Merge pull request #31837 from fredizzimo/multigrid-composition
feat(ui): include compositor info with multigrid
2025-04-15 11:56:39 +02:00
Fred Sundvik
f29856d034 feat(ui): include compositor info with multigrid
Provide compositor information, like composition index and absolute
position.
2025-04-15 10:52:57 +02:00
Phạm Bình An
c58c650adf vim-patch:829eda7: runtime(new-tutor): update tutor and correct comandline completion (#33449)
Problem: Some parts of the tutor are outdated.

- For example, pressing `<Tab>` after typing `:e` does not complete the
command `:edit`, but shows a completion menu with the first entry being
`:earlier`.

closes: vim/vim#17107

829eda7d38
2025-04-15 15:11:17 +08:00
zeertzjq
9272dc9597 vim-patch:9.1.1300: wrong detection of -inf (#33474)
Problem:  wrong detection of -inf
Solution: correctly compare 4 characters and not 3
          (John Marriott)

closes: vim/vim#17109

10f69298b4

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-04-15 08:58:00 +08:00
luukvbaal
3341ab0776 fix(marks): clamp conceal_lines corrected line number #33464
Problem:  Line number corrected for conceal_lines may be set beyond eob
          when the last buffer line is concealed, causing ml_get errors.

Solution: Avoid setting line number beyond eob.
2025-04-14 04:19:07 -07:00
luukvbaal
aa47c8efa9 vim-patch:9.1.1297: Ctrl-D scrolling can get stuck #33453
Problem:  cursor_correct() calculates a valid cursor position which
	  is later changed by update_topline() and causes Ctrl-D
          scrolling to be stuck (Daniel Steinberg, after v9.1.0258).
Solution: Update the valid cursor position before validating topline
          (Luuk van Baal).

c98250377d
2025-04-14 04:10:36 -07:00
Christian Clason
287955cfb4 vim-patch:9.1.1299: filetype: mbsyncrc files are not recognized
Problem:  filetype: mbsyncrc files are not recognized
Solution: detect isyncrc and "*.mbsyncrc" files as mbsync filetype,
          include filetype and syntax plugin (Pierrick Guillaume)

mbsync is a command line application which synchronizes mailboxes;
currently Maildir and IMAP4 mailboxes are supported.
New messages, message deletions and flag changes can be propagated both ways;
the operation set can be selected in a fine-grained manner.

References:
mbsync syntax overview: mbsync manual (isync v1.4.4)
https://isync.sourceforge.io/mbsync.html

Upstream support for the mbsync filetype.
Original plugin: https://github.com/Fymyte/mbsync.vim

closes: vim/vim#17103

836b87d699

Co-authored-by: Pierrick Guillaume <pguillaume@fymyte.com>
2025-04-14 09:47:56 +02:00
zeertzjq
2d6120240d vim-patch:3cbd7f1: runtime(gleam): update Maintainer and filetype options (#33461)
closes: vim/vim#17086

3cbd7f18e3

Co-authored-by: Kirill Morozov <kirill@robotix.pro>
2025-04-14 15:41:58 +08:00
zeertzjq
51caf0a3af fix(completion): avoid freeing uninitialized value (#33459) 2025-04-14 05:02:58 +00:00
zeertzjq
fd76646a95 vim-patch:9.1.1298: define_function() is too long (#33457)
Problem:  define_function() is too long
Solution: refactor and split up into smaller functions
          (Yegappan Lakshmanan)

closes: vim/vim#17105

3956c5b53c

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2025-04-14 02:07:36 +00:00
zeertzjq
ec9931fae1 Merge pull request #33456 from zeertzjq/vim-eded336
vim-patch: improve 'wildmode' description
2025-04-14 08:44:35 +08:00
zeertzjq
0f4623d346 vim-patch:f4b1a60: runtime(doc): update options.txt and clarify 'wildmode' further
related: vim/vim#17100

f4b1a60dd1

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Girish Palya <girishji@gmail.com>
2025-04-14 08:22:29 +08:00
zeertzjq
52be3b14e3 vim-patch:eded336: runtime(doc): Improve 'wildmode' setting desciption
closes: vim/vim#17100

eded33621b

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-04-14 08:21:33 +08:00
luukvbaal
2f8fb4f28a fix(mouse): mouseclick after conceal_lines is miscalculated #33451
Problem:  Computed buffer line for mouse position does not take into
          account concealed lines on the reached row.

Solution: Adjust for concealed lines at the end of the loop computing
          the buffer position.
2025-04-13 14:30:24 -07:00
Riley Bruins
0977f70f4d fix(treesitter): injected lang ranges may cross capture boundaries #32549
Problem:
treesitter injected language ranges sometimes cross over the capture
boundaries when `@combined`.

Solution:
Clip child regions to not spill out of parent regions within
languagetree.lua, and only apply highlights within those regions in
highlighter.lua.


Co-authored-by: Cormac Relf <web@cormacrelf.net>
2025-04-13 14:22:17 -07:00
zeertzjq
ee3f9a1e03 vim-patch:6f6c0db: runtime(doc): disable last-position-jump in diff mode (#33442)
This has been bothering me quite for some time and I never knew why it
happened. Just today it occurred to me this might have been because of
the last-position-jump.

So I figured, let's fix it for everybody, not just me.

closes: vim/vim#17092

6f6c0dba9f

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-04-13 00:36:28 +00:00
dundargoc
0814086a23 docs: misc (#33093)
Co-authored-by: Jx <JxJxxJxJ@github.com>
Co-authored-by: Richard Dzenis <richard@dzenis.dev>
Co-authored-by: Shixian Sheng <shixian_sheng-2@protonmail.com>
Co-authored-by: Sourabh Kumar <sourabh7.tech@gmail.com>
Co-authored-by: Yegor Yefremov <yegorslists@googlemail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-04-13 07:41:54 +08:00
Riley Bruins
60af1a1db2 fix(treesitter): clear parse options state #33437
Apparently after parsing with options in tree-sitter, the options data
persists in the parser object, and thus successive calls to
`ts_parser_parse()` will act like `ts_parser_parse_with_options()`. This
is problematic because `languagetree.lua` makes coroutine-environment
assumptions based on if a nullptr has been returned by the parser
function. This commit makes it so that the parse options state is reset
upon a regular parse (would be nice if this was done upstream).

Fixes #33277
2025-04-12 15:51:29 -07:00
Emanuel Krollmann
b8763cb215 fix(man.lua): useless executability check #33438
Problem:
executability check using `uv.fs_access`
doesn't work currently and can't work on windows

Solution:
only check for executable with `vim.fn.executable`
2025-04-12 15:50:04 -07:00
Emanuel Krollmann
a8dd5c7e41 fix(man.lua): noisy "ENOENT" error on Windows #33409
Problem:
:Man shows noisy "ENOENT: no such file or directory" error on Windows.

Solution:
Do some checks before calling `vim.system`.
2025-04-12 10:54:20 -07:00
Justin M. Keyes
74ca73d545 docs: misc #33330 2025-04-12 10:21:03 -07:00
Alexej Kowalew
d77d961b35 feat(defaults): shelltemp=false #33012
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-04-12 08:24:42 -07:00
zeertzjq
c8fbb0d2ee vim-patch:ab2fe65: runtime(doc): correct backslash escaping comma example (#33433)
closes: vim/vim#17096

ab2fe65fbf

Co-authored-by: Qiming zhao <chemzqm@gmail.com>
2025-04-12 10:08:57 +00:00
luukvbaal
4a706a7092 fix(column): don't count signs on lines beyond eob #33410
Problem:  Computed previous buffer line count may be beyond end of
          buffer. This results in signs being removed from `b_signcols`
          that were never included in it, tripping an assertion.

Solution: Store the previous line count as it was before appending or
          deleting lines. Use it to clamp the edited region when
          clearing signs before a splice, after which it is reset.
2025-04-11 04:46:55 -07:00
luukvbaal
064ff74cdb fix(marks): wrong display after inserting/deleting lines #33389
Problem:  Lines to/from which virt_lines or inline virt_text may have
          moved are left valid. Similarly the modified region may be
          too small to account for moved decorations after inserting
          or deleting lines. `redrawOneLine()` can be replaced with
          a call to `changed_lines_redraw_buf()`.

Solution: Invalidate the line after a change if there is virt_lines, or
          inline virt_text in the buffer with 'wrap' enabled. Extend the
          modified region for inserted or deleted lines if there may be
          decorations in the buffer. Remove `redrawOneLine()`.
          Simplify the logic for `changed_lines_invalidate_win()`.

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-04-11 04:36:49 -07:00
Christian Clason
5111d66ac9 build(deps): bump luajit to 51d4c26ec (#33422)
* ARM: Fix soft-float math.min()/math.max().
* ARM64: Fix pass-by-value struct calling conventions.
2025-04-11 12:47:50 +02:00
Phạm Bình An
092962b07c fix(vim.version): vim.VersionRange:has(<prerelease>) (#33324)
Problem:
`vim.version.range('>=0.10'):has('0.12.0-dev')` returns false, which is
wrong per semver.

Solution:
`vim.VersionRange:has()` shouldn't have special handling for prereleases
(Why would we need it when `__eq`, `__lt`, `__le` already handle
 prereleases?).

Closes #33316
2025-04-11 03:15:18 -07:00
zeertzjq
6a728382f9 vim-patch:06a41ad: runtime(keymaps): include 2 Brazilian Keymaps (#33424)
closes: vim/vim#17072

06a41ad084

Co-authored-by: Elsarques <luismarques0504@proton.me>
2025-04-11 08:56:23 +00:00
zeertzjq
3aa833e0d9 vim-patch:5c84d12: runtime(filetype): make shell filetype detection more robust (#33421)
closes: vim/vim#17063

5c84d12df1

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2025-04-11 16:45:14 +08:00
zeertzjq
7c15987444 vim-patch:9.1.1290: tests: missing cleanup in test_filetype.vim (#33420)
Problem:  tests: missing cleanup in test_filetype.vim, wrong name in
          test_plugin_matchparen
Solution: Add :bwipe corresponding to :split, rename test case

closes: vim/vim#17088

b0e19f9e1b
2025-04-11 08:10:50 +08:00
zeertzjq
dc00b37965 vim-patch:9.1.1212: filetype: logrotate'd pacmanlogs are not recognized (#33412)
Problem:  filetype: logrotate'd pacmanlogs are not recognized
Solution: also detect pacman.log* files as pacmanlog filetype,
          remove BufNewFile autocmd (Eisuke Kawashima)

closes: vim/vim#16873

20d23ce93b

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-04-10 16:20:22 +08:00
Christian Clason
0ee5a4d481 feat(meta): vendor luv meta files
Problem: No type information for `vim.uv`.

Solution: Vendor https://github.com/LuaCATS/luv (which is what
luals bundles). This will allow other tooling to work out-of-the-box and
make these files available to users and plugins without the need for
`lazydev.nvim` etc.
2025-04-10 09:13:13 +02:00
Christian Clason
627d0a2b32 vim-patch:f9f53f5: runtime(remind): include remind.vim ftplugin
closes: vim/vim#17085

f9f53f5a8f

Co-authored-by: Joe Reynolds <joereynolds952@gmail.com>
2025-04-10 09:12:57 +02:00
zeertzjq
51a967d58a vim-patch:9.1.1289: tests: no test for matchparen plugin with WinScrolled event (#33411)
Problem:  tests: no test for matchparen plugin with WinScrolled event
Solution: add missing test

closes: vim/vim#10942

96a0b2a6d5

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-04-10 00:46:49 +00:00
Phạm Bình An
f908fe4462 vim-patch:0b540c6: runtime(help): add omni completion and 'iskeyword' to filetype plugin (#33398)
Problem:

- Help tags provide a good way to navigate the Vim documentation, but
  many help documents don't use them effectively. I think one of the
  reasons is that help writers have to look up help tags manually with
  `:help` command, which is not very convenient.
- 'iskeyword' is only set for help buffers opened by `:help` command.
  That means if I'm editing a help file, I cannot jump to tag in same
  file using `Ctrl-]` unless I manually set it, which is annoying.

Solution:

- Add omni completion for Vim help tags.
- Set 'iskeyword' for `ft-help`

closes: vim/vim#17073

0b540c6f38

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-04-10 07:36:30 +08:00
Siddhant Agarwal
f068386c9f fix(lsp): "bold" border for vim.lsp.buf.hover #33395
Problem: vim.lsp.buf.hover allows a bold border size which hasn't been
defined

Solution: Define the bold border size for vim.lsp.buf.hover
2025-04-09 04:15:33 -07:00
Yochem van Rosmalen
5a94edad70 feat(health): summary in section heading #33388
Problem:
As checkhealth grows, it is increasingly hard to quickly glance through
the information.

Solution:
Show a summary of ok, warn, and error outputs per section.
2025-04-09 04:13:20 -07:00
Christian Clason
ff2cbe8fac vim-patch:7517a8c: runtime(lf): improve syntax script, add filetype plugin
- Greatly improve detection and highlighting of command/shell regions,
  input-device key labels, escape sequences (@joelim-work)
- Add ftplugin for formatoptions, toggling comment areas
  (@andis-sprinkis)
- Add a few missing lf option keywords, rm. old non-working code, misc.
  formatting (@andis-sprinkis)

closes: vim/vim#17078

7517a8cadf

Co-authored-by: Andis Spriņķis <andis@sprinkis.com>
2025-04-09 10:14:27 +02:00
zeertzjq
c73a827564 vim-patch:9.1.1288: Using wrong window in ll_resize_stack() (#33397)
Problem:  Using wrong window in ll_resize_stack()
          (after v9.1.1287)
Solution: Use "wp" instead of "curwin", even though they are always the
          same value.  Fix typos in documentation (zeertzjq).

closes: vim/vim#17080

b71f1309a2
2025-04-09 07:40:55 +08:00
jyn
3647b821ea fix(editor): respect [+cmd] when executing :drop #33339
Problem:
Normally, `:drop +41 foo.txt` will open foo.txt with the cursor on line
41. But if foo.txt is already open, it instead is a no-op, even if the
cursor is on a different line.

Steps to reproduce:

    nvim --clean foo.txt
    :drop +30 foo.txt

Solution:
Handle +cmd in ex_drop().
2025-04-08 05:54:32 -07:00
luukvbaal
5b1561bb71 fix(display): scroll redrawing doesn't account for virt_lines above fold #33374
Problem:  Logic computing the new height of the modified area does not
          take into account virtual lines attached to a folded line.

Solution: Remove `hasFolding()` branch and let `plines_win_full()` do its job.
2025-04-08 05:47:18 -07:00
zeertzjq
c0f46daca5 Merge pull request #33381 from zeertzjq/vim-9.1.1283
vim-patch:9.1.{1253,1283,1287}
2025-04-08 13:24:43 +08:00
zeertzjq
454abde1aa vim-patch:9.1.1287: quickfix code can be further improved
Problem:  quickfix code can be further improved (after v9.1.1283)
Solution: slightly refactor quickfix.c (Hirohito Higashi)

- remove error message output
- adjust comments
- rename functions:
  - qf_init_quickfix_stack() --> qf_init_stack()
  - qf_resize_quickfix_stack() --> qf_resize_stack()
  - qf_resize_stack() --> qf_resize_stack_base()

Now qf_alloc_stack() can handle both quickfix/location lists.

closes: vim/vim#17068

adcfb6caeb

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-04-08 13:06:20 +08:00
zeertzjq
00eff4b196 vim-patch:9.1.1283: quickfix stack is limited to 10 items
Problem:  quickfix and location-list stack is limited to 10 items
Solution: add the 'chistory' and 'lhistory' options to configure a
          larger quickfix/location list stack
          (64-bitman)

closes: vim/vim#16920

88d41ab270

Co-authored-by: 64-bitman <60551350+64-bitman@users.noreply.github.com>
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-04-08 13:06:19 +08:00
zeertzjq
36d143e707 vim-patch:9.1.1253: abort when closing window with attached quickfix data
Problem:  If win_close() is called with a window that has quickfix stack
          attached to it, the corresponding quickfix buffer will be
          closed and freed after the buffer was already closed. At that
          time curwin->w_buffer points to NULL, which the CHECK_CURBUF
          will catch and abort if ABORT_ON_ERROR is defined
Solution: in wipe_qf_buffer() temporarily point curwin->w_buffer back to
          curbuf, the window will be closed anyhow, so it shouldn't
          matter that curbuf->b_nwindows isn't incremented.

closes: vim/vim#16993
closes: vim/vim#16985

ce80c59bfd

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-04-08 13:06:19 +08:00
zeertzjq
8af9f8ab5e vim-patch:9.1.1286: filetype: help files not detected when 'iskeyword' includes ":" (#33377)
Problem:  Help files not detected when 'iskeyword' includes ":".
Solution: Do not use \< and \> in the pattern (zeertzjq).

fixes: vim/vim#17069
closes: vim/vim#17071

e370141bf4
2025-04-08 00:13:12 +00:00
zeertzjq
1ffc7d6bf8 vim-patch:2ffb4d0: runtime(lua): fix whitespace style issues in lua ftplugin (#33378)
related: vim/vim#17049

2ffb4d0298

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-04-08 08:07:26 +08:00
Christian Clason
2c960e8f04 ci(deps): bump lua-language-server to 3.14.0 2025-04-07 17:30:08 +02:00
luukvbaal
ca16b54c86 fix(decor): enable decoration provider in on_start #33337
Problem:  An on_win-disabled decoration provider is left disabled for
          the on_buf callback during the next redraw (if the provider
          does not subscribe to on_end).

Solution: Move re-activation of the provider from after the on_end
          callback to before the on_start callback.
2025-04-07 03:58:18 -07:00
Dmitry Zolotukhin
cf59631f65 fix(treesitter): not refreshing virtualtext contents #33361
Problem: In some cases, when treesitter is enabled, deleting a
line below virtualtext will not refresh all updated lines.
https://github.com/neovim/neovim/issues/33358

Solution: Revert a part of https://github.com/neovim/neovim/pull/31324
to ensure that the full range (with virtual lines) is refreshed.
2025-04-07 03:56:40 -07:00
Maria José Solano
666a82374d docs: PR template #33109 2025-04-07 03:15:55 -07:00
Christian Clason
12720e929d build(deps): bump luajit to e0a7ea8a9 2025-04-07 12:01:45 +02:00
Felipe Lema
bd37348939 fix(health): expecting nonexistent "inotifywait" function #33312
Problem:
55e4301036 changed the program name but not the function name.

Solution:
Fix the healthcheck.
2025-04-07 02:13:05 -07:00
Emanuel Krollmann
3ebde5ea14 fix(defaults): keywordprg=:help on Windows #33336
Problem:
As `:h kp` says, the default value for keywordprg
should be ':help' on Windows. It is currently
always ':Man'.

Solution:
Add condition to options.lua which sets keywordprg
to ':help' if running on windows.
2025-04-07 02:07:31 -07:00
Christian Clason
1e9e523521 vim-patch:00b927b: runtime(lua): improve foldexpr, add vim9 script version
closes: vim/vim#17049

00b927b295

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2025-04-07 10:19:00 +02:00
Christian Clason
5e192dbce2 vim-patch:9cd6d82: runtime(fstab): set formatoptions-=t in filetype plugin
closes: vim/vim#17020

9cd6d82fbb

Co-authored-by: Radu Dineiu <radu.dineiu@gmail.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-04-07 10:19:00 +02:00
Christian Clason
1867f2a830 vim-patch:9adb310: runtime(svelte): add matchit support to svelte filetype plugin
closes: vim/vim#17052

9adb310cf3

Co-authored-by: 231tr0n <zeltronsrikar@gmail.com>
2025-04-07 10:19:00 +02:00
dependabot[bot]
2d11b981bf ci: bump actions/create-github-app-token from 1 to 2
Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 1 to 2.
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Commits](https://github.com/actions/create-github-app-token/compare/v1...v2)

---
updated-dependencies:
- dependency-name: actions/create-github-app-token
  dependency-version: '2'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-06 11:20:06 +02:00
Justin M. Keyes
fece489794 refactor(lsp): deprecate client_is_stopped #33342
Problem:
`client_is_stopped(…)` is an alias for `not get_client_by_id(…)`.
And it's not used anywhere in our codebase.

Solution:
Deprecate it.
2025-04-06 02:13:13 +00:00
phanium
28e8190185 fix(vim.hl): nvim_buf_del_extmark on invalid buffer #33331
Problem:
nvim_buf_del_extmark error if buffer is destroyed before timer stops

Solution:
check nvim_buf_is_valid.
2025-04-05 15:56:40 -07:00
Justin M. Keyes
f9dec1228d build: bump NVIM_API_LEVEL #33340
Bumping NVIM_API_LEVEL is pretty much required after every major
release, because it's also used to correlated Lua stdlib changes to
a Nvim version.
2025-04-05 22:48:28 +00:00
Justin M. Keyes
57d99a515f docs: clipboard, eval #33223 2025-04-05 06:01:40 -07:00
zeertzjq
e8785c2e94 vim-patch:9.1.1276: inline word diff treats multibyte chars as word char (#33323)
Problem:  inline word diff treats multibyte chars as word char
          (after 9.1.1243)
Solution: treat all non-alphanumeric characters as non-word characters
          (Yee Cheng Chin)

Previously inline word diff simply used Vim's definition of keyword to
determine what is a word, which leads to multi-byte character classes
such as emojis and CJK (Chinese/Japanese/Korean) characters all
classifying as word characters, leading to entire sentences being
grouped as a single word which does not provide meaningful information
in a diff highlight.

Fix this by treating all non-alphanumeric characters (with class number
above 2) as non-word characters, as there is usually no benefit in using
word diff on them. These include CJK characters, emojis, and also
subscript/superscript numbers. Meanwhile, multi-byte characters like
Cyrillic and Greek letters will still continue to considered as words.

Note that this is slightly inconsistent with how words are defined
elsewhere, as Vim usually considers any character with class >=2 to be
a "word".

related: vim/vim#16881 (diff inline highlight)
closes: vim/vim#17050

9aa120f7ad

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-04-05 09:42:00 +08:00
zeertzjq
1e1384b6dd vim-patch:b8d5c85: runtime(doc): update WinScrolled documentation (#33322)
closes: vim/vim#17036

b8d5c85099

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-04-05 08:02:32 +08:00
Lewis Russell
a8edf6e445 feat(lsp.util): deprecate vim.lsp.util.stylize_markdown
It's not used anywhere.
2025-04-04 14:34:33 +01:00
Lewis Russell
379c37fa0b fix: bug in stylize_markdown
`stripped` and `markdown_lines` are iterated together so must have the same length.
2025-04-04 14:33:50 +01:00
luukvbaal
98f5aa2564 fix(messages): verbose message emitted without kind #33305
Problem:  Successive autocmd verbose messages may be emitted without a kind.

Solution: Always set the kind when preparing to emit a verbose message.
2025-04-04 05:24:17 -07:00
Yochem van Rosmalen
b10cb0296a feat(defaults): store spellfile in stdpath('data') #33048
Problem:
First rtp directory is unpredictable and not in line with XDG
base spec.

Solution:
Use stdpath('data')/spell as directory if 'spellfile' is not set.

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-04-04 05:21:57 -07:00
Christian Clason
4983fa45fc vim-patch:9.1.1271: filetype: Power Query files are not recognized
Problem:  filetype: Power Query files are not recognized
Solution: detect '*.pq' as pq filetype, include pq syntax and filetype
          plugin (Anarion Dunedain)

Microsoft Power Query provides a powerful data import experience that
encompasses many features. Power Query works with desktop Analysis
Services, Excel, and Power BI workbooks, in addition to many online
services, such as Fabric, Power BI service, Power Apps, Microsoft 365
Customer Insights, and more. A core capability of Power Query is to
filter and combine, that is, to mash-up data from one or more of a rich
collection of supported data sources. Any such data mashup is expressed
using the Power Query M formula language. The M language is a
functional, case sensitive language similar to F#.

Reference:
- Power Query M formula language overview:
  https://learn.microsoft.com/en-us/powerquery-m/

closes: vim/vim#17045

e74ec3f523

Co-authored-by: Anarion Dunedain <anarion80@gmail.com>
2025-04-04 10:43:18 +02:00
Christian Clason
b788c7fa6c vim-patch:6099db9: runtime(sh): Update syntax file, command substitution opening paren at EOL
Allow the opening parenthesis of a command substitution to appear at
EOL.

This fixes the issue raised in
https://github.com/vim/vim/issues/17026#issuecomment-2774112284.

closes: vim/vim#17044

6099db9a60

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-04-04 10:43:18 +02:00
zeertzjq
74edfebbde Merge pull request #33282 from glepnir/vim-9.1.1269
vim-patch:9.1.{1269,1272}
2025-04-04 14:13:51 +08:00
glepnir
b01921cb55 vim-patch:9.1.1272: completion: in keyword completion Ctrl_P cannot go back after Ctrl_N
Problem:  completion: in keyword completion Ctrl_P cannot go back after
          Ctrl_N
Solution: in find_compl_when_fuzzy() always return first match of array, after Ctrl_P
          use compl_shown_match->cp_next instead of compl_first_match.
          (glepnir)

closes: vim/vim#17043

3e50a28a03

Co-authored-by: glepnir <glephunter@gmail.com>
2025-04-04 13:52:04 +08:00
tstsrt
d9405c7935 test(plugin/shada_spec): failure if timezone isn't a whole hour ahead of UTC (#33257)
Problem: When running functional tests locally, test `syntax/shada.vim works`
fails if the local timezone is not a whole number of hours ahead of UTC.

Solution: Use '!%M' for minute format so that UTC is used in the expected
timestamp instead of the local timezone, just like '%H' for hours.
2025-04-04 11:59:29 +08:00
zeertzjq
4ef9dcb1eb test(lua/hl_spec): fix hang on exit with ASAN (#33298) 2025-04-04 01:19:13 +00:00
Evgeni Chasnovski
71e133e5e6 docs(diagnostic): mention severity in Opts.VirtualLines (#33293)
Problem: `severity` field is recognized by
  `vim.diagnostic.Opts.VirtualLines`, but it is not explicitly
  documented.

Solution: document it.
2025-04-03 10:19:37 -05:00
Siddhant Agarwal
eae2d3b145 feat(vim.hl): allow multiple timed highlights simultaneously #33283
Problem: Currently vim.hl.range only allows one timed highlight.
Creating another one, removes the old one.

Solution: vim.hl.range now returns a timer and a function. The timer
keeps track of how much time is left in the highlight and the function
allows you to clear it, letting the user decide what to do with old
highlights.
2025-04-03 07:26:56 -07:00
zeertzjq
974a3aa2c4 test(lua/secure_spec): fix failure with long path (#33280)
Ref #33278
2025-04-03 21:32:17 +08:00
Deveshi Dwivedi
9722bd7b1b feat(clipboard): g:clipboard="foo" forces the "foo" clipboard tool #33235 2025-04-03 06:14:08 -07:00
Christian Clason
5cdfa3324f vim-patch:9.1.1268: filetype: dax files are not recognized
Problem:  filetype: dax files are not recognized
Solution: detect "*.dax" as dax filetype, include dax filetype and
          syntax plugin (Anarion Dunedain)

Data Analysis Expressions (DAX) is a formula expression language used in
Analysis Services, Power BI, and Power Pivot in Excel. DAX formulas
include functions, operators, and values to perform advanced
calculations and queries on data in related tables and columns in
tabular data models.

DAX language overview:
- https://learn.microsoft.com/en-us/dax/dax-overview

closes: vim/vim#17035

7f518e044f

Co-authored-by: Anarion Dunedain <anarion80@gmail.com>
2025-04-03 10:15:11 +02:00
glepnir
8cf413e450 vim-patch:9.1.1269: completion: compl_shown_match is updated when starting keyword completion
Problem:  compl_shown_match is updated when starting keyword completion
          and does not include fuzzy matching.
Solution: Do not update compl_shown_match when starting keyword
          completion, since it is the one already selected by the
          keyword completion direction. (glepnir)

closes: vim/vim#17033

e4e4d1c381

Co-authored-by: glepnir <glephunter@gmail.com>
2025-04-03 14:21:37 +08:00
zeertzjq
18caa5fb23 Merge pull request #33279 from zeertzjq/vim-8293574
vim-patch: zip plugin updates
2025-04-03 07:10:53 +08:00
zeertzjq
8e2a9cbaa3 vim-patch:a359c9c: runtime(zip): add *.whl to the list of zip extensions
This commits adds the extension *.whl to the list of zip extensions.
Wheel (WHL) files are binary distribution files for python packages.

Reference:
https://packaging.python.org/en/latest/specifications/binary-distribution-format/

fixes: vim/vim#17038

a359c9c25e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-04-03 06:47:58 +08:00
zeertzjq
d9149a9a09 vim-patch:8293574: runtime(doc): update pi_zip.txt with current list of zip file extensions
closes: vim/vim#17037

8293574c8b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-04-03 06:47:57 +08:00
phanium
0b61bc8982 fix(events): crash on SIGTSTP (Ctrl-Z) #33258
Problem:
Nvim crashes on receive SIGTSTP (Ctrl-Z) since 4dabeff308.

Solution:
* Don't exit on SIGTSTP (not a deadly signal).
* Avoid SIGTSTP handler in os/signal.c.

Co-authored-by: 27Onion Nebell <zzy20080201@gmail.com>
2025-04-02 15:12:19 +00:00
luukvbaal
3af43cffa0 fix(highlight): no match highlight during :substitute prompt #33262
Problem:  Redrawing during a substitute confirm prompt causes the match
          highlight to disappear.
Solution: Unset `highlight_match` after the prompt has returned.
          Use global highlight definitions in searchhl_spec.lua.
2025-04-02 05:14:11 -07:00
zeertzjq
e5ddf7ae7d vim-patch:9.1.1266: MS-Windows: type conversion warnings (#33264)
Problem:  MS-Windows: type conversion warnings
Solution: cast the variables (Yegappan Lakshmanan)

closes: vim/vim#17027

7b6add0b4a

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2025-04-02 01:39:12 +00:00
Lewis Russell
9b239a6a86 Merge pull request #32686 from lewis6991/lsp-rpc-perf
perf(lsp): improve rpc loop performance (with shim)
2025-04-01 13:49:45 +01:00
tstsrt
ec18ebcb41 fix(api): nvim_set_keymap() throws error even in pcall() #33228
Problem: When `nvim_set_keymap` tries to overwrite a `<unique>` mapping,
it throws an error even when called in `pcall`.

Solution: src/nvim/mapping.c:buf_do_map no longer calls `semsg`. Its
callers now decide whether to ignore the error, or use
`semsg` (not caught)/`api_set_error` (caught by `pcall`).
2025-04-01 05:30:00 -07:00
luukvbaal
0e7479bb76 fix(window): crash on negative window height with 'winbar' #33250
Problem:  Negative window and grid height with 'winbar'.
Solution: Clamp the height when subtracting the 'winbar' height.
2025-04-01 05:02:24 -07:00
Sean Dewar
ec6670080a docs(eval): fix dict param type of mapset
Match maparg's return type.
2025-04-01 10:55:39 +01:00
Sean Dewar
4a36f234ac docs(eval): fix lnum type for functions using tv_get_lnum
These occurrences also accept string, which is used like in getline.

Also make the lnum field of vim.fn.sign_placelist.list.item optional, as it can
be omitted like vim.fn.sign_place.dict's.
2025-04-01 10:55:39 +01:00
zeertzjq
2322ae403b vim-patch:4ac995b: runtime(rust): set formatprg to rustfmt (#33245)
closes: vim/vim#16967

4ac995bf93

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2025-04-01 17:20:11 +08:00
luukvbaal
7e8b7bba21 fix(display): wrong cursor column with 'concealcursor' = "n" and virt_text (#33218)
Problem:  Inline virtual text placed in a decor provider callback
          invalidates `w_virtcol`, which must be valid for `win_line()`.
Solution: Call `validate_virtcol()` after "line" decor provider callbacks.
2025-04-01 07:56:36 +02:00
luukvbaal
32325a66ca fix(move): adjust for concealed lines above topline after scrolling up (#33211)
Problem:  Scrolling up does not adjust `w_topline` for concealed lines
          directly above it, resulting in (non-visual) asymmetry when
          scrolling up/down.
Solution: Adjust `w_topline` for concealed lines after scrolling up.
2025-04-01 07:56:16 +02:00
zeertzjq
8a40213eb3 vim-patch:9.1.1265: tests: no tests for typing normal char during completion (#33239)
Problem:  tests: no tests for typing normal char during completion
Solution: add a test verifying the default behaviour (see :h
          popupmenu-completion)

related: vim/vim#17019

71f17fdd5f

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Girish Palya <girishji@gmail.com>
2025-04-01 08:41:48 +08:00
Lewis Russell
e76a7e8afb refactor: add basic stringbuffer shim 2025-03-31 16:51:18 +01:00
Mathias Fussenegger
f517fcd148 perf(lsp): use string.buffer for rpc loop
Avoids some table allocations.
In a quick test over 50000 iterations it reduces the time from 130ms to
74 ms

For the test setup details see:

https://github.com/mfussenegger/nvim-dap/pull/1394#issue-2725352391
2025-03-31 16:44:33 +01:00
Mathias Fussenegger
42657e70b8 perf(lsp): optimize content length extraction from rpc headers
- No redundant `:gsub` to turn `-` in `Content-Length` into `_`
- No table allocations only to add and later get the content-length
  header
2025-03-31 16:44:33 +01:00
Lewis Russell
2ee896201c fix(lsp): better handling of "*" configs
Problem:

If a config name contains "*" it causes rtp discovery of `lsp/` to
consider the `*` as a wildcard and could lead to strange and unintended
behaviour. For example, accessing the `'*'` config from a `lsp/` file
would cause an infinite loop.

Solution:

- Explicitly disallow a config name from containing wildcards, with the
  exception of `'*'`.
- When Resolving `'*'` config, skip the rtp step.
2025-03-31 16:42:25 +01:00
zeertzjq
04901f4ee7 test(float): restore border tests (#33222) 2025-03-31 14:08:54 +00:00
zeertzjq
089c28b1e8 vim-patch:649a237: runtime(debversions): Add release name for Debian 15 - duke (#33207)
https://lists.debian.org/debian-devel-announce/2025/01/msg00004.html

closes: vim/vim#17010

649a237bc8

Co-authored-by: James McCoy <jamessan@jamessan.com>
2025-03-31 21:54:02 +08:00
glepnir
216cc893bf feat(float): 'winborder' "bold" style #33189 2025-03-31 06:39:50 -07:00
Ghjuvan Lacambre
57b4fb5c53 fix(defaults): enable :terminal [[,]] motion in operator-pending mode #33217
This enables y]] to copy a command and its output.
2025-03-31 06:22:21 -07:00
Skoh
4dabeff308 feat(editor): 'autowriteall' on SIGHUP/SIGQUIT #32843
Problem:
Upon receiving a deadly signal, Nvim doesn't write buffers even if
the option 'autowriteall' is set.

Solution:
Write to all writable buffers upon SIGHUP or SIGQUIT (but not
SIGTERM), if the option 'autowriteall' is set.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-03-31 06:14:45 -07:00
bfredl
2e5958186a Merge pull request #32440 from fredizzimo/message-attach
fix(ui): send multigrid message position and size when the UI is refreshed
2025-03-31 11:23:25 +02:00
Tan, Long
28eaec5e15 fix(treesitter): don't memoize modified headings (#33186)
Problem: repeated gO in markdown etc. adds extra toc indentation

Solution: don't memoize heading table which gets modified
2025-03-31 11:22:57 +02:00
phanium
ee143aaf65 fix(terminal): emit Termrequest for all OSC sequences #33181
Problem: osc 0/1/2/52 didn't emit TermRequest.

Solution: emit `TermRequest` for all recognized osc.
2025-03-30 21:08:01 +00:00
Yegor Yefremov
8a7c9c971f build: ignore out-of-source build folder #33191
Create a .gitignore file inside a build folder. This way this folder
will be ignored by git and hence, no entry in the root .gitignore is
required.

For more information see this post:
https://www.scivision.dev/cmake-auto-gitignore-build-dir/
2025-03-30 13:37:42 -07:00
Justin M. Keyes
b41e066aa1 docs: lsp config/commands #33122
fix #33075
2025-03-30 13:29:36 -07:00
msaher
cb247e06f0 fix(defaults): visual-mode [[,]] for :terminal shell prompts #33201
Problem:
:terminal shell prompt jump mappings ]]/[[ don't work in visual mode.

Solution:
Also define them for in visual mode.
2025-03-30 12:33:37 -07:00
Michael Strobel
90d15227c5 feat(lsp): workspace_required #31824
Problem:
Some language servers do not work properly without a workspace folder.

Solution:
Add `workspace_required`, which skips starting the lsp client if no
workspace folder is found.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-03-30 11:07:53 -07:00
Tighearnán Carroll
de96063bda docs(lsp): vim.api.buf_request_sync can also take function as params #33170 2025-03-30 08:51:49 -07:00
Bartłomiej Maryńczak
49756ebc70 fix(vim.lsp.inlay_hint): requesting inlay_hints even when disabled #32999
Problem:
Nvim needlessly requests inlay_hints even if they are disabled for a given buffer.

Solution:
Add the missing `enabled` check in `on_refresh`.
Rest of the code has this check already so that's the only needed one to fix this.
2025-03-30 08:39:10 -07:00
Phạm Bình An
87b4469adc docs: faq, lua packages #33183
Problem:
- `health#check()` seems to have been removed for a while, but `:h faq`
  still refers to it.
- `news-0.11.txt` doesn't mention #33044
2025-03-30 08:18:23 -07:00
zeertzjq
76cbe9c8f8 vim-patch:9.1.1263: string length wrong in get_last_inserted_save() (#33194)
Problem:  string length wrong in get_last_inserted_save()
          (after v9.1.1222)
Solution: when removing trailing ESC, also decrease the string length
          (Christ van Willegen)

closes: vim/vim#16961

583f5aee96

Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
2025-03-30 14:30:18 +00:00
zeertzjq
e87d2ae383 fix(checkhealth): check outdated pynvim version properly #33175
Fixes #33174, a regression from #22962.
2025-03-30 07:02:59 -07:00
zeertzjq
e4f37481ff vim-patch:9.1.1261: No test for 'pummaxwidth' non-truncated items (#33193)
Problem:  No test for 'pummaxwidth' non-truncated items (after v9.1.1250)
Solution: Add shorter items to Test_pum_maxwidth_multibyte() (zeertzjq).

closes: vim/vim#17007

c6336acfe3
2025-03-30 21:45:07 +08:00
zeertzjq
431c037709 vim-patch:9.1.1260: Hang when filtering buffer with NUL bytes (#33192)
Problem:  Hang when filtering buffer with NUL bytes (after 9.1.1050).
Solution: Don't subtract "written" from "lplen" repeatedly (zeertzjq).

related: neovim/neovim#33173
closes: vim/vim#17011

53fed23cb7
2025-03-30 13:41:05 +00:00
Justin M. Keyes
75fe540500 feat(checkhealth): emoji for OK/WARN/ERROR #33172
Problem:
Health status can be much more visually distinct.

Solution:
Use emoji next to each status.
2025-03-30 06:33:12 -07:00
zeertzjq
99529577cc fix(api): use E226 instead of E227 for duplicate abbreviation (#33159) 2025-03-30 07:12:01 +08:00
Justin M. Keyes
5f9f5bc04d fix(checkhealth): check g:loaded_xx_provider for all providers #33168 2025-03-29 13:35:06 -07:00
Sathya Pramodh
b4906577c9 fix(provider): misleading :checkhealth if user sets g:loaded_python3_provider=1 #32696
Problem:
:checkhealth shows a confusing message if user sets
g:loaded_python3_provider=1.

Solution:
- Show a warning if that var is set to 1.
- Update provider modules to default to 0. Any user code that is
  checking for 1, is like already broken because these may be set to 2.
2025-03-29 11:06:23 -07:00
Riley Bruins
f4fc769c81 refactor(treesitter): migrate to ts parser callback API #33141
Remove the `set_timeout` functions for `TSParser` and instead add a timeout
parameter to the regular parse function. Remove these deprecated tree-sitter
API functions and replace them with the preferred `TSParseOptions` style.
2025-03-29 10:57:22 -07:00
Daniel Kusai
6e12ef4a7b fix(desktop): cannot open filename with spaces using OS file manager #33161
Problem:
When activated from OS "filetype handling", Nvim cannot handle filenames containing spaces.

Solution:
Quote the filename in the .desktop config.
2025-03-29 08:49:21 -07:00
zeertzjq
295ab46ea0 Merge pull request #33114 from zeertzjq/vim-9.1.1250
vim-patch:9.1.{1250,1255,1257}: 'pummaxwidth'
2025-03-29 21:33:13 +08:00
Christian Clason
d6a5bc4e8b vim-patch:1054b18: runtime(java): Make changes for JDK 24 in syntax script
- "Demote" SecurityManager from the list of java.lang class
  types to javaLangDeprecated.
- Reintroduce supported syntax-preview-feature numbers 455
  and 476 as _new numbers_ 488 and 494, respectively.

References:
- https://openjdk.org/jeps/486 (Permanently Disable the Security Manager)
- https://openjdk.org/jeps/488 (Primitive Types in Patterns etc.)
- https://openjdk.org/jeps/494 (Module Import Declarations)

closes: vim/vim#16977

1054b18291

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2025-03-29 14:29:26 +01:00
Christian Clason
ab00aec67b vim-patch:0dc9a0b: runtime(lf): add lf r34 keywords to syntax script
closes: vim/vim#17002

0dc9a0bc60

Co-authored-by: Andis Spriņķis <andis@sprinkis.com>
2025-03-29 14:29:26 +01:00
Gregory Anders
0d73ec5834 fix(api): use original LHS in keymap error message #33135
When setting a keymap with "unique" that already exists the error
message contains the LHS of the keymap with termcodes replaced. In
particular this means that keys like <Tab> show as an actual tab
character, meaning the error message displays as "Mapping already exists
for ", which is hard to debug for users.

Instead, display the original LHS (without any simplification or parsed
termcodes). This rperesents exactly what the user passed to the `lhs`
argument of `nvim_set_keymap`, which makes it easier to find where the
offending keymap is.
2025-03-29 06:29:06 -07:00
zeertzjq
52b19e0124 vim-patch:9.1.1257: Mixing vim_strsize() with mb_ptr2cells() in pum_redraw()
Problem:  Mixing vim_strsize() with mb_ptr2cells() in pum_redraw().
Solution: Change vim_strsize() to mb_string2cells() (zeertzjq).

Since vim_strsize() uses ptr2cells() for the cell width of each char, it
is strange to mix it with mb_ptr2cells(), which is used both just below
and in pum_screen_puts_with_attr(), and screen_puts_len() also uses
something similar.  Meanwhile mb_string2cells() uses mb_ptr2cells() for
the cell width of each char.

Note that the vim_strsize() and mb_string2cells() actually return the
same value here, as the transstr() above makes sure the string only
contains printable chars, and ptr2cells() and mb_ptr2cells() only return
different values for unprintable chars.

closes: vim/vim#17003

90e52490b3
2025-03-29 21:12:32 +08:00
zeertzjq
686e7aca40 fix(pum): simplify 'pummaxwidth' truncation and avoid crash 2025-03-29 21:12:32 +08:00
zeertzjq
675ee057e0 vim-patch:9.1.1255: missing test condition for 'pummaxwidth' setting
Problem:  missing test condition for 'pummaxwidth' setting, pummaxwidth
          not effective when width is 32 and height is 10
          (after v9.1.1250)
Solution: add missing comparison condition in pum_width()
          (glepnir)

closes: vim/vim#16999

532c5aec6f

Co-authored-by: glepnir <glephunter@gmail.com>
2025-03-29 21:12:32 +08:00
zeertzjq
62da4e2949 vim-patch:9.1.1250: cannot set the maximum popup menu width
Problem:  cannot set the maximum popup menu width
          (Lucas Mior)
Solution: add the new global option value 'pummaxwidth'
          (glepnir)

fixes: vim/vim#10901
closes: vim/vim#16943

88d75934c3

Co-authored-by: glepnir <glephunter@gmail.com>
2025-03-29 21:12:32 +08:00
zeertzjq
89bc945554 vim-patch:9.1.1258: regexp: max \U and \%U value is limited by INT_MAX (#33156)
Problem:  regexp: max \U and \%U value is limited by INT_MAX but gives a
          confusing error message (related: v8.1.0985).
Solution: give a better error message when the value reaches INT_MAX

When searching Vim allows to get up to 8 hex characters using the /\V
and /\%V regex atoms.  However, when using "/\UFFFFFFFF" the code point is
already above what an integer variable can hold, which is 2,147,483,647.

Since patch v8.1.0985, Vim already limited the max codepoint to INT_MAX
(otherwise it caused a crash in the nfa regex engine), but instead of
error'ing out it silently fell back to parse the number as a backslash
value and not as a codepoint value and as such this "/[\UFFFFFFFF]" will
happily find a "\" or an literal "F".  And this "/[\d127-\UFFFFFFFF]"
will error out as "reverse range in character class).

Interestingly, the max Unicode codepoint value is U+10FFFF which still
fits into an ordinary integer value,  which means, that we don't even
need to parse 8 hex characters, but 6 should have been enough.

However, let's not limit Vim to search for only max 6 hex characters
(which would be a backward incompatible change), but instead allow all 8
characters and only if the codepoint reaches INT_MAX, give a more
precise error message (about what the max unicode codepoint value is).
This allows to search for "[\U7FFFFFFE]" (will likely return "E486
Pattern not found") and "[/\U7FFFFFF]" now errors "E1517: Value too
large, max Unicode codepoint is U+10FFFF".

While this change is straight forward on architectures where long is 8
bytes, this is not so simple on Windows or 32bit architectures where long
is 4 bytes (and therefore the test fails there).  To account for that,
let's make use of the vimlong_T number type and make a few corresponding
changes in the regex engine code and cast the value to the expected data
type. This however may not work correctly on systems that doesn't have
the long long datatype (e.g. OpenVMS) and probably the test will fail
there.

fixes: vim/vim#16949
closes: vim/vim#16994

f2b16986a1

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-03-29 13:05:03 +00:00
phanium
78d2e0b43e fix(checkhealth): don't override user "q" keymap #33132 2025-03-29 05:55:17 -07:00
Ricardo Casía
874e214993 fix: remove exec permission from .gitattributes #33140
Problem:
.gitattributes was marked as executable, which isn’t needed for a config
file and goes against the principle of least privilege.

Solution:
Set file mode to 100644 to reflect its intended use.
2025-03-29 05:30:30 -07:00
zeertzjq
6ef5dd5266 refactor(diff): remove unreachable code (#33149) 2025-03-29 11:01:57 +08:00
zeertzjq
2681e1fce3 fix(pum): fix heap-buffer-overflow with 'rightleft' (#33146) 2025-03-29 02:07:14 +00:00
zeertzjq
cb31663663 vim-patch:9.1.1252: typos in code and docs related to 'diffopt' "inline:" (#33143)
Problem:  Typos in code and docs related to 'diffopt' "inline:".
          (after v9.1.1243)
Solution: Fix typos and slightly improve the docs.
          (zeertzjq)

closes: vim/vim#16997

5a307c361c
2025-03-29 07:01:49 +08:00
luukvbaal
f4ee0ab2f1 fix(cmdline): avoid empty @: register after :<CR> (#33126)
Fix https://github.com/neovim/neovim/issues/33125
2025-03-28 19:48:17 +01:00
Micah Halter
5554fcc286 fix(lsp): warn on missing config in :checkhealth #33087
Problem
When calling `:checkhealth vim.lsp` after the user has enabled a language
server with `vim.lsp.enable` that has no configuration a runtime error
is hit because the code expects for a configuration to exist.

Solution:
Check if a configuration was returned before parsing it, if it isn't
returned then warn the user that the server has been enabled but a
configuration was not found.
2025-03-28 05:46:10 -07:00
luukvbaal
95ab723995 fix(cmdline): empty ext_cmdline block events for :<CR> #33118
Problem:  An ext_cmdline block event that should be empty after :<CR>
          re-emits the previous cmdline.
Solution: Clear `last_cmdline` even when `new_last_cmdline == NULL`.
2025-03-28 04:52:57 -07:00
v1nh1shungry
ade58885c4 fix(provider)!: drop Python 3.7, 3.8 support #33088
Problem: #33022 didn't update `min_version` to 3.9, therefore Python 3.7
and 3.8 are still available.

Solution: Update `min_version` to 3.9.
2025-03-28 04:49:10 -07:00
Riley Bruins
75cbd9a8ae refactor(treesitter): simplify injection retrieval #33104
Simplify the logic for retrieving the injection ranges for the language
tree. The trees are now also sorted by starting position, regardless of
whether they are part of a combined injection or not. This would be
helpful if ranges are ever to be stored in an interval tree or other
kind of sorted tree structure.
2025-03-28 04:38:47 -07:00
Shadman
18fa61049a fix(mouse): crash with click on win-separator in statusline (#33091)
Problem: Clicking on window separator in statusline crashes Nvim due
to out of bound memory access

Solution: Check if the click location is within clicking range before
applying it.
2025-03-28 15:09:02 +08:00
zeertzjq
edb9d0d21e Merge pull request #33086 from zeertzjq/vim-9.1.1243
vim-patch:9.1.{1243,1246}
2025-03-28 15:07:20 +08:00
zeertzjq
e2e0f92f17 vim-patch:9.1.1246: coverity complains about some changes in v9.1.1243
Problem:  coverity complains about some changes in v9.1.1243
Solution: remove duplicate code in diff_find_changed() (Yee Cheng Chin)

closes: vim/vim#16988

4f9b1243e3

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-03-28 14:46:21 +08:00
zeertzjq
2331c52aff vim-patch:9.1.1243: diff mode is lacking for changes within lines
Problem:  Diff mode's inline highlighting is lackluster. It only
          performs a line-by-line comparison, and calculates a single
          shortest range within a line that could encompass all the
          changes. In lines with multiple changes, or those that span
          multiple lines, this approach tends to end up highlighting
          much more than necessary.

Solution: Implement new inline highlighting modes by doing per-character
          or per-word diff within the diff block, and highlight only the
          relevant parts, add "inline:simple" to the defaults (which is
          the old behaviour)

This change introduces a new diffopt option "inline:<type>". Setting to
"none" will disable all inline highlighting, "simple" (the default) will
use the old behavior, "char" / "word" will perform a character/word-wise
diff of the texts within each diff block and only highlight the
differences.

The new char/word inline diff only use the internal xdiff, and will
respect diff options such as algorithm choice, icase, and misc iwhite
options. indent-heuristics is always on to perform better sliding.

For character highlight, a post-process of the diff results is first
applied before we show the highlight. This is because a naive diff will
create a result with a lot of small diff chunks and gaps, due to the
repetitive nature of individual characters. The post-process is a
heuristic-based refinement that attempts to merge adjacent diff blocks
if they are separated by a short gap (1-3 characters), and can be
further tuned in the future for better results. This process results in
more characters than necessary being highlighted but overall less visual
noise.

For word highlight, always use first buffer's iskeyword definition.
Otherwise if each buffer has different iskeyword settings we would not
be able to group words properly.

The char/word diffing is always per-diff block, not per line, meaning
that changes that span multiple lines will show up correctly.
Added/removed newlines are not shown by default, but if the user has
'list' set (with "eol" listchar defined), the eol character will be be
highlighted correctly for the specific newline characters.

Also, add a new "DiffTextAdd" highlight group linked to "DiffText" by
default. It allows color schemes to use different colors for texts that
have been added within a line versus modified.

This doesn't interact with linematch perfectly currently. The linematch
feature splits up diff blocks into multiple smaller blocks for better
visual matching, which makes inline highlight less useful especially for
multi-line change (e.g. a line is broken into two lines). This could be
addressed in the future.

As a side change, this also removes the bounds checking introduced to
diff_read() as they were added to mask existing logic bugs that were
properly fixed in vim/vim#16768.

closes: vim/vim#16881

9943d4790e

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-03-28 14:45:01 +08:00
zeertzjq
ae98d0a560 vim-patch:9.1.1247: fragile setup to get (preferred) keys from key_name_entry (#33102)
Problem:  fragile setup to get (preferred) keys from key_name_entry
          (after v9.1.1179)
Solution: refactor the code further, fix a bug with "pref_name" key
          entry introduced in v9.1.1180 (Yee Cheng Chin)

The optimization introduced for using bsearch() with key_name_entry
in vim/vim#16788 was fragile as it required synchronizing a non-obvious index
(e.g. IDX_KEYNAME_SWU) with the array that could be accidentally changed
by any one adding a key to it. Furthermore, the "pref_name" that was
introduced in that change was unnecessary, and in fact introduced a bug,
as we don't always want to use the canonical name.

The bug is triggered when the user triggers auto-complete using a
keycode, such as `:set <Scroll<Tab>`. The bug would end up showing two
copies of `<ScrollWheelUp>` because both entries end up using the
canonical name.

In this change, remove `pref_name`, and simply use a boolean to track
whether an entry is an alt name or not and modify logic to respect that.

Add test to make sure auto-complete works with alt names

closes: vim/vim#16987

7d8e7df551

In Nvim there is no `enabled` field, so put `is_alt` before `name` to
reduce the size of the struct.

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-03-28 08:08:36 +08:00
zeertzjq
59e02ee93b Merge pull request #33101 from zeertzjq/vim-052b86b
vim-patch: runtime file updates
2025-03-28 08:06:12 +08:00
zeertzjq
d96a685fae vim-patch:f9f4e27: runtime(hyprlang): save and restore cpo setting in syntax script
fixes: vim/vim#16970
closes: vim/vim#16973

f9f4e27ad7

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-03-28 07:21:54 +08:00
zeertzjq
558de3d9ad vim-patch:052b86b: runtime(solidity): update syntax script with error definitions
closes: vim/vim#16978

References:
- https://docs.soliditylang.org/en/latest/contracts.html#transient-storage
- https://soliditylang.org/blog/2021/04/21/custom-errors/

052b86ba63

Co-authored-by: S0AndS0 <strangerthanbland@gmail.com>
2025-03-28 07:21:42 +08:00
Eisuke Kawashima
07f048a8d7 fix(health): message should mention "vim.provider" #33095 2025-03-27 16:19:54 -07:00
zeertzjq
e1f1386d5e Merge pull request #33098 from zeertzjq/vim-9.1.1245
vim-patch:9.1.{1245,1249}
2025-03-28 07:15:33 +08:00
zeertzjq
e4172bcbdf vim-patch:9.1.1249: tests: no test that 'listchars' "eol" doesn't affect "gM"
Problem:  No test that 'listchars' "eol" doesn't affect "gM".
Solution: Add a test (zeertzjq).

closes: vim/vim#16990

757c37da6d
2025-03-28 06:56:18 +08:00
zeertzjq
b20fc95c1a vim-patch:9.1.1245: need some more tests for curly braces evaluation
Problem:  need some more tests for curly braces evaluation
Solution: Add a test for the regression introduced by patch v9.1.1242
          (Yegappan Lakshmanan)

closes: vim/vim#16986

d9b82cfe84

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2025-03-28 06:56:04 +08:00
zeertzjq
d01d476480 refactor(eval): move diff functions to diff.c (#33085)
They were moved in Vim in patch 8.1.1989.
This change is required to port patch 9.1.1243.
2025-03-27 13:35:20 +00:00
luukvbaal
703f4037c4 fix(ui): wincmd _ should not increase 'cmdheight' above 0 (#33056) 2025-03-27 12:52:46 +01:00
luukvbaal
ce0c0c31a0 fix(display): scroll logic does not take into account concealed topline (#33054) 2025-03-27 12:51:57 +01:00
Fred Sundvik
424d30fe97 fix(ui): send multigrid message position and size when the UI is refreshed 2025-03-27 18:41:57 +07:00
zeertzjq
c5044bd021 vim-patch:51a06ec: runtime(sh): consider sh as POSIX shell by default (#33078)
Also, do not set g:is_kornshell when g:is_posix is set. BSD shells are
POSIX but many are derived from the ash shell.

closes: vim/vim#16939

51a06ecee0

Co-authored-by: Mohamed Akram <mohd.akram@outlook.com>
2025-03-27 11:22:22 +08:00
zeertzjq
750e1836af vim-patch:9.1.1224: cannot :put while keeping indent (#33076)
Problem:  cannot :put while keeping indent (Peter Aronoff)
Solution: add the :iput ex command (64-bitman)

fixes: vim/vim#16225
closes: vim/vim#16886

e08f10a55c

Cherry-pick test_put.vim changes from patch 8.2.1593.

N/A patches:
vim-patch:9.1.1213: cannot :put while keeping indent
vim-patch:9.1.1215: Patch 9.1.1213 has some issues

Co-authored-by: 64-bitman <60551350+64-bitman@users.noreply.github.com>
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-03-27 01:06:46 +00:00
zeertzjq
8f40ffdb92 Merge pull request #32953 from glepnir/vim-9.1.1214
vim-patch:9.1.{1214,1217,1219}: matchfuzzy() "camelcase"
2025-03-27 08:54:32 +08:00
zeertzjq
797195e0ea vim-patch:9.1.1219: Strange error with wrong type for matchfuzzy() "camelcase"
Problem:  Strange error with type for matchfuzzy() "camelcase".
Solution: Show the error "Invalid value for argument camelcase" instead
          of "Invalid argument: camelcase" (zeertzjq).

Note that using tv_get_string() will lead to confusion, as when the
value cannot be converted to a string tv_get_string() will also give an
error about that, but "camelcase" takes a boolean, not a string.  Also
don't use tv_get_string() for the "limit" argument above.

closes: vim/vim#16926

c4815c157b
2025-03-27 08:25:12 +08:00
zeertzjq
f9280cde0a vim-patch:9.1.1217: tests: typos in test_matchfuzzy.vim
Problem:  tests: typos in test_matchfuzzy.vim (after 9.1.1214).
Solution: Fix the typos.  Consistently put the function call on the
          second line in assertions for camelcase (zeertzjq).

closes: vim/vim#16907

85627732e0
2025-03-27 08:20:32 +08:00
glepnir
162edf7b30 vim-patch:9.1.1214: matchfuzzy() can be improved for camel case matches
Problem:  When searching for "Cur", CamelCase matches like "lCursor" score
          higher than exact prefix matches like Cursor, which is
          counter-intuitive (Maxim Kim).
Solution: Add a 'camelcase' option to matchfuzzy() that lets users disable
          CamelCase bonuses when needed, making prefix matches rank higher.
          (glepnir)

fixes: vim/vim#16504
closes: vim/vim#16797

28e40a7b55

Co-authored-by: glepnir <glephunter@gmail.com>
2025-03-27 08:19:25 +08:00
zeertzjq
ce590e2077 Merge pull request #30189 from zeertzjq/vim-9.1.0598
vim-patch: 'completefuzzycollect' option
2025-03-27 08:02:45 +08:00
zeertzjq
0af780e8df vim-patch:9.1.1228: completion: current position column wrong after got a match
Problem:  The current_pos.col was incorrectly updated to the length of
          the matching text. This will cause the next search to start
          from the wrong position.
Solution: current_pos has already been updated in search_str_in_line and
          does not need to be changed (glepnir)

closes: vim/vim#16941

5753084042

Co-authored-by: glepnir <glephunter@gmail.com>
2025-03-27 07:26:42 +08:00
zeertzjq
e39cdafed9 vim-patch:9.1.1201: 'completefuzzycollect' does not handle dictionary correctly
Problem:  'completefuzzycollect' does not handle dictionary correctly
Solution: check for ctrl_x_mode_dictionary (glepnir)

closes: vim/vim#16867

587601671c

Cherry-pick a documentation fix from later.

Co-authored-by: glepnir <glephunter@gmail.com>
2025-03-27 07:26:42 +08:00
zeertzjq
5975ddbdb8 vim-patch:1dc731a: runtime(doc): make :h 'completefuzzycollect' a bit clearer
- Fix grammar
- Use "matches" instead of "items" ("completion candidates" is used in
  some other places, but it's a bit verbose)
- "When set" is a bit vague, instead use "For specified modes"

closes: vim/vim#16871

1dc731a49f
2025-03-27 07:26:42 +08:00
zeertzjq
28f6199474 vim-patch:9.1.1197: process_next_cpt_value() uses wrong condition
Problem:  process_next_cpt_value() uses wrong condition
Solution: use cfc_has_mode() instead and remove redundant else if branch
          (glepnir)

closes: vim/vim#16833

53b14578e0

Co-authored-by: glepnir <glephunter@gmail.com>
2025-03-27 07:26:42 +08:00
zeertzjq
cd95ea5d48 vim-patch:9.1.1185: endless loop with completefuzzycollect and no match found
Problem:  endless loop with completefuzzycollect and no match found
Solution: move pointer to line end and break loop

closes: vim/vim#16820

dd42b05f8a

Co-authored-by: glepnir <glephunter@gmail.com>
2025-03-27 07:26:42 +08:00
zeertzjq
10fde593f1 vim-patch:9.1.1182: No cmdline completion for 'completefuzzycollect'
Problem:  No cmdline completion for the 'completefuzzycollect' option
          (after v9.1.1178)
Solution: Add cmdline completion for the 'completefuzzycollect' option,
          improve its description in optwin.vim (zeertzjq).

closes: vim/vim#16813

53d59ecc1d

No code change is needed in Nvim as Nvim uses expand_set_str_generic()
by default.
2025-03-27 07:26:42 +08:00
zeertzjq
17db70f3af vim-patch:9.1.1181: Unnecessary STRLEN() calls in insexpand.c
Problem:  Unnecessary STRLEN() calls in insexpand.c (after 9.1.1178).
Solution: Use the already available length (zeertzjq).

closes: vim/vim#16814

4422de6316
2025-03-27 07:26:42 +08:00
zeertzjq
90d59e6c8a vim-patch:9.1.1178: not possible to generate completion candidates using fuzzy matching
Problem:  not possible to generate completion candidates using fuzzy
          matching
Solution: add the 'completefuzzycollect' option for (some) ins-completion
          modes (glepnir)

fixes vim/vim#15296
fixes vim/vim#15295
fixes vim/vim#15294
closes: vim/vim#16032

f31cfa29bf

Co-authored-by: glepnir <glephunter@gmail.com>
2025-03-27 07:26:42 +08:00
zeertzjq
3029357520 vim-patch:9.1.1131: potential out-of-memory issue in search.c
Problem:  potential out-of-memory issue in search.c
Solution: improve situation and refactor search.c slightly
          (John Marriott)

- In function update_search_stat():
  add a check for a theoretical null pointer reference, set and remember
  the length of lastpat, remove the three calls to STRLEN() and use the
  various string's associated lengths instead, add a check for an
  out-of-memory condition.

- In function search_for_fuzz_match():
  remove a call to strnsave() and thus avoid having to add a check for
  an out-of-memory condition, also replace the call to STRLEN() by
  ml_get_buf_len().

closes: vim/vim#16689

b79fa3d9c8

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-03-27 07:26:42 +08:00
zeertzjq
c17caca9b7 vim-patch:9.1.1008: tests: test for patch 9.1.1006 doesn't fail without the patch
Problem:  tests: test for patch 9.1.1006 doesn't fail without the patch
          (after v9.1.1006)
Solution: Add ctermbg=NONE to the highlight groups (zeertzjq).

closes: vim/vim#16425

faf250c9e4
2025-03-27 07:26:42 +08:00
zeertzjq
44f70b4be1 vim-patch:9.1.1006: PmenuMatch completion highlight can be combined
Problem:  PmenuMatch completion highlight can be combined
Solution: Combine highlight groups PmenuMatch with Pmenu and
          PmenuMatchSel with PmenuSel (glepnir)

fixes: vim/vim#15563
closes: vim/vim#16408

9eff3ee818

Co-authored-by: glepnir <glephunter@gmail.com>
2025-03-27 07:26:42 +08:00
zeertzjq
fbac254511 vim-patch:9.1.0733: keyword completion does not work with fuzzy
Problem:  keyword completion does not work with fuzzy
          (egesip)
Solution: handle ctrl_x_mode_normal() specifically
          (glepnir)

fixes: vim/vim#15412
closes: vim/vim#15424

7cfe693f9b

Co-authored-by: glepnir <glephunter@gmail.com>
2025-03-27 07:26:42 +08:00
zeertzjq
bf62672d59 vim-patch:26e4b00: runtime(doc): Revert outdated comment in completeopt's fuzzy documentation
Originally, `:set completeopt+=fuzzy` did not affect how the candidate
list is collected in default keyword completion. A comment was added to
documentation as part of vim/vim#14912 to clarify it. vim/vim#15193 later changed the
fuzzy behavior to now change the candidate collection behavior as well
so the clarification in docs is now wrong. Remove them here.

closes: vim/vim#15656

26e4b00002

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-03-27 07:26:42 +08:00
zeertzjq
767a52ba30 vim-patch:9.1.0705: Sorting of fuzzy filename completion is not stable
Problem:  Sorting of fuzzy filename completion is not stable
Solution: Compare indexes when scores are equal.  Fix some typos.
          (zeertzjq)

closes: vim/vim#15593

58d705238c
2025-03-27 07:26:42 +08:00
zeertzjq
f4ddbaeb9e vim-patch:9.1.0654: completion does not respect completeslash with fuzzy
Problem:  completion does not respect completeslash with fuzzy
          (egesip)
Solution: Change path separator on Windows, depending on 'completeslash'
          option value (glepnir)

fixes: vim/vim#15392
closes: vim/vim#15418

b9de1a057f

Co-authored-by: glepnir <glephunter@gmail.com>
2025-03-27 07:26:42 +08:00
zeertzjq
d9f4c1db23 vim-patch:9.1.0634: Ctrl-P not working by default
Problem:  Ctrl-P not working by default
          (Jesse Pavel, after v9.1.0598)
Solution: Revert part of v9.1.0598 and set cur_match_pos
          correctly according to compl_dir_forward()

fixes: vim/vim#15370
closes: vim/vim#15379

13032a49b7

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-03-27 07:26:42 +08:00
zeertzjq
9757b11aaf vim-patch:9.1.0631: wrong completion list displayed with non-existing dir + fuzzy completion
Problem:  wrong completion list displayed with non-existing dir + fuzzy
          completion (kawarimidoll)
Solution: clear list of matches, if leader did not use fuzzy match
          (glepnir)

fixes: vim/vim#15357
closes: vim/vim#15365

6b6280c4a2

Co-authored-by: glepnir <glephunter@gmail.com>
2025-03-27 07:26:42 +08:00
zeertzjq
a9aedfbc58 vim-patch:9.1.0605: internal error with fuzzy completion
Problem:  internal error with fuzzy completion
          (techntools)
Solution: only fuzzy complete the pattern after directory separator
          (glepnir)

fixes: vim/vim#15287
closes: vim/vim#15291

0be03e14b9

Co-authored-by: glepnir <glephunter@gmail.com>
2025-03-27 07:26:42 +08:00
zeertzjq
d5a6040967 vim-patch:9.1.0598: fuzzy completion does not work with default completion
Problem:  fuzzy completion does not work with default completion
Solution: Make it work (glepnir)

closes: vim/vim#15193

8159fb18a9

Cherry-pick insexpand.c changes from patch 9.1.0608.

N/A patch:
vim-patch:9.1.0632: MS-Windows: Compiler Warnings

Co-authored-by: glepnir <glephunter@gmail.com>
2025-03-27 07:26:41 +08:00
Gregory Anders
9acb52c8f3 refactor(diagnostic)!: remove deprecated diagnostic APIs (#33072) 2025-03-26 13:56:23 -05:00
Christian Clason
c5f3b4ca02 revert: "refactor(tui): disable kitty key event reporting"
This reverts commit 466f20dd70.
2025-03-26 17:23:53 +01:00
Justin M. Keyes
c46b7ab9a3 docs: news 0.12 #33065 2025-03-26 07:50:46 -07:00
Justin M. Keyes
2e68e9c051 fix: temporarily disable 0.12 deprecation tests
Re-enable these after release.
2025-03-26 14:49:23 +01:00
Justin M. Keyes
0926098e9d version bump 2025-03-26 14:49:03 +01:00
Justin M. Keyes
a99c469e54 NVIM v0.11.0
For notable changes, see runtime/doc/news.txt (or `:help news` in Nvim).

Following is a list of fixes/features commits.

BREAKING
--------------------------------------------------------------------------------
- 0f4f7d32ce remove `nvim` and `provider` module for checkhealth
- 7dbbaaec3f rename 'jumpoptions' flag "unload" to "clean" (#30418)
- 35c5e23107 store artifact shasums in a single shasum.txt file
- 188ec19894 turn off translations by default
- 328ea02eb7 use utf8proc full casefolding
- 737f58e232 api: rename Dictionary => Dict
- a389dc2f95 clipboard: use OSC 52 as fallback clipboard provider (#31730)
- ad70c9892d column: rework 'statuscolumn' %r/l items
- eb60cd74fb deps: bump tree-sitter to HEAD, wasmtime to v29.0.1 (#32200)
- a119aae4d3 diagnostic: filter diagnostics by severity before passing to handlers (#30070)
- 51ccd12b3d diagnostic: make virtual text handler opt-in (#32079)
- a9e725b26e diagnostics: sort underline severity_sort (#30898)
- e8b5dd1e89 lsp: `symbol_to_item` requires `offset_encoding`
- 8260e4860b lsp: multiple client support for vim.lsp.buf.hover()
- debabaf884 lsp: pass buffer number to root_dir function
- 9b357e30fd lsp: remove client-server handlers from vim.lsp.handlers
- 3e3775961f lsp: rename lsp.completion.trigger() to get() (#32911)
- 0083e03d6f lsp: support multiple clients in goto methods (#30877)
- dff684fdb3 lsp: support multiple clients in lsp.buf.references
- 970a27927e lua: do not use typed table for empty dict
- de48fbbd5f messages: vim.ui_attach message callbacks are unsafe
- a27419f3fc options: disallow setting hidden options #28400
- b922b7d6d7 options: use OptVal for option defaults #26691
- 4d9a1b9852 provider/python: add python 3.13, drop 3.7 and 3.8 (EOL) #33022
- 318676ad13 release: remove backwards compatible releases
- ad191be65e signs: place higher-priority signs from the left #27781
- 0dd933265f terminal: cursor shape and blink (#31562)
- 35e5307af2 terminal: include cursor position in TermRequest event data (#31609)
- 3cf602486c terminal: make 'belloff' and 'visualbell' apply to terminal bell (#30859)
- 041d98fe8d treesitter: add default fallback to `ft_to_lang` lookups
- 6913c5e1d9 treesitter: default to correct behavior for quantified captures (#30193)
- bd4ca22d03 treesitter: don't parse tree in get_parser() or start()
- a0b52e7cb3 treesitter: enforce buffer is loaded when creating parser
- 99e0facf3a treesitter: use return values in `language.add()`
- bda63d5b97 typval: remove distinction of binary and nonbinary strings
- 48e2a73610 ui: emit prompt "messages" as cmdline events #31525
- ca5fca2912 windows: drop cat and tee executables from windows
- be89d520d7 windows: only support UCRT, even for mingw

FEATURES
--------------------------------------------------------------------------------
- efa45832ea add "jump" options to vim.diagnostic.config() (#29067)
- 0631492f9c add vim.fs.relpath
- f864b68c5b allow gx to function for markdown links
- f3632e14e3 get/set namespace properties #28728
- a664246171 remove deprecated features
- ead5683ff9 api: add err field to nvim_echo() opts
- aec4938a21 api: broadcast events to ALL channels #28487
- 34d808b73c api: combined highlights in nvim_eval_statusline()
- 19b25f3fea api: deprecate nvim_buf_add_highlight()
- 5c92b40b4b api: deprecate nvim_out/err_write(ln)
- d84a95da7e api: nvim_get_autocmds filter by id#31549
- 25d8c3a5ad api: nvim_open_win() relative to tabline and laststatus #32006
- e00d67ef31 checkhealth: group parsers by name and path in output
- 563051a53e clipboard: support g:clipboard="osc52" #33021
- 60ea046741 clipboard: try cygutils, clip on Windows #30215
- 2c629ad13f column: apply appropriate numhl highlight to virt_lines (#32400)
- 65c7033cbe comment: allow commentstring to be determined from node metadata
- 268a3de0a7 complete: CompleteDone reason "cancel", "discard" #32600
- a616272f56 complete: specify reason for CompleteDone
- f1748b78e3 default: bind `vim.lsp.buf.signature_help` in select mode (#31223)
- ac207c3ac2 defaults: "Show Diagnostics" in mouse popupmenu #32122
- 2c6b635872 defaults: add LSP default mappings (again) (#28650)
- bb7604edda defaults: add default unimpaired style mappings (#28525)
- 4662ad5643 defaults: completeopt=popup #32909
- e8e3b443f8 defaults: disable 'foldcolumn' in terminal buffers (#31480)
- cc6992f1ca defaults: dot-repeat [<Space> #31186
- 6db830e40e defaults: enable diffopt "linematch" #32346
- b31132f1c1 defaults: jump between :terminal shell prompts with ]]/[[ #32736
- 0b7cc014fc defaults: map gO to LSP document_symbol #30781
- 26e765f905 defaults: map gri to vim.lsp.buf.implementation() (#30764)
- 76aa3e52be defaults: popupmenu "Open in browser", "Go to definition" #30261
- 09d76afe84 defaults: pretty :help headings #30544
- 079e5f4f9b defaults: unimpaired empty line below/above cursor #30984
- 1c6d920052 defaults: use vim.diagnostic.jump() for default mappings (#29066)
- c9c17fda80 deprecations: vim._defer_deprecated_module()
- 38a52caec0 diagnostic: add `current_line` option for `virtual_text` handler
- 8ba73f0e4c diagnostic: add vim.diagnostic.jump() (#26745)
- 445ecca398 diagnostic: format() can filter diagnostics by returning nil #32302
- 99e7323aa3 diagnostic: inherit parent 'path' option in open_float (#31273)
- 21961967ff diagnostic: update quickfix list by title #31486
- 7579af3c51 diagnostic: vim.diagnostic.setqflist improvements #30868
- 1759b7844a diagnostic: virtual_lines #31959
- fd65422b99 diff: do not try external when out of memory
- 0c296ab224 docs: "yxx" runs Lua/Vimscript code examples #31904
- 6628741ada docs: improve `@see` meta docstrings #30693
- 23290e7676 editor: handle new multibyte sequences in normal mode replacement
- cb6c0fda71 editorconfig: add support for spelling_language (#28638)
- 4817547ec4 ex_cmds: :sleep! hides the cursor while sleeping (#31493)
- 4f9260d06a ext_messages: add hl_id to ext_messages chunks
- 4cced601c8 extmark: stack multiple highlight groups in `hl_group`
- 931ee5591f extmarks: virtual text can be right-aligned, truncated #31921
- 62d9fab9af float: add winborder option (#31074)
- 9b8907d905 float: allow enabling mouse for non-focusable window (#30844)
- 511b991e66 fs.lua: add vim.fs.rm()
- 054a287dbe ftplugin: change 'commentstring' to `// %s` for C/C++ (#29085)
- f398e3a61a ftplugin: set Lua 'omnifunc' to vim.lua_omnifunc #32491
- b61051ccb4 func: allow manual cache invalidation for _memoize
- 548f19ccc3 health: close checkhealth buffers with q #31870
- f2fa4ca97e health: highlight headings #30525
- b12b91c274 health: show :checkhealth in floating window #31086
- 6592873f77 help: use treesitter for table of contents
- 3e09fbdf82 highlight: add StatusLineTerm and StatusLineTermNC groups
- 295920845e highlight: make `PmenuMatch` and `PmenuMatchSel` bold
- 5b1136a99c inccommand: preview 'nomodifiable' buffers #32034
- 61025c9e7a install: mention standard paths, XDG vars in Windows installer #29101
- 8ef41f5902 jobs: jobstart(…,{term=true}), deprecate termopen() #31343
- e7020306a1 jumplist: allow opting out of removing unloaded buffers (#29347)
- 8d55cc218c keysets: teach Union and LuaRefOf
- 5931f780e0 log: use "ui" as default name for TUI client #30345
- e4c6e732fd lsp: add select kind in showMessageRequest #32387
- f20335a54c lsp: add support for completionItem.command resolving
- 3f1d09bc94 lsp: add vim.lsp.config and vim.lsp.enable
- 6072153796 lsp: announce codeLens resolveSupport (#29956)
- 1f5bcc7c4e lsp: completion opts support custom item conversion (#30060)
- ff097f2091 lsp: completion side effects
- 7a7747f1e4 lsp: deprecate execute_command with client:exec_cmd
- 454ae672aa lsp: deprecate non-method client functions
- 54249d051c lsp: deprecate vim.lsp.buf.completion
- e56437cd48 lsp: deprecate vim.lsp.start_client #31341
- 55e4301036 lsp: drop fswatch, use inotifywait (#29374)
- dad55f5e76 lsp: export diagnostic conversion functions (#30064)
- 44229bb85b lsp: highlight hover target/range #31110
- 27f3750817 lsp: improve LSP doc hover rendering #30695
- 6722149776 lsp: include `end_col` and `end_lnum` in `vim.lsp.buf.symbols_to_items`
- 20f22f75ee lsp: include end_col, end_lnum in vim.lsp.buf.locations_to_items #29164
- 4e90bc3023 lsp: lsp.completion support set deprecated (#29882)
- 6e68fed374 lsp: multi-client support for signature_help
- 629483e24e lsp: require `offset_encoding` param #31249
- e00cd1ab40 lsp: return resolved config for vim.lsp.config[name]
- 130b5fd85f lsp: return table from lsp/ files on runtimepath (#31663)
- ce678043e3 lsp: show server name in code actions #30830
- 07d5dc8938 lsp: show server version in `:checkhealth` #31611
- a1e313ded6 lsp: support `textDocument/foldingRange` (#31311)
- 3b0fe2659e lsp: support completion context #32793
- 41b07b128c lsp: support for resolving code action command (#32704)
- 35247b00a4 lsp: support function for client root_dir (#31630)
- 45e76acaa0 lsp: support hostname in rpc.connect #30238
- b2bad0ac91 lsp: support postfix snippets in completion
- d3e4ffafff lsp: support utf-8 and utf-32 position encodings
- 5d26934c7c lsp: update LSP healthcheck format (#28980)
- ae2fd91b41 lsp: update LSP types
- 0df2c6b5d0 lsp: use fuzzy match on filterText instead of prefix match
- e4c1f6667b lsp: use the meta model to generate server capability map
- 5581a95534 lsp: vim.lsp.buf.format() supports textDocument/rangesFormatting #27323
- 92e4e3fb76 lsp.util: fix type errors
- ff1d7d4299 lsp.util: get_bufs_with_prefix -> get_writeable_bufs
- cbc82011ce lsp.util: improve offset_encoding type annotations
- a18fa2f11c lsp.util: minor codestyle
- 1944c0d610 lsp.util: refactor get_border_size()
- f0973d4227 lsp.util: refactor symbols_to_items()
- 0e8568d72c lsp.util: remove lsp spec extract
- 0621718e3b lsp.util: remove metatable in locations_to_items
- 3f87e222f7 lsp.util: remove some aliases
- e954a16063 lsp.util: remove some variables
- 5bec7288a5 lsp.util: remove uneeded do-end
- 8ad000ef7c lsp.util: remove unneeded table
- d44d36b8ff lsp.util: simplify some bounds checking
- 0066dd0f65 lsp.util: use faster version of vim.validate
- 1edfe5c09e lsp.util: use vim.api alias
- 97119a2369 lsp.util: use vim.w/b
- cd53db2157 lua: add `context.env` (environment variables) to `vim._with()`
- 9afa1fd355 lua: add `vim._with`
- 5180707310 lua: add `vim.fs.abspath`
- b34e137e43 lua: allow vim.on_key() callback to consume the key (#30939)
- d5ae5c84e9 lua: completion for vim.fn, vim.v, vim.o #30472
- 0a5a0efda6 lua: don't complete private (_) fields after dot (.) #32690
- 07cc559cdf lua: update `vim._with` to allow more granular option contexts
- af0ef2ac9d lua: vim.hl.range() "timeout" #32012
- be1fbe38b3 lua: vim.text.indent()
- fdeb01cd77 main: expand file ~\ or ~/ prefix on Windows (#28515)
- ea5b748f24 man.vim: "q" always closes window #30819
- f58e7d5fac marks: add conceal_lines to nvim_buf_set_extmark()
- 51cf84daf9 marks: virtual lines support horizontal scrolling (#32497)
- cfdf68a7ac mbyte: support extended grapheme clusters including more emoji
- 124c655f56 messages: "g<" mapping for ext_messages
- cb7b4e2962 messages: "verbose" message kind #31991
- 5bae80899d messages: add :!cmd shell message kinds
- e16bec41b6 messages: confirm kind for z=, :tselect, inputlist() #32521
- 21151144c6 meta: add type for quickfix entries
- 82a215cb2d options: add 'eventignorewin' (#32152)
- d831392b15 paste: unify cancel and error behavior (#30476)
- 08c328b8b0 runtime: Lua ftplugin 'includeexpr' #32719
- f5714994bc runtime: Lua ftplugin sets 'omnifunc', 'foldexpr' #32697
- e6cfcaed18 snippet: add default keymaps during snippet session
- 123f8d229e snippet: set snippet keymaps permanent instead of dynamic (#31887)
- 96128a5076 startup: validate --listen address
- 230b0c7f02 stdlib: overload vim.str_byteindex, vim.str_utfindex #30735
- 517ecb85f5 stdlib: vim.json.encode(...,{escape_slash:boolean}) #30561
- 8df6736ca1 term: enable reflow by default (#21124)
- 4199671047 term: support OSC 8 hyperlinks in :terminal (#30050)
- 93480f7fba term: trigger TermRequest for APC (#32407)
- 3ad977f01d terminal: add support for copying with OSC 52 in embedded terminal (#29117)
- 6f0bde11cc terminal: add support for kitty keyboard protocol
- 06a1f82f1c terminal: forward X1 and X2 mouse events
- e3bfcf2fd4 terminal: support grapheme clusters, including emoji
- f1c45fc7a4 terminal: support theme update notifications (DEC mode 2031) (#31999)
- 56d11b494b terminal: disable 'number', 'relativenumber', and 'signcolumn' in terminal buffers (#31443)
- 34cd94812d test: support and document lua test case debugging
- b8c75a31e6 treesitter: #trim! can trim all whitespace
- ec8922978e treesitter: add more metadata to `language.inspect()` (#32657)
- bd3b6ec836 treesitter: add node_for_range function
- 688b961d13 treesitter: add support for wasm parsers
- 8543aa406c treesitter: allow LanguageTree:is_valid() to accept a range
- 44ccd9ca24 treesitter: allow `iter_captures` to accept `opts`
- 8b5a0a00c8 treesitter: allow disabling captures and patterns on TSQuery (#32790)
- 1af55bfcf2 treesitter: allow get_node to return anonymous nodes
- a94a2927d0 treesitter: allow passing lang to InspectTree
- 45e606b1fd treesitter: async parsing
- 3dfb9e6f60 treesitter: include capture id in return value of `get_captures_at_pos()` #30559
- 267c7525f7 treesitter: introduce child_with_descendant()
- 09f9f0a946 treesitter: show which nodes are missing in InspectTree
- b9b408a56c treesitter: start moving get_parser to return nil #30313
- da0ae95349 treesitter: support modelines in `query.set()` (#30257)
- 2e5b560482 treesitter: table of contents for checkhealth, markdown (#32282)
- 8ba047e33f treesitter: vertical conceal support for highlighter
- ff85e54939 tui: builtin UI (TUI) sets client info #30397
- 4fb3b57a19 tui: handle kitty key events in libtermkey (#31727)
- f93ecd2760 tui: parse CSI subparams in termkey (#29805)
- 44dbfcfba4 tui: recognize X1 and X2 mouse events
- e41368f3bc tui: support in-band resize events (#29791)
- d460928263 tui: update 'background' on theme change events (#31350)
- 45e319ade6 tutor: give hints to satisfy the line checker #30952
- 4b0e2605ea ui: UI :detach command
- 394f69a25d ui: additional arguments for cmdline_show/hide events
- a0e3fe5741 ui: cascading style inheritance for Pmenu* highlights #29980
- f85bc41c80 ui: don't show unfocusable windows in :tabs, 'tabline' #27984
- 9762c5e340 ui: gx: use url extmark attribute and tree-sitter directive (#30192)
- 43d552c566 ui: more intuitive :substitute confirm prompt #31787
- 433b342baa ui: sign/statuscolumn can combine highlight attrs #31575
- a10636fbe7 ui: specify whether msg_show event is added to history
- e049c6e4c0 ui: statusline text inherits highlights #29976
- 611ef35491 vim.fs: find(), dir() can "follow" symlinks #31551
- 3f15e57b26 vim.ui: configurable "gx" / vim.ui.open() tool
- f4b620c4e6 vim.ui.open: support lemonade #30845
- 3572319b4c vim.validate: improve fast form and deprecate spec form
- cb84cd5d9f win32: embed executable icon

FIXES
--------------------------------------------------------------------------------
- 200e7ad157 apply the change on more files
- 6720bd440f assert failure in VimL expression parser
- d123202ae6 change deprecation presentation
- ded15ca8c2 completion.enable(false,...) deletes invalid augroup #32121
- 7737f89206 deps build for ARM64 MSVC
- 50749f8df8 extend the life of vim.tbl_flatten to 0.13
- 25abcd243e fix broken wasmtime build
- b6ab294838 fix incorrect search code
- 46b69aaf14 include nvim/ascii_defs.h
- 01b4da65c2 merge all provider healthchecks into a single health.lua
- 5c245ec3e9 remove vim.lsp._with_extend
- 98ba65b8be replace NVIM with Nvim in default titlestring (#30348)
- 6aa42e8f92 resolve all remaining LuaLS diagnostics
- e71713ba2b show swapfile warning as a warning (#28971)
- 0418107074 update osc52 termfeatures flag on UIEnter/UILeave (#32756)
- 0829e7575d warn when :InspectTree on buffer with no parser #32783
- 47f2769b46 Man: completion on Mac
- 89f9f168a5 api: alloc and draw cursor window in nvim__redraw
- 743c5808b6 api: allow `scope = 'local'` with `buf` when using `nvim_get_option_value`
- 487c48ec86 api: clamp range lines in `nvim__redraw()` (#31710)
- 141114c170 api: crash on invalid buffer to nvim_buf_del_user_command (#31908)
- 716adbcc45 api: deprecate nvim_subscribe, nvim_unsubscribe #30456
- 1e47aa677a api: deprecated API nvim_get_option does not validate option name #31919
- 095c0876c2 api: don't override Vimscript SID (#32610)
- bff07f6dd0 api: don't try to get/set option for invalid option name (#31302)
- 0e59f6f4c7 api: don't use 'winborder' when reconfiguring float (#32984)
- cce1eb0806 api: error properly with invalid field in nvim_open_win (#30078)
- 63bbb7c109 api: fix 'winborder' preventing splits with nvim_open_win (#32981)
- f55213ce0e api: fix crash/leak with float title/footer on error (#30543)
- 022449b522 api: generic error messages, not using TRY_WRAP #31596
- 8de1dc6923 api: make `nvim_set_hl()` respect all `cterm` attributes (#31390)
- ad60b3fb48 api: memory leaks in vim.api.nvim_*get_option #32390
- 167a2383b9 api: not using TRY_WRAP, generic error messages #31595
- bf48dfadec api: nvim__complete_set requires completeopt=popup #31177
- d1d7d54680 api: nvim_buf_get_text() crashes with large negative column #28740
- 6ea45031d5 api: nvim_echo free text memory with invalid highlight (#31243)
- e2ad251c8d api: nvim_get_option_value does not clean up on FileType error #31219
- 5b9518b436 api: nvim_set_decoration_provider callback return type #31912
- 01a97d2ad7 api: nvim_win_set_buf(0, 0) fails if 'winfixbuf' is set #31576
- 40347f6e27 api: only flush nvim__redraw when necessary #31250
- 36f44b3121 api: remove invalid assertions
- 235cb5bc5f api: update "range" windows in nvim__redraw #31042
- 9c718bc2bc api: validation, documentation of hl_group #31195
- 289c9d21cb autocmds: once=true Lua event-handler may call itself #29544
- ffaab09e99 build: <termios.h> is system-dependent #31705
- 486076a0e1 build: remove USE_FNAME_CASE, redundant with CASE_INSENSITIVE_FILENAME
- 217e26cb64 build: surpress spurious warnings from gcc in -E preprocessor mode
- 34a2bfdcc5 build: vimdoc tags are not validated #32801
- 8070988247 channel: handle writing to file instead of pipe (#30519)
- c49162be59 channel: log after (not before) channel-close
- 965dc81f81 checkhealth: disable 'listchars' #31245
- 4c9f3689a1 checkhealth: failed if 'lua' in plugin name
- f5dd30948e checkhealth: handle nested lua/ directory #32918
- c48cf18752 checkhealth: module not found when `&rtp` has nested paths #32988
- 2495e7e22a clipboard: tmux clipboard depends on $TMUX #31268
- 847c28f6f6 cmdline: always show cmdline when it is a prompt #31866
- af4231d407 cmdline: cmdline completion of _defer_require() modules #33007
- a70ad5cdb6 cmdline: ext_cmdline block events for conditionals
- bbf36ef8ef cmdline: prevent cmdline_show events after exiting cmdline #32033
- 092042b43d cmdline: simplify and correct grapheme cluster adjustment
- 86ae59c612 colorscheme: distinguish CursorLine/Folded/StatusLineNC highlights #32256
- 9b9f54e2c1 colorscheme: underline StatusLineNC with 'notermguicolors' #28810
- 8bc28978b6 column: apply custom highlight to last 'statuscolumn' segment (#32182)
- 3cb1e825e6 column: check if signcolumn changed in all windows #31439
- 1dcda86559 column: clamp line number for legacy signs
- f2083bd55c column: crash with 'signcolumn' set to "number" (#29003)
- f9a49fab0c column: modifying a sign should update placed signs (#29750)
- d5f6f61879 column: set signcolumn width after splitting window (#30556)
- 063b69bab4 column: unnecessary redraws with resized 'statuscolumn' (#32944)
- 0a2218f965 comment: fall back to using trimmed comment markers (#28938)
- e788d1a3a9 completion: avoid deleting text when completion leader changes #31448
- bfa365a872 completion: don't include <Lua function> in -complete= (#30209)
- 55dc482e75 completion: fix inconsistent Enter behavior (#30196)
- 83a7d97d64 coverity: CID 509571 Uninitialized variables #30395
- e1c2179dd9 coverity: INTEGER_OVERFLOW #31657
- f9eb68f340 coverity: error handling CHECKED_RETURN #31618
- 069451bb21 coverity: size_t overflow #30497
- ff7832ad3f coverity/497355: shada_read_when_writing out of bounds read #30665
- c49030b75a coverity/497375: f_strpart cast overflow (#30773)
- 0fe4362e21 coverity/509227/509228: tui driver_ti underflow #30341
- 60e1862ccb coverity/510275: linematch out of bounds access (#30687)
- a2008118a0 coverity/510436: shada_read_when_writing index out of bounds (#30686)
- 71507281fb coverity/530826: validate_opt_idx unchecked negative idx (#32081)
- 5af9c065ad decor: don't draw invalidated virtual lines (#29858)
- a8fbe1d409 decor: don't use separate DecorSignHighlight for url (#30096)
- 34ded4d97b decor: exclude invalid marks from meta total
- 87610d82db decor: set invalid flag for end of invalidated paired marks
- 33ff546b50 decoration: fix crash when on_lines decor provider modifies marktree
- 0e299ebf75 decorator: noisy errors from decoration provider #31418
- f2173b1aa2 defaults: cannot remove "How-to disable mouse" menu item #30375
- 61aabe0730 defaults: default @/Q broken when 'ignorecase' is set (#29343)
- 8323398bc6 defaults: don't replace keycodes in Visual search mappings (#31460)
- f6f2334ac2 defaults: error messages UX for unimpaired mappings #30884
- 59a171fd99 defaults: improve visual search mappings #32378
- 01739d4673 defaults: missing ]Q/[Q unimpaired mappings #30943
- c644228e1d defaults: omit empty line from unimpaired mapping messages (#31347)
- ff93cccbc1 defaults: omit extraneous info from unimpaired mapping errors (#30983)
- 4075e613b2 defaults: properly pass count to quickfix commands (#30632)
- 289380bc40 defaults: use "range" instead of "count" for some mappings (#30642)
- 573fcb8b66 deps: revert accidental test commits (#30864)
- de794f2d24 diagnostic: broken variable reference #31557
- c78728a384 diagnostic: clear autocmd only for valid buf (#32861)
- f1fcf653cb diagnostic: clear virtual_lines autocmd only for valid buf #32979
- 921dc22fc0 diagnostic: correct `severity` type on `setqflist`, `setloclist` (#30506)
- 0e8e4a07f5 diagnostic: don't include diagnostic code when using custom formatter #32464
- d918ebe3b8 diagnostic: fix backwards compatibility for goto_next and goto_prev (#29593)
- f69937fdbd diagnostic: fix float scope filtering (#29134)
- 5bc948c050 diagnostic: improve current_line refresh logic #32275
- 4b3be56a03 diagnostic: make docs agree with code (#29561)
- fd902b1cb2 diagnostic: only store quickfix id when creating a new one #31466
- 3b1d0e7f70 diagnostic: remove deprecated `severity_limit` option
- 5eda7aafe9 diagnostic: setqflist() is stuck after vim.lsp.buf.document_symbol #31553
- 9a43ec13e6 diagnostic: show backtrace for deprecation warnings
- 4cbeb6fa3c diagnostic: silence :chistory #31701
- 6c975515c5 diagnostic: vim.diagnostic.setqflist() opens loclist on first call #31585
- 17c25a66fc diagnostic: virtual lines should scroll horizontally
- fb842dfc22 diagnostic: virtual_lines diagnostic columns (#32703)
- e5e81262af diagnostics: don't apply extmarks to invalid lines #29321
- c65646c247 diff: use mmfile_t in linematch
- 81ea44fa6a display: adjust winline info for concealed lines below last line (#32708)
- f25dd7a8d5 display: correctly store winline info for concealed lines (#32656)
- a901fb875f docs: add missing properties to hl_info #30032
- cc26cf0400 docs: do not treat indexes as `short_link`
- 056009f741 docs: markdown instead of vimdoc in meta docstrings #30680
- 8801b77ed0 docs: missing `@returns` desc in _meta/api.lua #30673
- 09bcb31068 docs: replace `yxx` mappings with `g==` #31947
- efe92f9dff docs: update context type in `vim.lsp.LocationOpts.OnList`
- b8135a76b7 docs: wrong return value annotation for `nvim_buf_get_extmarks`
- 376de1483e drawline: correct highlight priority with Visual selection (#30706)
- 9a0239fdc8 drawline: don't draw beyond end of window (#29035)
- b1c439cef6 drawline: don't draw beyond end of window with 'rnu' (#29406)
- 34344b939c editor: avoid scrolling :substitute confirm message #32149
- 9e7b0bcf51 editorconfig: fix indent style for `local.mk` (#31342)
- b0a1d35f69 eval: don't shorten $HOME in v:stacktrace (#32634)
- 2a3561819e eval: handle wrong v:lua in expr option properly (#29953)
- 4317d36669 event-loop: process input before events in getchar() (#32322)
- f05a6666cf events: always allow some events to be nested (#32706)
- e9f4ceeb74 events: don't expand `args.file` for Lua callback (#31473)
- 1f49a59b8b events: fix incorrect capitalization of Cmdwin* events (#32813)
- 8c2d45be77 exit: close memfiles after processing events (#30872)
- c7ec010ade extmark: builtin completion can still affect nearby extmarks #31387
- 93278e7720 extmark: clearer error message for invalid ephemeral mark usage
- 43a2019f09 extmarks: issues with revalidating marks #28961
- 84ad95fdc9 fileio: copy to correct buffer position when reading
- 93347a67bf filetype: fix :filetype detect error with -u NONE (#29991)
- aa9f21ee95 filetype: fix typos in filetype detection
- 032e024f8a filetype: handle .in files with no filename (#30487)
- 1077843b9b filetype: make filetype detection work with :doautocmd (#31470)
- 21cbd90007 filetype: normalize full path before matching #32227
- 5a8a34dafa filetype: source ftdetect/* after creating scripts.vim autocmds (#29445)
- cff5fa49fc float: "Not enough room" error for 1-line float #25192
- 07c5f41da3 float: can set title/footer without setting border #32594
- be01b361d8 float: cannot set title/footer independently #31993
- ff1791c9e5 float: close preview float window when no selected #29745
- d2cca606a1 float: ensure floating window width can fit title
- 8ddcf9d939 float: handle error in win_float_create() (#29742)
- 8b2b1fba2a float: missing default highlight for title
- df915f3afc float: properly find last window of tabpage (#30571)
- 17383870dd float: re-sort layers when grid zindex changed #30259
- 206f8f24a2 fs: make vim.fs.root work for relative paths and unnamed buffers (#28964)
- 2c160f39d3 ftplugin/man.vim: hide signcolumn (auto)
- 214ce8d33c gen_help_html: first tag in h2 is broken #30720
- ceea6898a8 gen_help_html: handle delimiter, heading #29415
- 6c3f7e7e27 gen_vimdoc: correctly generate function fields
- 913e81c35f getchar: do not simplify keycodes in terminal mode
- b109b1abce glob: avoid `subcapture nesting too deep` error (#29520)
- 4bd86120d4 glob: handle overlapping `{}` condition elements #29236
- b47b0b3f75 grid: double grid_line_start() with ext_messages #31292
- fe87656f29 grid: grid_line_start NULL access with 'redrawdebug'
- a9c89bcbf6 gx: allow `@` in url
- 570a8da01b health: "q" should not close last window #31876
- 2e3f1069f4 health: better layout of vim.treesitter health check
- 10f9173519 health: broken ruby detect #28804
- 84e85aeb10 health: check more "old" files #30421
- 5b778a64ec health: fix fetching url with python in provider health (#29594)
- b4b4cf46a7 health: fix pyenv root and python exepath detect issue
- 237d2aef4d health: return correct name from 'path2name()'
- 5e90406487 health: set nomodifiable in checkhealth buffers
- 9177371014 help: remove runnable code virtual text
- ff75f345ab highlight: 'winhl' shouldn't take priority over API (#31288)
- 458473acb8 highlight: add `StatusLineTerm`/`StatusLineTermNC` to `:color vim` (#29313)
- 6bcefad5a6 highlight: fix the seg fault caused by the invalid linked hl ids
- 8e81212e15 highlight: floating windows inherit NormalFloat from global-ns
- 6719276040 highlight: make TablineSel more noticeable with 'notermguicolors' #31905
- b67fcd0488 highlight: make `TablineSel` more noticeable #31896
- 862679c70f highlight: update `PmenuSel` for colored completion items #30183
- 59e130b6ca inccommand: ensure cursor is where it belongs
- 16f63b964f input: handle vim.on_key() properly with ALT and K_SPECIAL (#29677)
- b52ffd0a59 inspect: always show priority
- 9c278af7cc inspect: show priority for treesitter highlights
- 22fd52325b inspector: update semantic token namespace (#32157)
- efe1732c6f jobs: do not block UI when jobwait() doesn't block (#31803)
- 574ea6a191 keycodes: recognize <Find>, <Select> #28431
- 67bb0cfa79 loader: follow the style of the error message for built-in loaders
- 44740e561f log: RPC log format #32337
- 851137f679 log: log unset $TMPDIR at "debug" level #32137
- c908c2560d log: unify error messages for vim.ui_attach/decor providers #33005
- a6f219b06b log: unintuitive message for undefined $TMPDIR
- 2e6d295f79 lsp: account for changedtick version gap on modified reset (#29170)
- fac96b72a5 lsp: add foldingrange method support check #31463
- 8263ed4670 lsp: add textDocument/documentLink to capability map (#28838)
- a41b6fd173 lsp: autocmds to close lsp preview windows not cleared
- b42dc232c5 lsp: autotrigger should only trigger on client's triggerCharacters (#32266)
- 7031949be0 lsp: avoid reusing diagnostics from different servers in actions (#30002)
- fc9b70826e lsp: avoid vim.keymap.del error when stopping a client (#29478)
- 39d79efa1e lsp: better multi-client support for callHierarchy
- bdfba8598b lsp: cancel pending requests before refreshing
- f9bf64d746 lsp: check buffer is loaded and valid #30330
- c2bf09ddff lsp: check for configuration workspace folders when reusing clients
- 81b372fecd lsp: check for nil response from server (#29196)
- a9cdf76e3a lsp: check for valid buf before processing semantic tokens response
- 230bc34ca5 lsp: check if buffer is valid before LspDetach autocmd (#29162)
- af200c10cf lsp: check if buffer was detached in on_init callback (#28914)
- 02097e43c8 lsp: check if sig_help window is focusable when configuring cycle keymap
- 025c874415 lsp: clear lsp client diagnostics (#29050)
- c374f26430 lsp: clear word when expand multi-lines word (#32393)
- adf7c98d60 lsp: compare URI instead of workspace folder name (#30962)
- b4599acbf8 lsp: correct hover result handling (#30995)
- f8d5811c71 lsp: correctly check for "codeAction/resolve" support
- 7d8db54441 lsp: delete b:lsp_floating_preview buf var after win close
- 2a1f604c77 lsp: delete bufvar inside WinClosed event
- 879d17ea8d lsp: detach all clients on_reload to force buf_state reload (#28875)
- 292365fa1b lsp: do not detach from buffer if there are uninitialized clients (#29029)
- 37bf4c572a lsp: do not reset buf version when detaching client (#29242)
- d56ba71af1 lsp: document_symbol uses loclist by default #32070
- 720b309c78 lsp: don't send foreign diagnostics to servers in buf.code_action (#29501)
- 1f2f460b4a lsp: don't show codelens for buffers that don't support it (#29690)
- 5f527f24f0 lsp: don't use completion filterText if prefix is empty
- 305012ea07 lsp: enable `additionalPropertiesSupport`
- 9d9ee3476e lsp: ensure watcher cancel
- aec7f1979a lsp: fallback to `label` for completion items if all others are missing (#29522)
- 33d10db5b7 lsp: filter completion candidates based on completeopt (#30945)
- b3109084c2 lsp: fix cursor position after snippet expansion (#30659)
- 4b001f297a lsp: fix infinite loop
- 983953858e lsp: fix isIncomplete condition in completion trigger (#30130)
- 2ce4a4d91e lsp: fix reverse sorting of same position text edits (#29212)
- 8654a97006 lsp: handle empty call hierarchy items #30349
- f279d1ae33 lsp: handle encoding bounds in str_utfindex_enc
- 882a450a29 lsp: handle locations exceeding line length #30253
- 008782208d lsp: handle mixed encoding in tagfunc params
- e0a5c3bb58 lsp: handle multiline signature help labels #30460
- 8512f669f0 lsp: handle nil bytes in strings
- f03b1622ad lsp: handle nil root_dir in health check (#29007)
- ed07167261 lsp: handle non-existent configs in lsp.config/enable
- 003b8a251d lsp: handle out-of-bounds character positions #30288
- 5187be81c2 lsp: handle using array as open_floating_preview title (#33016)
- d9a2acdab3 lsp: hide layout in codelenses in virtual text (#28794) (#28807)
- f54266dbed lsp: hover border type can be string (#31013)
- 9a681ad09e lsp: hover keymap (#31208)
- a14fca432b lsp: improve LSP floating preview window cleanup #31353
- e29f245a10 lsp: inlay hints are rendered in the correct order (#29707)
- 0086ee90dd lsp: list all workspace folders in healthcheck #30966
- 0e394f136f lsp: log when receiving markup messages (#30065)
- 203e7a43d1 lsp: mention function name in warning #31301
- a4f575abd8 lsp: minimum height for floating popup #31990
- 4fd2694f20 lsp: missing method parameter when canceling requests
- be8d87014c lsp: on detach, cancel pending foldingRange requests #31509
- 7d5866d471 lsp: open_floating_preview() ignores max_height (#32716)
- 86770108e2 lsp: open_floating_preview() zindex relative to current window #31886
- 724d1110b1 lsp: pre-filter matches on label if filterText is missing (#29491)
- a450fda4ed lsp: prefer `on_list` over `loclist` in default handler
- 6bb40f3dbf lsp: prevent desync due to empty buffer (#29904)
- eb629cce91 lsp: redundant spaces in lsp log (#29970)
- 43581011e4 lsp: remove superfluous on_detach callback from semantic tokens module (#29174)
- d76f7fef13 lsp: reset active request when reporting an error
- 6bc7979044 lsp: reset the applied hints on `refresh` request #32446
- 47aaddfa0d lsp: resize hover window for concealed lines
- 081beb3659 lsp: restore get_language_id behaviour
- 29c72cdf4a lsp: retrigger diagnostics request on server cancellation (#31345)
- d9ccd828b0 lsp: return call hierarchy item, not the index (#30145)
- 9c20342297 lsp: reuse client if configs match and no root dir
- 6e45cd7f00 lsp: revert buf_versions deprecation/replacement (#29217)
- bdff50dee5 lsp: revert text edit application order change (#29877)
- e8a6c1b021 lsp: schedule call to vim.lsp.start for async root_dir (#31998)
- a108852b00 lsp: semantic token functions allow "0" bufnr #28849
- c3cb702ac7 lsp: set 'smoothscroll' in docs hover #30748
- 8a236c242a lsp: set floating window filetype after setup #32112
- 3c51058d76 lsp: set tagstack on jump via goto methods
- 24d7debdfb lsp: signature_help highlights wrong parameter #32382
- 80e37aa533 lsp: str_byteindex_enc bounds checking #30747
- 629a5b71b5 lsp: support multiple clients in typehierarchy
- e48179f31e lsp: suppress completion request if completion is active (#30028)
- 50f006b617 lsp: tagfunc fails in unusual buffer #30700
- 5ac8db10f0 lsp: trigger LspDetach on buffer delete (#28795)
- 19be3d2683 lsp: trim trailing whitespace from completion words (#29122)
- aa47af7e69 lsp: tune completion word extraction for decorated labels (#29331)
- 38838fb00a lsp: type-errors, other nits in vim.lsp.log #31235
- 8d7eb03040 lsp: unify get_completion_word for textEdits/insertText
- fe5ae88b20 lsp: update request name to capability map #30098
- 5aa9906676 lsp: use client.id instead of pairs index (#29143)
- c8d7d65679 lsp: use correct method for prepareTypehierarchy
- b9e6fa7ec8 lsp: use filterText as word if textEdit/label doesn't match
- 5d08b65ac2 lsp: use unresolved code action when `codeAction/resolve` fails
- 0a7e4e9e5f lsp: vim.lsp.enable(...,false) does not disable  #32002
- 888a803755 lsp: vim.lsp.start fails if existing client has no workspace_folders #31608
- 42ed0ffad9 lsp: when prefix is non word add all result into matches (#30044)
- 55bdb077b7 lsp: wrapped ctx in opts before passed to vim.lsp.completion.trigger #32837
- 2dcbfe78fc lsp.buf: use correct offset_encoding for all requests
- 3275ae830d lsp.protocal: improve typing of constants
- acbc6a7f91 lsp.util: inconsistent handling of offset_encoding
- 564173e556 lsp.util: wrong arguments to 'validate' function
- 614c9322d5 lua: SIGSEGV in luv callback with error(nil) #32595
- b283736388 lua: `@private` => `@nodoc` #32587
- b6e350a6b4 lua: allows tables with integer keys to be merged in tbl_deep_extend
- c8b64b7a43 lua: always use vim.inspect() for :lua= (#32715)
- 0e42c81c7f lua: avoid recursive vim.on_key() callback (#30753)
- fe1e2eff06 lua: avoid vim._with() double-free with cmdmod (#31505)
- 487f44a6c1 lua: change some vim.fn.expand() to vim.fs.normalize() (#29583)
- 43bd9c9c1c lua: don't clamp -1 or v:maxcol in vim.highlight.range() (#29203)
- bdc6e38781 lua: don't include text after cursor in completion pattern (#29587)
- e2aca58bcc lua: don't override script ID from :source (#32626)
- d40481322a lua: ensure inspect_pos() only shows visible highlight extmarks
- 948f2beed4 lua: find length of completion prefix earlier (#29384)
- ebb963a4a0 lua: format errors from luv callbacks using __tostring
- 65a703e060 lua: ignore stdout and stderr for xdg-open
- 6b00c9acfd lua: no omni/cmdline completion for vim.env (#33044)
- c6d2cbf8f5 lua: pop retval for fast context LuaRef
- a5b1b83a26 lua: prevent SIGSEGV when lua error is NULL in libuv_worker
- 3d707e6f14 lua: remove vim.loader.disable() #31344
- 3a88113246 lua: revert vim.tbl_extend behavior change and document it
- 3688a33354 lua: show stacktrace for error in vim.on_key() callback (#31021)
- 40a149e7f9 lua: types for vim.api.keyset.win_config #32700
- 7f33c1967b lua: use rawget() to get __call in vim.is_callable() (#29536)
- 960fdc775a lua: vim.deprecate does not support major>0
- d832518ec6 lua: vim.hl.on_yank highlights wrong region with yi' (#32850)
- cd3855fb2b lua: vim.tbl_get({}, nil, 1) should return nil #32218
- 89d6d6f25c lua: wrong script context for option set by func from nvim_exec2 (#32659)
- 9eb0426002 luacats: allow all types inside tuples
- ee5aaba215 man: avoid setting v:errmsg (#30052)
- 7588ff2d89 man: check if buffer is valid before restoring 'tagfunc' (#30180)
- da6f68ee69 man: filter OSC 8 hyperlink markup #29171
- 7940ec6913 man.lua: `:Man <tab>` does not complete #31569
- e08e3d15f6 man.lua: skip `Attrs.None` highlights #32262
- d6653e1cc9 marks: ensure decor is removed with proper range (#32973)
- 906ad04ddd marks: handle composing in inline virt_text with 'nowrap' (#32477)
- 8452032554 marks: handle double-with inline virt_text with 'nowrap' (#32476)
- 86046c5a31 marks: ineffective conceal_line callback optimization (#32662)
- 72f630f92d marks: issues with invalid marks and marks beyond eob (#32862)
- 8da59060c6 marks: mark winline as invalid if change is in a concealed line (#32766)
- 012db2b0f5 marks: revalidate marks whose position did not change
- 5cc93ef472 marks: revise metadata for start mark of revalidated pair #32017
- c4f76299f0 marks: skip right_gravity marks when deleting text
- cdedfc3743 marks: truncate double-width inline virt_text consistently (#32560)
- 7371abf755 marks: wrong winline info for concealed line with below virt line (#32747)
- a9287dd882 mbyte: check for utf8proc_map() failure (#30531)
- 50a576ba57 mbyte: mark any 0xFE0F sequence as a TUI ambiguous width char
- 15bc930fca memline: don't check line count for closed memline #32403
- aa976f0d93 messages: add a trailing space to inputlist() etc. prompts (#32328)
- 37c77ab46b messages: attaching/detaching ext_messages causes asserts #31952
- d98827b634 messages: avoid empty msg_showmode with 'noshowmode'
- 31d6885deb messages: better formatting for :highlight with ext_messages #31627
- 21718c67dd messages: better formatting for ext_messages #31839
- 92556be33d messages: compute msg_col after last newline in ext_messages
- ad853d1df0 messages: improve deadly signal messages #32364
- 51853b82bc messages: incorrect error message splitting and kind #32990
- 08f7c22377 messages: list_cmd kind for :registers, :au[g] #32531
- 7ce27381fb messages: lsp window/showMessage is not an error
- 1b6442034f messages: more ext_messages kinds #31279
- 9c6a3703bb messages: no message kind for :undo messages #31590
- ca760e645b messages: no message kind for :write messages #31519
- 909b18d05a messages: no message kind for completion menu messages #31646
- f111c32ff9 messages: no message kind for search pattern #31272
- 282f73f067 messages: no trailing newline for inputlist, tselect, z= with ext_messages
- 9fa3a0964e messages: pass previous highlight id to ext chunks
- e025f5a5b3 messages: proper multiline Lua print() messages #31205
- d1e00a5f6d messages: typo and unwanted truncation in msg_outtrans_long #31669
- d55b17e2b4 messages: verbose kind for nvim_echo()
- c8e47f6480 meta: do not use hyphens in param names
- 2cd72258f6 mouse: 'statuscolumn' fold and popopmenu handling
- 81d4e96bc8 mouse: don't treat click on hsep as click on statusline (#29565)
- 102971a396 mouse: early return when clicking in padded 'statuscolumn' (#29394)
- 86c5c8724b mouse: indicate X1 and X2 button clicks on statusline (#30655)
- f86864f22f move: 'scrolloff' cursor correction no longer handles folds properly (#32642)
- 5947f249f8 move: half-page scrolling with resized grid at eob (#28821)
- ac7e0ff32f move: redraw for 'concealcursor' after changing w_wcol (#31276)
- af0a2157ad move: wrong cursor row on concealed line (#32629)
- 83479b95ab mpack: remove invalid bool definition
- d32780de4d mswin: UI may hang on exit
- fa99afe35e multibyte: handle backspace of wide clusters in replace mode
- de83cc5842 netrw: re-add missing comment marker in syntax file
- d9585bdcfb nvim__set_complete: pum preview info truncated during completion #32555
- 34e2185022 options: better handling of empty values
- 190d0241e2 options: fix 'winborder' accepting multiple string values (#32978)
- 8c532a9ea8 options: fix 'winhl' still accepting invalid value (#30896)
- 1b9dafa67b options: fix :setglobal not working for 'spelloptions' (#30894)
- 395f420fc6 options: fix some 'belloff' flags not working properly (#30856)
- 50e63c8171 options: missing error check for global 'scl' and 'winhl' (#30919)
- e697c1b43d paste: improve repeating of pasted text (#30438)
- 052875b9dc paste: only record a paste when it's from RPC (#30491)
- 9516997eb0 paste: wrong '[ mark after pasting a big string (streamed chunks) #33025
- 42aa69b076 path: avoid chdir() when resolving path (#28799)
- 42db8b1759 path: crash with nvim_get_runtime_file during wildcard expansion (#32992)
- 0dfcf3fe12 plines: don't count invalidated virt text in char size (#29863)
- afc3c43f12 popup: new preview_bufnr created when menu item is selected #32819
- ac1c5ccb2c popup: reuse pum preview float win, set 'winfixbuf' #32636
- d288f7003d popup: wrong extmark data sync when lines changed in popup preview #30246
- d24fb72c33 pum: don't select item when clicking to the left/right (#30967)
- 73ae7d44a2 quickfix: make shortmess+=O work with cmdheight=0 (#29609)
- 3bcd5624be regexp: fix typo in E888 error message (#30161)
- cb924764a4 runtime: "E121 Undefined variable s:termguicolors" #32209
- 29a47b39cc runtime: E15: Invalid expression in lua file when `gf`
- b6c1ce8a95 runtime: add commentstring for glsl ftplugin
- 9ddfcb64bf runtime: add remaining missing commentstrings (#30252)
- e641155b02 runtime: avoid E31 in ftplugin (#32578)
- 82b02ae2f2 runtime: clean up one-off scripts
- 9788b81d7e runtime: fully port emoji_list to Lua
- 74fcc9452c runtime: gO always says "Help TOC" #32971
- 69aa33d890 runtime: let matchit and matchparen skips fallback on treesitter captures
- 8369590eb2 runtime: remove obsolete ftplugin/calender.lua
- 41b70a0dea runtime: set 'keywordprg' only once in vim ftplugin
- 7b16c1fa84 runtime: source c ftplugin properly for cpp on Windows (#29053)
- 12c9791e0f runtime: stop treesitter highlight in b:undo_ftplugin (#29533)
- 862338255d runtime: sync bundled treesitter queries
- 9e80738f30 runtime: sync bundled treesitter queries
- 5057753431 runtime: treat b:undo_ftplugin consistently in Lua ftplugins (#30473)
- 8f5e908110 runtime: update b:undo_ftplugin in Lua runtime files (#29529)
- a5bd6665b0 scripts: update bundled dependencies in bump_deps
- 573a71469d scrollbind: properly take filler/virtual lines into account
- a8b6fa07c4 search: avoid quadratic time complexity when computing fuzzy score (#32153)
- 648d6426c8 server: CID 509282: DEADCODE #30316
- f4921e2b7d shada: ":wshada/:rshada [filename]" with shadafile=NONE #32538
- cd48b72b60 shada: restore search pattern length properly (#28929)
- 608543f8a9 snippet: cancel snippet session when leaving the buffer (#29031)
- 7994fdba6a snippet: don't override unnamed register on tabstop select (#28998)
- 5fe4ce6678 snippet: modify base indentation when there's actually whitespace (#29670)
- 424f4cc038 snippet: wrong indentation when snippet contains "^" #32970
- d46ebd2a74 startup: avoid crash with completion from -l script (#32160)
- 08153ddd1c startup: ignore broken $XDG_RUNTIME_DIR #30285
- 17e00d0cc6 startup: report --startuptime error to stderr (#31131)
- 8a2aec9974 startup: server fails if $NVIM_APPNAME is relative dir #30310
- 19fc65acbc statuscolumn: misleading v:lnum for virtual lines #32912
- 87e806186c statusline: overwriting stl_items with nvim_eval_statusline() {-item #32265
- 1c30d86c33 tabline: restore behavior of click after last tabpage (#30602)
- a49f95d887 terminal: avoid mismatched `busy_start` without `busy_stop` (#32458)
- f3ce67549c terminal: avoid more `busy_start` lacking `busy_stop` (#32509)
- 3d49c55d3c terminal: avoid rescheduling events onto the same queue (#32755)
- 69a19295f8 terminal: delay when finishing terminal process #32846
- f8c8a245aa terminal: don't crash on unprintable chars
- 6d997f8068 terminal: handle C0 characters in OSC terminator (#30090)
- fa46441264 terminal: improve cursor refresh handling (#32596)
- 1d11808bfd terminal: interrupt/got_int hangs terminal (#30056)
- 3db3947b0e terminal: restore cursor from 'guicursor' on TermLeave (#31620)
- c51bf5a6b2 terminal: set cursor cell percentage (#31703)
- 5def8714ad terminal: set local values of window options (#29326)
- e9c077d197 termkey: fix null pointer dereference (#31792)
- c8e3618e0e test: "tempdir not a directory" in CI logs
- f7e32fb6e6 test: better management of tmpfiles
- db2c3d1143 tests: filter out lines with __typeof__ keyword (#32524)
- e61228a214 tests: needing two calls to setup a screen is cringe
- 639734bed4 tests: remove the __extension__ keyword  in filter_complex_blocks (#32483)
- 59baa5e8a1 tohtml: apply sp color if present #30110
- 67c39f5eca tohtml: disable modeline #32822
- e37404f7fe tohtml: enclose font-family names in quotation marks
- 25db0a1385 tohtml: extmark text may be out of bounds
- 8cd9feb501 tohtml: ignore lsp inlay hints
- eb37241d38 tohtml: properly handle multiple hl groups #29012
- 2ed6423c7e tohtml: replace ipairs with pairs
- 88c7997503 tohtml: show how many warnings are hidden
- 118ae7e5ed tohtml: support ranges again
- c63e49cce2 treesitter: #trim! range for nodes ending at col 0 #31488
- b63cd8cbae treesitter: EditQuery shows swapfile ATTENTION #30536
- 55b165ac15 treesitter: `TSNode:field()` returns all children with the given field
- 86b737649b treesitter: add 'QuitPre' event to autocommands in inspect_tree
- bc1018a8d3 treesitter: avoid computing fold levels for empty buffer
- a119dab40f treesitter: avoid computing foldlevels for reloaded buffer #32233
- 6696ea7f10 treesitter: clean up parsing queue
- 99acc9de55 treesitter: close InspectTree/EditQuery window on BufUnload (#31036)
- f50f86b9ff treesitter: compute folds on_changedtree only if not nil
- 7a20f93a92 treesitter: correct condition in `__has_ancestor`
- 9b25c68db2 treesitter: correctly parse queries with combined injections
- 3abfaafad2 treesitter: detect trees with outdated regions in `is_valid()`
- 9217e0d671 treesitter: display fields for anonymous nodes in :InspectTree
- da4e8dc5b0 treesitter: do not modify highlight state for _on_spell_nav
- 0e3e1e6b6d treesitter: don't open fold when o/O adds a line below #28709
- aa2b44fbb0 treesitter: don't return error message on success #31955
- b0bbe25c48 treesitter: don't spam query errors in the highlighter
- b88874d33c treesitter: empty queries can disable injections (#31748)
- d413038b4f treesitter: ensure syntaxset augroup exists (#29542)
- f8e1ebd6f6 treesitter: escape things like `"` in omnifunc results
- c4eb0b64bd treesitter: find buffer in multiple windows #28922
- 94d42a3e72 treesitter: highlight anonymous nodes in inspect_tree
- 5331f87f61 treesitter: indent size for inspect_tree #28727
- 6ef80eb42c treesitter: keep treeview open if source window is still open #31198
- 052e048db6 treesitter: lint top-level anonymous nodes
- 4b90952851 treesitter: mark supertype nodes as named
- 096ae3bfd7 treesitter: nil access when running string parser async
- c3337e357a treesitter: nil check query for has_conceal_line
- 6711fa27ca treesitter: recalculate folds on VimEnter #32240
- 05dcda8f9b treesitter: recognize aliased parsers in omnifunc, query linter
- d3193afc25 treesitter: remove duplicate symbol names in language.inspect()
- cdc9baeaf8 treesitter: remove redundant on_bytes callback #31041
- 1827ab7a1f treesitter: separately track the number of valid regions
- 36990f324d treesitter: show proper node name error messages
- 4349bdbd0b treesitter: specify success status in edit_query return value
- e7ebc5c13d treesitter: stop async parsing if buffer is invalid
- 0f067cd34d treesitter: suppress get_parser warnings via opts.error
- ae917dbd06 treesitter: sync queries from upstream
- c4e9ff30a6 treesitter: sync queries with upstream
- d8eec81560 treesitter: update lua, markdown queries
- 6e44a6a289 treesitter: update queries
- 5a54681025 treesitter: uv_dlclose after uv_dlerror
- e4bc8b5967 treesitter.foldexpr: only refresh valid buffers
- 48acbc4d64 treesitter.foldexpr: refresh in the buffers affected by OptionSet
- 8474f52978 treesitter.foldexpr: robustness against ctrl-c
- f81131cca2 tui: also reset cursor color if it was invisible (#31348)
- 4846bf05dc tui: avoid flushing buffer halfway an OSC 2 sequence (#30793)
- 720ec5cec2 tui: cursor color in suckless terminal #32310
- b5cb69f8a4 tui: handle key events for arrow and function keys (#31804)
- d7651b27d5 tui: move $COLORTERM check to _defaults.lua (#29197)
- a811d4babd tui: only reset cursor color if it was changed (#31337)
- 0c0352783f tui: remove DCS escaping in tmux (#32723)
- 47c741e30c tui: remove duplicate disabling of synchronized output (#28884)
- f32557ca67 tui: reset active attr ID when OSC 8 sequence is terminated (#29960)
- bc63ffcf39 tui: reset clear_region attributes during startup #28713
- b02c839414 tui: set id parameter in OSC 8 sequences (#29840)
- 0231265c8c tui: skip TUI in ui_rgb_attached (#29096)
- 8b8096500d tutor: incorrect lines marked as correct #29833
- 31745b17e6 types: add narrower vim.validate types
- 44410d063a types: add some vim.fn type annotations
- b813075b8a types: do not mark unstable API as private
- e947f226be types: use vararg return type annotation
- a1906c23dd ui: Windows :detach is opt-in
- 594c7f3d77 ui: avoid ambiguity about last chunk when flushing halfway (#29718)
- 216ec73972 ui: avoid redundant ext_cmdline events (#32237)
- 6cdcac4492 ui: clamp 'cmdheight' for other tabpages on screen resize (#31419)
- 318c0415d5 ui: correctly pass metadata to get_node_text #30222
- 7eba016c86 ui: ensure screen update before waiting for input #30576
- 5b6477be45 ui: flush ext_cmdline events before doing cmdpreview #27950
- 6e4df18b45 ui: no fast context for prompt message kinds #31224
- 6b8c56c7f6 ui: schedule UI detach (#32827)
- b66106a46c ui: superfluous showmode / excessive grid_cursor_goto #29089
- d1fd674df3 ui: update title in more cases (#31508)
- 442d338cb5 uri: uri_encode encodes brackets incorrectly for RFC2732 #31284
- d049752e45 version: fix vim.version().prerelease
- 8bdfc2ab2b version: return nil with empty string
- 6401b433f7 vim.fs: default to follow=false #32859
- 47e6b2233f vim.fs: dirname() returns "." on mingw/msys2 #30480
- 0bef3b911c vim.fs: joinpath() does not normalize slashes on Windows #31782
- 6dc0eb9f41 vim.fs.abspath: correctly handle UNC paths
- a8ace2c58a vim.fs.normalize: normalize case for windows drive letter
- 4c0d18c197 vim.iter: enable optimizations for arrays (lists with holes) (#28781)
- 734dba04d1 vim.system: close pipe handles after process handle
- 4e130c1ee4 vim.system: invalid MAX_TIMEOUT for 32-bit systems #31638
- ad3472e291 vim.system: resolve executable paths on windows
- 33464189bc vim.text: handle very long strings (#30075)
- 4cff418564 vim.text: remove assert from vim.text.hexdecode
- d338ec9cb2 vim.ui.open: prefer xdg-open on WSL #30302
- 8bf79bd13c vim.wo: never allow non-zero bufnr
- 453f2c52d2 vim_snprintf: special-case handling of binary format
- 32e128f209 watch: exclude .git when using inotifywait (#29914)
- 9e23b4e185 watch: ignore nonexistent paths (ENOENT)
- a18652ed61 win-msi: add bin to PATH per-machine after installation (#29099)
- 88f07d6ca4 win-msi: set installer scope to machine #29895
- 4f9311b759 window: making float with title/footer non-float leaks memory (#30551)
- 7b71fdbc1e window: respect hide flag of float windows when switching (#30507)
- 59da82abd9 wininfo: when freeing windows, free the lowest priority wininfo

PERFORMANCE
--------------------------------------------------------------------------------
- 48251134ee add fast path to vim.validate (#28977)
- 3abd7ed4a4 consider only active decorations when drawing lines
- 8d2ee542a8 decor: join predicates and matches cache
- 48e3ac60c6 diagnostics: cache line diagnostics when `current_line` is set #32288
- b8ddd3b6bb events: remove unnecessary loop in event_nr2name() (#32777)
- 15f2da55a8 events: use hashy for event name lookup (#32802)
- abf4b65a51 filetype: cache (more) pattern data during "add" time
- f61efe3fe7 filetype: implement parent pattern pre-matching (#29660)
- ff575b3886 filetype: optimize internal data structures
- dc04ef2a20 filetype: skip contents check in `match()` if there is no contents (#29596)
- 12d4caa9d3 keycodes: use hashy for string lookup
- f8fc6cb157 loader: reduce calls to Loader.cache_file
- 138a93a057 lsp: avoid repeated table lookup in completion.enable
- 7342e6b00d lsp: do not apply semantic tokens to folded lines
- c85d15e0d5 lsp: don't construct potentially expensive strings
- cc1f2d2ca6 lsp: don't copy completion items in filter pass
- 3e855d533f lsp: use faster version of str_byteindex
- 000129201c mouse: only generate <MouseMove> for a new cell positon (#31103)
- 3fdc430241 treesitter: cache queries strongly
- b192d58284 treesitter: calculate folds asynchronously
- c6abc97006 treesitter: do not use tree cursors with a small lifetime
- cbad2c6628 treesitter: don't block when finding injection ranges
- d9ee0d2984 treesitter: don't fetch parser for each fold line
- 562056c875 treesitter: only search for injections within the parse range
- c57a85e0ed treesitter: remove unnecessary foldexpr loop
- 64847fbdc9 treesitter: use `child_containing_descendant()` in `is_ancestor()`
- 4b02916334 treesitter: use child_containing_descendant() in has-ancestor? (#28512)
- 3f3e4837d5 validate: use lighter version
- 99b5ffd688 vim.text: use lookup table implementation for hex encoding (#30080)

BUILD
--------------------------------------------------------------------------------
- 104800ce2e "popcount" name conflict on NetBSD #28983
- 198a952c13 add luals check
- ef8067a19d add quotes around `CMAKE_GENERATOR` variable
- 32e16cb0b6 add utf8proc as dependency
- b213f5169c allow comment after #include for required header (#29722)
- 382eb878bc bump lua dev dependencies
- 1d815acd78 bump minimum cmake version to 3.16
- 5284a2a793 bump unibilium to v2.1.2
- ac5a6d9ff5 fix RelWithDebInfo optimization flags #31802
- 7c65224257 fix lint error on macos
- 046e0956ee fix or silence new clang-tidy warnings
- 5719f2b91a fix uncrustify install in nix devShell (#33020)
- 4a0ee22e77 make makefile work on msys
- 4ee65484b1 make makefile work on windows
- 1b90f4a9c4 mark CMake variables advanced #31412
- 0f24b0826a move all generator scripts to `src/gen/`
- e5ff302033 remove -O2 from gen_cflags
- d74c74aae3 remove `lintcommit` from `lint` target
- 573bcb2aaf remove enforcement of cmake build type
- 0e9c92a900 remove nix flakes (#28863)
- f09f5c45fa reuse code for deps.txt for both deps and main build
- e1dc824b7e set luals checklevel to Hint #32392
- cac86e9b4c silence "po" noise #30469
- 07b14c8e2e specify POST_BUILD when using add_custom_command
- e83ce331da use treesitter's CMakeLists.txt
- e268fcbdaa work around bug in make when PATH includes cmake as dir
- b288fa8d62 bump_deps: abort if archive doesn't exist
- 7ead328a48 cjson: sync with upstream (#32114)
- 0e2f92ed79 clint: make NOLINT work with header checks (#31281)
- 327110ff8c cmake: remove unnecessary policy code
- 535c2f8658 contrib: add zsh completion (#32617)
- 51d85f7ea5 deps: drop unused bundled bash, python parsers and queries
- 9216bc927c deps: fix formatc target on MSVC
- b3641b8008 deps: remove libtermkey dependency
- 1247684ae1 deps: remove msgpack-c dependency
- fa79a8ad6d deps: vendor libvterm at v0.3.3
- c614969570 docs: update CSS #28896
- 0a087f2073 generator: add dependencies on hashy (#32796)
- e178331488 lpeg: search for lpeg.so on MacOS
- 7e099cf3eb macos: disable deduplication in link step
- f4d9a2983a release.sh: fix hang when generating docs (#33026)
- b923fcbaf0 vim-patch.sh: don't ignore changes to version*.txt (#29425)
- 7aaa4a51b7 vim-patch.sh: include commit subject #28767
- 3146433190 vim-patch.sh: use 7 hex digits for runtime patch file name (#29940)
2025-03-26 14:48:09 +01:00
Mathias Fußenegger
6566b66f65 docs(lsp): completion.enable #33063 2025-03-26 06:43:40 -07:00
Justin M. Keyes
8a7e1b19b9 docs: news, lsp autocomplete #33047 2025-03-26 05:49:48 -07:00
Phạm Bình An
6b00c9acfd fix(lua): no omni/cmdline completion for vim.env (#33044)
Problem:
- `:lua vim.env.<Tab>` does not show completion of environment variables
- Meanwhile, `:let $<Tab>` does show completion of environment variables

Solution:
- Fix it
2025-03-26 07:35:12 +08:00
zeertzjq
a3b4743b43 vim-patch:9.1.1238: wrong cursor column with 'set splitkeep=screen' (#33060)
Problem:  With ':set splitkeep=screen', cursor did't restore column
          correctly when splitting a window on a line longer than the
          last line on the screen (after v9.1.0707)
Solution: Restore cursor column in `win_fix_scroll()` since it may be
          changed in `getvcol()` after 396fd1ec2956 (phanium).

Example:
```
echo longlonglongling\nshort | vim - -u NONE --cmd 'set
splitkeep=screen' +'norm $' +new +q
```

fixes: vim/vim#16968
closes: vim/vim#16971

7746348c5d

Co-authored-by: phanium <91544758+phanen@users.noreply.github.com>
2025-03-26 06:58:36 +08:00
Justin M. Keyes
d32780de4d fix(mswin): UI may hang on exit
Problem:
On Windows, since b360c06085, UI may hang on exit. #33019

Solution:
Restore the hack in on_proc_exit, until we can figure out why rpc_close
is not called in the UI client when the server closes the channel.
2025-03-25 15:14:28 +01:00
zeertzjq
c1ac55ba45 vim-patch:9.1.1236: tests: test_comments leaves swapfiles around (#33050)
Problem:  tests: test_comments leaves swapfiles around
Solution: use ':bw!' instead of ':close!'

closes: vim/vim#16955

35cb03648f

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-03-25 00:05:22 +00:00
Matthieu Coudron
5719f2b91a build: fix uncrustify install in nix devShell (#33020)
running "make format" from the nix devShell defined at https://github.com/nix-community/neovim-nightly-overlay/
failed with:
```
Install the project...
-- Install configuration: "Release"
CMake Error at cmake_install.cmake:52 (file):
  file INSTALL cannot find "/home/teto/neovim/build/usr/bin/uncrustify": No
  such file or directory.
```

Turns out the following uncrustify (probably cmake-generated) check:
```
   file(RPATH_CHECK
        FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/uncrustify"
        RPATH "")
```
would remove the executable when RPATH was non-empty.
I dont think it's much of an issue here as it's not an executable
supposed to be installed so seeing paths referenced in rpath getting removed should not be a concern
(which I beleive is the reason for the  check).
2025-03-24 22:15:22 +01:00
Justin M. Keyes
76eca62137 Merge #33043 redundar channel_close() 2025-03-24 10:15:35 -07:00
Justin M. Keyes
c49162be59 fix(channel): log after (not before) channel-close
Problem:
chan_close_on_err() writes to the log file before peforming its actual
work. This could be slightly misleading in terms of log timestamps, or
could delay important work on Windows where file-open/write can be slow.

Solution:
Log after closing the channel, instead of before.
2025-03-24 17:48:19 +01:00
Justin M. Keyes
e73a3f1edc refactor(channel): redundant channel_close()
Problem:
`receive_msgpack()` calls `channel_close()` just before calling
`chan_close_on_err()`, even though `chan_close_on_err()` always calls
`channel_close()`.

Solution:
Remove the redunant `channel_close()` in `receive_msgpack()`.
2025-03-24 17:38:34 +01:00
Christian Clason
c4e9ff30a6 fix(treesitter): sync queries with upstream
Update C highlight query from nvim-treesitter
2025-03-24 16:45:36 +01:00
Andrei Heidelbacher
563051a53e feat(clipboard): support g:clipboard="osc52" #33021
Problem:
Forcing Neovim to use OSC52 for the system clipboard should be simple
and concise, since OSC52 is widely supported (Alacritty, Ghostty,
iTerm2, WezTerm, Kitty, xterm, tmux, etc.) and is the most portable
approach for syncing clipboards across SSH.

Solution:
Support g:clipboard="osc52".
2025-03-24 05:17:56 -07:00
phanium
af4231d407 fix(cmdline): cmdline completion of _defer_require() modules #33007
Problem:
`:lua vim.lsp.c<tab>` does not list vim.lsp.completion in the completion
list after 24cea4c7f7.

Solution:
- Always include `vim.lsp._submodule` keys in candidates.
  - Fixes `vim.lsp.c<tab>` -> `vim.lsp.completion`.
- Eager-load `vim.lsp.completion` to get its completion.
  - Fixes `vim.lsp.completion.g<tab>` -> `vim.lsp.completion.get`.
2025-03-24 05:14:22 -07:00
phanium
c982608226 test(checkhealth): nested path 'runtimepath' #33034 2025-03-23 16:30:08 -07:00
luukvbaal
958df63606 test(log): use tempfile for expected error logs #33017 2025-03-23 16:12:50 -07:00
Au.
9516997eb0 fix(paste): wrong '[ mark after pasting a big string (streamed chunks) #33025
Problem
Pasting a big string ("streamed paste" with multiple chunks) sets the '[
mark to the edit from the last chunk, instead of the start of the paste.

Solution:
Set the '[ mark where the paste started, not where the last chunk was
inserted.

Note: `startpos == nil` is not equal to `phase == 1` because there may
be some empty chunks pasted which won't arrive here (returned at code
before).
2025-03-23 16:10:42 -07:00
Christian Clason
2eddd6f7c0 vim-patch:9.1.1231: filetype: SPA JSON files are not recognized
Problem:  filetype: SPA (single page application) JSON files are not
          recognized (used by pipewire and wireplumber)
Solution: detect pipewire and wireplumber configuration files as spajson
          filetype, include filetype, indent and syntax scripts for this
          new filetype (David Mandelberg).

I looked at all the files found by this command to see if the syntax
highlighting looked reasonable:

```
find {~/.config,/etc,/usr/share}/{pipewire,wireplumber} -type f -name \*.conf
```

References:
*   pipewire config files: https://docs.pipewire.org/page_config.html
*   wireplumber config files:
    https://pipewire.pages.freedesktop.org/wireplumber/daemon/configuration/conf_file.html
    and
*   https://pipewire.pages.freedesktop.org/wireplumber/daemon/locations.html

closes: vim/vim#16950

4e7b4308fb

Co-authored-by: David Mandelberg <david@mandelberg.org>
2025-03-23 11:47:42 +01:00
zeertzjq
f4d9a2983a build(release.sh): fix hang when generating docs (#33026)
It's been hanging since the change in #32638.
2025-03-22 22:39:31 +08:00
Eisuke Kawashima
4d9a1b9852 feat(provider/python)!: add python 3.13, drop 3.7 and 3.8 (EOL) #33022
https://devguide.python.org/versions/

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-03-22 07:20:46 -07:00
Au.
5187be81c2 fix(lsp): handle using array as open_floating_preview title (#33016) 2025-03-22 10:43:06 +08:00
Christian Clason
b165ad0671 build(deps): bump tree-sitter-vim to v0.5.0 2025-03-21 17:53:13 +01:00
Christian Clason
0ff630bfad build(deps): bump tree-sitter-markdown to v0.4.1 2025-03-21 17:53:13 +01:00
Christian Clason
10c0f6257a build(deps): bump tree-sitter-lua to v0.3.0 2025-03-21 17:53:13 +01:00
dundargoc
e0cd8cfba4 docs: misc (#32928)
Co-authored-by: James Trew <j.trew10@gmail.com>
Co-authored-by: przepompownia <przepompownia@users.noreply.github.com>
2025-03-21 19:28:29 +08:00
Justin M. Keyes
264b4303a0 docs: LSP completion #33006 2025-03-21 03:34:28 -07:00
luukvbaal
c908c2560d fix(log): unify error messages for vim.ui_attach/decor providers #33005
Problem:  Error messages that cause a vim.ui_attach() namespace to
          detach are not visible in the message history. Decoration
          provider and vim.ui_attach error messages are dissimilar.
Solution: Emit vim.ui_attach() errors as an actual message in addition
          to logging it. Adjust error message format.
2025-03-21 03:05:01 -07:00
Riley Bruins
fa85543e3b docs(treesitter): document TSNode:named_children()
This commit also gives an internal documentation description for
`TSNode:__has_ancestor()`.
2025-03-21 09:01:47 +01:00
zeertzjq
175c09bd66 vim-patch:9.1.1226: "shellcmdline" completion doesn't work with input() (#32998)
Problem:  "shellcmdline" completion doesn't work with input().
Solution: Use set_context_for_wildcard_arg().  Fix indent in nextwild()
          (zeertzjq).

There are some other inconsistencies for input() completion (ref vim/vim#948),
but since "shellcmdline" currently doesn't work at all, it makse sense
to at least make it work.

fixes: vim/vim#16932
closes: vim/vim#16934

7a5115ce50
2025-03-20 07:21:17 +08:00
luukvbaal
51853b82bc fix(messages): incorrect error message splitting and kind #32990
Problem:  Message kind logic for emitting an error message is convoluted
          and still results in emitting an unfinished message earlier than
          wanted.
Solution: Ensure emsg_multiline() always sets the kind wanted by the caller
          and doesn't isn't unset to logic for emitting the source message.
          Caller is responsible for making sure multiple message chunks are
          not emitted as multiple events by setting `msg_ext_skip_flush`...
2025-03-19 11:04:08 -07:00
phanium
c48cf18752 fix(checkhealth): module not found when &rtp has nested paths #32988
Problem: `:checkhealth` fail to find the module when `&rtp` have nested
paths.

Solution: find in order all existed `&rtp/lua` path rather than `&rtp`
to ensure prefix exist before trim `&rtp`.

In this case one module can be searched out from two different
`&rtp/lua`, we use the first `&rtp/lua` contain the module (like how
require() works).
2025-03-19 07:48:28 -07:00
Avinash Thakur
424f4cc038 fix(snippet): wrong indentation when snippet contains "^" #32970
## Problem
The pattern used to match indentation is wrong as can be seen in

```lua
-- current pattern doesn't match starting space
print(vim.inspect(("   xyz"):match("(^%s+)%S")))
-- nil

-- instead, it matches characters `^ ` in text
print(vim.inspect(("x^ yz"):match("(^%s+)%S")))
-- "^ "

-- indentation could've been matched by, however not required
print(vim.inspect(("   xyz"):match("^(%s+)%S")))
-- "   "
```

## Solution
We don't even need to modify `base_indent` at every line. If every line's indentation is calculated by the previous line's indentation (which already has starting indentation) added to the starting indentation, we see that indentation is multiplied on every line.

Hence, we only add the starting line indentation to every line.
2025-03-19 14:47:59 +00:00
zeertzjq
42db8b1759 fix(path): crash with nvim_get_runtime_file during wildcard expansion (#32992)
Problem:  Crash with nvim_get_runtime_file during wildcard expansion.
Solution: Ensure recursive gen_expand_wildcards() is allowed when
          calling os_breakcheck()
2025-03-19 22:36:08 +08:00
markstegeman
21cbd90007 fix(filetype): normalize full path before matching #32227
Problem:
On Windows, treesitter query files are not recognized as such when
opened from inside their directory, because the full path returned from
fnamemodify(_, ':p') contains backslashes, while the filetype patterns
expect forward slashes.

Solution:
Normalize the result of fnamemodify(_, ':p') before trying to match it
to filetype patterns.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-03-19 05:41:25 -07:00
Mars Peng
f1fcf653cb fix(diagnostic): clear virtual_lines autocmd only for valid buf #32979 2025-03-19 05:27:20 -07:00
glepnir
0e59f6f4c7 fix(api): don't use 'winborder' when reconfiguring float (#32984)
Problem: Reconfiguring a float window applies the global 'winborder'.
Solution:
- Ignore 'winborder' when reconfiguring a float window.
- Still apply 'winborder' when converting a split to a float window.
2025-03-19 12:16:20 +00:00
Justin M. Keyes
74fcc9452c fix(runtime): gO always says "Help TOC" #32971
Problem:
gO always says "Help TOC".

Solution:
Use a generic title instead.
2025-03-19 04:17:00 -07:00
luukvbaal
d6653e1cc9 fix(marks): ensure decor is removed with proper range (#32973)
Problem:  Paired mark whose end is in front of its start should not have
          its decor removed (as fixed by 72f630f9), but may still need to
          have its range redrawn.
Solution: Still call `buf_decor_remove()` but ensure it is not called with
          an inverse range when `extmark_del()` is called on an end mark.
2025-03-19 10:00:42 +00:00
Christian Clason
5ff8a2fa8b vim-patch:40ab82b: runtime(sh): remove invalid commented out line in syntax script
40ab82b974

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-03-19 10:24:51 +01:00
Christian Clason
ef591f46bf vim-patch:711f4a0: runtime(sh): update sh indent script
fixes: vim/vim#16930

711f4a07f3

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-03-19 10:24:51 +01:00
Christian Clason
17d0420e65 vim-patch:11ab02c: runtime(go): use :term for keywordprg for nvim/gvim
Problem:
- The document from `go doc` can be very long, and you can scroll if
  using `!` to run shell command in Gvim.
- I realize that I didn't fully mimic behavior of default keywordprg
  in Nvim in the last commit.

Solution:
- Use builtin terminal for keywordprg in Gvim
- In Nvim (both TUI and GUI), it should mimic the behavior of Vim
  `:term`, `:Man`, and `:help`

closes: vim/vim#16911

11ab02c819

Co-authored-by: Phạm Bình An <phambinhanctb2004@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-03-19 10:24:51 +01:00
Christian Clason
ac2fcb5f76 vim-patch:ad2f6b6: runtime(keymap) Add forward slash (/) to russian-jcukenwin keymap
closes: vim/vim#16912

ad2f6b6662

Co-authored-by: Marat Amerov <maratamerov@gmail.com>
2025-03-19 10:24:51 +01:00
zeertzjq
63bbb7c109 fix(api): fix 'winborder' preventing splits with nvim_open_win (#32981)
While at it, rename the p_winbd variable to p_winborder, as 'winbd' is
not the option's short name.

Co-authored-by: glepnir <glephunter@gmail.com>
2025-03-19 07:28:24 +00:00
zeertzjq
190d0241e2 fix(options): fix 'winborder' accepting multiple string values (#32978)
Problem:  'winborder' accepting multiple string values.
Solution: Use the fallback did_set_str_generic() callback instead of
          did_set_winborder() which calls opt_strings_flags() with
          incorrect last argument.
2025-03-19 14:17:53 +08:00
Acaibrid
aafbd442b2 vim-patch:9.1.1220: filetype: uv.lock file not recognized (#32955)
Problem:  filetype: uv.lock file not recognized
Solution: detect uv.lock file as toml filetype
          (Acaibird)

closes: vim/vim#16924

18a6853a76
2025-03-18 23:34:56 +00:00
zeertzjq
430d12a4fd vim-patch:9.1.1221: Wrong cursor pos when leaving Insert mode just after 'autoindent' (#32976)
Problem:  Wrong cursor position and '^' mark when leaving Insert mode
          just after 'autoindent' and cursor on last char of line.
Solution: Don't move cursor to NUL when it wasn't moved to the left
          (zeertzjq).

fixes: vim/vim#15581
related: neovim/neovim#30165 neovim/neovim#32943
closes: vim/vim#16922

a3a7d10bfb
2025-03-18 23:34:02 +00:00
zeertzjq
4d83649d10 vim-patch:9.1.1222: using wrong length for last inserted string (#32975)
Problem:  using wrong length for last inserted string
          (Christ van Willegen, after v9.1.1212)
Solution: use the correct length in get_last_insert_save(), make
          get_last_insert() return a string_T (John Marriott)

closes: vim/vim#16921

8ac0f73eb1

N/A patches:
vim-patch:9.1.1129: missing out-of-memory test in buf_write()
vim-patch:9.1.1218: missing out-of-memory check in filepath.c

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-03-19 07:08:39 +08:00
glepnir
62d9fab9af feat(float): add winborder option (#31074)
Problem:
There is currently no global option to define the default border style for floating windows. This leads to repetitive code when developers need consistent styling across multiple floating windows.

Solution:
Introduce a global option winborder to specify the default border style for floating windows. When a floating window is created without explicitly specifying a border style, the value of the winborder option will be used. This simplifies configuration and ensures consistency in floating window appearance.

Co-authored-by: Gregory Anders <greg@gpanders.com>
2025-03-18 16:05:35 -05:00
Christian Clason
eefd72fff7 build(deps): bump tree-sitter-query to v0.5.1 2025-03-18 15:21:37 +01:00
Christian Clason
d774fc6b33 build(deps): bump tree-sitter-vimdoc to v3.0.1 2025-03-18 14:44:38 +01:00
Christian Clason
9177371014 fix(help): remove runnable code virtual text
Problem: Virtual text indicating runnable code examples in help files is
intrusive and non-configurable (and often denotes actually non-working
examples).

Solution: Remove virtual text.
2025-03-18 14:22:08 +01:00
Justin M. Keyes
6623b4e050 docs: misc #32959 2025-03-18 06:20:47 -07:00
Justin M. Keyes
7333c39e6c docs: misc #32959 2025-03-18 06:18:37 -07:00
phanium
29a47b39cc fix(runtime): E15: Invalid expression in lua file when gf
Problem:
after https://github.com/neovim/neovim/pull/32719, `gf` error in lua:
```
E15: Invalid expression: "v:lua.require"vim._ftplugin.lua".includeexpr()"
E447: Can't find file "vim._ftplugin.lua" in path
```

Solution:
* use single quote (no idea why there's two pair double quote in
  expression).
* add missing `v:fname`.
2025-03-18 10:10:36 +01:00
Luuk van Baal
d40481322a fix(lua): ensure inspect_pos() only shows visible highlight extmarks
Problem:  Unpaired marks are shown with `filter.extmarks == true`, which
          should only return visible highlights. Misleading `end_col`
          included in `inspect_pos()` for unpaired mark; it is set to
          `start_col + 1` which would be a visible highlight, which it is
          not. Custom "is_here" filter used to get extmarks overlapping a
          position.

Solution: Exclude unpaired highlight extmarks with `filter.extmarks == true`.
          Set `end_col` to `start_col` for an unpaired mark. Supply
          appropriate arguments to nvim_buf_get_extmarks() to return
          overlapping extmarks; exclude marks whose end is at `{row, col}`
          with `filter.extmarks == true`.
2025-03-18 09:39:19 +01:00
Justin M. Keyes
1369d86812 test: cleanup ftplugin_spec.lua #32948
Problem:
- cannot run ftplugin_spec.lua by itself
- test leaves foo/ dir

Solution:
- fix setup and teardown
2025-03-17 17:13:04 -07:00
Christian Clason
3b1d0e7f70 fix(diagnostic): remove deprecated severity_limit option
Deprecated to be removed in 0.11
2025-03-17 23:43:09 +01:00
zeertzjq
97bbc49cda Merge pull request #32935 from zeertzjq/vim-3495497
vim-patch: too many strlen() calls in edit.c
2025-03-18 06:41:58 +08:00
Phạm Bình An
08c328b8b0 feat(runtime): Lua ftplugin 'includeexpr' #32719
Problem:
Current `'includeexpr'` in runtime/ftplugin/lua.vim doesn't work with Nvim Lua.

Solution:
Provide an improved 'includeexpr' for Lua in "ftplugin/lua.lua".

Closes: https://github.com/neovim/neovim/issues/32490
2025-03-17 15:41:07 -07:00
zeertzjq
d717f8605a vim-patch:9.1.1216: Pasting the '.' register multiple times may not work
Problem:  Pasting the '.' register multiple times may work incorrectly
          when the last insert starts with Ctrl-D and ends with '0'.
          (after 9.1.1212)
Solution: Restore the missing assignment (zeertzjq).

closes: vim/vim#16908

61b3544424
2025-03-18 06:12:40 +08:00
zeertzjq
59d8d50c5b vim-patch:3495497: patch 9.1.1212: too many strlen() calls in edit.c
Problem:  too many strlen() calls in edit.c
Solution: refactor edit.c and remove strlen() calls
          (John Marriott)

This commit attempts to make edit.c more efficient by:

- in truncate_spaces() pass in the length of the string.
- return a string_T from get_last_insert(), so that the length of the
  string is available to the caller.
- refactor stuff_insert():

  - replace calls to stuffReadbuff() (which calls STRLEN() on it's
    string argument) with stuffReadbuffLen() (which gets the length of
    it's string argument passed in).
  - replace call to vim_strrchr() which searches from the start of the
    string with a loop which searches from end of the string to find the
    last ESC character.

- change get_last_insert_save() to call get_last_insert() to get the
  last_insert string (the logic is in one place).

closes: vim/vim#16863

34954972c2

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-03-18 06:12:29 +08:00
luukvbaal
063b69bab4 fix(column): unnecessary redraws with resized 'statuscolumn' (#32944)
Problem:  Since 3cb1e825, all windows with 'statuscolumn' set, and a
          resized 'signcolumn' for a particular buffer are marked
          to be fully redrawn when the first window is encountered.
          The "resized" variable is only unset after all windows have
          been drawn, so this results in windows that have just been
          draw to be marked for redraw again, even though the
          signcolumn did not change size again.
Solution: Replace the `resized` variable with a `last_max` variable that
          is changed when the first window into buf is encountered.
2025-03-17 21:52:45 +01:00
Justin M. Keyes
5440e59247 Merge #32810 docs 2025-03-17 04:59:31 -07:00
Justin M. Keyes
f96606371c docs: misc 2025-03-17 12:31:53 +01:00
Justin M. Keyes
041a939eeb docs(api): rename "handle" => "id" 2025-03-17 12:06:38 +01:00
Justin M. Keyes
cab3950762 docs: OSC 133
The "end" termcode is not actually needed for our purposes. And the
suggested $PS1 has trouble with bash's "reverse find" (CTRL-r) feature,
probably because I did it wrong...
2025-03-17 12:06:38 +01:00
Lewis Russell
d0cda9d6c5 Merge pull request #32871 from ofseed/test-lsp
test(lsp): add some tests for LSP bugs
2025-03-17 09:11:05 +00:00
Yi Ming
96e5b61be1 test(lsp): add a test for refreshing hints after being requested 2025-03-17 14:44:55 +08:00
Yi Ming
648b7f6101 test(lsp): add a test for resetting the active request after receiving error 2025-03-17 14:44:51 +08:00
Christian Clason
502324a7b5 vim-patch:3c7d9b1: runtime(prql): include prql syntax script
References:
https://prql-lang.org/
https://github.com/PRQL/prql

closes: vim/vim#16885

3c7d9b11c8

Co-authored-by: Jonathan <vanillajonathan@users.noreply.github.com>
2025-03-16 23:56:39 +01:00
Riley Bruins
c85d15e0d5 perf(lsp): don't construct potentially expensive strings 2025-03-16 19:12:36 +01:00
Matthieu Coudron
535c2f8658 build(contrib): add zsh completion (#32617)
* build(contrib): add zsh completion

this is not part of the build system yet, so packager managers are
supposed to install the file by themselves.

bash doesn't seem to provide shell completion, zsh embeds its own
completion that is bundled with vim's.

Instead of copying zsh's completion, this generated one via
https://github.com/RobSis/zsh-completion-generator


---------

Co-authored-by: Eisuke Kawashima <e.kawaschima+github@gmail.com>
2025-03-16 18:15:00 +01:00
Mathias Fußenegger
3e3775961f refactor(lsp)!: rename lsp.completion.trigger() to get() (#32911)
Problem: `trigger` is a custom word not yet used in APIs. 

Solution: Use `get` instead because the main effect is that the 
completion candidates will be collected (and shown by default,
but follow-up commits are planned to add an `on_result` callback
that allows more general handling).

---------

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2025-03-16 13:58:38 +01:00
phanium
f5dd30948e fix(checkhealth): handle nested lua/ directory #32918
Problem: :checkhealth fails if plugin has nested "lua/" directory

Solution: trim `{runtimepath}/lua` from fullpath to get subpath
(`./**/{health, health/init.lua}`)
2025-03-16 05:49:05 -07:00
Justin M. Keyes
7aae3f98de refactor(test): move runtime_spec.lua to editor/ #32919
Problem:
The `lua/` tests dir is for Lua stdlib tests. It is not for anything
that randomly happens to be implemented with Lua.

Solution:
Move `lua/runtime_spec.lua` to `editor/runtime_spec.lua`.
2025-03-16 05:43:06 -07:00
xzb
17c25a66fc fix(diagnostic): virtual lines should scroll horizontally 2025-03-16 12:31:29 +01:00
luukvbaal
72f630f92d fix(marks): issues with invalid marks and marks beyond eob (#32862)
Problem:  Marks that go beyond the end of the buffer, and paired marks
          whose end is in front of its start mark are added to and
          removed from the decor. This results in incorrect tracking
          of the signcolumn.
Solution: Ensure such marks are not added to and removed from the decor.
2025-03-16 12:15:50 +01:00
Gregory Anders
466f20dd70 refactor(tui): disable kitty key event reporting
Temporary measure for the stable release. Re-enable for nightly after
0.11 release.
2025-03-16 12:03:45 +01:00
Yi Ming
1862d3210d docs(lsp): simplify example of enabling LSP folding 2025-03-16 11:21:44 +01:00
Phạm Bình An
f5714994bc feat(runtime): Lua ftplugin sets 'omnifunc', 'foldexpr' #32697
Problem:
- Many other ftplugin have defined 'omnifunc', but the Lua one doesn't
  define one, even though there is `vim.lua_omnifunc()`
- Users may want "stupid" completion to fix Lua config with
  `nvim --clean` in case they breaks it
- Nvim doesn't port Lua foldexpr from Vim

Solution:
- Set 'omnifunc' to 'v:lua.vim.lua_omnifunc' in ftplugin/lua.lua
- Set 'foldexpr' to use treesitter
2025-03-15 09:44:53 -07:00
Justin M. Keyes
afdad5c76e refactor(test): deprecate n.feed_command() #32915
Problem:
`feed_command()` was added as a "bridge" for old test code. 99% of those
cases should be using `n.command()`, which raises errors instead of
silently continuing the test.

Solution:
Deprecate `feed_command()`. It should not be used in new tests.
All usages of `feed_command()` should be converted to `command()` or
`feed()`.
2025-03-15 08:45:39 -07:00
luukvbaal
19fc65acbc fix(statuscolumn): misleading v:lnum for virtual lines #32912
Problem:  Virtual 'statuscolumn' lines are evaluated with a misleading v:(rel)num.
          Namely set to the line above for `virt_lines_above = true` lines, or even
          the last drawn line for a partial redraw.
Solution: Set `v:lnum` for the first evaluated row of a line, first above
          virtual line of a row and first non-virtual line of a row.
2025-03-15 08:18:23 -07:00
Tobias Schmitz
f8d5811c71 fix(lsp): correctly check for "codeAction/resolve" support 2025-03-15 15:56:47 +01:00
dundargoc
026cfa28d0 docs: misc
Co-authored-by: Au. <acehinnnqru@gmail.com>
Co-authored-by: Daniel Rainer <daniel.rainer@localhost>
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: Lewis Russell <lewis6991@gmail.com>
Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
Co-authored-by: Pierre Barbin <pierre@heitzsystem.com>
Co-authored-by: Riley Bruins <ribru17@hotmail.com>
Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
Co-authored-by: phanium <91544758+phanen@users.noreply.github.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-03-15 15:00:44 +01:00
bekaboo
a41b6fd173 fix(lsp): autocmds to close lsp preview windows not cleared
Problem: Augroup to close lsp preview hover window is not cleared after
the window is closed because of unmatched group name.

Solution: Delete the augroup before closing the preview window with
correct group name.
2025-03-15 14:59:06 +01:00
Justin M. Keyes
4662ad5643 feat(defaults): completeopt=popup #32909
Assuming that completeopt=popup does what its documentation claims, it
is more appropriate that completeopt=preview as a default.
2025-03-15 13:07:21 +00:00
Christian Clason
d8eec81560 fix(treesitter): update lua, markdown queries 2025-03-15 12:10:22 +01:00
Christian Clason
94de236815 build(deps): bump tree-sitter-c to v0.23.4 2025-03-15 12:10:22 +01:00
Luuk van Baal
a70ad5cdb6 fix(cmdline): ext_cmdline block events for conditionals
Problem:  No block events emitted with ext_cmdline for :if, :while, :try etc.
Solution: Emit cmdline block events; store the indent level of the
          previous cmdline and whether a block event was emitted.
2025-03-15 12:09:22 +01:00
zeertzjq
98c1355e2f test(old): fix test_tabline failure (#32907)
Also fix tests after test_sha256 in test_alot.vim being skipped.
2025-03-15 10:53:33 +00:00
zeertzjq
85d125cac4 vim-patch:9.1.1206: tests: test_filetype fails when a file is a directory (#32905)
Problem:  tests: test_filetype fails when a file is a directory
          (Eisuke Kawashima)
Solution: When encountering a directory instead of a file, skip that
          particular filetype test

fixes: vim/vim#16894

63a885b650

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-03-15 10:00:40 +00:00
glepnir
551e26963b vim-patch:9.1.1205: completion: preinserted text not removed when closing pum (#32903)
Problem:  completion: preinserted text not removed when closing pum
Solution: delete preinsert text inside in ins_compl_stop() (glepnir).

closes: vim/vim#16891

84a7503e29
2025-03-15 09:40:25 +00:00
zeertzjq
ec8fc28743 vim-patch:9.1.1204: MS-Windows: crash when passing long string to expand() (#32902)
Problem:  MS-Windows: crash when passing long string to expand() with
          'wildignorecase'.
Solution: Use the same buflen as unix_expandpath() in dos_expandpath().
          Remove an unnecessary STRLEN() while at it (zeertzjq).

closes: vim/vim#16896

00a749bd90
2025-03-15 09:34:56 +00:00
Christian Clason
9ef80352b6 vim-patch:96395e1: runtime(cs): Update C# runtime files
closes: vim/vim#16884

96395e1512

Co-authored-by: Nick Jensen <nickspoon@gmail.com>
2025-03-15 10:26:56 +01:00
zeertzjq
1b1af8aae8 vim-patch:9.1.1203: matchparen keeps cursor on case label in sh filetype (#32900)
Problem:  matchparen keeps cursor on case label in sh filetype
          (@categorical, after 9.1.1187).
Solution: Use :defer so that cursor is always restored, remove checks
          for older Vims, finish early if Vim does not support :defer

fixes: vim/vim#16887
closes: vim/vim#16888

47071c6076
2025-03-15 17:18:08 +08:00
zeertzjq
25ba8392f2 vim-patch:2329bd4: runtime(doc): fix a typo in gitrebase filetype (#32899)
Introduced in 4d2c4b90f.

closes: vim/vim#16892

2329bd427a

Co-authored-by: skshetry <18718008+skshetry@users.noreply.github.com>
2025-03-15 17:17:56 +08:00
zeertzjq
e7627db35f Merge pull request #32895 from zeertzjq/vim-8.2.4963
vim-patch: buffer overflow when expanding long file name
2025-03-15 08:38:07 +08:00
zeertzjq
b0b61c42b3 vim-patch:9.0.1458: buffer overflow when expanding long file name
Problem:    Buffer overflow when expanding long file name.
Solution:   Use a larger buffer and avoid overflowing it. (Yee Cheng Chin,
            closes vim/vim#12201)

a77670726e

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-03-15 08:19:34 +08:00
zeertzjq
ad5bced637 vim-patch:8.2.4963: expanding path with "/**" may overrun end of buffer
Problem:    Expanding path with "/**" may overrun end of buffer.
Solution:   Use vim_snprintf().

386c24cd26

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-03-15 08:15:58 +08:00
zeertzjq
f1422a313f vim-patch:f22580e: runtime(doc): update a few minor omissions from 5876016 and 4d2c4b9 (#32888)
f22580e57c

Skip options.txt: included in #30189

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-03-14 12:17:17 +00:00
zeertzjq
a25ce5762d test: do not dedent() in feed() (#32884)
Most callers of feed() do not expect feed() to dedent.
Now use a literal space in tests where it looks better.
2025-03-14 09:12:35 +00:00
Justin M. Keyes
4a5585da7e test: flaky loop_spec.lua #32885
Problem:
Test may fail because it matches a Lua table address, and the following
whitespace may differ depending on the stringified address length:

    test/functional/lua/loop_spec.lua:233: Row 3 did not match.
    Expected:
      |{3:                                                  }|
      |{9:Error executing callback:}                         |
      |*{9:uv_idle_t: 0x{MATCH:%w+}}                         |
      |{6:Press ENTER or type command to continue}^           |
    Actual:
      |{3:                                                  }|
      |{9:Error executing callback:}                         |
      |*{9:uv_idle_t: 0xd4c2820a00}                           |
      |{6:Press ENTER or type command to continue}^           |

Solution:
Match a variable amount of whitespace.
2025-03-14 09:09:16 +00:00
Mathias Fußenegger
123f8d229e feat(snippet): set snippet keymaps permanent instead of dynamic (#31887)
Problem:

Given that `vim.snippet.expand()` sets temporary `<tab>`/`<s-tab>`
keymaps there is no way to build "smart-tab" functionality where `<tab>`
chooses the next completion candidate if the popup menu is visible.

Solution:

Set the keymap permanent in `_defaults`.

The downside of this approach is that users of multiple snippet engine's
need to adapt their keymaps to handle all their engines that are in use.
For example:

    vim.keymap.set({ 'i', 's' }, "<Tab>", function()
      if foreign_snippet.active() then
        return "<Cmd>lua require('foreign_snippet').jump()<CR>"
      elseif vim.snippet.active({ direction = 1 }) then
        return "<Cmd>lua vim.snippet.jump(1)<CR>"
      else
        return key
      end
    end, { expr = true })

Upside is that using `vim.keymap.set` to override keymaps is a well
established pattern and `vim.snippet.expand` calls made by nvim itself
or plugins have working keymaps out of the box.


Co-authored-by: Maria José Solano <majosolano99@gmail.com>
2025-03-14 09:51:52 +01:00
Mike
6401b433f7 fix(vim.fs): default to follow=false #32859
Problem:
Following symlinks can have surprising behavior and slow performance.

Solution:
Do not set it by default.
2025-03-14 01:36:39 -07:00
zeertzjq
2db1ae37f1 refactor(gen_keycodes): put TAB and K_TAB together (#32882)
Keep track of the original indexes of both TAB and K_TAB, so that there
doesn't have to be an extra table and loop for K_TAB.
2025-03-14 03:36:24 +00:00
zeertzjq
6d40fd1dbc vim-patch:4d2c4b9: runtime(doc): document gitrebase filetype (#32881)
closes: vim/vim#16883

4d2c4b90fb

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-03-14 08:27:02 +08:00
zeertzjq
4f6196e91d vim-patch:9.1.1200: cmdline pum not cleared for input() completion (#32879)
Problem:  Cmdline pum not cleared for input() completion.
Solution: Temporary reset RedrawingDisabled in cmdline_pum_cleanup(),
          like what is done in wildmenu_cleanup() (zeertzjq).

fixes: vim/vim#16874
closes: vim/vim#16876

1830e787f6

No code change is needed in Nvim, as RedrawingDisabled does not prevent
the compositor from removing a grid.
2025-03-13 23:15:53 +00:00
Luuk van Baal
282f73f067 fix(messages): no trailing newline for inputlist, tselect, z= with ext_messages
Problem:  Various list commands end in a newline to go to a new line on
          the message grid for the prompt message, which is unwanted
          with ext_messages.
Solution: Don't emit a trailing newline with ext_messages for
          inputlist(), :tselect and z=.

Co-authored-by: Tomasz N <przepompownia@users.noreply.github.com>
2025-03-13 11:33:35 +01:00
zeertzjq
6e588519c8 vim-patch:9.1.1196: filetype: config files for container tools are not recognized (#32873)
Problem:  filetype: config files for container tools are not recognized
Solution: detect the ones that aren't detected yet as toml filetype
          (David Mandelberg)

The .containerignore format doesn't look exactly the same as gitignore,
but very close. And .dockerignore is already using gitignore.

References:
https://github.com/containers/common/blob/main/docs/containerignore.5.md
https://github.com/containers/common/blob/main/docs/containers.conf.5.md
https://github.com/containers/storage/blob/main/docs/containers-storage.conf.5.md
https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md
https://github.com/containers/image/blob/main/docs/containers-registries.conf.d.5.md

I wasn't sure exactly how to interpret what containers.conf(5) was
saying about modules, so I looked at
https://github.com/containers/common/tree/main/pkg/config/testdata/modules
to get examples, and based the detection off those.

closes: vim/vim#16852

7546afbf52

Co-authored-by: David Mandelberg <david@mandelberg.org>
2025-03-13 17:38:30 +08:00
Christian Clason
543e40624e ci(deps): bump lua-language-server to 3.13.9 2025-03-13 09:23:55 +01:00
phanium
d832518ec6 fix(lua): vim.hl.on_yank highlights wrong region with yi' (#32850)
Problem: yi' don't highlight last character since
8ce504820a.

Solution: Always use `opts.inclusive=true`, since calculation of `"]`
(`b_op_end`) have taken `inclusive` into account.
2025-03-13 09:11:08 +08:00
zeertzjq
b25527d20d vim-patch:9.1.1198: [security]: potential data loss with zip.vim (#32867)
Problem:  [security]: potential data loss with zip.vim and special
          crafted zip files (RyotaK)
Solution: use glob '[-]' to protect filenames starting with '-'

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-693p-m996-3rmf

f209dcd3de

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-03-13 08:47:02 +08:00
zeertzjq
90d1260cb8 vim-patch:9.1.1195: inside try-block: fn body executed with default arg undefined (#32866)
Problem:  inside try-block: fn body executed when default arg is
          undefined
Solution: When inside a try-block do not execute function body after an
          error in evaluating a default argument expression
          (Shane Harper).

closes: vim/vim#16865

2d18789aa6

Co-authored-by: Shane Harper <shane@shaneharper.net>
2025-03-13 08:46:47 +08:00
zeertzjq
dbd76c2c41 test: reduce flakiness in blocking wait tests (#32868) 2025-03-13 00:42:02 +00:00
zeertzjq
785e620700 vim-patch:c1c3b5d: runtime(doc): remove unnecessary "an" (#32865)
"umask" is pronounce like "youmask", so having an "an" before it is a
bit strange.  In other places in the help, "umask" is not preceded by
either "a" or "an", and sometimes preceded by "the".

Also, "Note" is usually followed either by ":" or "that" in builtin.txt,
so add a ":" after "Note".

closes: 16860

c1c3b5d6a0
2025-03-13 07:15:19 +08:00
Jaehwang Jung
c78728a384 fix(diagnostic): clear autocmd only for valid buf (#32861) 2025-03-12 09:30:05 -05:00
Gregory Anders
0418107074 fix: update osc52 termfeatures flag on UIEnter/UILeave (#32756)
Problem:

Nvim tries to use OSC 52 even when no TUIs are attached.

Solution:

On each UIEnter/UILeave event, check that there is a TUI client connected to Nvim's stdout.
2025-03-12 08:11:19 -05:00
markstegeman
69a19295f8 fix(terminal): delay when finishing terminal process #32846
Problem:
On Windows, the first attempt at finishing up after a terminal process
terminates is delayed by 200ms, even if it would be possible to finish
up immediately.

Solution:
Make the first attempt at finishing up immediately after the process
terminates.
2025-03-12 05:35:14 -07:00
glepnir
3bc72a4980 refactor(popup): use plines_m_win #32857
Problem: Custom inline function duplicated existing functionality

Solution: Used existing plines_m_win function to reduce code duplication
2025-03-12 05:29:03 -07:00
Christian Clason
eea0aff4e5 ci(deps): bump lua-language-server to 3.13.8 2025-03-12 12:04:56 +01:00
Lewis Russell
ed07167261 fix(lsp): handle non-existent configs in lsp.config/enable 2025-03-12 09:06:28 +00:00
zeertzjq
c63e794b10 vim-patch:4fa2dd2: runtime(compiler): add comment for Dispatch (#32856)
closes: vim/vim#16854

4fa2dd2405

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2025-03-12 16:49:36 +08:00
Riley Bruins
44ccd9ca24 feat(treesitter): allow iter_captures to accept opts
This matches the `iter_captures` functionality to the `iter_matches`
functionality, allowing it to specify a match limit and start depth for
the query iterator.
2025-03-12 09:41:40 +01:00
Christian Clason
55fe49cadf build(deps): bump luajit to 538a82133 2025-03-12 09:37:55 +01:00
Muntasir Mahmud
02ed5dc088 vim-patch:2347330: runtime(compiler): allow customizing exe and args for tsc (#32853)
closes: vim/vim#16853

23473303b7

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2025-03-12 08:00:00 +00:00
Maria José Solano
a94a2927d0 feat(treesitter): allow passing lang to InspectTree 2025-03-12 08:58:41 +01:00
Muntasir Mahmud
092529ebbf vim-patch:a8aeeeb: runtime(tera): remove unwanted code and fix issues in syntax script (#32848)
closes: vim/vim#16857

a8aeeeb9aa
2025-03-12 07:52:57 +08:00
zeertzjq
bcafbc3f7b vim-patch:0a336cc: runtime(doc): clarify that a umask is applied to mkdir() (#32845)
fixes: vim/vim#16849

0a336ccb57

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-03-11 22:46:45 +00:00
Gregory Anders
6b8c56c7f6 fix(ui): schedule UI detach (#32827)
When a UI detaches it will execute any UILeave events. Autocommands
cannot run in a libuv handler because they will in turn poll the event
loop, which results in recursive loop execution. So we schedule the
callback to detach the UI on the main event queue.

We also have to schedule the exit when the RPC channel is closed to
ensure it does not run until after `remote_ui_disconnect` has run,
otherwise it will hang.
2025-03-11 15:35:12 -05:00
Will Lillis
dc1888fcfb refactor(lsp): rename on_publish_diagnostics parameter #32776
* fix(lsp): rename `on_publish_diagnostics` parameter: result->params
* fix(colors): specify local var type to address lint failure
2025-03-11 07:22:20 -07:00
Ian Chamberlain
8b5a0a00c8 feat(treesitter): allow disabling captures and patterns on TSQuery (#32790)
Problem: Cannot disable individual captures and patterns in treesitter queries.

Solution: 
* Expose the corresponding tree-sitter API functions for `TSQuery` object. 
* Add documentation for `TSQuery`.
* Return the pattern ID from `get_captures_at_pos()` (and hence `:Inspect!`).
2025-03-11 14:45:01 +01:00
phanium
0829e7575d fix: warn when :InspectTree on buffer with no parser #32783
Problem: `InspectTree` error on buffer without ts parser attached.

Solution: show a more correct warning.
2025-03-11 06:15:22 -07:00
zeertzjq
b9d693b804 ci(test): enable translations in at least one job (#32833)
Enable translations in the GCC release job, as it's the fastest.
Although there aren't many tests for translation behavior, this still
allows ensuring that Nvim isn't broken when translations are enabled.
2025-03-11 20:14:33 +08:00
glepnir
a14fca432b fix(lsp): improve LSP floating preview window cleanup #31353
Problem: The current implementation creates a unique autocommand group for each floating preview window, which is inefficient and can lead to numerous autocommand groups.

Solution: Use a single shared autocommand group with improved window validation to properly clean up LSP floating preview windows.
2025-03-11 05:10:09 -07:00
glepnir
55bdb077b7 fix(lsp): wrapped ctx in opts before passed to vim.lsp.completion.trigger #32837
Problem: ctx is passed directly to M.trigger. In fact, it is a field of opts.

Solution: wrapped in a table and passed to M.trigger.
2025-03-11 05:05:36 -07:00
Christian Clason
b750dee0a5 Merge pull request #32836 from clason/bump/luals
ci(deps): bump lua-language-server to 3.13.7
2025-03-11 11:09:38 +01:00
Christian Clason
8f056f63e3 ci(deps): bump lua-language-server to 3.13.7 2025-03-11 10:47:11 +01:00
zeertzjq
7e2b75760f vim-patch:9.1.1193: Unnecessary use of STRCAT() in au_event_disable() (#32829)
Problem:  Unnecessary use of STRCAT() in au_event_disable().  STRCAT()
          seeks to the end of new_ei, but here the end is already known.
Solution: Use STRCPY() and add p_ei_len to new_ei.  Also fix a typo in a
          comment.  Add a test that 'eventignore' works in :argdo
          (zeertzjq).

closes: vim/vim#16844

969e11a18b

Cherry-pick p_ei_len from patch 9.1.0256.
2025-03-11 06:54:17 +08:00
zeertzjq
1f49a59b8b fix(events): fix incorrect capitalization of Cmdwin* events (#32813)
The name of Cmdwin* events were changed to CmdWin* in 8ed2dbf6e2
without explanation. This commit changes them back.
This doesn't affect the creation or execution of autocommands. It only
affects the listing of autocommands.
2025-03-11 06:49:32 +08:00
zeertzjq
0ef1147313 Merge pull request #32828 from zeertzjq/vim-9.1.1186
vim-patch:9.1.{1186,1191,1194}: filetype: help files in git repos are not detected
2025-03-11 06:48:17 +08:00
zeertzjq
4533c40786 vim-patch:9.1.1194: filetype: false positive help filetype detection
Problem:  filetype: false positive help filetype detection
Solution: Only detect a file as help if modeline appears either at start
          of line or is preceded by whitespace (zeertzjq).

closes: vim/vim#16845

6763b0ee95
2025-03-11 06:24:57 +08:00
zeertzjq
4281a514e9 vim-patch:9.1.1191: tests: test for patch 9.1.1186 doesn't fail without the patch
Problem:  Test for patch 9.1.1186 doesn't fail without the patch.
Solution: Set 'nomodeline' in the test (zeertzjq).

closes: vim/vim#16835

d6c7913e24
2025-03-11 06:24:57 +08:00
zeertzjq
638b3c0717 vim-patch:9.1.1186: filetype: help files in git repos are not detected
Problem:  filetype: help files in git repos are not detected
Solution: detect */doc/*.txt files as help if they end with a help
          modeline, even if 'modeline' is off

Here's how I checked that this would still detect vim's own help files
correctly:

$ find . -type f -path '*/doc/*.txt' \
> -exec awk '{ } ENDFILE { print FILENAME ":" $0; }' '{}' + |
> grep -v 'vim:.*\<\(ft\|filetype\)=help\>'
./src/libvterm/doc/seqs.txt: 23    DECSM 42         = DECNRCM, national/multinational character

closes: vim/vim#16817

16d6fff98e

Split the pattern into a Lua pattern for the first part and a Vim regex
pattern for the second part, so that if the first part doesn't match
there is no need to use the Vim regex.

Co-authored-by: David Mandelberg <david@mandelberg.org>
2025-03-11 06:24:57 +08:00
Justin M. Keyes
f2c0755828 Merge pull request #32825 from moguls753/issue-32714-redundant-parsers
feat(checkhealth): group parsers by name and path in output
2025-03-10 14:48:50 -07:00
Eike
e00d67ef31 feat(checkhealth): group parsers by name and path in output
Problem:
  :checkhealth vim.treesitter sorts parser entries solely by path,
  splitting duplicates and reducing clarity.

Solution:
  Sort entries first by name, then by path, so that duplicates are grouped.
2025-03-10 21:15:19 +01:00
Lewis Russell
debabaf884 fix(lsp)!: pass buffer number to root_dir function
Problem:

The root dir function is not passed any context and can only assume the
current buffer is the one being attached.

The main use case is for getting the path of the buffer using
`nvim_buf_get_name`.

Solution:

Pass the buffer number as the first argument.
2025-03-10 18:54:03 +00:00
Maria José Solano
3b0fe2659e feat(lsp): support completion context #32793
Problem:
vim.lsp.completion with "autotrigger" enabled, does not send
completion context, even though it has all the necessary info.

Solution:
Include the context for "autotrigger".
trigger() also optionally accepts context when manually invoked.
2025-03-10 09:20:27 -07:00
altermo
67c39f5eca fix(tohtml): disable modeline #32822
Problem:
Running :TOhtml with a file containing modeline may generate an invalid modeline in the output.

Solution:
Add `<!-- vim: set nomodeline: -->` to the output.
Use vi-compatible modeline format ("set foo:"), to avoid the trailing `-->` being treated as part of the modeline.
2025-03-10 09:15:41 -07:00
Vlad
c9b5ac113a docs(vvars): vim.v.event.windows #32673 2025-03-10 08:18:11 -07:00
glepnir
afc3c43f12 fix(popup): new preview_bufnr created when menu item is selected #32819
Problem:
"use_float" in the if-condition causes a new buffer to be generated on every execution.

Solution:
- Remove the incorrect use_float check from the condition.
- Use buf_clear to properly clear the existing buffer.
2025-03-10 07:38:15 -07:00
Tomasz N
40a149e7f9 fix(lua): types for vim.api.keyset.win_config #32700 2025-03-10 06:01:51 -07:00
Christian Clason
85deb8d52b build(deps): bump luajit to 84cb21ffa (#32803) 2025-03-10 09:14:58 +00:00
zeertzjq
fc95cfb3db vim-patch:d49ba7b: runtime(sh): set b:match_skip to ignore matches for matchit (#32812)
related: vim/vim#16801
closes: chrisbra/matchit#50
closes: vim/vim#16834

d49ba7b92a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-03-10 16:47:21 +08:00
Christian Clason
8e55a5315a vim-patch:42e498d: runtime(plsql): move fold option from syntax to filetype plugin
closes: vim/vim#16838

42e498d9c4

Co-authored-by: Lee Lindley <lee.lindley@gmail.com>
Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2025-03-10 09:40:42 +01:00
zeertzjq
c53e00889d refactor(gen_events): sort enums case-insensitively (#32811)
This actually only affects the order in which Cmdline* and Cmdwin*
autocommands are listed, and it appears that the names of Cmdwin* were
changed to CmdWin* in 8ed2dbf6e2 without
explanation.

Also, remove the final NULL element from the names table.
2025-03-10 00:27:30 +00:00
zeertzjq
b90f649ca2 vim-patch:9.1.1190: C indentation does not detect multibyte labels (#32808)
Problem:  C indentation does not detect multibyte labels
Solution: Correctly skip over multibyte characters
          (Anttoni Erkkilä)

closes: vim/vim#16770

f4d87ff888

Co-authored-by: Anttoni Erkkilä <anttoni.erkkila@protonmail.com>
2025-03-09 23:43:27 +00:00
zeertzjq
15f2da55a8 perf(events): use hashy for event name lookup (#32802) 2025-03-10 06:56:02 +08:00
Justin M. Keyes
37786ccfcf docs(api): show "since" in API docs #32806 2025-03-09 15:47:45 -07:00
Justin M. Keyes
25d3b92d07 Merge #32687 "g<" for ext_messages 2025-03-09 13:38:32 -07:00
glepnir
d9585bdcfb fix(nvim__set_complete): pum preview info truncated during completion #32555
Problem:
1. The original info text is truncated in pum_set_preview_text.
2. There is an extra newline character at the end of the info text.
3. Incorrect usage of plines_win leads to errors in calculating the window height.

Solution:
1. Improved string handling in pum_preview_set_text to safely process line content without modifying the original text. Now, the preview info is correctly preserved while splitting lines.
2. Do not append a trailing newline to the preview buffer when one is present at the end.
3. Set w_widher_inner in advance; otherwise, plines_win cannot correctly calculate the wrapped line height.
2025-03-09 13:19:01 -07:00
Justin M. Keyes
34a2bfdcc5 fix(build): vimdoc tags are not validated #32801
Problem:
"make lintdoc" is not validating vimdoc (:help) tags.

Solution:
- Call `lang_tree:parse()` to init the parser.
- Load netrw 🤢 explicitly, since it was moved to `pack/dist/opt/`.
- Fix invalid help tags.
2025-03-09 10:27:28 -07:00
Christian Clason
903242f160 docs(highlight): collect all default highlight groups
Problem: It's difficult for colorscheme authors to know which highlight
groups should be defined.

Solution: List and link to all built-in highlight group categories. Also
remove outdated text on "preferred" and "secondary" groups.
2025-03-09 13:52:54 +01:00
zeertzjq
0a087f2073 build(generator): add dependencies on hashy (#32796)
This allows generated sources to be automatically rebuilt when modifying
hashy code.

Also, appending to NVIM_GENERATED_FOR_{HEADERS,SOURCES} in the middle of
custom commands is a bit strange. Move that after the custom commands.
2025-03-09 18:57:41 +08:00
Muntasir Mahmud
d4584903f3 vim-patch:9.1.1188: runtime(tera): tera support can be improved (#32799)
Problem:  runtime(tera): tera support can be improved
Solution: update tera filetype plugin, include a tera syntax script
          update the filetype test, update makemenu and synmenu vim scripts
          (MuntasirSZN)

closes: vim/vim#16830

vim/vim@14da0fb
2025-03-09 17:13:52 +08:00
zeertzjq
d414d0e8ea vim-patch:9.1.1187: matchparen plugin wrong highlights shell case statement (#32798)
Problem:  matchparen plugin wrong highlights shell case statement
          (Swudu Susuwu)
Solution: return early, if we are in a shSnglCase syntax element

The shell syntax element "case $var in foobar)" uses closing parenthesis
but there is no corresponding opening parenthesis for that syntax
element. However matchparen is not aware of such things and will happily
try to match just the next opening parenthesis.

So let's just add a way to opt out for such cases. In this case, use the
syntax state to check if the closing parenthesis belongs to the syntax
item "shSnglCase" and if it is, do not try to find a corresponding
opening parenthesis.

Since inspecting the syntax state might be expensive, put the whole
check behind a filetype test, so that matchparen will only perform this
particular check, when it knows the current buffer is a "sh" filetype.

fixes: vim/vim#16801
closes: vim/vim#16831

9102ac11ab

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-03-09 16:57:08 +08:00
zeertzjq
2a53ccdb42 Merge pull request #32797 from zeertzjq/vim-3d1a437
vim-patch:{3d1a437,d89770e}
2025-03-09 16:13:56 +08:00
zeertzjq
5763dccafa vim-patch:d89770e: runtime(doc): use GNOME instead of Gnome
It's called "GNOME Terminal" in
https://gitlab.gnome.org/GNOME/gnome-terminal

It's also called GNOME Terminal in English Wikipedia
https://en.wikipedia.org/wiki/GNOME_Terminal and the Wikipedia pages of
8 other languages.

Also, make line wrapping the same in insert.txt and cmdline.txt.

closes: vim/vim#16832

d89770eb98
2025-03-09 15:53:56 +08:00
zeertzjq
39ca7a844a vim-patch:3d1a437: runtime(doc): warn users about potentially risky hotkey
Also, mention that CTRL-SHIFT-V might be mapped to paste text, similar
to the note about CTRL-V.

References:
2d7e9d78c9/src/org.gnome.Terminal.gschema.xml (L395-398)
8942adde5b/src/org.gnome.Ptyxis.gschema.xml.in (L529-L533)

closes: vim/vim#16816

3d1a437f1b

Co-authored-by: David Mandelberg <david@mandelberg.org>
2025-03-09 15:53:05 +08:00
zeertzjq
5ee62906a3 refactor(hashy): use case labels instead of TOLOWER_ASC() (#32795)
Follow-up to #32768

This is slightly faster according to the benchmark.

This also makes it a build error if hashy is used incorrectly
(generating a case-insensitive hash function from mixed-case strings),
as duplicate case labels aren't allowed.
2025-03-09 00:58:18 +00:00
zeertzjq
8ea18119e7 vim-patch:9.1.1184: Unnecessary use of vim_tolower() in vim_strnicmp_asc() (#32792)
Problem:  Unnecessary use of vim_tolower() in vim_strnicmp_asc().
Solution: Use TOLOWER_ASC() instead (zeertzjq).

It was passing *s1 and *s2 to vim_tolower(). When char is signed, which
is the case on most platforms, c < 0x80 is always true, so it already
behaves the same as TOLOWER_ASC().

closes: vim/vim#16826

b7dc5d3b61

Use this function for hashy case-insensitive lookup, as it's ASCII-only.

Note that this function doesn't cast TOLOWER_ASC() argument to uint8_t,
so it'll treat a UTF-8 byte as smaller than NUL. It doesn't matter, as
one of the strings being compared is ASCII-only, and its behavior still
leads to consistent ordering.
2025-03-09 08:00:53 +08:00
zeertzjq
e02ee7410a refactor(generator): remove nested loop for event aliases (#32780)
After #32777 the aliases no longer need to come later, so the list of
autocommand names can be fully sorted.
2025-03-09 06:35:51 +08:00
zeertzjq
9271329635 docs(events): document events that can always be nested (#32778)
Follow-up to #32706

vim-patch:af05694: runtime(doc): CmdUndefined and FuncUndefined can always be nested

closes: vim/vim#16825

af05694900
2025-03-09 06:09:20 +08:00
Justin M. Keyes
05b9daa1e6 refactor(multiqueue): rename multiqueue_new_parent #32767 2025-03-08 12:28:15 -08:00
Christian Clason
d5ff0aff27 vim-patch:62e8228: runtime(go): add 'keywordprg' and 'formatprg' to ftplugin
closes: vim/vim#16804

62e822808e

Co-authored-by: Phạm Bình An <phambinhanctb2004@gmail.com>
2025-03-08 12:43:53 +01:00
zeertzjq
b2fa51bf15 test(lsp/utils): prevent CursorMoved closing float immediately (#32782)
This fixes the flakiness observed in https://github.com/neovim/neovim/actions/runs/13733258040/job/38413757162?pr=32780
2025-03-08 03:50:52 +00:00
Justin M. Keyes
c38c88edfd docs: OSC 133 shell config #32771 2025-03-07 16:37:42 -08:00
Lewis Russell
b813075b8a fix(types): do not mark unstable API as private
These functions are allowed to be used downstream, they are just not API
stable.
2025-03-08 00:08:03 +00:00
zeertzjq
b8ddd3b6bb perf(events): remove unnecessary loop in event_nr2name() (#32777)
It's no longer needed after #32152.
I'll not apply this change to Vim first, because Nvim's event name
aliases are a bit different from Vim.
After this change there is a small speedup in nvim_exec_autocmds as per
test/benchmark/autocmd_spec.lua.
2025-03-08 08:02:50 +08:00
zeertzjq
f05a6666cf fix(events): always allow some events to be nested (#32706)
Always allow the following four events to be nested, as they may contain
important information, and are triggered on the event loop, which may be
processed by a blocking call inside another autocommand.

- ChanInfo
- ChanOpen
- TermRequest
- TermResponse

There are some other events that are triggered on the event loop, but
they are mostly triggered by user actions in a UI client, and therefore
not very likely to happen during another autocommand, so leave them
unchanged for now.
2025-03-08 07:29:45 +08:00
zeertzjq
4a0e0e3453 vim-patch:6bdfeb0: runtime(vim): Update base-syntax, bug fixes (#32775)
- Allow trailing backslashes in option values.
- Match :map-special modifier.
- Match :map-arguments case-sensitively.
- Remove <*Leader> from map modifier list and allow in RHS of a mapping.

closes: vim/vim#16822

6bdfeb099a

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-03-07 22:25:26 +00:00
zeertzjq
246b1e9fb3 Merge pull request #32768 from zeertzjq/vim-9.1.1179
perf(keycodes): use hashy for string lookup
2025-03-08 06:04:16 +08:00
zeertzjq
12d4caa9d3 perf(keycodes): use hashy for string lookup
This is slightly faster than the binary search as per the benchmark, and
allows handling the vim/vim#16821 situation in generator code.
2025-03-08 05:45:39 +08:00
zeertzjq
af42f79221 vim-patch:partial:9.1.1179: too many strlen() calls in misc2.c
Problem:  too many strlen() calls in misc2.c
Solution: refactor misc2.c and use bsearch() instead of a linear search
          to find matches in the key_names_table array (John Marriott).

This commit changes misc2.c to use bsearch() to perform string searches of
the key_names_table array.

Implementation detail:
- Some entries in this array have alternate names. Add field alt_name to
  point to the alternate name.
- Some entries in this array are only available if a given feature is
  defined. Keep them in the array, but add a boolean field enabled to
  indicate if the record can be used or not. If the feature is not
  available, the corresponding enabled field is set to FALSE.

In my measurements running the test suite on a huge non-gui build on
linux, the number of string comparisons in get_special_key_code():
Before (linear search): 2,214,957
After (binary search): 297,770

A side effect of this is 1477 calls to STRLEN() in
get_special_key_name() for the same test run are no longer necessary.

closes: vim/vim#16788

4a1e6dacbb

Skip the mouse shape changes.

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-03-08 05:45:39 +08:00
zeertzjq
08d12b57ad test: add benchmark for nvim_replace_termcodes and keytrans() 2025-03-08 05:45:39 +08:00
zeertzjq
3824f52e52 refactor(keycodes): generate key_names_table[] using Lua
This allows easier refactoring.
2025-03-08 05:45:38 +08:00
Gregory Anders
3d49c55d3c fix(terminal): avoid rescheduling events onto the same queue (#32755)
Problem:

When a function like vim.wait() is used, we continuously drain the main
event queue until it is empty, never stopping for user input. This means
the libuv timer never runs and the terminal never gets refreshed, so
emit_termrequest continously reschedules itself onto the same event
queue, causing an infinite loop.

Solution:

Use a separate "pending" event queue, where events that require a
terminal refresh are temporarily placed. Drain this queue after a
terminal refresh and events are copied back onto the main queue. This
prevents infinite loops since the main event queue will always be able
to properly drain.
2025-03-07 12:16:39 -06:00
luukvbaal
8da59060c6 fix(marks): mark winline as invalid if change is in a concealed line (#32766)
Code that checks whether a `w_lines` entry has become invalid due to
a change in a folded line should now also check for concealed lines.
2025-03-07 16:21:20 +01:00
Gregory Anders
b31132f1c1 feat(defaults): jump between :terminal shell prompts with ]]/[[ #32736 2025-03-07 05:45:34 -08:00
zeertzjq
c8b64b7a43 fix(lua): always use vim.inspect() for :lua= (#32715) 2025-03-07 19:50:00 +08:00
Maria José Solano
5d08b65ac2 fix(lsp): use unresolved code action when codeAction/resolve fails 2025-03-07 10:23:55 +01:00
Christian Clason
e46f07b1d2 vim-patch:9.1.1177: filetype: tera files not detected
Problem:  filetype: tera files not detected
Solution: detect '*.tera' files as tera filetype,
          include a simple filetype plugin
          (MuntasirSZN)

closes: vim/vim#16806

5daaf23268

Co-authored-by: MuntasirSZN <muntasir.joypurhat@gmail.com>
2025-03-07 00:07:08 +01:00
luukvbaal
7371abf755 fix(marks): wrong winline info for concealed line with below virt line (#32747)
Problem:  Skipping over a concealed line for which `win_line()`
          _should_ be called because it has `virt_lines_above = false`
          lines associated with it.
Solution: Don't include such a line in `wl_lastlnum` from the line
          above.
2025-03-06 16:36:10 +01:00
zeertzjq
9a02906c44 vim-patch:08a410f: runtime(vim): recognize <...> strings (and keys) for 'keywordprg' (#32752)
see :help E499 and :h key-notation

closes: vim/vim#16795

08a410f674

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2025-03-06 19:40:47 +08:00
zeertzjq
baccb569dc vim-patch:9.1.1173: filetype: ABNF files are not detected (#32751)
Problem:  filetype: ABNF files are not detected
Solution: detect '.abnf' file as abnf filetype and
          include an abnf syntax plugin (A4-Tacks).

References:
- RFC5234
- RFC7405

closes: vim/vim#16802

9f827ec587

Co-authored-by: A4-Tacks <wdsjxhno1001@163.com>
2025-03-06 19:39:49 +08:00
Sean Dewar
fa46441264 fix(terminal): improve cursor refresh handling (#32596)
Problem: terminal mode cursor refresh logic has too many edge cases where it
fails when events change curbuf.

Solution: change the logic. Introduce cursor_visible to TerminalState to more
reliably track if terminal mode has changed busy. Move visibility handling to
refresh_cursor and move its call in refresh_terminal to terminal_check to avoid
temporarily changed curbufs from influencing cursor state.

This has the effect of "debouncing" shape/visibility updates to once per
terminal state tick (with the final attributes taking effect, as expected). I
think this is OK, but as a result it may also be warranted to update when
redrawing during the same state tick (e.g: from events executing :redraw); this
can be added later, if wanted.

Also move previous tests to a more appropriate place.
2025-03-06 08:31:50 +00:00
Maria José Solano
41b07b128c feat(lsp): support for resolving code action command (#32704)
* fix(lsp): don't call codeAction_resolve with commands

* feat(lsp): support for resolving code action command
2025-03-06 08:21:47 +00:00
Gregory Anders
0c0352783f fix(tui): remove DCS escaping in tmux (#32723)
Per https://github.com/tmux/tmux/issues/4386, tmux does not support DCS
responses, even if the initial request was escaped.
2025-03-05 21:28:05 -06:00
zeertzjq
9c4f2cde7b vim-patch:9.1.1176: wrong indent when expanding multiple lines (#32746)
Problem:  wrong indentation of lastline when expanding multiple lines
Solution: Check OPENLINE_FORCE_INDENT flag in open_line() (glepnir)

closes: vim/vim#16786

34a7d82aae

Co-authored-by: glepnir <glephunter@gmail.com>
2025-03-06 08:26:31 +08:00
zeertzjq
1a35eb9b56 vim-patch:9.1.1175: inconsistent behaviour with exclusive selection and motion commands (#32745)
Problem:  inconsistent behaviour with exclusive selection and motion
          commands (aidancz)
Solution: adjust cursor position when selection is exclusive
          (Jim Zhou)

fixes: vim/vim#16278
closes: vim/vim#16784

c8cce711dd

Co-authored-by: Jim Zhou <jimzhouzzy@gmail.com>
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-03-06 08:24:13 +08:00
zeertzjq
a261f602a0 vim-patch:9.1.1174: tests: Test_complete_cmdline() may fail (#32743)
Problem:  tests: when the file 'TestCommand?Test' exists,
          'Test_complete_cmdline()' will fail when writing the file. And
          there's no related cleaning operation for this kind of file
          before the test run.
Solution: modify `write` to `write!` to override (Jim Zhou).

closes: vim/vim#16799

f7087cbec7

Co-authored-by: Jim Zhou <jimzhouzzy@gmail.com>
2025-03-05 23:39:15 +00:00
zeertzjq
cd7d3cc041 vim-patch:4783a2c: runtime(doc): mention bzip3 in gzip plugin documentation (#32742)
closes: vim/vim#16800

4783a2c073

Co-authored-by: Jim Zhou <jimzhouzzy@gmail.com>
2025-03-05 23:38:33 +00:00
zeertzjq
761e920280 vim-patch:9.1.1172: [security]: overflow with 'nostartofline' and Ex command in tag file (#32739)
Problem:  heap-buffer-overflow with 'nostartofline' and Ex command in
          tag file.
Solution: Set cursor column when moving cursor to line 1 (zeertzjq).

closes: vim/vim#16796

3ed6659549
2025-03-06 07:08:53 +08:00
Gregory Anders
35e5307af2 feat(terminal)!: include cursor position in TermRequest event data (#31609)
When a plugin registers a TermRequest handler there is currently no way
for the handler to know where the terminal's cursor position was when
the sequence was received. This is often useful information, e.g. for
OSC 133 sequences which are used to annotate shell prompts.

Modify the event data for the TermRequest autocommand to be a table
instead of just a string. The "sequence" field of the table contains the
sequence string and the "cursor" field contains the cursor
position when the sequence was received.

To maintain consistency between TermRequest and TermResponse (and to
future proof the latter), TermResponse's event data is also updated to
be a table with a "sequence" field.

BREAKING CHANGE: event data for TermRequest and TermResponse is now a
table
2025-03-05 09:45:22 -06:00
bfredl
8448703662 Merge pull request #12049 from bfredl/luverr
convert non-string errors using tostring()
2025-03-05 13:30:06 +01:00
bfredl
ebb963a4a0 fix(lua): format errors from luv callbacks using __tostring 2025-03-05 12:09:57 +01:00
Christian Clason
e4c094a84d build(deps): bump tree-sitter to v0.25.3 2025-03-05 09:59:51 +01:00
zeertzjq
b0341136c1 vim-patch:9.1.1170: wildmenu highlighting in popup can be improved (#32728)
Problem:  wildmenu highlighting in popup can be improved
Solution: Check if the completion items contain submatches of the
          entered text (Girish Palya).

This update enables highlighting in the popup menu even when the matched
fragment or pattern appears within an item (string) rather than only at the
beginning. This is especially useful for custom completion, where menu items
may not always start with the typed pattern.

For specific use cases, refer to the two examples in
https://github.com/vim/vim/pull/16759

A sliding window approach is used with direct string comparison. Performance
is not a concern, as highlighting is applied only to displayed lines, even if
the menu list is arbitrarily long.

closes: vim/vim#16785

4ec46f3210

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-03-04 22:51:36 +00:00
zeertzjq
97dc02687a vim-patch:9.1.1171: tests: wrong arguments passed to assert_equal() (#32727)
Problem:  tests: wrong arguments passed to assert_equal()
          (after v9.1.1167).
Solution: Swap arguments in the assert_equal() call (zeertzjq).

closes: vim/vim#16782

a95085e0fc
2025-03-05 06:42:54 +08:00
luukvbaal
81ea44fa6a fix(display): adjust winline info for concealed lines below last line (#32708)
Problem:  Last line in a window does not store correct `wl_lastlnum` if
          lines below it are concealed (resulting in e.g. incorrect
          cursor row).
Solution: Increment `wl_lastlnum` while it points to a line above a
          concealed line.
2025-03-04 19:45:21 +01:00
Robert Muir
7d5866d471 fix(lsp): open_floating_preview() ignores max_height (#32716)
Problem:  After 47aaddfa the max_height option is no longer respected.
          Hover documentation and Signature help windows take up the
          entire text height.
Solution: Compare to window's current height and only modify the height
          if it would reduce the height, not enlarge it.
2025-03-04 18:36:57 +00:00
James Trew
fb842dfc22 fix(diagnostic): virtual_lines diagnostic columns (#32703)
When multiple diagnostics appear on a single line, the virtual lines for
all diagnostics except the first were rendered with progressively fewer
columns.
2025-03-04 08:59:37 -06:00
bfredl
859dbb6619 Merge pull request #32608 from bfredl/nolegacyhl
refactor(tests): use new-style highlight spec in legacy/
2025-03-04 13:12:01 +01:00
bfredl
90a63d242a refactor(tests): use new-style highlight spec in legacy/ 2025-03-04 12:32:22 +01:00
zeertzjq
47cfe901d7 vim-patch:9.1.1169: using global variable for get_insert()/get_lambda_name() (#32713)
Problem:  using global variable for get_insert()/get_lambda_name()
          (after v9.1.1151)
Solution: let the functions return a string_T object instead
          (Yee Cheng Chin)

In vim/vim#16720, `get_insert()` was modified to store a string length in a
global variable to be queried immediately by another `get_insert_len()`
function, which is somewhat fragile. Instead, just have the function
itself return a `string_T` object instead. Also do the same for
`get_lambda_name()` which has similar issues.

closes: vim/vim#16775

0b5fe42071

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-03-03 23:37:14 +00:00
zeertzjq
8ce504820a vim-patch:9.1.1167: mark '] wrong after copying text object (#32712)
Problem:  mark '] wrong after copying text object (ubaldot)
Solution: Adjust position of '] for non-linewise, exclusive motions
          (Jim Zhou)

related: vim/vim#16679
closes: vim/vim#16772

360a39ae6c

Co-authored-by: Jim Zhou <jimzhouzzy@gmail.com>
2025-03-04 07:05:05 +08:00
zeertzjq
65a3da8b15 vim-patch:659cb28: runtime(doc): fix typo "bet" in :h 'completeopt' (#32711)
closes: vim/vim#16773

659cb28c25
2025-03-04 07:04:25 +08:00
zeertzjq
e4fb697b69 Merge pull request #32709 from deathbeam/vim-9.1.1166
vim-patch:9.1.{1166,1168}: 'wildmode' noselect
2025-03-04 06:41:41 +08:00
zeertzjq
e56f741350 vim-patch:9.1.1168: wrong flags passed down to nextwild()
Problem:  wrong flags passed down to nextwild()
          (zeertzjq, after v9.1.1166)
Solution: only pass options flags (Girish Palya)

`options` needs to be passed into nextwild() since it may contain
WILD_KEEP_SOLE_ITEM which prevents the menu items list from getting
freed if there is only 1 item left (if `noselect` is set).

closes: vim/vim#16778

d2219d547d

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-03-04 06:20:57 +08:00
Tomas Slusny
99d688e645 vim-patch:9.1.1166: command-line auto-completion hard with wildmenu
Problem:  command-line auto-completion hard with wildmenu
Solution: implement "noselect" wildoption value (Girish Palya)

When `noselect` is present in `wildmode` and 'wildmenu' is enabled, the
completion menu appears without pre-selecting the first item.

This change makes it easier to implement command-line auto-completion,
where the menu dynamically appears as characters are typed, and `<Tab>`
can be used to manually select an item. This can be achieved by
leveraging the `CmdlineChanged` event to insert `wildchar(m)`,
triggering completion menu.

Without this change, auto-completion using the 'wildmenu' mechanism is
not feasible, as it automatically inserts the first match, preventing
dynamic selection.

The following Vimscript snippet demonstrates how to configure
auto-completion using `noselect`:

```vim
vim9script
set wim=noselect:lastused,full wop=pum wcm=<C-@> wmnu
autocmd CmdlineChanged : timer_start(0, function(CmdComplete, [getcmdline()]))

def CmdComplete(cur_cmdline: string, timer: number)
  var [cmdline, curpos] = [getcmdline(), getcmdpos()]
  if cur_cmdline ==# cmdline  # Avoid completing each character in keymaps and pasted text
    && !pumvisible() && curpos == cmdline->len() + 1

    if cmdline[curpos - 2] =~ '[\w*/:]'  # Reduce noise by completing only selected characters
      feedkeys("\<C-@>", "ti")
      set eventignore+=CmdlineChanged  # Suppress redundant completion attempts
      timer_start(0, (_) => {
        getcmdline()->substitute('\%x00$', '', '')->setcmdline()  # Remove <C-@> if no completion items exist
        set eventignore-=CmdlineChanged
      })
    endif
  endif
enddef
```

fixes: vim/vim#16551
closes: vim/vim#16759

2bacc3e5fb

Cherry-pick Wildmode_Tests() change from patch 9.0.0418.

Co-authored-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
2025-03-04 06:20:20 +08:00
Luuk van Baal
124c655f56 feat(messages): "g<" mapping for ext_messages
Problem:  Cannot use "g<" mapping with ext_messages. Mapping displays
          the scrollback buffer since the last command, but the
          scrollback buffer is not populated with ext_messages.
Solution: With ext_messages; store messages in the history that otherwise
          wouldn't be. Mark them as temporary messages to be deleted when
          the scrollback buffer would be cleared. To this end, make the
          message history a doubly-linked list such that messages can be
          removed from an arbitrary position.
Outlook:  Default ext_messages UI might not show the hit-enter prompt
          so we want "g<" to work as a recommended way to show messages
          for the last command (prompted by an indicator).
2025-03-03 11:30:15 +01:00
Luuk van Baal
f7fa6d1266 refactor(messages): simplify message history 2025-03-03 11:24:54 +01:00
zeertzjq
948179cb19 vim-patch:9.1.1165: diff: regression with multi-file diff blocks (#32702)
Problem:  Vim's diff block merging algorithm when doing a multi-file diff
          is buggy when two different diff hunks overlap a single
          existing diff block (after v9.1.0743)

Solution: fix a couple bugs in this logic:

1. Fix regression from v9.1.0743 where it's not correctly expanding the
   2nd overlap correctly, where it always expands without taking into
   account that this was always taken care of when the first overlap
   happened. Instead, we should only grow the 2nd overlap if it overhangs
   outside the existing diff block, and if we encounter a new overlapping
   diff block (due to overlap chaining).
2. When we expand a diff block to match the hunk size on the orig side
   (when handling the first overlap), we expand the same amount of lines
   in the new side. This is not sound if there exists a second overlap
   hunk that we haven't processed yet, and that hunk has different
   number of lines in orig/new. Fix this by doing the corresponding
   counter adjustment when handling 2nd/3rd/etc overlap by calculating
   the difference in lines between orig and new side.
   (Yee Cheng Chin)

closes: vim/vim#16768

bc08ceb755

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-03-03 10:53:03 +08:00
zeertzjq
560b8a8ce0 vim-patch:9.1.1164: [security]: code execution with tar.vim and special crafted tar files (#32701)
Problem:  editing a special crafted tar file allows code execution
          (RyotaK, after 129a8446d23cd9cb4445fcfea259cba5e0487d29)
Solution: escape the filename before feeding it to the `:read` command

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-wfmf-8626-q3r3

334a13bff7

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-03-02 22:59:54 +00:00
Justin M. Keyes
c4a0c1d3b0 docs: misc #31996 2025-03-02 14:27:52 -08:00
Maria José Solano
0a5a0efda6 feat(lua): don't complete private (_) fields after dot (.) #32690 2025-03-02 13:44:13 -08:00
Riley Bruins
65c7033cbe feat(comment): allow commentstring to be determined from node metadata
**Problem:** Some weird languages have different comment syntax
depending on the location in the code, and we do not have a way to
determine the correct `commentstring` for these special cases.

**Solution:** Allow queries to specify `commentstring` values in
metadata, allowing users/`nvim-treesitter` to provide a better
commenting experience without hugely increasing the scope of the code in
core.
2025-03-02 18:38:13 +01:00
dundargoc
59c328bc88 test: simplify ASAN detection 2025-03-02 11:57:41 +01:00
fredizzimo
b45a44dd32 test: enable more multigrid popup tests (#32470) 2025-03-02 15:07:46 +08:00
dundargoc
188ec19894 build!: turn off translations by default
The translation step prolongs the build time too much to be enabled by
default. Enable it by passing cmake flag `ENABLE_TRANSLATIONS=ON`.
2025-03-02 02:29:25 +01:00
zeertzjq
1351383579 vim-patch:9.1.1161: preinsert requires bot "menu" and "menuone" to be set
Problem:  preinsert requires bot "menu" and "menuone" to be set,
          but "menu" is redundant (after v9.1.1160)
Solution: preinsert only requires menuone (glepnir)

closes: vim/vim#16763

94a045ed56

Co-authored-by: glepnir <glephunter@gmail.com>
2025-03-02 07:02:10 +08:00
zeertzjq
26775183ff vim-patch:9.1.1160: Ctrl-Y does not work well with "preinsert" when completing items
Problem:  The 'preinsert' feature requires Ctrl-Y to confirm insertion,
          but Ctrl-Y only works when the popup menu (pum) is displayed.
          Without enforcing this dependency, it could lead to confusing
          behavior or non-functional features.

Solution: Modify ins_compl_has_preinsert() to check for both 'menu' and
          'menuone' flags when 'preinsert' is set. Update documentation
          to clarify this requirement. This avoids adding complex
          conditional behaviors. (glepnir)

fixes: vim/vim#16728
closes: vim/vim#16753

a2c5559f29

Co-authored-by: glepnir <glephunter@gmail.com>
2025-03-02 07:02:10 +08:00
brianhuster
47b748af54 vim-patch:0b82054: runtime(lua): Improve 'include' and make '*expr' functions script-local
- Prevent 'include' from matching variable assignments as calls to
  require() and others.
- Use script-local functions for 'includeexpr' and 'foldexpr'.
- Formatting fixes.

closes: vim/vim#16746

0b8205484b

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-03-02 06:46:26 +08:00
brianhuster
2b0f967b77 vim-patch:00a00f5: runtime(lua): Update lua ftplugin and documentation
Problem:
- The doc says the default `g:lua_subversion` is 2, but in fact it is 3
  (see `runtime/syntax/lua.vim`)
- `includeexpr` doesn't work with module in `init.lua`

Solution:
- Update documentation
- Assign value to option `&include`
- Add function `LuaInclude` and assign it to `l:&includeexpr`

closes: vim/vim#16655

00a00f5d3f

Co-authored-by: brianhuster <phambinhanctb2004@gmail.com>
Co-authored-by: dkearns <dougkearns@gmail.com>
2025-03-02 06:46:26 +08:00
Christian Clason
ea4a7cc616 vim-patch:8ac975d: runtime(tar): fix syntax error in tar.vim
8ac975d97e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-03-01 23:03:10 +01:00
Lewis Russell
ec8922978e feat(treesitter): add more metadata to language.inspect() (#32657)
Problem: No way to check the version of a treesitter parser.

Solution: Add version metadata (ABI 15 parsers only) as well as parser state count and supertype information (ABI 15) in `vim.treesitter.language.inspect()`. Also graduate the `abi_version` field, as this is now the official upstream name.

---------

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2025-03-01 15:51:09 +00:00
Christian Clason
48e6147e64 vim-patch:56957ed: runtime(misc): add support for bzip3 to tar, vimball and gzip plugins
fixes: vim/vim#16751
closes: vim/vim#16755

56957ed410

Co-authored-by: Jim Zhou <jimzhouzzy@gmail.com>
2025-03-01 13:21:55 +01:00
zeertzjq
45d7aa3301 vim-patch:9.1.1158: :verbose set has wrong file name with :compiler! (#32682)
Problem:  :verbose set has wrong file name with :compiler!
Solution: Add -keepscript (zeertzjq)

closes: vim/vim#16752

5e8b2268e1
2025-02-28 23:45:47 +00:00
Luca Saccarola
7b4295390f docs(Open): add reference in documentation (#32678) 2025-02-28 23:14:01 +00:00
luukvbaal
86046c5a31 fix(marks): ineffective conceal_line callback optimization (#32662)
Problem:  _on_conceal_line callbacks are not invoked if callback has not
          let Nvim know it wants to receive them. But this may change on
          factors other than what is currently checked (changed buffer).
Solution: Forego this optimization, callback is still guarded behind
          'conceallevel'.
2025-02-28 13:36:25 +01:00
zeertzjq
77626ed7fd Merge pull request #28486 from zeertzjq/vim-8.2.4603
vim-patch:8.2.{4594,4603,4607,4647,4974}
2025-02-28 18:40:24 +08:00
zeertzjq
b66f395ff4 vim-patch:8.2.4974: ":so" command may read after end of buffer
Problem:    ":so" command may read after end of buffer.
Solution:   Compute length of text properly.

4748c4bd64

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-02-28 18:21:08 +08:00
zeertzjq
4e25b1a675 vim-patch:8.2.4647: "source" can read past end of copied line
Problem:    "source" can read past end of copied line.
Solution:   Add a terminating NUL.

2bdad61267

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-02-28 18:21:08 +08:00
zeertzjq
7c6a9c5589 vim-patch:8.2.4607: sourcing buffer lines may lead to errors for conflicts
Problem:    Sourcing buffer lines may lead to errors for conflicts.
Solution:   Add the ++clear argument. (Yegappan Lakshmanan, closes vim/vim#9991)

35dc17634d

Documentation changes only. Vim9script is N/A.
Cherry-pick another documentation change for :source from latest Vim.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2025-02-28 18:21:08 +08:00
zeertzjq
6750d00fe9 vim-patch:8.2.4603: sourcing buffer lines is too complicated
Problem:    Sourcing buffer lines is too complicated.
Solution:   Simplify the code. Make it possible to source Vim9 script lines.
            (Yegappan Lakshmanan, closes vim/vim#9974)

85b43c6cb7

This commit changes the behavior of sourcing buffer lines to always have
a script ID, although sourcing the same buffer always produces the same
script ID.

vim-patch:9.1.0372: Calling CLEAR_FIELD() on the same struct twice

Problem:  Calling CLEAR_FIELD() on the same struct twice.
Solution: Remove the second CLEAR_FIELD().  Move the assignment of
          cookie.sourceing_lnum (zeertzjq).

closes: vim/vim#14627

f68517c167

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2025-02-28 18:21:08 +08:00
zeertzjq
a3a9f86d4a vim-patch:8.2.4594: need to write script to a file to be able to source them
Problem:    Need to write script to a file to be able to source them.
Solution:   Make ":source" use lines from the current buffer. (Yegappan
            Lakshmanan et al., closes vim/vim#9967)

36a5b6867b

Most code and test changes are reverted or modified again in patch
8.2.4603, so only port parts that are untouched in patch 8.2.4603.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2025-02-28 18:21:07 +08:00
Riley Bruins
9b25c68db2 fix(treesitter): correctly parse queries with combined injections 2025-02-28 09:33:02 +01:00
Christian Clason
8c4c9ca192 vim-patch:3d75ec7: runtime(compiler): improve svelte-check
closes: vim/vim#16749

3d75ec7401

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2025-02-28 09:32:42 +01:00
zeertzjq
da219960cb vim-patch:85a50fe: runtime(doc): fix confusing docs for 'completeitemalign' (#32671)
closes: vim/vim#16743

85a50fe825
2025-02-28 08:28:24 +08:00
zeertzjq
567ab3c34f vim-patch:60bd140: runtime(vim): Update base-syntax, match Vim9 function calls after "|" (#32670)
Match Vim9 function calls after ex-bar.  These are also currently
matched but invalid syntax for legacy script.

fixes: vim/vim#16721
closes: vim/vim#16747

60bd140256

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-02-28 08:28:05 +08:00
zeertzjq
332d596959 vim-patch:9.1.1157: command completion wrong for input() (#32669)
Problem:  command completion wrong for input()
          (Cdrman Fu)
Solution: Set commandline completion context explicitly
          (Jim Zhou)

fixes vim/vim#16723
closes: vim/vim#16733

3255af850e

Co-authored-by: Jim Zhou <csd_189@163.com>
2025-02-28 08:23:02 +08:00
zeertzjq
3eee6f9d63 vim-patch:9.1.1156: tests: No test for what patch 9.1.1152 fixes (#32668)
Problem:  No test for what patch 9.1.1152 fixes.
Solution: Add a test (zeertzjq).

closes: vim/vim#16742

4be1ab80be
2025-02-27 23:11:16 +00:00
zeertzjq
df0328521f vim-patch:9.1.1155: Mode message not cleared after :silent message (#32667)
Problem:  Mode message not cleared after :silent message
          (after 9.0.1634).
Solution: Don't reset mode_displayed when the message is empty.
          (zeertzjq)

fixes: neovim/neovim#32641
closes: vim/vim#16744

fce1fa5b61
2025-02-27 23:03:52 +00:00
zeertzjq
89d6d6f25c fix(lua): wrong script context for option set by func from nvim_exec2 (#32659)
Problem:  Wrong script context for option set by function defined by
          nvim_exec2 in a Lua script.
Solution: Call nlua_set_sctx() after adding SOURCING_LNUM and always set
          sc_lnum for a Lua script.

This is a bug discovered when testing #28486. Not sure if this actually
happens in practice, but it's easy to fix and required for #28486.
2025-02-27 13:49:57 +00:00
luukvbaal
f25dd7a8d5 fix(display): correctly store winline info for concealed lines (#32656)
Off-by-one error in storing last line number for a logical line.
2025-02-27 13:15:47 +01:00
glepnir
ac1c5ccb2c fix(popup): reuse pum preview float win, set 'winfixbuf' #32636
Problem:
popup floating window is closed and recreated for each item selection,
this is a bit wasteful.

Solution:
- Hide the preview win (instead of closing it) when the menu is still displayed:
    1. When selected_item is -1.
    2. When switching from an item with an "info" field to one without.
- When pum is undisplayed it is still closed.
2025-02-27 02:41:29 -08:00
David Briscoe
6a9555c0fa doc: clarify window-id, tab-id, nvim_set_current_x #32528
Problem:
Descriptions are somewhat vague. nvim_set_current_line modifies contents
but nvim_set_current_buf does not, etc.

Solution:
- Make it clear that these functions accept or return a winid/tabid by
  linking to that concept in help.
- Only these few files use the term "handles", so replace them with the
  more conventional terminology.
- Add a new help section for tab-ID. This concept is unique to neovim
  because vim exposes tabnr, but not tab handles. This section is
  modelled after `:h winid`.
2025-02-27 02:05:00 -08:00
zeertzjq
746139fa1e refactor(do_source): remove duplicate assignments (#32654)
The code above have already set sc_lnum to 0.
2025-02-27 17:39:25 +08:00
luukvbaal
f86864f22f fix(move): 'scrolloff' cursor correction no longer handles folds properly (#32642)
Problem:  f58e7d5f passed `&botline` to `plines_win_full()`, (probably)
          assuming it would be set to the first line of the fold.
Solution: Reinstate call to `hasFolding()` to do so.
2025-02-27 08:52:19 +01:00
zeertzjq
1e4c708033 test: option set by Lua autocommand has correct script context (#32652) 2025-02-27 05:48:52 +00:00
zeertzjq
877f3b7288 refactor(shada): fix coverity warning about leaking memory (#32650) 2025-02-27 10:38:04 +08:00
zeertzjq
189bba7c77 Merge pull request #32649 from zeertzjq/vim-9.1.1151
vim-patch:9.1.{1151,1152}
2025-02-27 09:17:36 +08:00
zeertzjq
f56d2b3c59 vim-patch:9.1.1152: Patch v9.1.1151 causes problems
Problem:  Patch v9.1.1151 causes problems
Solution: partially revert it (John Marriott)

closes: vim/vim#16736

18bacc811c

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-02-27 08:55:43 +08:00
zeertzjq
e1a3128ec4 vim-patch:9.1.1151: too many strlen() calls in getchar.c
Problem:  too many strlen() calls in getchar.c
Solution: store last inserted and recorded lengths,
          add functions to retrieve those and use those
          functions (John Marriott)

closes: vim/vim#16720

d3c4b7e946

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-02-27 08:55:14 +08:00
Justin M. Keyes
3cce657031 refactor: old references to scripts/ dir #32647 2025-02-26 23:00:54 +00:00
Justin M. Keyes
4f42b69b4a Merge #32601 vim.text.indent() 2025-02-26 14:31:03 -08:00
Justin M. Keyes
4a997a1732 test: unreliable swapfile_preserve_recover_spec
Problem:
Test sometimes fails on bsd (cirrus ci):

    test/functional/ex_cmds/swapfile_preserve_recover_spec.lua:589: retry() attempts: 464
    test/functional/ex_cmds/swapfile_preserve_recover_spec.lua:590: Expected objects to be the same.
    Passed in:
    (table: 0x0d5f1aa44070) {
      [1] = ''
     *[2] = ''
      [3] = '[Process exited 1]' }
    Expected:
    (table: 0x0d5ea3eb8718) {
      [1] = ''
     *[2] = '[Process exited 1]'
      [3] = '' }
    stack traceback:
      test/testutil.lua:104: in function 'retry'
      test/functional/ex_cmds/swapfile_preserve_recover_spec.lua:589: in function <test/functional/ex_cmds/swapfile_preserve_recover_spec.lua:556>

Solution:
Filter out empty items to avoid irrelevant redraw-timing assumptions.
2025-02-26 23:06:22 +01:00
Justin M. Keyes
be1fbe38b3 feat(lua): vim.text.indent()
Problem:
Indenting text is a common task in plugins/scripts for
presentation/formatting, yet vim has no way of doing it (especially
"dedent", and especially non-buffer text).

Solution:
Introduce `vim.text.indent()`. It sets the *exact* indentation because
that's a more difficult (and thus more useful) task than merely
"increasing the current indent" (which is somewhat easy with a `gsub()`
one-liner).
2025-02-26 23:06:22 +01:00
IpsumCapra
f4921e2b7d fix(shada): ":wshada/:rshada [filename]" with shadafile=NONE #32538
Problem: read/write shada function logic was skipped entirely if it was
detected the shadafile option was set to 'NONE'.

Solution: The filename is now always resolved. When the shadafile option
is set to 'NONE' AND no filename was passed, the filename resolves to an
empty string, which causes the read/write functions to return.
Regardless of whether the option is set to 'NONE', when a filename is
explicitly passed, it gets resolved and the read/write logic is
accessed.
2025-02-26 11:03:50 -08:00
Lewis Russell
0f24b0826a build: move all generator scripts to src/gen/
- Move all generator Lua scripts to the `src/gen/`
- Add a `.luarc.json` to `src/gen/`
- Add a `preload.lua` to `src/gen/`
  - Add `src` to `package.path` so it aligns with `.luarc.json'
- Fix all `require` statements in `src/gen/` so they are consistent:
    - `require('scripts.foo')` -> `require('gen.foo')`
    - `require('src.nvim.options')` -> `require('nvim.options')`
    - `require('api.dispatch_deprecated')` -> `require('nvim.api.dispatch_deprecated')`
2025-02-26 16:54:37 +00:00
zeertzjq
85caaa70d4 refactor(gen_api_dispatch): avoid trailing spaces (#32632)
Problem:
Generated Lua API bindings may have trailing spaces (e.g. nvim_set_hl).

Solution:
Add leading spaces only if arg_free_code is non-empty.
Also:
- Remove an unnecessary string.format() in write_shifted_output() args.
- Fix incorrect indent for the nlua_push_keydict() below.
2025-02-26 20:23:27 +08:00
James McCoy
c619d1da61 Merge pull request #32631 from jamessan/snprintf-binary
fix(vim_snprintf): special-case handling of binary format
2025-02-26 04:23:52 -07:00
Tristan Knight
7ead328a48 build(cjson): sync with upstream (#32114)
Sync with commit 91ca29db9a
2025-02-26 09:40:02 +01:00
zeertzjq
b0a1d35f69 fix(eval): don't shorten $HOME in v:stacktrace (#32634) 2025-02-26 07:33:11 +00:00
zeertzjq
f4bb7417b7 refactor: remove unnecessary allocation for "run Nvim with -V1" (#32633) 2025-02-26 05:55:29 +00:00
James McCoy
453f2c52d2 fix(vim_snprintf): special-case handling of binary format
A binary format spec always expects a corresponding unsigned long long
value. However, that explicit handling didn't get included when porting
the code from Vim, so binary format spec was falling through to the
"unsigned" and "length_modifier = NUL" portion of the code:

        } else {
          // unsigned
          switch (length_modifier) {
          case NUL:
            uarg = (tvs
                    ? (unsigned)tv_nr(tvs, &arg_idx)
                    : (skip_to_arg(ap_types, ap_start, &ap, &arg_idx,
                                   &arg_cur, fmt),
                       va_arg(ap, unsigned)));
            break;

This incorrectly read an "unsigned" value from an "unsigned long long"
variable, which would produce incorrect results on certain platforms.
2025-02-25 21:58:22 -05:00
zeertzjq
a2b464944a refactor(options): fix coverity warning about unintialized sc_chan (#32630) 2025-02-26 01:47:29 +00:00
Riley Bruins
93278e7720 fix(extmark): clearer error message for invalid ephemeral mark usage 2025-02-26 01:08:51 +01:00
zeertzjq
23f7e5593d Merge pull request #32614 from brianhuster/vim-094494b
vim-patch: improve &keywordprg in Vim ftplugin
2025-02-26 07:51:10 +08:00
zeertzjq
e2aca58bcc fix(lua): don't override script ID from :source (#32626)
Problem:  When setting an option, mapping etc. from Lua without -V1, the
          script ID is set to SID_LUA even if there already is a script
          ID assigned by :source.
Solution: Don't set script ID to SID_LUA if it is already a Lua script.
          Also add _editor.lua to ignorelist to make script context more
          useful when using vim.cmd().
2025-02-25 23:40:21 +00:00
zeertzjq
9c43e5cd4a vim-patch:580e457: runtime(vim): make VimKeywordPrg even smarter for regexes
closes: vim/vim#16729

580e457a2a

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2025-02-26 07:31:49 +08:00
brianhuster
6db439ff01 vim-patch:094494b: runtime(vim): improve &keywordprg in ftplugin
- let keywordprg in vim filetype handle context-sensitive help calls by
  detecting the syntax group of the word under the cursor
- reformat whitespace
- add modeline

related: vim/vim#16677
closes: vim/vim#16680

094494bf2e

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
Co-authored-by: Andrew Radev <andrey.radev@gmail.com>
Co-authored-by: "D. Ben Knoble" <ben.knoble+github@gmail.com>
Co-authored-by: Gary Johnson <garyjohn@spocom.com>
Co-authored-by: Tim Pope <code@tpope.net>
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-02-26 07:31:03 +08:00
luukvbaal
af0a2157ad fix(move): wrong cursor row on concealed line (#32629)
Problem:  Cursor row calculation does not take into account concealed lines.
Solution: Break the loop when the next calculated line is concealed.
2025-02-25 23:45:52 +01:00
Luuk van Baal
c3337e357a fix(treesitter): nil check query for has_conceal_line 2025-02-25 16:21:16 +01:00
zeertzjq
3bdc3a1689 test(ui/cursor_spec): reduce flakiness (#32627) 2025-02-25 21:29:10 +08:00
Luuk van Baal
47aaddfa0d fix(lsp): resize hover window for concealed lines
Problem:  Height of a (markdown) `vim.lsp.util.open_floating_preview()`
          window can be reduced to account for concealed lines (after #31324).
Solution: Set the window height to the text height of the preview window.
          Set 'concealcursor' to avoid unconcealing the cursorline when
          entering the hover window.
2025-02-25 14:26:58 +01:00
Luuk van Baal
8ba047e33f feat(treesitter): vertical conceal support for highlighter
TSHighlighter now places marks for conceal_lines metadata. A new
internal decor provider callback _on_conceal_line was added that
instructs the highlighter to place conceal_lines marks whenever the
editor needs to know whether a line is concealed. The bundled markdown
queries use conceal_lines metadata to conceal code block fence lines.
2025-02-25 13:09:01 +01:00
Luuk van Baal
f58e7d5fac feat(marks): add conceal_lines to nvim_buf_set_extmark()
Implement an extmark property that conceals lines vertically.
2025-02-25 13:09:01 +01:00
zeertzjq
a31ccc3b1f vim-patch:9.1.1140: filetype: m17ndb files are not detected (#32618)
Problem:  filetype: m17ndb files are not detected
Solution: detect m17ndb files as m17ndb filetype,
          include filetype, syntax and indent files for the
          new filetype (David Mandelberg).

References:

https://www.nongnu.org/m17n/manual-en/m17nDBFormat.html describes the
format. https://git.savannah.nongnu.org/cgit/m17n/m17n-db.git/tree/ has
examples of the files.

closes: vim/vim#16696

ed7d8e55ac

Also adjust the xkb parent pattern according to dev_vimpatch.txt.

Co-authored-by: David Mandelberg <david@mandelberg.org>
2025-02-25 09:20:44 +00:00
Artem
0c650da799 test: combined injections (#32611)
* refactor: rewrite test without trailing whitespace

* test: combined injection tests
2025-02-25 09:12:49 +00:00
glepnir
c9a2b16c48 vim-patch:9.1.1145: multi-line completion has wrong indentation for last line (#32625)
Problem:  When expanding omni completion items with newlines (e.g.
          `then\n\t\nend`), the end statement gets wrong indentation.
Solution: Add OPENLINE_FORCE_INDENT flag to make open_line() use
          second_line_indent directly (glepnir)

closes: vim/vim#16614

5090a1fecb
2025-02-25 06:30:21 +00:00
zeertzjq
095c0876c2 fix(api): don't override Vimscript SID (#32610)
Problem:  When calling an API from Vimscript to set an option, mapping,
          etc., :verbose shows that it's set from an API client.
Solution: Don't override current_sctx.sc_sid when calling an API from
          Vimscript. Also fix the inverse case where API channel id is
          not set when calling an API from RPC. Move channel id into
          sctx_T to make saving and restoring easier.

Related #8329
2025-02-25 01:17:51 +00:00
phanium
614c9322d5 fix(lua): SIGSEGV in luv callback with error(nil) #32595
Problem:
luv callback `vim.uv.new_timer():start(0, 0, function() error() end)`
causes SIGSEGV, since `xstrdup` gets NULL from `lua_tostring`.
Similar to: a5b1b83a26

Solution:
Check NULL before `xstrdup`.
2025-02-24 13:34:49 -08:00
zeertzjq
56fabcadb6 vim-patch:025dc48: runtime(vim): Update base-syntax, match :CompilerSet and :SynMenu commands (#32605)
closes: vim/vim#16713

025dc48e88

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-02-24 04:16:36 +00:00
zeertzjq
01236c3bfe vim-patch:9.1.1143: illegal memory access when putting a register (#32604)
Problem:  illegal memory access when putting a register
Solution: make sure cursor column doesn't become negative

e0029daa35

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-02-24 11:20:37 +08:00
Evgeni Chasnovski
268a3de0a7 feat(complete): CompleteDone reason "cancel", "discard" #32600
Problem: there is no way to distinguish between user's explicit
  completion stop/cancel and other automated reasons.

Solution: update "cancel" reason to be set only on explicit CTRL-e, and
  set intentionally vague "discard" otherwise.
2025-02-23 14:08:26 -08:00
Evgeni Chasnovski
07c5f41da3 fix(float): can set title/footer without setting border #32594
Problem: setting title and/or footer without explicitly setting border
  shows "title/footer/ requires border to be set" error.
  At the same time, explicitly setting `border = "none"` (which is
  default) shows expected no-border-no-title-no-footer window without
  error.

Solution: allow setting title/footer without explicitly setting border.
2025-02-23 09:08:16 -08:00
Yi Ming
6bc7979044 fix(lsp): reset the applied hints on refresh request #32446 2025-02-23 08:48:08 -08:00
Justin M. Keyes
2a733ec6cc revert "feat(ftplugin): set 'omnifunc' of Lua to 'v:lua.vim.lua_omnifunc'" #32597
This reverts commit f398e3a61a.
2025-02-23 08:21:24 -08:00
Justin M. Keyes
9304a417af Merge #32503 feat(lsp): use the meta model to generate server capability map 2025-02-23 08:20:19 -08:00
Riley Bruins
0c9c140f91 refactor(treesitter): simplify parsing coroutine logic
Lua coroutines can yield across non-coroutine function boundaries,
meaning that we don't need to wrap each helper function in a coroutine
and resume it within `_parse()`. If we just have them yield when
appropriate, this will be caught by the top level `_parse()` coroutine,
and resuming the `_parse()` will resume from the position in the helper
function where we yielded last.
2025-02-23 17:12:58 +01:00
Phạm Bình An
f398e3a61a feat(ftplugin): set Lua 'omnifunc' to vim.lua_omnifunc #32491
Problem:
- Many other ftplugin have defined 'omnifunc', but the Lua one doesn't
  define one, even though there is `vim.lua_omnifunc()`
- Users may want "stupid" completion to fix Lua config with
  `nvim --clean` in case they breaks it

Solution:
Set 'omnifunc' to 'v:lua.vim.lua_omnifunc' in ftplugin/lua.lua
2025-02-23 07:57:16 -08:00
Dan Sully
b283736388 fix(lua): @private => @nodoc #32587
Problem:
vim.log.levels.* and vim.opt_local are marked `@private` but they should be `@nodoc`.

Solution:
Fix the annotation.
2025-02-23 07:51:12 -08:00
dundargoc
4a0ee22e77 build: make makefile work on msys
Relying on $(OS) doesn't work as it's too naive, so we check if $PATH
contains a colon instead.

Closes https://github.com/neovim/neovim/issues/31027
2025-02-23 11:38:29 +01:00
Maria José Solano
d2cca606a1 fix(float): ensure floating window width can fit title 2025-02-23 10:32:20 +00:00
zeertzjq
f932c7852e Merge pull request #32593 from zeertzjq/vim-9.1.1139
vim-patch:9.1.{1139,1141}
2025-02-23 17:53:53 +08:00
zeertzjq
365b865d6b vim-patch:9.1.1141: Misplaced comment in readfile()
Problem:  Misplaced comment in readfile().
          (after v9.1.1139)
Solution: Move the comment above S_ISDIR().
          (zeertzjq)

closes: vim/vim#16714

b8989fb860
2025-02-23 17:19:55 +08:00
zeertzjq
0861ea6949 vim-patch:9.1.1139: [fifo] is not displayed when editing a fifo
Problem:  [fifo] is not displayed when editing a fifo
          (after v7.4.2189)
Solution: stat the filename and detect the type correctly

fixes: vim/vim#16702
closes: vim/vim#16705

f1c3134ee1

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-02-23 17:19:55 +08:00
zeertzjq
16e6f6e584 vim-patch:9.1.1137: ins_str() is inefficient by calling STRLEN() (#32591)
Problem:  ins_str() is inefficient by calling STRLLEN()
Solution: refactor ins_str() to take a length argument
          and let all callers provide the correct length
          when calling ins_str() (John Marriott)

closes: vim/vim#16711

f4b36417e8

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-02-23 16:52:44 +08:00
luukvbaal
5a41f7e69c vim-patch:9.1.1136: Match highlighting marks a buffer region as changed (#32561)
Problem:  Match highlighting marks a buffer region to be redrawn as if
          its buffer text was changed, unnecessarily invoking syntax code.
Solution: Set the `w_redraw_top/bot` variables instead of the b_mod_* ones
          (Luuk van Baal)

7bbb0f357e
2025-02-23 16:35:26 +08:00
James McCoy
1c81734871 test(unit/strings_spec): show ctx when vim_snprintf content check fails #32570
Same idea as a7be4b7bf8, but that only showed the context if the
length of the string differed. Since these tests check both string
length and string content, the ctx should be provided for both.

    ERROR    test/unit/testutil.lua @ 797: vim_snprintf() positional arguments
    test/unit/testutil.lua:769: test/unit/testutil.lua:753: (string) '
    test/unit/strings_spec.lua:159: snprintf(buf, 4, "%1$0.*2$b", 12ULL, cdata<int>: 0xf78c8ed8) = 001100
    Expected objects to be the same.
    Passed in:
    (string) '000'
    Expected:
    (string) '001''
2025-02-22 17:11:15 -08:00
Christian Clason
228fe50087 vim-patch:9.1.1134: filetype: Guile init file not recognized
Problem:  filetype: Guile init file not recognized
Solution: detect '.guile' file as scheme filetype
          (David Mandelberg)

References:

https://www.gnu.org/software/guile/manual/html_node/Init-File.html
> When run interactively, Guile will load a local initialization file
> from ~/.guile. This file should contain Scheme expressions for
> evaluation.

closes: vim/vim#16683

41a6026f00

Co-authored-by: David Mandelberg <david@mandelberg.org>
2025-02-23 00:19:53 +01:00
Christian Clason
010684e024 vim-patch:9.1.1133: filetype: xkb files not recognized everywhere
Problem:  filetype: xkb files not recognized everywhere
Solution: detect xkb files in more places
          (David Mandelberg)

References:
https://xkbcommon.org/doc/current/user-configuration.html#user-config-locations

closes: vim/vim#16684

b62bf81488

Co-authored-by: David Mandelberg <david@mandelberg.org>
2025-02-23 00:19:53 +01:00
Christian Clason
90958c3648 vim-patch:61af587: runtime(dockerfile): set comments in filetype plugin
closes: vim/vim#16698

61af587f26

Co-authored-by: David Mandelberg <david@mandelberg.org>
2025-02-22 16:17:11 +01:00
Christian Clason
5f11efe423 vim-patch:d15114c: runtime(compiler): include svelte-check compiler
closes: vim/vim#16704

d15114c148

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2025-02-22 16:17:11 +01:00
phanium
e641155b02 fix(runtime): avoid E31 in ftplugin (#32578)
fix: twice nunmap in ftplugin
2025-02-22 14:17:35 +01:00
Christian Clason
2e5b560482 feat(treesitter): table of contents for checkhealth, markdown (#32282)
Problem: It's difficult to navigate large structured text files (vim
help, checkhealth, Markdown).

Solution: Support `gO` for table of contents and `]]`/`[[` for moving
between headings for all these filetypes using treesitter queries.

Refactor: colorization of highlight groups is moved to the `help` ftplugin
while headings-related functionality is implemented in a private
`vim.treesitter` module for possible future use for other filetypes.
2025-02-22 13:07:21 +01:00
zeertzjq
5cead869fb vim-patch:9.1.1135: 'suffixesadd' doesn't work with multiple items (#32573)
Problem:  'suffixesadd' doesn't work with multiple items
          (after 9.1.1122).
Solution: Don't concat multiple suffixes together.
          (zeertzjq)

fixes: vim/vim#16694
closes: vim/vim#16699

bf595ae4ac
2025-02-22 08:38:12 +00:00
Mathias Fussenegger
8d7eb03040 fix(lsp): unify get_completion_word for textEdits/insertText
Problem:

After https://github.com/neovim/neovim/pull/32377 selecting snippets
provided by luals inserted the multi-line text before accepting the
candidates. That's inconsistent with servers who provide `textEdit`
instead of `insertText` and having lines shift up/down while cycling
through the completion candidates is a bit irritating.

Solution:

Use the logic used for `textEdit` snippets also for `insertText`
2025-02-22 09:33:54 +01:00
Sören Tempel
db2c3d1143 fix(tests): filter out lines with __typeof__ keyword (#32524)
Problem: On 32-bit architectures, musl libc makes heavy use of
__typeof__ as part of its __REDIR macro for optional backwards
compatibility with 32-bit time_t values. Unfortunately, the
__typeof__ keyword is not supported by the LuaJIT C parser.

Solution: Filter out the keyword in filter_complex_blocks.
2025-02-22 07:37:15 +08:00
zeertzjq
59b672fda2 vim-patch:9.1.1132: Mark positions wrong after triggering multiline completion (#32564)
Problem:  Mark positions wrong after triggering multiline completion.
Solution: Call deleted_lines_mark() after deleting lines.
          (zeertzjq)

closes: vim/vim#16687

060e6556e2

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2025-02-21 23:07:47 +00:00
zeertzjq
f3f94d2c37 vim-patch:partial:9.1.1131: potential out-of-memory issue in search.c (#32565)
Problem:  potential out-of-memory issue in search.c
Solution: improve situation and refactor search.c slightly
          (John Marriott)

- In function update_search_stat():
  add a check for a theoretical null pointer reference, set and remember
  the length of lastpat, remove the three calls to STRLEN() and use the
  various string's associated lengths instead, add a check for an
  out-of-memory condition.

- In function search_for_fuzz_match():
  remove a call to strnsave() and thus avoid having to add a check for
  an out-of-memory condition, also replace the call to STRLEN() by
  ml_get_buf_len().

closes: vim/vim#16689

b79fa3d9c8

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-02-21 22:49:59 +00:00
zeertzjq
cdedfc3743 fix(marks): truncate double-width inline virt_text consistently (#32560)
- Fix wrong cursor position with 'listchars' "precedes".
- Always show the '<' truncation character.
2025-02-21 22:35:10 +00:00
zeertzjq
4ff813e5c6 vim-patch:9.1.1130: 'listchars' "precedes" is not drawn on Tabs. (#32563)
Problem:  'listchars' "precedes" is not drawn on Tabs.
Solution: Only draw 'listchars' "precedes" when not skipping over cells.
          (zeertzjq)

fixes: vim/vim#5927
closes: vim/vim#16691

13f100e932
2025-02-21 22:05:32 +00:00
Riley Bruins
cbad2c6628 perf(treesitter): don't block when finding injection ranges
**Problem:** Currently, parsing is asynchronous, but it involves a
(sometimes lengthy) step which finds all injection ranges for a tree by
iterating over that language's injection queries. This causes edits in
large files to be extremely slow, and also causes a long stutter during
the initial parse of a large file.

**Solution:** Break up the injection query iteration over multiple event
loop iterations.
2025-02-21 18:10:24 +01:00
Maria José Solano
e4c1f6667b feat(lsp): use the meta model to generate server capability map 2025-02-21 08:40:33 -08:00
zeertzjq
2e0a563828 test: adjust multibyte virtual text test (#32557)
Having more chars after a double-width char makes it easier to spot the
bug where truncating it causes the pending chars to be lost.
2025-02-21 20:57:41 +08:00
Riley Bruins
55b165ac15 fix(treesitter): TSNode:field() returns all children with the given field 2025-02-21 09:47:02 +00:00
Christian Clason
3e39250a79 vim-patch:3cb4148: runtime(sieve): set fileformat=dos in filetype plugin
References:
https://datatracker.ietf.org/doc/html/rfc5228#section-2.2

closes: vim/vim#16685

3cb41489dc

Co-authored-by: David Mandelberg <david@mandelberg.org>
2025-02-21 10:03:52 +01:00
Christian Clason
2b7d9d1900 vim-patch:27f5136: runtime(mail): add commentstring '> %s' to ftplugin
The new native commenting functionality is currently not used when
editing mail. One could reasonably expect it to change the "quote" state
of any given line in the mail (i.e. the preceding ">"), which would be
very handy and feel natural when editing mail. Especially since the
current file already uses "setlocal comments+=n:>".

Solution: Add commentstring to `> %s` to be used in files of type mail.

closes: vim/vim#16669

27f5136761

Co-authored-by: Lucas Eekhof <105216949+eekhof@users.noreply.github.com>
2025-02-21 10:03:52 +01:00
Christian Clason
40dfc4ebd1 vim-patch:106899e: runtime(dnsmasq): include simple filetype plugin
closes: vim/vim#16671

106899eb21

Co-authored-by: dringsim <dringsim@qq.com>
2025-02-21 10:03:52 +01:00
Christian Clason
9996a36cd5 vim-patch:911742a: runtime(dosini): Add support for # comments to ftplugin
runtime/syntax/dosini.vim supports both ; and # as comments, and I think
a bunch of the files detected as dosini do too, so add support for # to
the ftplugin.

closes: vim/vim#16681

911742a975

Co-authored-by: David Mandelberg <david@mandelberg.org>
2025-02-21 10:03:52 +01:00
Riley Bruins
562056c875 perf(treesitter): only search for injections within the parse range
Co-authored-by: Jaehwang Jung <tomtomjhj@gmail.com>
2025-02-21 09:56:21 +01:00
Riley Bruins
b533c0f222 ci: add "_" to luacheck's list of global variables 2025-02-21 09:56:21 +01:00
luukvbaal
08f7c22377 fix(messages): list_cmd kind for :registers, :au[g] #32531
Problem:  No kind for `:registers/autocmd/augroup` messages. `:registers`
          chunks are emitted as separate `msg_show` events.

Solution: Add the `list_cmd` kind to the message. Introduce a new
          `msg_ext_skip_flush` variable to set to true around a
          group of to be paired message chunks.
2025-02-20 16:40:21 -08:00
zeertzjq
f4cd5a33b6 vim-patch:9.1.1127: preinsert text is not cleaned up correctly (#32544)
Problem:  when 'completeopt' is set to preinsert the preinserted text is
          not cleared when adding new leader (Yee Cheng Chin)
Solution: add a condition to delete preinsert text in edit function
          (glepnir)

closes: vim/vim#16672

52fd867f5e

Co-authored-by: glepnir <glephunter@gmail.com>
2025-02-21 08:25:11 +08:00
zeertzjq
b96c3d9a51 vim-patch:9.1.1125: cannot loop through pum menu with multiline items (#32543)
Problem:  cannot loop through pum menu with multiline items with
          fuzzy and noselect in 'completeopt' (Tomasz N)
Solution: remove unnecessary compl_no_select condition (glepnir)

fixes: vim/vim#16641
closes: vim/vim#16674

3af0a8d8f5

Co-authored-by: glepnir <glephunter@gmail.com>
2025-02-21 08:24:52 +08:00
zeertzjq
1fb606b2ff vim-patch:9.1.1126: patch 9.1.1121 used a wrong way to handle enter
Problem:  patch 9.1.1121 used a wrong way to handle enter
Solution: compl_enter_selects also needs to consider the selected item
          in ins_compl_new_leader() (glepnir)

closes: vim/vim#16673

4418041698

Co-authored-by: glepnir <glephunter@gmail.com>
2025-02-21 07:45:30 +08:00
zeertzjq
145c2e720c test(completion_spec): make Enter test descriptions more accurate 2025-02-21 07:45:30 +08:00
glepnir
07785ea9c5 vim-patch:9.1.1121: Enter does not insert newline with "noselect"
Problem:  Enter does not insert newline with "noselect" when the pum is
          visible (lifepillar)
Solution: When Enter is pressed and no complete-item is selected,
          ins_compl_prep returns false, and the edit function continues
          processing Enter to insert a new line. (glepnir)

fixes: vim/vim#1653
closes: vim/vim#16653

07f0dbe3aa

Co-authored-by: glepnir <glephunter@gmail.com>
2025-02-21 07:45:30 +08:00
zeertzjq
99a6cbe540 vim-patch:9.1.1124: No test for 'listchars' "precedes" with double-width char (#32541)
Problem:  No test for 'listchars' "precedes" with double-width char.
Solution: Add a test and fix a typo in code (zeertzjq).

closes: vim/vim#16675

08a83a033a

Cherry-pick test_listchars.vim changes from patch 9.0.0625.
Fix a regression from #30014 by moving the mb_schar assignment after the
double-width check.
2025-02-21 07:02:49 +08:00
luukvbaal
e16bec41b6 feat(messages): confirm kind for z=, :tselect, inputlist() #32521
Problem:  Messages preceding a `cmdline_show->prompt` event can not be
          distinguished as such when receiving the event. (But since
          `msg_show` handlers should be scheduled, one can already check
          whether a prompt is active when displaying the message.)

Solution: Rather than add a new kind again, use the `confirm` kind.
          Could be seen as slightly misleading where it is more of
          a choice rather than a confirmation, but that already applies
          to `confirm()` as well...
2025-02-20 14:04:27 -08:00
zeertzjq
51cf84daf9 feat(marks): virtual lines support horizontal scrolling (#32497)
Add a new field `virt_lines_overflow` that enables horizontal scrolling
for virtual lines when set to "scroll".
2025-02-20 21:47:12 +08:00
Mantas Mikulėnas
574ea6a191 fix(keycodes): recognize <Find>, <Select> #28431
PuTTY sets TERM=xterm, but sends ESC[1~ and ESC[4~ for Home/End keys,
which does not match what the 'xterm' terminfo has for khome/kend, so
libtermkeys instead reports them as the original DEC VT220 names.

The VT220 came with a DEC LK201 keyboard which had the following keys in
the area above arrow keys (where PCs now have Ins/Del/Home/End/etc):

  ┌────────┬────────┬────────┐
  │ Find   │ Insert │ Re-    │
  │        │ Here   │ move   │
  ├────────┼────────┼────────┤
  │ Select │ Prev   │ Next   │
  │        │ Screen │ Screen │
  └────────┴────────┴────────┘

These would send ESC[x~ sequences in the expected order:

  ┌────────┬────────┬────────┐
  │ ESC[1~ │ ESC[2~ │ ESC[3~ │
  ├────────┼────────┼────────┤
  │ ESC[4~ │ ESC[5~ │ ESC[6~ │
  └────────┴────────┴────────┘

Modern terminals continue to use the same sequences for Ins/Del as well
as PageUp/PageDn. But the VT220 keyboard apparently had no Home/End, and
PuTTY apparently chose to re-purpose the Find/Select key sequences for
Home/End (even though it claims to emulate Xterm and this doesn't match
what actual Xterm does).

So when Home/End are used in Neovim through PuTTY with TERM=xterm (the
default setting), libtermkey finds no match for the received sequences
in the terminfo database and defaults to reporting them as <Find> and
<Select> respectively.

PuTTY is not unique here -- tmux *also* sends ESC[1~ and ESC[4~ after
its internal translation -- but the difference is that 'tmux' terminfo
correctly maps them to Home/End so Neovim recognizes them as such, while
PuTTY defaults to using 'xterm' which uses a different mapping.

This initial patch only allows Neovim to recognize <Find> and <Select>
key codes as themselves, so that the user could manually map them e.g.
using ":imap <Find> <Home>".

Alternatives:

  - Using TERM=putty(-256color) would of course be the most correct
    solution, but in practice it leads to other minor issues, e.g. the
    need to have different PuTTY config profiles for older or non-Linux
    systems that lack that terminfo, or tmux's insistence on rendering
    italics as reverse.

  - Using Neovim through tmux avoids the problem (as tmux recognizes
    ESC[1~ on input), but is something that needs to be manually run
    every time.

The keycodes.h constants are slightly misnamed because K_SELECT was
already taken for a different purpose.
2025-02-20 05:26:46 -08:00
Luca Saccarola
4913b7895c vim-patch:c729d6d: runtime: decouple Open and Launch commands and gx mapping from netrw (#32506)
closes: vim/vim#16494
fixes: #vim/vim#16486

c729d6d154
2025-02-20 12:10:13 +00:00
Riley Bruins
b0bbe25c48 fix(treesitter): don't spam query errors in the highlighter
**Problem:** An erroneous query in the treesitter highlighter gives a
deluge of errors that makes the editor almost unusable.

**Solution:** Detach the highlighter after an error is detected, so that
it only gets displayed once (per highlighter instance).
2025-02-19 19:13:16 +01:00
Luuk van Baal
36f44b3121 fix(api): remove invalid assertions
Problem: `try_leave()` assertions moved in #31600 no longer hold.
Solution: Remove the assertions.
2025-02-19 19:11:55 +01:00
Luuk van Baal
bc1018a8d3 fix(treesitter): avoid computing fold levels for empty buffer
Problem:  Computing fold levels for an empty buffer (somehow) breaks the
          parser state, resulting in a broken highlighter and foldexpr.
          Cached foldexpr parser is invalid after filetype has changed.
Solution: Avoid computing fold levels for empty buffer.
          Clear cached foldinfos upon `FileType`.
2025-02-19 19:11:55 +01:00
Luuk van Baal
a0b52e7cb3 fix(treesitter)!: enforce buffer is loaded when creating parser
Problem: `vim.treesitter._create_parser()` silently loads the buffer,
          bypassing the swapfile prompt.
Solution: Error for an unloaded buffer, ensure buffer is loaded in
          `vim.treesitter.start()` instead.
2025-02-19 19:11:55 +01:00
Phạm Bình An
a422f3393e docs: Lua "bit" library #32492
Problem:
lua-bit is built-in, but there is no doc

Solution:
Upstream doc from https://bitop.luajit.org/
2025-02-19 10:09:09 -08:00
Sean Dewar
f3ce67549c fix(terminal): avoid more busy_start lacking busy_stop (#32509)
Problem: after #32458, it may still be possible for `busy_start` UI events to be
emitted without matching `busy_stop`s in the terminal.

Solution: do `terminal_enter`'s cursor visibility check immediately after
setting/restoring State so it occurs before events. This ensures that if pending
escape sequences are processed while in `terminal_enter`, the cursor's initial
visibility is set before `is_focused` is checked by `term_settermprop`.

As a result, we can move the call to `showmode` back to where it was originally.
2025-02-19 10:47:44 +00:00
zeertzjq
a3eb49f638 vim-patch:9.1.1122: too many strlen() calls in findfile.c (#32516)
Problem:  too many strlen() calls in findfile.c
Solution: refactor findfile.c and remove calls to strlen()
          (John Marriott)

closes: vim/vim#16595

d6e3c9048d

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-02-19 17:14:38 +08:00
zeertzjq
9005134cdc vim-patch:9.0.0532: edit test is flaky when run under valgrind (#32518)
Problem:    Edit test is flaky when run under valgrind.
Solution:   Send some text to the terminal to trigger a redraw.

14f91765c0

Cherry-pick Test_edit_shift_bs() from patch 8.2.4876.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-02-19 06:32:45 +00:00
zeertzjq
5d03060743 test(lua/hl_spec): fix hang on exit with ASAN (#32508) 2025-02-18 21:22:46 +08:00
Christian Clason
4c2d14a370 build(deps): bump tree-sitter to v0.25.2 2025-02-18 10:41:11 +01:00
Maria José Solano
ae2fd91b41 feat(lsp): update LSP types 2025-02-17 17:52:55 -08:00
zeertzjq
4a2a54f993 vim-patch:5647c91: runtime(doc): add reference to extendnew() at extend() (#32500)
related: vim/vim#16607

5647c91355

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-02-17 22:59:34 +00:00
Sören Tempel
639734bed4 fix(tests): remove the __extension__ keyword in filter_complex_blocks (#32483)
Problem: This keyword is used by GCC and Clang to prevent -Wpedantic
(and other options) from emitting warnings for many GNU C extensions.
This is used heavily in Alpine Linux through musl libc and
foritfy-headers. Without filtering the __extension__ keyword some type
definitions are duplicated. For example, timeval is defined once as

  struct timeval { time_t tv_sec; suseconds_t tv_usec; };

and once as:

  __extension__ struct timeval { time_t tv_sec; suseconds_t tv_usec; };

Without this patch, the LuaJIT C parser doesn't recognize that these
definitions are equivalent, causing unit test to fail on Alpine Linux.

Solution: Filter out the keyword in filter_complex_blocks.
2025-02-18 06:43:48 +08:00
Riley Bruins
1827ab7a1f fix(treesitter): separately track the number of valid regions
We need to add a separate variable to keep track of this information,
since we cannot read the length of the valid regions table itself, since
it has holes.
2025-02-17 15:13:26 +00:00
Justin M. Keyes
b360c06085 refactor(channel): eliminate special case in on_proc_exit() #32485
Problem:
on_proc_exit() has a special-case that assumes that the UI client will
never spawn more than 1 child process.

Solution:
If the Nvim server exits, the stream EOF will trigger `rpc_close()` in
the UI client, so we don't need the special case in `on_proc_exit`.
Pass `Channel.exit_status` from `rpc_close()` so that the correct exit
code is reflected.
2025-02-17 02:26:19 -08:00
dundargoc
bd0a65bc15 docs: misc (#32258)
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: Julian Visser <12615757+justmejulian@users.noreply.github.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-02-17 10:33:20 +08:00
zeertzjq
5e7801329f test(lua/hl_spec): reduce flakiness (#32489) 2025-02-17 10:32:35 +08:00
zeertzjq
bfd59c955f test: reduce flakiness in highlight tests (#32488) 2025-02-17 01:45:53 +00:00
zeertzjq
9d699e2005 vim-patch:68ba6c2: runtime(vim): Update base-syntax, improve performance (#32487)
Contain the vimNotation syntax group, matching this at top level is
unnecessary and very slow.

The removed vimString and vimNumber definitions are broken and/or never
match. They have long been replaced by newer definitions.

closes: vim/vim#16645

68ba6c2c6c

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-02-17 08:00:33 +08:00
phanium
a75b09019f docs: stdpath() type #32480 2025-02-16 13:33:56 -08:00
Maria José Solano
0e8e4a07f5 fix(diagnostic): don't include diagnostic code when using custom formatter #32464 2025-02-16 12:13:29 -08:00
zeertzjq
906ad04ddd fix(marks): handle composing in inline virt_text with 'nowrap' (#32477) 2025-02-16 22:54:32 +08:00
zeertzjq
8452032554 fix(marks): handle double-with inline virt_text with 'nowrap' (#32476) 2025-02-16 14:05:13 +00:00
Maria José Solano
efe92f9dff fix(docs): update context type in vim.lsp.LocationOpts.OnList 2025-02-16 11:31:08 +01:00
Sean Dewar
a49f95d887 fix(terminal): avoid mismatched busy_start without busy_stop (#32458)
Problem: `showmode` in `terminal_enter` may cause `vpeekc` to process events,
which may handle pending escape sequences. If `CSI ? 25 l` is handled to hide
the cursor, it may remain hidden even after leaving terminal mode if both
`terminal_enter` and (indirectly) `showmode` call `ui_busy_start`, as there is
only one matching call to `ui_busy_stop` after leaving terminal mode.

Solution: let `terminal_enter` handle setting the initial visibility of the
cursor before calling `showmode`.

Closes #32456.

This simple solution assumes it isn't possible for e.g. `os_breakcheck` to be
called indirectly by something else before `terminal_enter` initially handles
cursor visibility and after it restores it, which I think is true.
2025-02-15 17:25:48 +00:00
dundargoc
8e4b77134a ci(test): disable ubuntu arm
There are too many flakes and intermittent failures to reliably use it.
Disable it for the time being until things stabilize.
2025-02-15 14:55:25 +01:00
Christian Clason
0a0f53663b vim-patch:3f60114: runtime(keymap): Add ukrainian-enhanced keymap
The "Ukrainian enhanced keymap" allows you to type Ukrainian in Vim
using jcuken Windows layout.

Original file is made by Ivan Korneliuk and can be found at
https://github.com/vansha/ukrainian-enhanced.vim. It is being added here
with the permission of the author.

There is another ukrainian layout already in Vim, namely the
keymap\ukrainian-jcuken.vim script by Anatoli Sakhnik. But this one
differs in way it maps numeric keys. It uses values usual for Windows
users.

closes: vim/vim#16628

3f60114236

Co-authored-by: Vladyslav Rehan <rehanvladyslav@gmail.com>
2025-02-15 11:20:50 +01:00
zeertzjq
10a3a85473 vim-patch:faf4112: runtime(doc): document ComplMatchIns highlight for insert-completion (#32448)
closes: vim/vim#16636

faf4112cdc

Co-authored-by: glepnir <glephunter@gmail.com>
2025-02-14 23:42:16 +00:00
zeertzjq
1cdeb037c1 vim-patch:9.1.1112: Inconsistencies in get_next_or_prev_match() (#32447)
Problem:  Inconsistencies in get_next_or_prev_match() (after 9.1.1109).
Solution: Change "file" to "entry" or "match" in comments.  Use the same
          order of branches for PAGEUP and PAGEDOWN (zeertzjq).

closes: vim/vim#16633

b6c900be9c
2025-02-14 23:24:26 +00:00
Mathias Fussenegger
f20335a54c feat(lsp): add support for completionItem.command resolving
`command` was already resolved via a `completionItem/resolve` request
but only if `additionalTextEdits` were also present, and the
`resolveSupport` capability wasn't listed.

Closes https://github.com/neovim/neovim/issues/32406
2025-02-14 19:49:08 +01:00
dundargoc
c091bc3b9a ci(release): change to ubuntu-22.04
Ubuntu 20.04 is deprecated.
2025-02-14 14:54:18 +01:00
glepnir
cff5fa49fc fix(float): "Not enough room" error for 1-line float #25192
Problem: set winbar on a floating window which only have one row will
cause crash.

Solution: when new floating window only have one room don't copy winbar
from target window"

Fix #19464
2025-02-14 05:28:51 -08:00
zeertzjq
dc33879dc2 Merge pull request #32442 from zeertzjq/vim-407319f
vim-patch: runtime file updates
2025-02-14 20:48:39 +08:00
dundargoc
ca5fca2912 build(windows)!: drop cat and tee executables from windows
The legitimacy of the binaries can't be guaranteed and poses a security
risk. A replacement version of these may be introduced in the future in
a more secure manner.

Closes https://github.com/neovim/neovim/issues/32431.
2025-02-14 13:10:11 +01:00
zeertzjq
565152a2ac vim-patch:d7deeff: runtime(exports): include simple filetype plugin
closes: vim/vim#16625

d7deeffe11

Co-authored-by: Matt Perry <matt@mattperry.com>
2025-02-14 19:54:14 +08:00
zeertzjq
92f0933abb vim-patch:407319f: runtime(samba): include simple filetype plugin
closes: vim/vim#16626

407319fe89

Co-authored-by: Matt Perry <matt@mattperry.com>
2025-02-14 19:53:54 +08:00
zeertzjq
f247402010 vim-patch:9.1.1107: cannot loop through completion menu with fuzzy (#32438)
Problem:  cannot loop through completion menu with fuzzy and nosort in
          'completeopt'
          (Tomasz N)
Solution: Reset cur to zero and update compl_shown_match when
          'completeopt' contains "nosort" but not "noselect"
          (glepnir)

fixes: vim/vim#16624
closes: vim/vim#16629

c0b7ca406b

Co-authored-by: glepnir <glephunter@gmail.com>
2025-02-14 09:09:01 +08:00
zeertzjq
478c71f03c vim-patch:9.1.1109: cmdexpand.c hard to read (#32437)
Problem:  cmdexpand.c hard to read
Solution: refactor the file slightly (glepnir)

closes: vim/vim#16621

977561a719

Co-authored-by: glepnir <glephunter@gmail.com>
2025-02-14 08:26:52 +08:00
zeertzjq
6b387bde69 vim-patch:4f010c9: runtime(vim): Update base-syntax, always match continuation comments to EOL (#32435)
closes: vim/vim#16630

4f010c90bd

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-02-14 07:49:57 +08:00
zeertzjq
9f85dace94 vim-patch:9.1.1108: 'smoothscroll' gets stuck with 'listchars' "eol" (#32434)
Problem:  'smoothscroll' gets stuck with 'listchars' "eol".
Solution: Count size of 'listchars' "eol" in line size when scrolling.
          (zeertzjq)

related: neovim/neovim#32405
closes: vim/vim#16627

2c47ab8fcd
2025-02-13 23:21:45 +00:00
Till Bungert
93480f7fba feat(term): trigger TermRequest for APC (#32407)
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-02-13 08:24:01 -06:00
Maria José Solano
e4c6e732fd feat(lsp): add select kind in showMessageRequest #32387 2025-02-13 05:48:56 -08:00
Justin M. Keyes
375847fb33 Merge #32426 fix(lsp): reset active request when reporting an error 2025-02-13 05:19:33 -08:00
glepnir
c374f26430 fix(lsp): clear word when expand multi-lines word (#32393)
Problem: When expanding a completion item that contains a multi-line word, the word is not deleted correctly.

Solution: If the word contains a line break, delete the text from Context.cursor to the current cursor position.
2025-02-13 11:24:38 +01:00
Robert Muir
b42dc232c5 fix(lsp): autotrigger should only trigger on client's triggerCharacters (#32266)
Problem: autotrigger option of vim.lsp.completion.enable() would trigger
all clients, as long as it matched at least one client's
triggerCharacters.

Solution: trigger only the clients with triggerCharacters matching the
character. overtriggering still happens if any client returns
isIncomplete=true (this case is more involved).


Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2025-02-13 11:08:11 +01:00
Christian Clason
0c3d2c9560 vim-patch:8f3277f: runtime(nroff): set define option & add matchit config in ftplugin
closes: vim/vim#16619

8f3277fbbe

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2025-02-13 10:03:28 +01:00
Yi Ming
2df68d3696 refactor(lsp): handling errors and nil responses together 2025-02-13 12:01:16 +08:00
Yi Ming
d76f7fef13 fix(lsp): reset active request when reporting an error 2025-02-13 11:59:18 +08:00
Yi Ming
4fd2694f20 fix(lsp): missing method parameter when canceling requests 2025-02-13 10:19:34 +08:00
zeertzjq
66b60fe62b Merge pull request #32425 from zeertzjq/vim-4a530a6
vim-patch: update Vim syntax
2025-02-13 09:42:35 +08:00
zeertzjq
212fce1636 vim-patch:a9c0642: runtime(vim): Update base-syntax, match Vim9 boolean and null literals in parens
- Match Vim9 boolean and null literals in parenthesised expressions and
  function argument lists.
- Match read-only registers in expressions.

closes: vim/vim#16622

a9c06429ac

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-02-13 09:05:31 +08:00
zeertzjq
3b4ef34fc3 vim-patch:1aa287e: runtime(vim): Update base-syntax, improve variable matching
- Match variables after operators, including line continuations.
- Match option variables without leading whitespace.
- Explicitly match expression subscripts.
- Match Vim9 variables in LHS of assignments and method calls.
- Match option variables (&option) with a dedicated syntax group like
  environment variables.
- Match list literals, fixes: vim/vim#5830
- Match :{un}lockvar arguments.
- Match registers and environment variables in :let unpack lists.
- Match lambda expressions
- Match Vim9 scope blocks
- Match variables in :for subject
- Highlight user variables with Normal
- Improve this/super keyword matching, fixes: vim/vim#15970

closes: vim/vim#16476

1aa287e048

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-02-13 09:03:42 +08:00
zeertzjq
c58566a5ab vim-patch:4a530a6: runtime(vim): Update base-syntax, match :debuggreedy count prefix
Match :0debuggreedy as a special case until better range/count support
is implemented.

closes: vim/vim#16572

4a530a632b

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-02-13 09:02:03 +08:00
Christian Clason
8117db48ed ci(cirrus): update to freebsd-14-2
Previous `freebsd-14-0` image was dropped
2025-02-12 17:43:42 +01:00
luukvbaal
15bc930fca fix(memline): don't check line count for closed memline #32403
Problem:  Error thrown when for invalid line number which may be accessed
          in an `on_detach` callback at which point line count is
          intentionally set to 0.
Solution: Move empty memline check to before line number check.
2025-02-12 08:20:51 -08:00
Yi Ming
be8d87014c fix(lsp): on detach, cancel pending foldingRange requests #31509
Problem:
1. Open a relatively large file (so the server needs some time to
   process the request).
2. Then immediately execute `:bdelete`.
3. Once the request is completed, the handler will obtain the bufstate
   of a buffer already unloaded.

    Error executing vim.schedule lua callback: ...7841_1/share/nvim/runtime/lua/vim/lsp/_folding_range.lua:119: assertion failed!
    stack traceback:
            [C]: in function 'assert'
            ...7841_1/share/nvim/runtime/lua/vim/lsp/_folding_range.lua:119: in function 'multi_handler'
            ...7841_1/share/nvim/runtime/lua/vim/lsp/_folding_range.lua:140: in function 'handler'
            ...HEAD-c137841_1/share/nvim/runtime/lua/vim/lsp/client.lua:669: in function ''
            vim/_editor.lua: in function <vim/_editor.lua:0>

Solution:
On detach, cancel all pending textDocument_foldingRange requests.
2025-02-12 06:22:59 -08:00
luukvbaal
2c629ad13f feat(column): apply appropriate numhl highlight to virt_lines (#32400)
Problem:  Number and statuscolumn highlighting for virtual lines does
          not take always take on numhl highlights.
Solution: Apply the appropriate numhl highlight to the number/statuscolumn
          of virtual lines, fetching the numhl highlight of the line above
          for `virt_line_above == false` lines.
2025-02-12 11:01:43 +01:00
luukvbaal
82a215cb2d feat(options): add 'eventignorewin' (#32152)
vim-patch:partial:9.1.1084: Unable to persistently ignore events in a window and its buffers

Problem:  Unable to persistently ignore events in a window and its buffers.
Solution: Add 'eventignorewin' option to ignore events in a window and buffer
          (Luuk van Baal)

Add the window-local 'eventignorewin' option that is analogous to
'eventignore', but applies to a certain window and its buffers. Identify
events that should be allowed in 'eventignorewin', adapt "auto_event"
and "event_tab" to encode this information. Window context is not passed
onto apply_autocmds_group(), and when to ignore an event is a bit
ambiguous when "buf" is not "curbuf", rather than a large refactor, only
ignore an event when all windows into "buf" are ignoring the event.

b7147f8236

vim-patch:9.1.1102: tests: Test_WinScrolled_Resized_eiw() uses wrong filename

Problem:  tests: Test_WinScrolled_Resized_eiw() uses wrong filename
          (Luuk van Baal, after v9.1.1084)
Solution: Rename the filename to something more unique

bfc7719e48
2025-02-12 11:01:06 +01:00
zeertzjq
6982106f8c refactor(insexpand.c): remove duplicate assignment (#32410) 2025-02-12 10:31:41 +08:00
zeertzjq
00d75a24cf vim-patch:9.1.1104: CI: using Ubuntu 22.04 Github runners (#32409)
Problem:  CI: uses Ubuntu 22.04 runners
Solution: Switch to Ubuntu 24.04 runners, make a few adjustments for
          different $TMPDIR (Drew Vogel)

closes: vim/vim#16442

f0ed0e6f63

Co-authored-by: Drew Vogel <dvogel@github>
2025-02-12 07:49:08 +08:00
Justin M. Keyes
ac768996b2 refactor(tests): drop os_kill #32401
Also change job tests to use `nvim` instead of random programs like `ping`.
2025-02-11 07:19:46 -08:00
Justin M. Keyes
891d2f4029 Merge #30860 LSP: symbols_to_items() 2025-02-11 03:38:07 -08:00
Yi Ming
e8b5dd1e89 feat(lsp)!: symbol_to_item requires offset_encoding 2025-02-11 18:48:56 +08:00
Riley Bruins
3abfaafad2 fix(treesitter): detect trees with outdated regions in is_valid() 2025-02-11 09:17:08 +00:00
Yi Ming
6722149776 feat(lsp): include end_col and end_lnum in vim.lsp.buf.symbols_to_items 2025-02-11 17:09:39 +08:00
zeertzjq
f8cbdbb4a8 Merge pull request #32398 from zeertzjq/vim-9.1.1098
vim-patch:9.1.{1098,1101}
2025-02-11 10:06:45 +08:00
zeertzjq
7f3157f3f6 vim-patch:9.1.1101: insexpand.c hard to read
Problem:  insexpand.c hard to read
Solution: refactor slightly to make it better readable
          (glepnir)

Problem:
- Complex while loops with nested conditions
- Redundant if branches
- Hard to understand and maintain

Solution:
- Restructure using while(true) with clear break conditions
- Using ternary to replace some if conditions
- Add descriptive comments for each step

closes: vim/vim#16600

40891bac5d

Co-authored-by: glepnir <glephunter@gmail.com>
2025-02-11 09:33:42 +08:00
zeertzjq
b7020e263e vim-patch:9.1.1098: leaking memory with completing multi lines
Problem:  leaking memory with completing multi lines
          (after v9.1.1086)
Solution: free allocated memory (glepnir)

closes: vim/vim#16605

e3647c8bf5

Co-authored-by: glepnir <glephunter@gmail.com>
2025-02-11 09:33:41 +08:00
zeertzjq
5d2b6f4fa0 vim-patch:9.1.1095: tests: matchparen plugin test wrongly named (#32397)
Problem:  tests: matchparen plugin test wrongly named
          (zeertzjq)
Solution: rename test_matchparen to test_plugin_matchparen
          to be consistent with the other plugin tests

related: vim/vim#16599

7de6b1bb56

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-02-11 09:07:47 +08:00
Justin M. Keyes
c7d13f2895 Merge #32385 UI :detach command 2025-02-10 10:21:47 -08:00
Justin M. Keyes
a1906c23dd fix(ui): Windows :detach is opt-in
Problem:
On Windows, spawning the `nvim --embed` server with `detach=true` breaks
various `tt.setup_child_nvim` tests.

Solution:
Make this behavior opt-in with an env var, temporarily.
2025-02-10 18:56:11 +01:00
Justin M. Keyes
69abeaad1d test: use --clean 2025-02-10 18:56:11 +01:00
Justin M. Keyes
4b0e2605ea feat(ui): UI :detach command
Problem:
Cannot detach the current UI.

Solution:
- Introduce `:detach`.
- Introduce `Channel.detach`.

Co-authored-by: bfredl <bjorn.linse@gmail.com>
2025-02-10 18:56:11 +01:00
Cai Rijun (Richard)
ad60b3fb48 fix(api): memory leaks in vim.api.nvim_*get_option #32390
Problem: `get_option_value` returns caller owned `Object`s but the
corresponding C apis do not marked `FUNC_API_RET_ALLOC` properly.

Solution: add `FUNC_API_RET_ALLOC` to the C apis.
2025-02-10 09:37:36 -08:00
fredizzimo
524cdd35c2 test(fix): make testing of ext_cmdline optional #32375 2025-02-10 05:51:04 -08:00
Siddhant Agarwal
06d8dd89fd refactor(defaults): cleanup enable_ctx_menu #32391
The ctx parameter is not needed since various refactors.
2025-02-10 05:18:01 -08:00
Lewis Russell
e1dc824b7e build: set luals checklevel to Hint #32392 2025-02-10 03:04:01 -08:00
Christian Clason
ad8e0cfc1d vim-patch:f30eb4a: runtime(qf): Update syntax file, match second delimiter
Match both | separators and link to the Delimiter highlight group.

fixes vim/vim#16584
closes: vim/vim#16590

f30eb4a170

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-02-10 09:33:23 +01:00
zeertzjq
e6b84fab83 Merge pull request #32389 from zeertzjq/vim-9.0.1675
vim-patch:9.{0.1675,1.1091}
2025-02-10 12:46:25 +08:00
zeertzjq
a80023c3f8 vim-patch:9.1.1091: tests: timeout might be a bit too small
Problem:  tests: timeout might be a bit too small
Solution: increase the test timeout from 30 to 45 seconds

related: vim/vim#16599

ec7a4e4d69

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-02-10 11:34:23 +08:00
zeertzjq
82a088551f vim-patch:9.0.1675: test may run into timeout when using valgrind
Problem:    Test may run into timeout when using valgrind.
Solution:   Use a longer timeout when using valgrind.

7c2beb48ef

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-02-10 11:33:06 +08:00
zeertzjq
bb31814033 vim-patch:partial:9.1.1088: tests: plugin tests are named inconsistently (#32388)
Problem:  tests: plugin tests are named inconsistently
Solution: group them under a common 'plugin' prefix

related: vim/vim#16599

934d9ab3a2

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-02-10 11:27:13 +08:00
neeshy
59a171fd99 fix(defaults): improve visual search mappings #32378
Problem: The behavior of the visual search mappings aren't consistent
with their normal mode counterparts.
  - The count isn't considered
  - Searching with an empty selection will match every character in the
    buffer
  - Searching backwards only jumps back when the cursor is positioned at
    the start of the selection.

Solution:
  - Issue `n` `v:count1` times
  - Error out and exit visual mode when the selection is empty
  - Detect when the cursor is not at the start of the selection, and
    adjust the count accordingly

Also, use the search register instead of the more error-prone approach
of feeding the entire search string as an expression
2025-02-09 13:23:30 -08:00
Siddhant Agarwal
ac207c3ac2 feat(defaults): "Show Diagnostics" in mouse popupmenu #32122
Problem:
No obvious way to see diagnostics without configuring it first.
Solution:
Add `Show Diagnostics`, `Show All Diagnostics` and `Configure
Diagnostics` buttons to the context menu.
2025-02-09 11:32:12 -08:00
Shantanu Raj
24d7debdfb fix(lsp): signature_help highlights wrong parameter #32382
Problem:
With some LSP servers, `vim.lsp.buf.signature_help` (CTRL-s in insert-mode)
highlights the first parameter regardless of the current cursor position.

- On some lsps the `textDocument/signatureHelp` response only includes the
  `activeParameter` field on the `lsp.SignatureHelp` object.
  ```lua
  {
    {
      result = {
        activeParameter = 2,
        signatures = {
          {
            documentation = {
              kind = "markdown",
              value = ""
            },
            label = "getBuyers(ctx context.Context, orderDB boil.ContextExecutor, supplierID string) ([]*BuyerWithLocation, error)",
            parameters = {
              {
                label = "ctx context.Context"
              },
              {
                label = "orderDB boil.ContextExecutor"
              },
              {
                label = "supplierID string"
              }
            }
          }
        }
      }
    }
  }
  ```

Solution:
Ensure we retain this information before showing the signature information.

Closes #32381
2025-02-09 10:02:46 -08:00
dundargoc
198a952c13 build: add luals check
This automatically downloads and uses the correct luals binary for the
currently used system. `make luals` will run luals on all lua files in
`runtime`.

We download lua-language-server manually instead of relying on
contributors downloading it on their own (like with stylua) as
lua-language-server is updated frequently which may cause unnecessary
friction. Therefore, we download a pinned version of luals which we then
can manually bump when needed. This can be re-evaluated if luals becomes
more stable in the future.

Currently this is not run when using `make lint` since cmake style "file
caching" doesn't seem possible at the moment. This is because checking a
single file doesn't seem to work.

Work on https://github.com/neovim/neovim/issues/24563.
2025-02-09 18:10:54 +01:00
phanium
cd3855fb2b fix(lua): vim.tbl_get({}, nil, 1) should return nil #32218
Problem:
`vim.tbl_get(tbl, nil, 1)` returns `tbl` itself. In this case, `keys` is not
empty, but `ipairs` skips the iteration:

    local keys = { nil, 1 }
    assert(#keys == 2)
    for i, k in ipairs(keys) do
      assert(false, 'unreachable')
    end

Solution:
Use `select("#", ...)` and `select(i, ...)` to ensure consistency for count and
iteration.
2025-02-09 08:40:43 -08:00
fredizzimo
8c2571991a test: reset cmdline abort state only after expect() has finished #32376
Problem:
cmdline abort state may be reset when intermediate states are received.

Solution:
Reset after `self:_wait()`.
2025-02-09 07:44:41 -08:00
fredizzimo
af0cd9a907 test: screen.lua can check win_pos #32373
Also remove a hack in the multigrid "with winbar" test.
2025-02-09 07:31:14 -08:00
Christian Clason
9198368f32 vim-patch:9.1.1085: filetype: cmmt files are not recognized
Problem:  filetype: cmmt files are not recognized
Solution: detect '*.cmmt' as trace32 filetype
          (Christian Sax)

"*.cmmt" files use the same syntax as regular TRACE32 scripts,
but are intended as a kind of script template.

closes: vim/vim#16598

746fe54d4f

Co-authored-by: Christoph Sax <c_sax@mailbox.org>
2025-02-09 11:08:53 +01:00
glepnir
53e737748e vim-patch:9.1.1086: completion doesn't work with multi lines (#32377)
Problem:  completion doesn't work with multi lines
          (Łukasz Jan Niemier)
Solution: handle linebreaks in completion code as expected
          (glepnir)

fixes: vim/vim#2505
closes: vim/vim#15373

76bdb82527
2025-02-09 10:43:02 +08:00
zeertzjq
ec3071ffad Merge pull request #32374 from zeertzjq/vim-8.2.2933
vim-patch:8.2.{2933,2934,2935},9.1.1083
2025-02-09 09:19:05 +08:00
zeertzjq
6f0a91579f vim-patch:9.1.1083: setreg() doesn't correctly handle mbyte chars in blockwise mode
Problem:  setreg() doesn't correctly handle mbyte chars in blockwise
          mode
Solution: use mb_ptr2len_len function pointer (Yee Cheng Chin)

setreg() will automatically calculate the width when a blockwise mode is
specified, but it does not properly calculate the line widths of mbyte
characters when value is passed as newline-terminated string. It does
work when value is passed as a list of lines though.

Fix this by properly using the mbyte function pointer to increment the
loop counter.

closes: vim/vim#16596

a17f8bfb28

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-02-09 08:46:55 +08:00
zeertzjq
00bce2723f vim-patch:8.2.2935: calculating register width is not always needed
Problem:    Calculating register width is not always needed. (Christian
            Brabandt)
Solution:   Only calculate the width when the type is MBLOCK.

6c4c404c58

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-02-09 08:30:32 +08:00
zeertzjq
9afc1f0f3b vim-patch:8.2.2934: ASAN error when using text from the clipboard
Problem:    ASAN error when using text from the clipboard.
Solution:   Get width of each character.

24951a67c2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-02-09 08:26:44 +08:00
zeertzjq
9dc5e2100f vim-patch:8.2.2933: when 'clipboard' is "unnamed" zp does not work correctly
Problem:    When 'clipboard' is "unnamed" zp and zP do not work correctly.
Solution:   Pass -1 to str_to_reg() and fix computing the character width
            instead of using the byte length. (Christian Brabandt,
            closes vim/vim#8301, closes vim/vim#8317)

6e0b553fa1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-02-09 08:19:25 +08:00
Christian Clason
59edd7c88a vim-patch:a35040f: runtime(tex): improve syntax highlighting (#32370)
this change includes the following changes:
- a macro option must be #1–#9
- add \providecommand
- add starred versions of \newcommand, \newenvironment, and their
  variants
- add number of arguments to \(re)newenvironment

a35040f795

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-02-09 07:41:37 +08:00
dundargoc
818a2980db ci(arm64): skip installing npm to prevent segmentation faults
Installing npm on linux arm64 causes intermittent segmentation faults
for unknown reasons.

Closes https://github.com/neovim/neovim/issues/32339.
2025-02-08 14:14:42 +01:00
Evgeni Chasnovski
a9cdf76e3a fix(lsp): check for valid buf before processing semantic tokens response
Problem: There is no check for buffer validity before processing
  semantic tokens response. This can lead to `Invalid buffer id` error
  if processing request takes a long time and the buffer is wiped out.

  For example, this can happen after by accident navigating to a buffer
  from different project which leads to first loading project's
  workspace and *then* processing semantic tokens. During that time
  a buffer can be wiped out, as navigation to it was by accident.

Solution: Add extra check for buffer validity before processing semantic
  tokens response.
2025-02-07 22:10:59 +00:00
Justin M. Keyes
ad853d1df0 fix(messages): improve deadly signal messages #32364
Problem:
Deadly signal messages mention "Vim", and add redundant newlines.

Solution:
- Update the messages.
- Don't add an extra newline.
2025-02-07 05:49:52 -08:00
zeertzjq
52ff5e3032 vim-patch:b69cd52: runtime(misc): Add support for lz4 to tar & gzip plugin (#32360)
while at it, clean up the tar plugin a bit and sort the patterns for the
tar and gzip plugin

References:
- https://github.com/lz4/lz4
- https://lz4.org/

closes: vim/vim#16591

b69cd52447

Co-authored-by: Corpulent Robin <177767857+corpulentrobin@users.noreply.github.com>
2025-02-07 17:10:51 +08:00
zeertzjq
5371659524 Merge pull request #32358 from zeertzjq/vim-8.2.0849
vim-patch:8.2.{0849,0931},9.1.1081
2025-02-07 07:05:44 +08:00
zeertzjq
7c43f1128d vim-patch:9.1.1081: has('bsd') is true for GNU/Hurd
Problem:  has('bsd') is true for GNU/Hurd
Solution: exclude GNU/Hurd from BSD feature flag
          (Zhaoming Luo)

GNU/Hurd, like Mac OS X, is a BSD-based system. It should exclude
has('bsd') feature just like what Mac OS X does. The __GNU__ pre-defined
macro indicates it's compiled for GNU/Hurd.

closes: vim/vim#16580

a41dfcd55b

Co-authored-by: Zhaoming Luo <zhmingluo@163.com>
2025-02-07 06:30:11 +08:00
zeertzjq
d8e191a6ab vim-patch:8.2.0849: BeOS code is not maintained and probably unused
Problem:    BeOS code is not maintained and probably unused.
Solution:   Remove the BeOS code. (Emir Sari, closes vim/vim#5817)

041c7107f2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-02-07 06:30:11 +08:00
zeertzjq
893fad2851 test(old): reorder test_functions.vim to match upstream 2025-02-07 06:30:10 +08:00
Christian Clason
5f54f03285 vim-patch:9.1.1080: filetype: Mill files are not recognized
Problem:  filetype: Mill files are not recognized
Solution: detect '*.mill' files as scala filetype
          (author)

In the past [Mill](https://mill-build.org/mill/index.html) build files
were always `build.sc` and treated as Scala files. However as the 0.12.x
series of mill you can create a `build.mill` file. You can see a lot of
examples of this if you search
[GitHub](https://github.com/search?q=build.mill&type=code). This small
change just ensures that if you have a `*.mill` file it treats it as a
Scala file.

closes: vim/vim#16585

9c8f9b10fc

Co-authored-by: Chris Kipp <ckipp@pm.me>
2025-02-06 23:23:58 +01:00
Siddhant Agarwal
6db830e40e feat(defaults): enable diffopt "linematch" #32346 2025-02-06 04:17:36 -08:00
zeertzjq
878b3b89c3 vim-patch:9.1.1077: included syntax items do not understand contains=TOP (#32343)
Problem:  Syntax engine interpreted contains=TOP as matching nothing
          inside included files, since :syn-include forces HL_CONTAINED
          on for every included item. After 8.2.2761, interprets
          contains=TOP as contains=@INCLUDED, which is also not correct
          since it doesn't respect exclusions, and doesn't work if there
          is no @INCLUDED cluster.
Solution: revert patch 8.2.2761, instead track groups that have had
          HL_CONTAINED forced, and interpret contains=TOP and
          contains=CONTAINED using this. (Theodore Dubois)

fixes: vim/vim#11277
closes: vim/vim#16571

f50d5364d7

Co-authored-by: Theodore Dubois <tblodt@icloud.com>
2025-02-06 08:04:42 +08:00
Justin M. Keyes
44740e561f fix(log): RPC log format #32337
Problem:
RPC log messages show `log_notify` function name, which is not useful:

    DBG 2025-02-04T22:28:02.419 ui.37862   log_notify:57: RPC -> 3: [notify]    nvim_ui_set_focus
    DBG 2025-02-04T22:28:02.419 nvim.37863.0 log_notify:57: RPC <- 1: [notify]    nvim_ui_set_focus

Solution:
Call logmsg() directly.

    DBG 2025-02-04T22:42:00.104 ui.40680   RPC: -> 3: [notify]    nvim_ui_attach
    DBG 2025-02-04T22:42:00.104 ui.40680   RPC: -> 3: [notify]    nvim_set_client_info
2025-02-05 13:23:33 -08:00
Maria José Solano
38a52caec0 feat(diagnostic): add current_line option for virtual_text handler 2025-02-05 15:27:09 +01:00
Riley Bruins
09f9f0a946 feat(treesitter): show which nodes are missing in InspectTree
Now `:InspectTree` will show missing nodes as e.g. `(MISSING identifier)`
or `(MISSING ";")` rather than just `(identifier)` or `";"`. This is
doable because the `MISSING` keyword is now valid query syntax.

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2025-02-05 09:29:31 +01:00
Christian Clason
d769c340b9 build(deps): bump luv to v1.50.0-1 2025-02-05 09:29:14 +01:00
zeertzjq
aa976f0d93 fix(messages): add a trailing space to inputlist() etc. prompts (#32328)
Before #31525 the prompts had a trailing space.
Also add a test for #7857.
2025-02-05 11:36:01 +08:00
zeertzjq
1deb580977 vim-patch:9.1.1076: vim_strnchr() is strange and unnecessary (#32327)
Problem:  vim_strnchr() is strange and unnecessary (after v9.1.1009)
Solution: Remove vim_strnchr() and use memchr() instead.  Also remove a
          comment referencing an #if that is no longer present.

vim_strnchr() is strange in several ways:
- It's named like vim_strchr(), but unlike vim_strchr() it doesn't
  support finding a multibyte char.
- Its logic is similar to vim_strbyte(), but unlike vim_strbyte() it
  uses char instead of char_u.
- It takes a pointer as its size argument, which isn't convenient for
  all its callers.
- It allows embedded NULs, unlike other "strn*" functions which stop
  when encountering a NUL byte.

In comparison, memchr() also allows embedded NULs, and it converts bytes
in the string to (unsigned char).

closes: vim/vim#16579

34e1e8de91
2025-02-05 07:06:33 +08:00
zeertzjq
4317d36669 fix(event-loop): process input before events in getchar() (#32322)
Follow-up to #27358.
2025-02-05 06:48:56 +08:00
dundargoc
e4a58a7ca0 ci(vim-patches): fix failing workflow 2025-02-04 10:48:10 +01:00
Riley Bruins
1103d9fc10 build(deps): bump tree-sitter-query to v0.5.0 (#32299)
and sync queries from nvim-treesitter (adds support for `MISSING` nodes).
2025-02-04 09:56:11 +01:00
zeertzjq
8ce2833411 test(terminal/cursor_spec): remove unnecessary busy handlers (#32321)
They are no longer necessary after #31562, as busy_start and busy_stop
are no longer emitted by terminal buffers with visible cursor.
2025-02-04 10:07:35 +08:00
zeertzjq
3d22293496 test(getchar_spec): fix flakiness (#32320)
Problem:  getchar_spec may fail when screen:expect_unchanged() doesn't
          wait long enough.
Solution: Add poke_eventloop() before screen:expect_unchanged().
2025-02-04 01:31:37 +00:00
zeertzjq
40edfb0af0 Merge pull request #32315 from zeertzjq/vim-9.1.1009
vim-patch:9.1.{1009,1022,1023,1027,1072}
2025-02-04 09:13:51 +08:00
zeertzjq
3a1fe4732d vim-patch:9.1.1072: 'diffopt' "linematch" cannot be used with {n} less than 10
Problem:  'diffopt' "linematch" cannot be used with {n} less than 10
          digits (after v9.1.1022)
Solution: Fix off-by-one error when checking for digit (zeertzjq)

closes: vim/vim#16577

ccd7f454fc
2025-02-04 08:42:53 +08:00
zeertzjq
bd145a6c83 vim-patch:9.1.1027: no sanitize check when running linematch
Problem:  no sanitize check when running linematch
Solution: add sanitize check before applying the linematch algorithm,
          similar to diff_find_change() (Jonathon)

closes: vim/vim#16446

ca307efe48

Co-authored-by: Jonathon <jonathonwhite@protonmail.com>
2025-02-04 08:42:53 +08:00
zeertzjq
4d0c6cae72 vim-patch:9.1.1023: Coverity complains about dereferencing NULL pointer
Problem:  Coverity complains about dereferencing NULL pointer
Solution: Verify curdiff is not null before dereferencing it

closes: vim/vim#16437

a9f77be922

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-02-04 08:42:53 +08:00
zeertzjq
1c3bda7e92 vim-patch:9.1.1022: linematch option value not completed
Problem:  linematch option value not completed
          (after v9.1.1009)
Solution: Update diffoption completion values

related: vim/vim#9661
closes: vim/vim#16437

9162e636b3

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-02-04 08:42:53 +08:00
zeertzjq
290bb4c64b vim-patch:9.1.1009: diff feature can be improved
Problem:  diff feature can be improved
Solution: include the linematch diff alignment algorithm
          (Jonathon)

closes: vim/vim#9661

7c7a4e6d1a

Co-authored-by: Jonathon <jonathonwhite@protonmail.com>
2025-02-04 08:42:53 +08:00
zeertzjq
5a7cf85c2c vim-patch:9.1.1074: Strange error when heredoc marker starts with "trim" (#32317)
Problem:  Strange error when heredoc marker starts with "trim".
Solution: Check for whitespace after "trim" or "eval" (zeertzjq)

For :python3 etc., a heredoc marker that starts with a lower-case letter
is valid, and when it starts with "trim" it works in a script but not in
a function, and this PR makes it works in a function.
For :let, a heredoc marker that starts with a lower-case letter is not
valid, but when it starts with "trim" or "eval" the error can be a bit
confusing in a function, and this PR make it less confusing.

closes: vim/vim#16574

449c2e5454
2025-02-04 07:44:41 +08:00
zeertzjq
f618cdf9c4 Merge pull request #31604 from zeertzjq/vim-9.1.0935
vim-patch:9.1.{0935,0967,1073}
2025-02-04 07:44:15 +08:00
zeertzjq
ca8694a69d vim-patch:9.1.1073: tests: test_compiler fails on Windows without Maven
Problem:  tests: test_compiler fails on Windows without Maven.
Solution: Add Xspotbugs directory to $PATH when mvn is not available
          (zeertzjq).

closes: vim/vim#16576

23da16d3d0
2025-02-04 06:45:31 +08:00
zeertzjq
89c2945148 vim-patch:9.1.0967: SpotBugs compiler setup can be further improved
Problem:  SpotBugs compiler can be further improved
Solution: Introduce event-driven primitives for SpotBugs
          (Aliaksei Budavei)

closes: vim/vim#16258

2e252474c4

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2025-02-04 06:45:25 +08:00
zeertzjq
d7426bc9e9 vim-patch:9.1.0935: SpotBugs compiler can be improved
Problem:  SpotBugs compiler can be improved
Solution: runtime(compiler): Improve defaults and error handling for
          SpotBugs; update test_compiler.vim (Aliaksei Budavei)

runtime(compiler): Improve defaults and error handling for SpotBugs

* Keep "spotbugs#DefaultPreCompilerTestAction()" defined but
  do not assign its Funcref to the "PreCompilerTestAction"
  key of "g:spotbugs_properties": there are no default and
  there can only be introduced arbitrary "*sourceDirPath"
  entries; therefore, this assignment is confusing at best,
  given that the function's implementation delegates to
  whatever "PreCompilerAction" is.

* Allow for the possibility of relative source pathnames
  passed as arguments to Vim for the Javac default actions,
  and the necessity to have them properly reconciled when
  the current working directory is changed.

* Do not expect users to remember or know that new source
  files ‘must be’ ":argadd"'d to be then known to the Javac
  default actions; so collect the names of Java-file buffers
  and Java-file Vim arguments; and let users providing the
  "@sources" file-lists in the "g:javac_makeprg_params"
  variable update these file-lists themselves.

* Strive to not leave behind a fire-once Syntax ":autocmd"
  for a Java buffer whenever an arbitrary pre-compile action
  errors out.

* Only attempt to run a post-compiler action in the absence
  of failures for a pre-compiler action.  Note that warnings
  and failures are treated alike (?!) by the Javac compiler,
  so when previews are tried out with "--enable-preview",
  remember about passing "-Xlint:-preview" too to also let
  SpotBugs have a go.

* Properly group conditional operators when testing for key
  entries in a user-defined variable.

* Also test whether "javaExternal" is defined when choosing
  an implementation for source-file parsing.

* Two commands are provided to toggle actions for buffer-local
  autocommands:
  - SpotBugsRemoveBufferAutocmd;
  - SpotBugsDefineBufferAutocmd.

For example, try this from "~/.vim/after/ftplugin/java.vim":
------------------------------------------------------------
if exists(':SpotBugsDefineBufferAutocmd') == 2
	SpotBugsDefineBufferAutocmd BufWritePost SigUSR1
endif
------------------------------------------------------------

And ":doautocmd java_spotbugs User" can be manually used at will.

closes: vim/vim#16140

368ef5a48c

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2025-02-04 06:45:25 +08:00
Justin M. Keyes
eacd662ccb Merge #32082 refactor(treesitter): use coroutines for resuming _parse() 2025-02-03 09:11:04 -08:00
uio23
720ec5cec2 fix(tui): cursor color in suckless terminal #32310
Problem:
's 'guicursor' cursor color not working in suckless terminal (ST).
Nvim's builtin terminfo for ST lacks a "Cs" entry, even though ST does
support the cursor color to be set via termcodes.

Solution:
- In `augment_terminfo()`, assume that `st` always supports color cursor.
- Thomas Dickey will add a "Cs" entry for st to ncurses, from which
  Nvim's builtin terminfos are generated.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-02-03 01:09:47 -08:00
Maria José Solano
445ecca398 feat(diagnostic): format() can filter diagnostics by returning nil #32302 2025-02-03 00:54:31 -08:00
zeertzjq
3a28930157 vim-patch:9.0.1391: "clear" macros are not always used (#32312)
Problem:    "clear" macros are not always used.
Solution:   Use ALLOC_ONE, VIM_CLEAR, CLEAR_POINTER and CLEAR_FIELD in more
            places. (Yegappan Lakshmanan, closes vim/vim#12104)

960dcbd098

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2025-02-03 05:20:48 +00:00
zeertzjq
0c8890e7a7 vim-patch:8.2.4948: cannot use Perl heredoc in nested :def function (#32311)
Problem:    Cannot use Perl heredoc in nested :def function. (Virginia
            Senioria)
Solution:   Only concatenate heredoc lines when not in a nested function.
            (closes vim/vim#10415)

d881d15984

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-02-03 12:49:33 +08:00
zeertzjq
efa3677f28 Merge pull request #32293 from zeertzjq/vim-9.1.1063
vim-patch:8.2.{0825,1445,2505},9.0.1142,9.1.{1063,1066,1071}
2025-02-03 12:07:22 +08:00
zeertzjq
db7db783a2 vim-patch:9.1.1071: args missing after failing to redefine a function
Problem:  Arguments of a function are missing after failing to redefine
          it (after 8.2.2505), and heap-use-after-free with script-local
          function (after 9.1.1063).
Solution: Don't clear arguments or free uf_name_exp when failing to
          redefine an existing function (zeertzjq)

closes: vim/vim#16567

04d2a3fdc0
2025-02-03 11:27:56 +08:00
zeertzjq
82ac8294c2 vim-patch:9.1.1066: heap-use-after-free and stack-use-after-scope with :14verbose
Problem:  heap-use-after-free and stack-use-after-scope with :14verbose
          when using :return and :try (after 9.1.1063).
Solution: Move back the vim_free(tofree) and the scope of numbuf[].
          (zeertzjq)

closes: vim/vim#16563

2101230f40
2025-02-03 11:27:56 +08:00
zeertzjq
b853ef770a vim-patch:9.1.1063: too many strlen() calls in userfunc.c
Problem:  too many strlen() calls in userfunc.c
Solution: refactor userfunc.c and remove calls to strlen(),
          drop set_ufunc_name() and roll it into alloc_ufunc(),
          check for out-of-memory condition in trans_function_name_ext()
          (John Marriott)

closes: vim/vim#16537

b32800f7c5

Add missing change to call_user_func() from patch 8.1.1007.
Consistently use PRIdSCID instead of PRId64 for script IDs.

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-02-03 11:27:56 +08:00
zeertzjq
82b029cbb0 vim-patch:9.0.1142: crash and/or memory leak when redefining function
Problem:    Crash and/or memory leak when redefining function after error.
Solution:   Clear pointer after making a copy.  Clear arrays on failure.
            (closes vim/vim#11774)

f057171d8b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-02-03 11:14:17 +08:00
zeertzjq
638c6b406b vim-patch:8.2.2505: Vim9: crash after defining function with invalid return type
Problem:    Vim9: crash after defining function with invalid return type.
Solution:   Clear function growarrays.  Fix memory leak.

31842cd077

Cherry-pick free_fp from patch 8.2.3812.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-02-03 11:14:17 +08:00
zeertzjq
cd42740245 vim-patch:8.2.1445: Vim9: function expanded name is cleared when sourcing again
Problem:    Vim9: function expanded name is cleared when sourcing a script
            again.
Solution:   Only clear the expanded name when deleting the function.
            (closes vim/vim#6707)

c4ce36d486

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-02-03 11:14:17 +08:00
zeertzjq
0309d3fbf0 vim-patch:8.2.0825: def_function() may return pointer that was freed
Problem:    def_function() may return pointer that was freed.
Solution:   Set "fp" to NULL after freeing it.

a14e697547

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-02-03 11:14:13 +08:00
zeertzjq
af069c5c05 vim-patch:9.1.1070: Cannot control cursor positioning of getchar() (#32303)
Problem:  Cannot control cursor positioning of getchar().
Solution: Add "cursor" flag to {opts}, with possible values "hide",
          "keep" and "msg".

related: vim/vim#10603
closes: vim/vim#16569

edf0f7db28
2025-02-03 00:09:03 +00:00
luukvbaal
87e806186c fix(statusline): overwriting stl_items with nvim_eval_statusline() {-item #32265
Problem:
When an evaluation {-item calls `nvim_eval_statusline()`, that nested
call may overwrite the same memory used for `stl_items`.

Solution:
Make `curitem` static and use it to compute an offset to avoid
overwriting `stl_items` in nested calls to `build_stl_str_hl()`. Move
miscellaneous statusline tests into `describe()` block.
2025-02-02 15:09:43 -08:00
Riley Bruins
8543aa406c feat(treesitter): allow LanguageTree:is_valid() to accept a range
When given, only that range will be checked for validity rather than the
entire tree. This is used in the highlighter to save CPU cycles since we
only need to parse a certain region at a time anyway.
2025-02-02 12:13:25 -08:00
Riley Bruins
9508d6a814 refactor(treesitter): use coroutines for resuming _parse() logic
This means that all work previously done by a `_parse()` iteration will
be kept in future iterations. This prevents it from running indefinitely
in some cases where the file is very large and there are 2+ injections.
2025-02-02 11:51:24 -08:00
Riley Bruins
77be44563a refactor(treesitter): always return valid range from parse() #32273
Problem:
When running an initial parse, parse() returns an empty table rather
than an actual range. In `languagetree.lua`, we manually check if
a parse was incremental to determine the changed parse region.

Solution:
- Always return a range (in the C side) from parse().
- Simplify the language tree code a bit.
- Logger no longer shows empty ranges on the initial parse.
2025-02-02 03:46:26 -08:00
Riley Bruins
02ea0e77a1 refactor(treesitter): drop LanguageTree._has_regions #32274
This simplifies some logic in `languagetree.lua`, removing the need for
`_has_regions`, and removing side effects in `:included_regions()`.

Before:
- Edit is made which sets `_regions = nil`
- Upon the next call to `included_regions()` (usually right after we
  marked `_regions` as `nil` due to an `_iter_regions()` call), if
  `_regions` is nil, we repopulate the table (as long as the tree
  actually has regions)

After:
- Edit is made which resets `_regions` if it exists
- `included_regions()` no longer needs to perform this logic itself, and
  also no longer needs to read a `_has_regions` variable
2025-02-02 03:42:47 -08:00
Maria José Solano
48e3ac60c6 perf(diagnostics): cache line diagnostics when current_line is set #32288
Compute the diagnostics per line when `show` is called, allowing for
O(1) access for the diagnostics to display when the cursor line or the
list of diagnostics haven't changed.
2025-02-02 03:40:43 -08:00
Johannes Larsen
e08e3d15f6 fix(man.lua): skip Attrs.None highlights #32262
Before the 7121983c45 refactoring this
loop added highlights from a `buf_hls` list that had filtered out
elements with `Attrs.None`. After the refactoring this added highlights
from `hls` directly, and those elements would fail with e.g.:

    $ nvim 'man://math.h(0)'
    Error detected while processing command line:
    Error executing Lua callback: /usr/share/nvim/runtime/lua/man.lua:205: Invalid 'hl_group': Expected Lua string
    stack traceback:
            [C]: in function 'nvim_buf_add_highlight'
            /usr/share/nvim/runtime/lua/man.lua:205: in function 'highlight_man_page'
            /usr/share/nvim/runtime/lua/man.lua:632: in function 'init_pager'
            /usr/share/nvim/runtime/plugin/man.lua:9: in function </usr/share/nvim/runtime/plugin/man.lua:6>
2025-02-02 03:00:05 -08:00
glepnir
3e882bf81c vim-patch:9.1.1069: preinsert text completions not deleted with <C-W>/<C-U> (#32296)
Problem:  preinsert text completions not deleted with <C-W>/<C-U>
          (ddad431, after v9.1.1059)
Solution: handle <C-W> or <C-U> specifically and clear the completion
          (glepnir)

fixes: vim/vim#16557
closes: vim/vim#16565

001c26cd61
2025-02-02 10:02:25 +00:00
Tristan Knight
5bc948c050 fix(diagnostic): improve current_line refresh logic #32275
Problem:
The current implementation uses a global augroup for virtual lines in
diagnostics, which can lead to conflicts and unintended behavior when
multiple namespaces/buffers are involved.

Solution:
Refactor the code to use a namespace-specific augroup for virtual lines.
This ensures that each namespace has its own augroup.
Scope the clear commands to only the relevant buffer.
2025-02-02 01:56:01 -08:00
Christian Clason
a22f2102ce build(deps): bump tree-sitter to v0.25.1 2025-02-02 10:55:12 +01:00
zeertzjq
4bdabf9b1a vim-patch:9.1.1068: getchar() can't distinguish between C-I and Tab (#32295)
Problem:  getchar() can't distinguish between C-I and Tab.
Solution: Add {opts} to pass extra flags to getchar() and getcharstr(),
          with "number" and "simplify" keys.

related: vim/vim#10603
closes: vim/vim#16554

e0a2ab397f

Cherry-pick tv_dict_has_key() from patch 8.2.4683.
2025-02-02 09:32:51 +00:00
zeertzjq
718e9ce018 vim-patch:a5d19aa: runtime(hyprlang): fix string recognition (#32290)
fixes: vim/vim#16064
closes: vim/vim#16527

a5d19aa44d

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2025-02-02 17:13:42 +08:00
Justin M. Keyes
0ce0e93bd9 refactor(autocmds): remove indirection #32291
Problem:
`AucmdExecutable` adds 2 layers of indirection. Although formalizing
a `union` is good practice for shared interfaces, this struct is mainly
for `autocmd_register` which is internal to this module.

Solution:
- Store the cmd/fn fields directly on the `AutoCmd` struct.
- Drop `AucmdExecutable` and related structures.
2025-02-01 23:43:31 -08:00
zeertzjq
a857b251d1 vim-patch: port some userfunc.c refactorings from Vim (#32292)
Port one_function_arg() and get_function_body() from Vim.

vim-patch:8.2.2865: skipping over function body fails

Problem:    Skipping over function body fails.
Solution:   Do not define the function when skipping.

d87c21a918

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-02-02 14:24:38 +08:00
Felipe Vicentin
289c9d21cb fix(autocmds): once=true Lua event-handler may call itself #29544
Problem:
Event handler declared with `once=true` can re-trigger itself (i.e. more
than once!) by calling `nvim_exec_autocmds` or `:doautocmd`.

Analysis:
This happens because the callback is executed before deletion/cleanup
(`aucmd_del`). And calling `aucmd_del` before `call_autocmd_callback`
breaks the autocmd execution...

Solution:
Set `ac->pat=NULL` to temporarily "delete" the autocmd, then restore it
after executing the callback.

Fix #25526

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-02-01 16:25:38 -08:00
zeertzjq
0985e784d8 vim-patch:9.1.1065: no digraph for "Approaches the limit" (#32289)
Problem:  no digraph for "Approaches the limit"
Solution: Add the digraph using .= (Hans Ginzel)

Add digraph Approaches the Limit

≐ U+2250 https://www.fileformat.info/info/unicode/char/2250/index.htm

closes: vim/vim#16508

3a621188ee

Co-authored-by: Hans Ginzel <hans@matfyz.cz>
2025-02-02 07:00:45 +08:00
Riley Bruins
096ae3bfd7 fix(treesitter): nil access when running string parser async 2025-02-01 17:02:52 +01:00
Christian Clason
f3381a8b64 build(deps): bump tree-sitter to v0.25.0 2025-02-01 10:15:32 +01:00
zeertzjq
9cc060218b vim-patch:9.1.1059: completion: input text deleted with preinsert when adding leader (#32276)
Problem:  completion: input text deleted with preinsert when adding leader
Solution: remove compl_length and check the ptr for being equal
          to pattern when preinsert is active (glepnir)

closes: vim/vim#16545

bfb4eea786

Co-authored-by: glepnir <glephunter@gmail.com>
2025-02-01 07:49:05 +08:00
dundargoc
e71d2c817d docs: misc
Co-authored-by: Dustin S. <dstackmasta27@gmail.com>
Co-authored-by: Ferenc Fejes <fejes@inf.elte.hu>
Co-authored-by: Maria José Solano <majosolano99@gmail.com>
Co-authored-by: Yochem van Rosmalen <git@yochem.nl>
Co-authored-by: brianhuster <phambinhanctb2004@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-01-30 13:46:06 +01:00
Evgeni Chasnovski
86ae59c612 fix(colorscheme): distinguish CursorLine/Folded/StatusLineNC highlights #32256
Problem: currently `CursorLine`, `Folded`, `StatusLineNC` highlight
  groups have the same background color in default color scheme (Grey3).
  This is a result of optimizing their highlighting to be different from
  `Normal` but not draw too much attention.

  However, this design has a usability issue as those groups are
  sometimes appear together which can make it hard (but not impossible)
  to differentiate between them.

  This was previously partially resolved with `StatusLineNC` using Grey1
  as background (and thus be different from `CursorLine` but closer to
  `Normal`), but optimizing more towards it being a visible separator
  between windows was decided to be more important.

Solution: make `Folded` use Grey1 and `StatusLineNC` use Grey4. This
  makes all three highlight groups have different backgrounds with the
  following consequences:
    - Folds now have the same background as floating windows. It makes
      them there differentiable only by the value of 'foldtext' (which
      is usually enough). Optimizing for the case "cursor line is next
      to the fold" seems to be more useful than for the case "make folds
      in floating window differ by background".
    - Statusline of inactive windows now draw more attention to them.
      The benefits are that they are different from cursor column and
      are better window separators.
    - Inactive tabline (both `TabLine` and `TabLineFill`) now also draws
      a bit more attention to it (as they are linked to `StatusLineNC`)
      but with the benefit of also being different from `CursorLine`.
2025-01-30 04:21:40 -08:00
zeertzjq
b3b255396d vim-patch:9.1.1057: Superfluous cleanup steps in test_ins_complete.vim (#32257)
Problem:  Superfluous cleanup steps in test_ins_complete.vim.
Solution: Remove unnecessary :bw! and :autocmd! commands.
          Also remove unnecessary STRLEN() in insexpand.c
          (zeertzjq)

closes: vim/vim#16542

8297e2cee3
2025-01-30 18:59:01 +08:00
zeertzjq
efa664c7ed vim-patch:9.1.1056: Vim doesn't highlight to be inserted text when completing (#32251)
Problem:  Vim doesn't highlight to be inserted text when completing
Solution: Add support for the "preinsert" 'completeopt' value
          (glepnir)

Support automatically inserting the currently selected candidate word
that does not belong to the latter part of the leader.

fixes: vim/vim#3433
closes: vim/vim#16403

edd4ac3e89

Co-authored-by: glepnir <glephunter@gmail.com>
2025-01-30 14:39:13 +08:00
dundargoc
35c5e23107 ci!: store artifact shasums in a single shasum.txt file
Users can parse this file to get the shasum they require.
2025-01-29 21:03:23 +01:00
James McCoy
a9f039c5be Merge pull request #32243 from jamessan/snprintf-unit-tests
Fix "vim_snprintf() positional arguments" failures on 32-bit systems
2025-01-29 12:56:15 -07:00
James McCoy
1426f3f3ce test(unit/strings_spec): use correct type for binary values
When 9.0.1856 was ported, the numbers being formatted as binary were cast
to "unsigned int" rather than uvarnumber_T, as is done upstream.
2025-01-29 06:30:59 -05:00
luukvbaal
216ec73972 fix(ui): avoid redundant ext_cmdline events (#32237)
Problem:  `cmdline_show` is emitted unnecessarily each event
          loop iteration, because `cmdline_was_last_drawn` is never set.
Solution: Keep track of whether the cmdline was last drawn to avoid
          unnecessarily emitting cmdline_show. Set `redraw_state` to
          emit `cmdline_pos` when emitting `CursorMovedC`. Only emit
          `cmdline_pos` when cmdline was last drawn.
2025-01-29 12:07:27 +01:00
notomo
e7ebc5c13d fix(treesitter): stop async parsing if buffer is invalid
Problem: Error occurs if delete buffer in the middle of parsing.
Solution: Check if buffer is valid in parsing.
2025-01-29 09:15:13 +01:00
Daniel Petrovic
19f00bf32c fix(treesitter) Set modeline=false in TSHighlighter:destroy (#32234)
Problem:  `TSHighlighter:destroy()` causes double-processing of the modeline
and failure of `b:undo_ftplugin`.

Solution: Disable modeline in `TSHighlighter:destroy()` by setting `modeline=false`
if executing `syntaxset` autocommands for the `FileType` event.

Co-authored-by: Daniel Petrovic <daniel.petrovic@ebcont.com>
2025-01-29 09:02:49 +01:00
Maria José Solano
da0ae95349 feat(treesitter): support modelines in query.set() (#30257) 2025-01-29 08:59:28 +01:00
James McCoy
a7be4b7bf8 test(unit/strings_spec): provide context for vim_snprintf tests
Since these assertions all use a common function to perform the test
assertions, it's difficult to figure out which test failed:

    ERROR    test/unit/testutil.lua @ 785: vim_snprintf() positional arguments
    test/unit/testutil.lua:757: test/unit/testutil.lua:741: (string) '
    test/unit/strings_spec.lua:143: Expected objects to be the same.
    Passed in:
    (number) 6400
    Expected:
    (number) 6'
    exit code: 256

Adding context to the assertion makes it clearer what the problem is:

    ERROR    test/unit/testutil.lua @ 785: vim_snprintf() positional arguments
    test/unit/testutil.lua:757: test/unit/testutil.lua:741: (string) '
    test/unit/strings_spec.lua:149: snprintf(buf, 0, "%1$0.*2$b", cdata<unsigned int>: 0xf78d0f38, cdata<int>: 0xf78dc4e0) = 001100
    Expected objects to be the same.
    Passed in:
    (number) 6400
    Expected:
    (number) 6'
    exit code: 256
2025-01-28 20:32:40 -05:00
Riley Bruins
6711fa27ca fix(treesitter): recalculate folds on VimEnter #32240
**Problem:** In the case where the user sets the treesitter foldexpr upon startup in
their `init.lua`, the fold info will be calculated before the parser has
been loaded in, meaning folds will be properly calculated until edits or
`:e`.

**Solution:** Refresh fold information upon `VimEnter` as a sanity check
to ensure that a parser really doesn't exist before always returning
`'0'` in the foldexpr.
2025-01-28 12:22:25 -08:00
Riley Bruins
b88874d33c fix(treesitter): empty queries can disable injections (#31748)
**Problem:** Currently, if users want to efficiently disable injections,
they have to delete the injection query files at their runtime path.
This is because we only check for existence of the files before running
the query over the entire buffer.

**Solution:** Check for existence of query files, *and* that those files
actually have captures. This will allow users to just comment out
existing queries (or better yet, just add their own injection query to
`~/.config/nvim` which contains only comments) to disable running the
query over the entire buffer (a potentially slow operation)
2025-01-28 18:59:04 +01:00
luukvbaal
a119dab40f fix(treesitter): avoid computing foldlevels for reloaded buffer #32233 2025-01-28 08:34:07 -08:00
Judit Novak
cb924764a4 fix(runtime): "E121 Undefined variable s:termguicolors" #32209
Problem: dircolors syntaxt termguicolors support was not taking dynamic
         termguicolors changes into account.

Solution: initializing missing script-internal data on dynamic
          termguicolors change.
2025-01-28 08:17:37 -08:00
dundargoc
318676ad13 ci(release)!: remove backwards compatible releases
Remove `nvim-linux64.tar.gz` and `nvim.appimage` as maintaining
these is too much work.

Also fix directory names to be consistent.
2025-01-28 10:21:27 +01:00
Riley Bruins
c47496791a docs(treesitter): fix TSNode:range() type signature #32224
Uses an overload to properly show the different return type based on the
input parameter.
2025-01-27 14:25:06 -08:00
Lewis Russell
6aa42e8f92 fix: resolve all remaining LuaLS diagnostics 2025-01-27 16:37:50 +00:00
Andreas Schneider
83479b95ab fix(mpack): remove invalid bool definition
This causes build failures with gcc 15.

Fixes #31723
2025-01-27 16:57:23 +01:00
glepnir
be01b361d8 fix(float): cannot set title/footer independently #31993
Problem:
`nvim_win_set_config` cannot set the title and footer independently.
When only one is given, the other is reset to the default of "left".

Solution:
Reuse existing title/footer value if not provided.
2025-01-27 07:52:27 -08:00
Christian Clason
c1718d6863 ci(release): add linux-arm64 appimage and tarball
Problem: No releases for ARM Linux.

Solution: Provide appimages and tarballs for `linux-arm64`. Rename
x86 releases to `linux-x86_64` for consistency.
2025-01-27 16:21:40 +01:00
Christian Clason
eb60cd74fb build(deps)!: bump tree-sitter to HEAD, wasmtime to v29.0.1 (#32200)
Breaking change: `ts_node_child_containing_descendant()` was removed

Breaking change: tree-sitter 0.25 (HEAD) required
2025-01-27 16:16:06 +01:00
dundargoc
b288fa8d62 build(bump_deps): abort if archive doesn't exist
Also use git tag archive over commit sha if possible.
2025-01-27 10:28:12 +01:00
Christian Clason
21aed725d2 vim-patch:db23436: runtime(asm): add byte directives to syntax script
closes: vim/vim#16523

db23436b92

Co-authored-by: Nir Lichtman <nir@lichtman.org>
2025-01-27 08:28:18 +01:00
glepnir
c7d4a77ff9 refactor(api): add missing cast #31960 2025-01-26 16:02:33 -08:00
Maria José Solano
1759b7844a feat(diagnostic): virtual_lines #31959 2025-01-26 15:33:03 -08:00
glepnir
d84a95da7e feat(api): nvim_get_autocmds filter by id#31549
Problem:
nvim_get_autocmds cannot filter by id.

Solution:
Support it.
2025-01-26 15:28:33 -08:00
Christian Clason
b8e947ed4e vim-patch:fb49e3c: runtime(filetype): commit 99181205c5f8284a3 breaks V lang detection
so make the regex more strict and have it check for a parenthesis.

See:
https://github.com/vlang/v/blob/master/examples/submodule/mymodules/submodule/sub_functions.v

related: vim/vim#16513

fb49e3cde7

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-01-25 23:56:18 +01:00
Christian Clason
974a3f7a43 vim-patch:9918120: runtime(filetype): Improve Verilog detection by checking for modules definition
While at it, also increase the maximum number of lines to check to 500.

fixes: vim/vim#16513

99181205c5

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-01-25 23:56:18 +01:00
Christian Clason
e3e1c1e765 vim-patch:509a8d5: runtime(just): fix typo in syntax file
closes: vim/vim#16515

509a8d58f9

Co-authored-by: Peter Benjamin <petermbenjamin@gmail.com>
2025-01-25 16:35:16 +01:00
zeertzjq
d4a65dad23 vim-patch:9.1.1052: tests: off-by-one error in CheckCWD in test_debugger.vim (#32202)
Problem:  tests: off-by-one error in CheckCWD in test_debugger.vim
Solution: Fix off-by-one in CheckCWD leading to local tests failure
          (Yee Cheng Chin)

Vim's test_debugger's Test_debug_backtrace_level test will fail if you
happen to run it in a Vim repository with full path of directory being
exactly 29 characters (e.g. `/Users/bob/developing/src/vim`). The test
does term dump comparison and the printout will overflow if the CWD is
too long. It does have a function to skip to test if it detects that but
it's off by one leading to this one situation where it will fail.

The reason why the logic didn't account for this is that Vim's message
printing will overflow the text if it prints a message at exactly the
width of the terminal. This could be considered a bug / quirk but that
will be another issue.

closes: vim/vim#16517

3acfbb4b54

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-01-25 23:03:43 +08:00
zeertzjq
fb1740521a Merge pull request #32204 from zeertzjq/vim-9.1.1049
vim-patch:9.1.{1049,1053}: 'completeopt' "nosort"
2025-01-25 22:57:59 +08:00
zeertzjq
689c23b2ac vim-patch:9.1.1053: "nosort" enables fuzzy filtering even if "fuzzy" isn't in 'completeopt'
Problem:  "nosort" enables fuzzy filtering even if "fuzzy" isn't in
          'completeopt' (after v9.1.1049)
Solution: Only enable fuzzy filtering when "fuzzy" is in 'completeopt'.
          (zeertzjq)

closes: vim/vim#16510

d65aa1bbdb
2025-01-25 22:39:40 +08:00
zeertzjq
63aa167f94 vim-patch:9.1.1049: insert-completed items are always sorted
Problem:  insert-completed items are always sorted, although the LSP
          spec[1] standard defines sortText in the returned
          completionitem list. This means that the server has sorted the
          results. When fuzzy is enabled, this will break the server's
          sorting results.
Solution: disable sorting of candidates when "nosort" is set in
          'completeopt'

[1]
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionItem

closes: vim/vim#16501

f400a0cc41

Co-authored-by: glepnir <glephunter@gmail.com>
2025-01-25 22:39:37 +08:00
phanium
851137f679 fix(log): log unset $TMPDIR at "debug" level #32137 2025-01-24 20:05:47 -08:00
georgev93
931ee5591f feat(extmarks): virtual text can be right-aligned, truncated #31921
Problem: Right aligned virtual text can cover up buffer text if virtual
text is too long

Solution: An additional option for `virt_text_pos` called
`eol_right_align` has been added to truncate virtual text if it would
have otherwise covered up buffer text. This ensures the virtual text
extends no further left than EOL.
2025-01-24 19:57:45 -08:00
Luuk van Baal
c6d2cbf8f5 fix(lua): pop retval for fast context LuaRef
Problem:  nlua_call_ref_ctx() does not pop the return value in fast
          context that did not error.
Solution: Fall through to end; calling nlua_call_pop_retval().
2025-01-24 11:57:51 +01:00
Luuk van Baal
d98827b634 fix(messages): avoid empty msg_showmode with 'noshowmode' 2025-01-24 11:39:39 +01:00
Christian Clason
0fd4ef5da7 ci(tests): remove build-types jobs
Problem: Some CI jobs are redundant: `RelWithDebInfo` is already tested
on Linux-Arm64; `MinSizeRel` and Ninja Multi Config are not sufficiently
relevant in practice to spend CI cycles on.

Solution: Remove `build-types` job.
2025-01-24 10:34:18 +01:00
Christian Clason
3702bcb139 ci(tests): add arm64 runner
Problem: Linux `aarch64`/`arm64` builds are not tested.

Solution: Add `ubuntu-arm` runners to test matrix (using
`RelWithDebInfo` build).
2025-01-24 10:34:18 +01:00
zeertzjq
2470db02c5 vim-patch:partial:9.1.1050: too many strlen() calls in os_unix.c (#32188)
Problem:  too many strlen() calls in os_unix.c
Solution: refactor os_unix.c and remove calls to strlen()
          (John Marriott)

closes: vim/vim#16496

efc41a5958

Omit os_expand_wildcards() change: Nvim's code is more complicated and
harder to refactor.

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-01-24 00:52:55 +00:00
luukvbaal
8bc28978b6 fix(column): apply custom highlight to last 'statuscolumn' segment (#32182) 2025-01-24 07:42:24 +08:00
Luuk van Baal
2cd72258f6 fix(mouse): 'statuscolumn' fold and popopmenu handling
Problem:  A right-click on the 'statuscolumn' does not open the
          popupmenu, even if a cell without a clickdef is clicked.
          Clicking the %C fold item does not open/close the fold.
Solution: Open the popupmenu when there is no clickdef like right-clicking
          the sign/numbercolumn does. Fill "linebuf_vcol" when drawing the
          'statuscolumn' to handle foldcolumn item clicks.
2025-01-23 17:26:10 +01:00
Evgeni Chasnovski
a450fda4ed fix(lsp): prefer on_list over loclist in default handler
Problem: setting `loclist = true` makes `on_list` being ignored. This
  was not a problem before, but with `vim.lsp.buf.document_symbol` using
  `loclist = true` as default it is needed to explicitly pass `loclist =
  false` in order to use custom `on_list`.

Solution: prefer `on_list` over `loclist` and document the latter as
  taking effect only in the default handler.
2025-01-23 17:04:23 +01:00
Luuk van Baal
34d808b73c feat(api): combined highlights in nvim_eval_statusline()
Problem:  Combined highlighting was not applied to nvim_eval_statusline(),
          and 'statuscolumn' sign segment/numhl highlights.
Solution: Add an additional `groups` element to the return value of
          `nvim_eval_statusline()->highlights`. This is an array of stacked
          highlight groups (highest priority last). Also resolve combined
          highlights for the 'statuscolumn' sign segment/numhl highlights.
          Expose/synchronize some drawline.c logic that is now mimicked in
          three different places.
2025-01-23 10:56:25 +01:00
Christian Clason
8634bd46b2 vim-patch:9.1.1042: filetype: just files are not recognized
Problem:  filetype: just files are not recognized
Solution: adjust filetype detection pattern, detect just shebang line,
          include just ftplugin, indent and syntax plugin
          (Peter Benjamin)

closes: vim/vim#16466

72755b3c8e

Co-authored-by: Peter Benjamin <petermbenjamin@gmail.com>
2025-01-23 09:42:20 +01:00
zeertzjq
28998e1f8a vim-patch:9.1.1045: filetype: N-Tripels and TriG files are not recognized (#32170)
Problem:  filetype: N-Tripels and TriG files are not recognized
Solution: detect '*.nt' files as ntriples filetype and '*.trig' files
          as trig filetype (Gordian Dziwis)

closes: vim/vim#16493

c04334c33f

Co-authored-by: Gordian Dziwis <gordian@dziw.is>
2025-01-23 16:33:41 +08:00
phanium
4c9f3689a1 fix(checkhealth): failed if 'lua' in plugin name 2025-01-23 07:46:40 +00:00
zeertzjq
a9c12d4c29 vim-patch:9.1.1048: crash after scrolling and pasting in silent Ex mode (#32168)
Problem:  Crash after scrolling and pasting in silent Ex mode.
          (fizz-is-on-the-way)
Solution: Don't move cursor to line 0 when scrolling.
          (zeertzjq)

closes: vim/vim#16506

df098fedbc
2025-01-23 08:12:10 +08:00
zeertzjq
fd55c7df6f test(lua/hl_spec): set timeout for transient state (#32169) 2025-01-23 08:11:53 +08:00
Siddhant Agarwal
af0ef2ac9d feat(lua): vim.hl.range() "timeout" #32012
Problem:
`vim.hl.on_yank()` has a "timeout" behavior but this is not available for
`vim.hl.range()`.

Solution:
Add `timeout` arg to `vim.hl.range()`.
2025-01-22 07:46:24 -08:00
luukvbaal
34344b939c fix(editor): avoid scrolling :substitute confirm message #32149
Regression from 48e2a73.
2025-01-22 07:36:57 -08:00
jdrouhard
22fd52325b fix(inspector): update semantic token namespace (#32157)
This updates the extmark namespace to search for when filtering out
semantic tokens to match the new namespace style recently introduced.
2025-01-22 21:02:30 +08:00
zeertzjq
d46ebd2a74 fix(startup): avoid crash with completion from -l script (#32160)
Related #27764
2025-01-22 17:10:29 +08:00
zeertzjq
a66f6add29 vim-patch:9.1.1046: fuzzymatching doesn't prefer matching camelcase (#32155)
Problem:  fuzzymatching doesn't prefer matching camelcase
          (Tomasz N)
Solution: Add extra score when case matches (glepnir)

fixes: vim/vim#16434
closes: vim/vim#16439

9dfc7e5e61

Co-authored-by: glepnir <glephunter@gmail.com>
2025-01-22 10:55:41 +08:00
zeertzjq
a8b6fa07c4 fix(search): avoid quadratic time complexity when computing fuzzy score (#32153) 2025-01-22 09:28:27 +08:00
zeertzjq
3a25995f30 Merge pull request #32144 from zeertzjq/termkey-x1-x2
feat(tui/terminal): support X1 and X2 mouse events
2025-01-21 22:50:39 +08:00
zeertzjq
06a1f82f1c feat(terminal): forward X1 and X2 mouse events
Ref:
https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Other-buttons
2025-01-21 22:21:05 +08:00
zeertzjq
44dbfcfba4 feat(tui): recognize X1 and X2 mouse events
Ref:
https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Other-buttons
2025-01-21 21:01:46 +08:00
bfredl
d7aba51d39 Merge pull request #32098 from bfredl/multihl_group
feat(extmark): stack multiple highlight groups in `hl_group`
2025-01-21 12:32:20 +01:00
bfredl
4cced601c8 feat(extmark): stack multiple highlight groups in hl_group
This has been possible in the "backend" for a while but
API was missing.

Followup: we will need a `details2=true` mode for `nvim_get_hl_id_by_name`
to return information in a way forward compatible with even further
enhancements.
2025-01-21 12:00:24 +01:00
zeertzjq
05435bf105 vim-patch:c273f1a: runtime(vim): Update base-syntax, match ternary and falsy operators (#32132)
fixes: vim/vim#14423
fixes: vim/vim#16227
closes: vim/vim#16484

c273f1ac77

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-01-21 00:10:14 +00:00
Christian Clason
855a2a75e6 vim-patch:4335fcf: runtime(kconfig): updated ftplugin and syntax script
4335fcfed1

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-01-21 00:16:24 +01:00
Konrad Malik
f50f86b9ff fix(treesitter): compute folds on_changedtree only if not nil 2025-01-20 22:32:45 +00:00
dundargoc
0bc75ac78e ci(news): treat deprecated.txt as part of news.txt
This is because we reference to deprecated.txt from news.txt, so
deprecation news updates are made only in deprecated.txt.
2025-01-20 20:39:08 +01:00
bfredl
20e16c1c49 Merge pull request #32099 from bfredl/no_bufhl
feat(api): deprecate nvim_buf_add_highlight()
2025-01-20 15:42:56 +01:00
Donatas
5b1136a99c feat(inccommand): preview 'nomodifiable' buffers #32034
Problem:
Incremental preview is not allowed on 'nomodifiable' buffers.

Solution:
- Allow preview on 'nomodifiable' buffers.
- Restore the 'modifiable' option in case the preview function changes it.
2025-01-20 06:40:26 -08:00
Luuk van Baal
92556be33d fix(messages): compute msg_col after last newline in ext_messages
Problem:  We want to keep track of the current message column, which is
          done very rudimentary for ext_messages; only checking if the
          message ends in a newline to reset the column, while computing
          the entire cellwidth of the message, which may contain
          (multiple) newlines not necessarily at the end (since 21718c6).
          This introduced a noticeable delay for large messages (e.g. :=vim).
Solution: Calculate the cellwidth of the message after the last newline.
          Use it to keep track of the current message column. This might
          not be a functional change currently, since it only affects
          messages with (multiple) newlines not at the end of a message,
          which I don't think we emit internally, and msg_col is reset for
          a new kind. It does fix the performance problem.
2025-01-20 15:11:33 +01:00
Konrad Malik
ded15ca8c2 fix: completion.enable(false,...) deletes invalid augroup #32121
Problem:

    vim.lsp.completion.enable(true, client.id, bufnr)
    vim.lsp.completion.enable(false, client.id, bufnr)

    Error detected while processing LspDetach Autocommands for "*":
    Error executing lua callback: …/lsp/completion.lua:701: Vim:E367: No such group: "vim/lsp/completion-22"
    stack traceback:
            [C]: in function 'nvim_del_augroup_by_name'
            …/lsp/completion.lua:701: in function 'disable_completions'
            …/lsp/completion.lua:724: in function 'enable'

Solution:
Delete the correct augroup.
2025-01-20 06:10:00 -08:00
Guilherme Soares
8a236c242a fix(lsp): set floating window filetype after setup #32112
Problem:
The filetype for the floating window buffer is being set before its context is fully initialized.
This results in `FileType` events not receiving the correct context.

Solution:
Set the filetype after the floating preview window and its buffer variables are
fully configured to ensure proper context is provided.
2025-01-20 05:00:13 -08:00
bfredl
19b25f3fea feat(api): deprecate nvim_buf_add_highlight()
This was kept for a while as it was a useful short hand and initially
matched what highlights what actually properly implemented. But now
|vim.hl.range()| is a better high-level shorthand with full support for
native multi-line ranges.
2025-01-20 13:59:29 +01:00
Jaehwang Jung
27c8806953 docs(treesitter): expose LanguageTree:parent() #32108
Plugins may want to climb up the LanguageTree.

Also add missing type annotations for other methods.
2025-01-20 04:17:36 -08:00
bfredl
71922cd1dc Merge pull request #31597 from bfredl/deletionism
fix(wininfo): when freeing windows, free the lowest priority wininfo
2025-01-20 11:02:58 +01:00
Christian Clason
5b025b499e vim-patch:9.1.1030: filetype: setting bash filetype is backwards incompatible
Problem:  filetype: setting bash filetype is backwards incompatible
Solution: revert patch v9.1.0965, detect bash scripts again as sh
          filetype

This reverts commit b9b762c21f2b61e0e7d8fee43d4d3dc8ecffd721.

related: vim/vim#16309

727c567a09

Co-authored-by: Christian Brabandt <cb@256bit.org>

vim-patch:9.1.1033: tests: shaderslang was removed from test_filetype erroneously

Problem:  tests: shaderslang was removed from test_filetype erroneously
          (Christian Clason, after v9.1.1030)
Solution: restore the test

1d2867df0c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-01-20 08:20:36 +01:00
Christian Clason
b172dd57fa vim-patch:2cb8246: runtime(tex): add texEmphStyle to texMatchGroup in syntax script
fixes: vim/vim#16228

2cb8246eb9

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Github User JordL
2025-01-20 08:20:24 +01:00
Christian Clason
4dc2e016da vim-patch:d402ba8: runtime(netrw): upstream snapshot of v175
Relevant commits:
- release: netrw v175
- fix: prevent netrw to load into the built-in terminal
- fix: restore correctly cpo settings
- fix(docs): mispelled original authors name
- chore: move viml files to new formatting standard

fixes: vim/vim#16463
closes: vim/vim#16465

d402ba81e2

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2025-01-20 08:20:11 +01:00
Christian Clason
de83cc5842 fix(netrw): re-add missing comment marker in syntax file 2025-01-20 08:20:11 +01:00
Mathias Fussenegger
5f527f24f0 fix(lsp): don't use completion filterText if prefix is empty
Follow up to https://github.com/neovim/neovim/pull/32072

If there is no prefix (e.g. at the start of word boundary or a line), it
always used the `filterText` because the `match` function always
returned false.
2025-01-19 22:11:20 +01:00
Yochem van Rosmalen
d56ba71af1 fix(lsp): document_symbol uses loclist by default #32070
Problem: Not able to open document symbols for different buffers

Solution: Use the location list as default.

To switch back to previous behavior (qflist):

  vim.lsp.buf.document_symbol({ loclist = false })

Fixes: #31832
2025-01-19 13:08:10 -08:00
deepsghimire
a6f219b06b fix(log): unintuitive message for undefined $TMPDIR 2025-01-19 11:37:04 -08:00
Jaehwang Jung
6696ea7f10 fix(treesitter): clean up parsing queue 2025-01-19 15:53:17 +01:00
zeertzjq
ee54069d1d vim-patch:8dec6c2: runtime(vim): Update base-syntax, fix is/isnot operator matching (#32100)
- Match is? and isnot? operators.
- Limit other comparison operators to one match modifier rather than
  two.

closes: vim/vim#16482

8dec6c2e6c

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-01-19 22:14:52 +08:00
Devon Gardner
71507281fb fix(coverity/530826): validate_opt_idx unchecked negative idx (#32081)
Problem:
opt_idx possible negative value used as index

Solution:
check opt_idx not less than zero (kOptInvalid)
2025-01-19 08:49:53 +08:00
林玮 (Jade Lin)
a5b1b83a26 fix(lua): prevent SIGSEGV when lua error is NULL in libuv_worker
Problem:
Calling `xstrdup` with a NULL pointer causes a SIGSEGV if `lua_tostring` returns
NULL in `nlua_luv_thread_common_cfpcall`.

Crash stack trace:
- `_platform_strlen` → `xstrdup` (memory.c:469)
- `nlua_luv_thread_common_cfpcall` (executor.c:281)

Solution:
Check if `lua_tostring` returns NULL and pass NULL to `event_create` to avoid the crash.
2025-01-18 19:08:50 +00:00
Gregory Anders
51ccd12b3d fix(diagnostic)!: make virtual text handler opt-in (#32079)
Making this opt-out (on by default) was the wrong choice from the
beginning. It is too visually noisy to be enabled by default.

BREAKING CHANGE: Users must opt-in to the diagnostic virtual text
handler by adding

  vim.diagnostic.config({ virtual_text = true })

to their config.
2025-01-18 07:43:21 -06:00
Christian Clason
954d4969c9 vim-patch:e064051: runtime(c): add new constexpr keyword to syntax file (C23)
closes: vim/vim#16471

e06405181a

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-01-18 11:54:53 +01:00
Christian Clason
7d04ebd43c vim-patch:54cb514: runtime(sh): update syntax script
- remove duplicated keywords
- add bash coproc and COPROC_PID keywords

54cb514c9a

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-01-18 11:48:35 +01:00
dundargoc
27da6f7757 refactor: simplify bump_deps.lua
Simplify usage and remove redundant flags and code.
2025-01-18 10:52:51 +01:00
Christian Clason
e962167245 vim-patch:9cfdabb: runtime(netrw): change netrw maintainer
Dr. Chip retired some time ago and is no longer maintaining the netrw
plugin. However as a runtime plugin distributed by Vim, it important to
maintain the netrw plugin in the future and fix bugs as they are
reported.

So, split out the netrw plugin as an additional package, however include
some stubs to make sure the plugin is still loaded by default and the
documentation is accessible as well.

closes: vim/vim#16368

9cfdabb074

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2025-01-18 09:49:35 +01:00
Christian Clason
136cb642a0 vim-patch:c2a967a: runtime(c): Update syntax and ftplugin files
- highlight more C keywords, including some from C23

Conditionally highlight C23 features:
- #embed, #elifdef and #elifndef preprocessor directives
- predefined macros
- UTF-8 character constants
- binary integer constants, _BitInt literals, and digit separators
- nullptr_t type and associated constant
- decimal real floating-point, bit precise and char types
- typeof operators

Matchit:
- update for new preprocessor directives

fixes: vim/vim#13667
fixes: vim/vim#13679
closes: vim/vim#12984

c2a967a1b9

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Co-authored-by: Albin Ahlbäck <albin.ahlback@gmail.com>
2025-01-18 08:45:43 +01:00
zeertzjq
c9000a6b13 vim-patch:9.1.1028: too many strlen() calls in screen.c (#32083)
Problem:  too many strlen() calls in screen.c
Solution: refactor screen.c and remove calls to strlen(),
          verify that leadmultispace != NULL (John Marriott)

closes: vim/vim#16460

c15de972e8

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-01-18 02:03:13 +00:00
Yochem van Rosmalen
c6cc937512 docs: change augroup names to new convention #32061
Ref: 09e01437c9
2025-01-17 14:56:30 -08:00
Mathias Fussenegger
b9e6fa7ec8 fix(lsp): use filterText as word if textEdit/label doesn't match
Problem:

With language servers like lemminx, completing xml tags like `<mo` first
shows the right candidates (`modules`) but after typing `d` the
candidates disappear.

This is because the server returns:

    [...]
    filterText = "<module",
    label = "module",
    textEdit = {
      newText = "<module>$1</module>$0",

Which resulted in `module` being used as `word`, and `module` doesn't
match the prefix `<mo`. Typing `d` causes the `complete()` filtering
mechanism to kick in and remove the entry.

Solution:

Use `<module` from the `filterText` as `word` if the textEdit/label
heuristic doesn't match.
2025-01-17 18:34:58 +01:00
Christian Clason
3530182ba4 vim-patch:9.1.1026: filetype: swc configuration files are not recognized
Problem:  filetype: swc configuration files are not recognized
Solution: detect .swcrc files as json filetype (Marces Engel)

References:
https://swc.rs/docs/configuration/swcrc

closes: vim/vim#16462

3a738fccaa

Co-authored-by: Marces Engel <marces@facemurphy.com>
2025-01-17 16:45:59 +01:00
Christian Clason
97d5855351 docs(gh): use new issue types 2025-01-17 16:41:39 +01:00
Luuk van Baal
5dd60e01ac refactor(cmdline): more idiomatic way to avoid cmdline_show
Problem:  Fix applied in #32033 can be more idiomatic.
Solution: Unset redraw_state instead of cmdbuff.
2025-01-17 08:40:50 +01:00
Luuk van Baal
7ce27381fb fix(messages): lsp window/showMessage is not an error
Ref https://github.com/neovim/neovim/discussions/32015
2025-01-17 08:40:50 +01:00
zeertzjq
ac3859a441 vim-patch:a234a46: runtime(doc): fix typo in usr_02.txt (#32063)
fixes: vim/vim#16455

a234a46651

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-01-17 09:09:47 +08:00
zeertzjq
cd92924896 vim-patch:9.1.1021: string might be used without a trailing NUL (#32062)
Problem:  string might be used without a trailing NUL (after v9.1.0997)
Solution: Make sure that the buffer is NUL terminated

closes: vim/vim#16457

70dfc374ec

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-01-17 08:53:10 +08:00
zeertzjq
0d3a8e8c1a vim-patch:9.1.1020: no way to get current selected item in a async context (#32056)
Problem:  no way to get current selected item in a async context
Solution: add completed flag to show the entries of currently selected
          index item (glepnir)

closes: vim/vim#16451

037b028a22

Co-authored-by: glepnir <glephunter@gmail.com>
2025-01-17 08:38:58 +08:00
Gregory Anders
bf098c12e3 Merge pull request #32038 from gpanders/push-nsrttwwnsqvm
feat(terminal): add support for kitty keyboard protocol
2025-01-16 18:33:22 -06:00
Gregory Anders
819337a13f test: use esc sequences in vterm unit tests 2025-01-16 16:41:37 -06:00
Gregory Anders
6f0bde11cc feat(terminal): add support for kitty keyboard protocol
This commit adds basic support for the kitty keyboard protocol to
Neovim's builtin terminal. For now only the first mode ("Disambiguate
escape codes") is supported.
2025-01-16 16:41:08 -06:00
Lewis Russell
fb564ddff0 refactor(options): generic expand and did_set callbacks (#32011)
* refactor(options): generic expand and did_set callbacks

Problem:

Many options have similar callbacks to check the values are valid.

Solution:

Generalize these callbacks into a single function that reads the option
table.

* refactor: gen_options.lua

refactor: gen_options.lua - inline get_cond

* refactor(options): use a simpler format for the common default
2025-01-16 20:53:17 +00:00
zeertzjq
92d3bf101d Merge pull request #32051 from zeertzjq/vim-9.1.1013
vim-patch:9.1.{1013,1017}
2025-01-16 12:20:33 +08:00
zeertzjq
47a4e42392 vim-patch:9.1.1017: Vim9: Patch 9.1.1013 causes a few problems
Problem:  Vim9: Patch 9.1.1013 causes a few problems
Solution: Translate the function name only when it is a string
          (Yegappan Lakshmanan)

fixes: vim/vim#16453
closes: vim/vim#16450

9904cbca41

Cherry-pick call() change from patch 9.0.0345.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2025-01-16 11:17:14 +08:00
zeertzjq
f8680d0097 vim-patch:9.1.1013: Vim9: Regression caused by patch v9.1.0646
Problem:  Vim9: Regression caused by patch v9.1.0646
Solution: Translate the function name before invoking it in call()
          (Yegappan Lakshmanan)

fixes: vim/vim#16430
closes: vim/vim#16445

6289f91591

N/A patch:
vim-patch:8.2.4176: Vim9: cannot use imported function with call()

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2025-01-16 11:17:14 +08:00
zeertzjq
718e165360 vim-patch:9.1.1018: v9.1.0743 causes regression with diff mode (#32047)
Problem:  v9.1.0743 causes regression with diff mode
Solution: Fix the regression with overlapping regions

closes: vim/vim#16454

01f6509fb2

Co-authored-by: Yukihiro Nakadaira <yukihiro.nakadaira@gmail.com>
2025-01-16 01:16:25 +00:00
Christian Clason
524be56042 vim-patch:9.1.1019: filetype: fd ignore files are not recognized (#32042)
Problem:  filetype: fd ignore files are not recognized
Solution: detect .fdignore files as gitignore filetype

closes: vim/vim#16444

3058087f6f

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2025-01-16 07:34:25 +08:00
Christian Clason
f0fdc1de6c build(deps): bump libuv to v1.50.0 2025-01-15 19:54:54 +01:00
dundargoc
7c65224257 build: fix lint error on macos 2025-01-15 18:54:08 +01:00
luukvbaal
bbf36ef8ef fix(cmdline): prevent cmdline_show events after exiting cmdline #32033
Problem:  If a (vim.ui_attach) cmdline_hide callback triggers a redraw,
          it may cause cmdline_show events for an already exited cmdline.
Solution: Avoid emitting cmdline_show event when ccline.cmdbuff is
          already NULL. Unset ccline.cmdbuff before emitting cmdline_hide.
2025-01-15 06:55:21 -08:00
luukvbaal
5cc93ef472 fix(marks): revise metadata for start mark of revalidated pair #32017
Problem:  Metadata may be revised for end mark of a revalidated pair.
Solution: Revise metadata for start mark of a revalidated pair.
2025-01-15 02:38:45 -08:00
Evgeni Chasnovski
09bcb31068 fix(docs): replace yxx mappings with g== #31947
Problem:
`yx` uses "y" prefix, which shadows a builtin operator.

Solution:
Use `g=` (in the form of `g==` currently), drawing from precedent of
CTRL-= and 'tpope/vim-scriptease'.
2025-01-15 02:36:00 -08:00
Justin M. Keyes
9552fe7ef9 Merge #32013 from luukvbaal/shellkind 2025-01-15 02:23:44 -08:00
Justin M. Keyes
3ee63edc1b Merge #32001 from MariaSolOs/consistent-namespaces 2025-01-15 02:01:44 -08:00
Andrew Braxton
0a7e4e9e5f fix(lsp): vim.lsp.enable(...,false) does not disable #32002
Problem:
Per the documentation, passing `false` as the `enable` parameter of
`vim.lsp.enable()` should disable the given LSP(s), but it does not work
due to a logic error.

Specifically, `enable == false and nil or {}` will always evaluate to
`{}` because `nil` is falsy.

Solution:
Correct the conditional statement.
2025-01-15 01:58:36 -08:00
Luuk van Baal
d55b17e2b4 fix(messages): verbose kind for nvim_echo()
Problem:  No "verbose" kind for nvim_echo() opts->verbose.
Solution: Pass NULL "kind" to indicate no new kind.
2025-01-15 10:51:55 +01:00
Luuk van Baal
5bae80899d feat(messages): add :!cmd shell message kinds
Also print stderr error messages with ErrorMsg highlight group.
2025-01-15 10:51:52 +01:00
Christian Clason
bc69f27237 vim-patch:045564d: runtime(colors): Update colorschemes, include new unokai colorscheme
- new unokai colorscheme (similar/inspired by monokai)
- the rest: add explicit PopupSelected link to PmenuSel

closes: vim/vim#16443

045564d0a7

Co-authored-by: Maxim Kim <habamax@gmail.com>
2025-01-15 09:48:55 +01:00
Maria José Solano
575f4bc7d5 docs: document namespace/augroup convention 2025-01-14 21:25:25 -08:00
Maria José Solano
09e01437c9 refactor: use nvim.foo.bar format for autocommand groups 2025-01-14 21:25:25 -08:00
zeertzjq
a78eddd541 vim-patch:9.1.1015: Coverity complains about dereferencing NULL value (#32020)
Problem:  Coverity complains about dereferencing NULL value
Solution: Check that cms2 is not null

closes: vim/vim#16438

1ac53b84ad

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-01-15 12:05:00 +08:00
Maria José Solano
850084b519 refactor: use nvim.foo.bar format for namespaces 2025-01-14 19:55:29 -08:00
Mike
611ef35491 feat(vim.fs): find(), dir() can "follow" symlinks #31551
Problem:
vim.fs.dir(), vim.fs.find() do not follow symlinks.

Solution:
- Add "follow" flag.
- Enable it by default.
2025-01-14 16:39:17 -08:00
Gregory Anders
e8a6c1b021 fix(lsp): schedule call to vim.lsp.start for async root_dir (#31998)
When `root_dir` is a function it can (and often will) call the provided
callback function in a fast API context (e.g. in the `on_exit` handler
of `vim.system`). When the callback function is executed we should
ensure that it runs vim.lsp.start on the main event loop.
2025-01-14 08:19:54 -06:00
Gregory Anders
f1c45fc7a4 feat(terminal): support theme update notifications (DEC mode 2031) (#31999) 2025-01-14 08:18:59 -06:00
bfredl
59da82abd9 fix(wininfo): when freeing windows, free the lowest priority wininfo
On master (and also before #31539) closing a window could cause the
used wininfo for a buffer to change. This is due to always removing the
previous NULL wininfo when deleting a window, even if that wininfo had
higher priority than the the deleted window's own wininfo.

Instead delete the wininfo with lowest priority. This retains the memory
saving efect while not affecting the effective value of window options
and so on.
2025-01-14 14:47:35 +01:00
bfredl
7eabc8899a Merge pull request #31932 from bfredl/termtab
fix(getchar): do not simplify keycodes in terminal mode
2025-01-14 14:46:34 +01:00
luukvbaal
25d8c3a5ad feat(api): nvim_open_win() relative to tabline and laststatus #32006
Problem:  Anchoring a floating window to the tabline and laststatus is
          cumbersome; requiring autocommands and looping over all
          windows/tabpages.
Solution: Add new "tabline" and "laststatus" options to the `relative`
          field of nvim_open_win() to place a window relative to.
2025-01-14 05:02:46 -08:00
Christian Clason
e8ddb7a469 vim-patch:30377e0: runtime(lyrics): support milliseconds in syntax script
The following tool creates LRC files using three fractional digits after
the seconds (i.e. milliseconds).

References:
https://github.com/magic-akari/lrc-maker
https://lrc-maker.github.io/

closes: vim/vim#16436

30377e0fe0

Co-authored-by: Denilson Sá Maia <denilsonsa@gmail.com>
2025-01-14 13:23:02 +01:00
zeertzjq
69ad6b12ec vim-patch:9.1.1010: filetype: VisualCode setting file not recognized (#32003)
Problem:  filetype: VisualCode setting file not recognized
Solution: detect json files in VSCode config directory as jsonc filetype
          (Konfekt)

closes: vim/vim#16400

c200f53cbb

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2025-01-14 18:55:06 +08:00
Famiu Haque
c5f93d7ab0 refactor(options): remove code for multitype options
Problem: It was decided on Matrix chat that multitype options won't be necessary for Neovim options, and that options should only have a single canonical type. Therefore the code for supporting multitype options is unnecessary.

Solution: Remove the additional code that's used to provide multitype option support.
2025-01-14 09:34:17 +00:00
Riley Bruins
b192d58284 perf(treesitter): calculate folds asynchronously
**Problem:** The treesitter `foldexpr` runs synchronous parses to
calculate fold levels, which eliminates async parsing performance in the
highlighter.

**Solution:** Migrate the `foldexpr` to also calculate and apply fold
levels asynchronously.
2025-01-14 09:30:43 +00:00
Horror Proton
5a54681025 fix(treesitter): uv_dlclose after uv_dlerror 2025-01-14 09:15:35 +00:00
Christian Clason
0dfa4de993 build(deps): bump luajit to HEAD - a4f56a459 2025-01-14 09:00:50 +01:00
Xuyuan Pang
a4f575abd8 fix(lsp): minimum height for floating popup #31990
Problem:
The floating window for hover and signature help always cuts off a few lines,
because the `_make_floating_popup_size` function counts empty lines as having
zero height.

Solution:
Ensure the height is at least 1.
2025-01-13 15:17:23 -08:00
Lewis Russell
34e2185022 fix(options): better handling of empty values
Problem:

Whether an option is allowed to be empty isn't well defined and
isn't properly checked.

Solution:

- For non-list string options, explicitly check the option value
  if it is empty.
- Annotate non-list string options that can accept an empty value.
  - Adjust command completion to ignore the empty value.
- Render values in Lua meta files
2025-01-13 16:58:25 +00:00
luukvbaal
cb7b4e2962 feat(messages): "verbose" message kind #31991 2025-01-13 04:59:34 -08:00
dundargoc
47866cd8d2 refactor: delete duplicate utf8-functionality
Also remove British National Replacement Character Set.

We keep the DEC Special Graphics and ASCII despite it not being unicode
as some old software such as calcurse still rely on this functionality.

References:
- https://github.com/neovim/neovim/pull/31934#discussion_r1911046426
- https://en.wikipedia.org/wiki/DEC_Special_Graphics
- https://vt100.net/docs/vt220-rm/chapter2.html#S2.4.3
2025-01-13 13:16:41 +01:00
dundargoc
0631492f9c feat: add vim.fs.relpath
This is needed to replace the nvim-lspconfig function is_descendant that
some lspconfg configurations still use.
2025-01-13 13:14:52 +01:00
bfredl
913e81c35f fix(getchar): do not simplify keycodes in terminal mode
The code represents a useful pattern in normal mode where remapping
`<tab>` will implicitly also remap `<c-i>` unless you remap that
explicitly. This relies on the _unmapped_ behavior being identical which
is not true in terminal mode, as vterm can distinguish these keys.

Vim seems to entangle this with kitty keyboard mode detection which
is irrelevant for us. Conditional fallbacks depending on
keyboard mode could be done completely inside `vterm/` without getchar.c
getting involved, I would think.
2025-01-13 11:55:16 +01:00
Guilherme Soares
a3ef29d570 test: use temp file #31907 2025-01-13 01:41:49 -08:00
zeertzjq
2c16c84998 vim-patch:9.1.1011: popupmenu internal error with some abbr in completion item (#31988)
Problem:  Popup menu internal error with some abbr in completion item.
Solution: Don't compute attributes when there is no corresponding text.
          Reduce indent in pum_redraw() while at it (zeertzjq).

fixes: vim/vim#16427
closes: vim/vim#16435

3a0cc36c69
2025-01-13 15:18:47 +08:00
Lewis Russell
99c4bd2f69 Merge pull request #31631 from ribru17/async_parse_attempt_2
feat(treesitter): async parsing
2025-01-13 06:58:33 +00:00
Christian Clason
f4cff3077b build(deps): bump tree-sitter to v0.24.7 2025-01-12 19:52:39 +01:00
Riley Bruins
bd4ca22d03 feat(treesitter)!: don't parse tree in get_parser() or start()
**Problem:** `vim.treesitter.get_parser()` and `vim.treesitter.start()`
both parse the tree before returning it. This is problematic because if
this is a sync parse, it will stall the editor on large files. If it is
an async parse, the functions return stale trees.

**Solution:** Remove this parsing side effect and leave it to the user
to parse the returned trees, either synchronously or asynchronously.
2025-01-12 08:10:49 -08:00
Riley Bruins
45e606b1fd feat(treesitter): async parsing
**Problem:** Parsing can be slow for large files, and it is a blocking
operation which can be disruptive and annoying.

**Solution:** Provide a function for asynchronous parsing, which accepts
a callback to be run after parsing completes.

Co-authored-by: Lewis Russell <lewis6991@gmail.com>
Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
Co-authored-by: VanaIgr <vanaigranov@gmail.com>
2025-01-12 08:10:47 -08:00
Riley Bruins
3fdc430241 perf(treesitter): cache queries strongly
**Problem:** Query parsing uses a weak cache which is invalidated
frequently

**Solution:** Make the cache strong, and invalidate it manually when
necessary (that is, when `rtp` is changed or `query.set()` is called)

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2025-01-12 16:44:24 +01:00
Christian Clason
40bf23adaf build(deps): bump wasmtime to v25.0.3 2025-01-12 12:57:07 +01:00
Christian Clason
bf58b757c4 vim-patch:9.1.1007: filetype: various ignore are not recognized
Problem:  filetype: various ignore are not recognized
Solution: detect rg/docker/npm/vvsce ignore files as 'gitgnore' filetype
          (Wu, Zhenyu)

Not only prettier, but many programs also support ignore files (like rg,
docker, npm, vscode). So use the gitignore filetype for them due to same syntax

closes: vim/vim#16428

8cbe2e0a0a

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2025-01-12 12:01:24 +01:00
zeertzjq
1a8a48d7e5 vim-patch:9.1.1003: [security]: heap-buffer-overflow with visual mode (#31971)
Problem:  [security]: heap-buffer-overflow with visual mode when
          using :all, causing Vim trying to access beyond end-of-line
          (gandalf)
Solution: Reset visual mode on :all, validate position in gchar_pos()
          and charwise_block_prep()

This fixes CVE-2025-22134

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-5rgf-26wj-48v8

c9a1e257f1

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-01-12 00:25:57 +00:00
zeertzjq
37316fbac6 vim-patch:9.1.1005: completion text is highlighted even with no pattern found (#31973)
Problem:  completion text is highlighted even with no pattern found
Solution: use ins_compl_leader_len() instead of checking
          compl_leader.length (glepnir)

closes: vim/vim#16422

9fddb8ae77

Co-authored-by: glepnir <glephunter@gmail.com>
2025-01-12 08:04:25 +08:00
zeertzjq
88dca6a835 vim-patch:partial:9598a63: runtime(doc): add package-<name> helptags for included packages (#31972)
Improve how to find the justify package

closes: vim/vim#16420

9598a6369b

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Peter Benjamin <petermbenjamin@gmail.com>
2025-01-12 07:43:58 +08:00
Gregory Anders
a119aae4d3 feat(diagnostic)!: filter diagnostics by severity before passing to handlers (#30070)
BREAKING CHANGE: This changes the list of diagnostics that are passed to
a diagnostic handler. If a handler is already filtering by severity
itself then this won't break anything, since the handler's filtering
will become a no-op. But handlers which depend on receiving the full
list of diagnostics may break.

Note that diagnostics are only filtered if the handler's configuration
has the `severity` option set. If `severity` is not set, the handler
still receives the full list of diagnostics.
2025-01-11 12:54:43 -06:00
Christian Clason
9e0d40f7e4 vim-patch:668e9f2: runtime(filetype): don't detect string interpolation as angular
fixes: vim/vim#16375

668e9f2403

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-01-11 11:20:19 +01:00
dundargoc
6a425e7045 docs: misc
Co-authored-by: Axel <axelhjq@gmail.com>
Co-authored-by: Colin Kennedy <colinvfx@gmail.com>
Co-authored-by: Daiki Noda <sys9kdr@users.noreply.github.com>
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: Jean-Jacq du Plessis <1030058+jj-du-plessis@users.noreply.github.com>
Co-authored-by: Juan Giordana <juangiordana@gmail.com>
Co-authored-by: Lincoln Wallace <locnnil0@gmail.com>
Co-authored-by: Matti Hellström <hellstrom@scm.com>
Co-authored-by: Steven Locorotondo <steven.locorotondo@justeattakeaway.com>
Co-authored-by: Yochem van Rosmalen <git@yochem.nl>
Co-authored-by: glepnir <glephunter@gmail.com>
Co-authored-by: ifish <fishioon@live.com>
2025-01-11 10:34:12 +01:00
zeertzjq
c060a6ea64 vim-patch:9.1.1001: ComplMatchIns highlight hard to read on light background (#31958)
Problem:  ComplMatchIns highlight hard to read on light background
          (after v9.1.0996)
Solution: define the highlighting group cleared, it should be configured in
          colorschemes separately (glepnir)

closes: vim/vim#16414

ad409876d9

Co-authored-by: glepnir <glephunter@gmail.com>
2025-01-11 09:08:01 +08:00
zeertzjq
df45b336f5 vim-patch:695522d: runtime(vim): Update base-syntax, highlight literal string quote escape (#31957)
Match the '' escape sequence in literal strings.  These were previously
ending the current string and starting another concatenated literal
string.

closes: vim/vim#16415

695522dea3

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-01-11 08:27:50 +08:00
glepnir
fbe546e25d vim-patch:9.1.0996: ComplMatchIns may highlight wrong text (#31931)
Problem:  ComplMatchIns may highlight wrong text
Solution: don't highlight in case of fuzzy match,
          skip-highlight when not inserting anything
          (glepnir)

closes: vim/vim#16404

e890887b80
2025-01-10 23:58:45 +00:00
Christian Clason
dcaf9a60e9 vim-patch:51754c8: runtime(editorconfig): set omnifunc to syntaxcomplete func
closes: vim/vim#16419

51754c8a49

Co-authored-by: Yochem van Rosmalen <git@yochem.nl>
2025-01-11 00:44:06 +01:00
Guilherme Soares
aa2b44fbb0 fix(treesitter): don't return error message on success #31955
Problem:
The `vim.treesitter.language.add` function returns
a error message even when it succeeds.

Solution:
Don't return error message on success.
2025-01-10 14:46:19 -08:00
luukvbaal
37c77ab46b fix(messages): attaching/detaching ext_messages causes asserts #31952
Problem:  Assert hit related to message kind, which is reset after a
          ext_messages UI is forcibly detached, so the assertion is
          expectedly false. Assert hit related to message grid variables
          after an ext_messages UI attaches while message grid is scrolled.
Solution: Don't check message kind assertion if no ext_messages UI is
          attached. Flush message grid when first/last ext_messages UI
          attaches/detaches.
2025-01-10 14:43:45 -08:00
Riley Bruins
cb02c20569 refactor(treesitter.foldexpr): remove unused parse_injections parameter 2025-01-10 22:06:35 +00:00
Justin M. Keyes
0717dfbfaf refactor(api): deprecate nvim_notify #31938
Problem:
The `nvim_notify` API (note: unrelated to `vim.notify()` Lua API) was
not given any real motivation in https://github.com/neovim/neovim/pull/13843

There are, and were, idiomatic and ergonomic alternatives already.

Solution:
Deprecate `nvim_notify`.
2025-01-10 11:42:04 -08:00
zeertzjq
b06f42b502 vim-patch:df4a7d7: runtime(tiasm): use correct syntax name tiasm in syntax script (#31942)
vim-patch:df4a7d7: runtime(tiasm):  use correct syntax name tiasm in syntax script

closes: vim/vim#16416

df4a7d7617

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2025-01-10 17:17:34 +08:00
Luuk van Baal
87610d82db fix(decor): set invalid flag for end of invalidated paired marks 2025-01-10 08:14:38 +01:00
zeertzjq
a37784ad83 vim-patch:9.1.1000: tests: ruby tests fail with Ruby 3.4 (#31940)
Problem:  tests: ruby tests fail with Ruby 3.4
Solution: adjust expected output for Ruby 3.4
          (Yee Cheng Chin)

Vim's Ruby tests relied on explicit matching of output texts which are
fragile in design. Ruby 3.4 has changed the output slightly (using
'name' instead of `name', and also using more spaces in dictionary
printouts). Modify the Vim tests to be less fragile to such changes.

closes: vim/vim#16411

ebea31e454

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-01-10 08:04:02 +08:00
zeertzjq
846a2019c0 vim-patch:9.1.0999: Vim9: leaking finished exception (#31939)
Problem:  leaking finished exception
          (after v9.1.0984)
Solution: use finish_exception to clean up caught exceptions
          (Yee Cheng Chin)

In Vimscript, v:exception/throwpoint/stacktrace are supposed to reflect
the currently caught exception, and be popped after the exception is
finished (via endtry, finally, or a thrown exception inside catch).
Vim9script does not handle this properly, and leaks them instead. This
is clearly visible when launching GVim with menu enabled.  A caught
exception inside the s:BMShow() in menu.vim would show up when querying
`v:stacktrace` even though the exception was already caught and handled.

To fix this, just use the same functionality as Vimscript by calling
`finish_exception` to properly restore the states. Note that this
assumes `current_exception` is always the same as `caught_stack` which
believe should be the case.

Added tests for this. Also fix up test_stacktrace to properly test the
stack restore behavior where we have nested exceptions in catch blocks
and to also test the vim9script functionality properly.

- Also, remove its dependency on explicitly checking a line number in
  runtest.vim which is a very fragile way to write tests as any minor
  change in runtest.vim (shared among all tests) would require changing
  test_stacktrace.vim. We don't actually need such granularity in the
  test.

closes: vim/vim#16413

2051af1642

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-01-10 08:03:44 +08:00
Justin M. Keyes
7c00e0efbb docs: misc #31867 2025-01-09 09:26:45 -08:00
Riley Bruins
0c296ab224 feat(docs): "yxx" runs Lua/Vimscript code examples #31904
`yxx` in Normal mode over a Lua or Vimscript code block section will execute the code.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-01-09 08:36:16 -08:00
Famiu Haque
1e47aa677a fix(api): deprecated API nvim_get_option does not validate option name #31919
Problem:
Deprecated API `nvim_get_option()` doesn't validate the option name,
which leads to an assertion failure.

Solution:
Validate option name in `nvim_get_option()`.

Ref: #31894
2025-01-09 07:32:27 -08:00
Justin M. Keyes
5135a23219 Merge #31900 from luukvbaal/nvim_echo 2025-01-09 06:36:29 -08:00
bfredl
dcaf8bef08 Merge pull request #31844 from bfredl/iter_crash
fix(decoration): fix crash when on_lines decor provider modifies marktree
2025-01-09 13:37:28 +01:00
Luuk van Baal
5c92b40b4b feat(api): deprecate nvim_out/err_write(ln) 2025-01-09 13:35:42 +01:00
Luuk van Baal
ead5683ff9 feat(api): add err field to nvim_echo() opts
Problem:  We want to deprecate `nvim_err_write(ln)()` but there is no
          obvious replacement (from Lua). Meanwhile we already have
          `nvim_echo()` with an `opts` argument.
Solution: Add `err` argument to `nvim_echo()` that directly maps to
          `:echoerr`.
2025-01-09 13:35:40 +01:00
bfredl
6dd7fcaafd Merge pull request #31898 from bfredl/termbomb
fix(terminal): don't crash on unprintable chars
2025-01-09 13:35:25 +01:00
bfredl
f8c8a245aa fix(terminal): don't crash on unprintable chars
fixes #31897
2025-01-09 11:22:00 +01:00
bfredl
33ff546b50 fix(decoration): fix crash when on_lines decor provider modifies marktree
If a "on_lines" callback changes the structure of the marktree, the
iterator (which is used for an entire window viewport) might now
point to invalid memory. Restore the iterator to the beginning of the
line in this case.

fixes #29484
2025-01-09 11:17:42 +01:00
zeertzjq
3f0adf90de vim-patch:9.1.0998: filetype: TI assembly files are not recognized (#31929)
Problem:  filetype: TI assembly files are not recognized
Solution: inspect '*.sa' and assembly files and detect TI assembly
          files, include filetype plugin and syntax script for TI
          assembly files (Wu, Zhenyu)

closes: vim/vim#15827

4f73c07abf

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2025-01-09 17:30:26 +08:00
Christian Clason
d740a4274d vim-patch:8ab1819: runtime(xf86conf): add section name OutputClass to syntax script
References:
https://man.archlinux.org/man/xorg.conf.5#DESCRIPTION

closes: vim/vim#16397

8ab1819df6

Co-authored-by: Jan-Arvid Harrach <jharrach@tutanota.com>
2025-01-09 08:07:30 +01:00
zeertzjq
5f85e78db3 vim-patch:9.1.0997: too many strlen() calls in drawscreen.c (#31927)
Problem:  too many strlen() calls in drawscreen.c
Solution: refactor drawscreen.c and remove calls to strlen(),
          make get_keymap_str() (in screen.c) return string length
          instead of TRUE/FALSE (John Marriott).

a21240b97d

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-01-09 12:49:45 +08:00
zeertzjq
19c9572d36 Revert "refactor(options): set option value for non-current context directly" (#31924)
Reverts #31112
2025-01-09 12:32:25 +08:00
zeertzjq
822313e42b vim-patch:partial:9.1.0882: too many strlen() calls in insexpand.c (#31490)
Problem:  too many strlen() calls in insexpand.c
Solution: Refactor insexpand.c and reduce number of calls to STRLEN(),
          fix a warning get_next_filename_completion(), add new function
          ins_compl_leader_len() (John Marriott)

closes: vim/vim#16095

5e6ea92b2c

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-01-09 08:59:59 +08:00
zeertzjq
0d469b697e vim-patch:1718e7d: runtime(vim): Update base-syntax, improve ex-bang matching (#31922)
Always match ex-bang explicitly rather than incidentally as the ! operator.

fixes: vim/vim#16221
closes: vim/vim#16410

1718e7d07e

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-01-09 00:40:50 +00:00
Lewis Russell
c4b658fed8 Merge pull request #31112 from famiu/refactor/options/set_option_for
refactor(options): set option value for non-current context directly
2025-01-08 17:56:21 +00:00
Guilherme Soares
17b46d01e2 test(treesitter): inspect_tree #31182
To prevent #30986 and #31198 regression update inspect_tree tests
2025-01-08 05:06:09 -08:00
notomo
5b9518b436 fix(api): nvim_set_decoration_provider callback return type #31912
Problem: incorrect return type doc causes luals `Annotations specify that at most 0 return value(s) are required, found 1 returned here instead.` diagnosis

Solution: correct return type doc
2025-01-08 04:37:29 -08:00
Christian Clason
561580aba5 vim-patch:9.1.0995: filetype: shaderslang files are not detected
Problem:  filetype: shaderslang files are not detected
Solution: detect '*.slang' files as shaderslang filetype,
          include a filetype and syntax script (mtvare6)

Reference:
https://shader-slang.com/

closes: vim/vim#16387

616219f684

Co-authored-by: mtvare6 <mtvare6@proton.me>
2025-01-08 10:32:45 +01:00
zeertzjq
141114c170 fix(api): crash on invalid buffer to nvim_buf_del_user_command (#31908) 2025-01-08 05:16:41 +00:00
Evgeni Chasnovski
6719276040 fix(highlight): make TablineSel more noticeable with 'notermguicolors' #31905
Problem: Linking `TablineSel` to `Normal` makes it more noticeable with
`notermguicolors` but less so with `termguicolors` (compared to using
bold text in both cases).

Solution: use bold text with `termguicolors` and regular with
`notermguicolors`.
2025-01-07 14:02:35 -08:00
glepnir
b12b91c274 feat(health): show :checkhealth in floating window #31086
Problem: health can not shown in a floating window
Solution: add g:health variable
2025-01-07 08:09:01 -08:00
Riley Bruins
d9ee0d2984 perf(treesitter): don't fetch parser for each fold line
**Problem:** The treesitter `foldexpr` calls `get_parser()` for each
line in the buffer when calculating folds. This can be incredibly slow
for buffers where a parser cannot be found (because the result is not
cached), and exponentially more so when the user has many
`runtimepath`s.

**Solution:** Only fetch the parser when it is needed; that is, only
when initializing fold data for a buffer.

Co-authored-by: Jongwook Choi <wookayin@gmail.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-01-07 16:43:45 +01:00
Jared Baur
b67fcd0488 fix(highlight): make TablineSel more noticeable #31896
The default `TablineSel` highlighting makes it subjectively difficult to
differentiate the selected tab from unselected ones.
2025-01-07 04:21:15 -08:00
dundargoc
d8bc08db7f refactor: adopt vterm
We have changed too much to consider it a mere bundled dependency (such
as unicode handling in e3bfcf2fd4), and
can consider it our own at this point.
2025-01-07 12:35:24 +01:00
Christian Clason
4d94059919 vim-patch:3159b64: runtime(sh): fix typo in Last Change header
related: vim/vim#16394

3159b6494e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-01-07 08:03:13 +01:00
Christian Clason
b44a8ba1e7 vim-patch:cf1f555: runtime(sh): add PS0 to bashSpecialVariables in syntax script
PS0 is also a special prompt variable. (It is expanded and displayed
after it reads a command but before executing it.)

References:
https://www.gnu.org/software/bash/manual/html_node/Interactive-Shell-Behavior.html

closes: vim/vim#16394

cf1f55548d

Co-authored-by: Jon Parise <jon@indelible.org>
2025-01-07 08:03:13 +01:00
Christian Clason
a942dea157 vim-patch:7ceaa8f: runtime(vim): Remove trailing comma from match_words
fixes: vim/vim#16377 (`filetype plugin indent on` breaks matchit).
closes: vim/vim#16389

7ceaa8f3dd

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-01-07 08:03:13 +01:00
zeertzjq
e27f7125d6 Merge pull request #31893 from zeertzjq/vim-9.1.0984
vim-patch:9.1.{0984,0991}: getstacktrace(), v:stacktrace
2025-01-07 09:42:17 +08:00
zeertzjq
8fa4306eb9 vim-patch:9.1.0991: v:stacktrace has wrong type in Vim9 script
Problem:  v:stacktrace has wrong type in Vim9 script.
Solution: Change the type to t_list_dict_any.  Fix grammar in docs.
          (zeertzjq)

closes: vim/vim#16390

6655bef330
2025-01-07 09:15:10 +08:00
zeertzjq
d5308637bf vim-patch:9.1.0984: exception handling can be improved
Problem:  exception handling can be improved
Solution: add v:stacktrace and getstacktrace()

closes: vim/vim#16360

663d18d610

Co-authored-by: ichizok <gclient.gaap@gmail.com>
Co-authored-by: Naruhiko Nishino <naru123456789@gmail.com>
2025-01-07 09:15:10 +08:00
luukvbaal
06ff5480ce vim-patch:9.1.0993: New 'cmdheight' behavior may be surprising #31892
Problem:  Although patch 9.1.0990 fixed a real problem/inconsistency,
          it also introduced new behavior that may break BWC and/or be
          unexpected. Before 9.1.0990, window commands could make the
          topframe smaller (without changing 'cmdheight'; quirk that is
          now fixed), but did not allow extending the topframe beyond
          the 'cmdheight' set by the user. After 9.1.0990, the user can
          reduce the 'cmdheight' below the value they set explicitly,
          through window commands, which may lead to confusion.
          (aftere v9.1.0990)
Solution: Store the value explicitly set by the user and clamp the
          'cmdheight' when resizing the topframe. This also applies to
          dragging laststatus, which in contrast to window commands
          _did_ allow reducing the 'cmdheight' to values below the one
          set by the user. So with this patch there is still new
          behavior, but I think in a way that is less surprising.
          While at it, also fix a Coverity warning, introduced in
          v9.1.0990 (Luuk van Baal)

c97e869535
2025-01-06 17:00:09 -08:00
Riley Bruins
30de00687b refactor(treesitter): simplify condition #31889 2025-01-06 16:56:53 -08:00
dundargoc
b6ab294838 fix: fix incorrect search code 2025-01-06 20:03:17 +00:00
Justin M. Keyes
3d9fb975b9 Merge #31625 perf(decor): improve iter_captures() cache 2025-01-06 07:09:34 -08:00
luukvbaal
86770108e2 fix(lsp): open_floating_preview() zindex relative to current window #31886
Problem:  open_floating_preview() may be hidden behind current window if
          that is floating and has a higher zindex.
Solution: Open floating preview with zindex higher than current window.
2025-01-06 06:05:50 -08:00
vanaigr
dd234135ad refactor: split predicates and directives 2025-01-06 00:35:19 -06:00
vanaigr
8d2ee542a8 perf(decor): join predicates and matches cache 2025-01-06 00:34:48 -06:00
vanaigr
ef77845b97 test: benchmark treesitter highlighing 2025-01-06 00:34:19 -06:00
zeertzjq
9b7905df16 Merge pull request #31882 from zeertzjq/vim-0c3e57b
vim-patch: doc updates
2025-01-06 10:17:19 +08:00
zeertzjq
e8c0b87c1f vim-patch:fd77161: runtime(doc): update doc for :horizontal
Revert the documentation for :horizontal from commit
0c3e57b403e0e3a1fefc because :horizontal cannot be shortened to :ho

closes: vim/vim#16362

fd771613b3

Co-authored-by: h-east <h.east.727@gmail.com>
2025-01-06 09:54:55 +08:00
zeertzjq
22dadf4c33 vim-patch:0c3e57b: runtime(doc): update index.txt, windows.txt and version9.txt
closes: vim/vim#16357

0c3e57b403

Co-authored-by: h-east <h.east.727@gmail.com>
Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2025-01-06 09:53:49 +08:00
zeertzjq
abb19e873b Merge pull request #31881 from zeertzjq/vim-21c37d7
vim-patch: update Vim syntax
2025-01-06 09:43:47 +08:00
zeertzjq
53f5d528cf vim-patch:6139766: runtime(vim): fix failing vim syntax test
after v9.1.0985

related: vim/vim#16356

6139766e82

Co-authored-by: h-east <h.east.727@gmail.com>

N/A patch:
vim-patch:8a27d97: runtime(doc): Capitalise the mnemonic "Zero" for the 'z' flag of search()
2025-01-06 09:16:13 +08:00
zeertzjq
b23c28845f vim-patch:21c37d7: runtime(vim): update base-syntax after v9.1.0936
21c37d7f69

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-01-06 09:16:13 +08:00
Justin M. Keyes
5e02a2c470 "nvim -es": disable shada #21723
Problem:
`nvim -es` (and `nvim -Es`) is the recommended way to non-interactively
run commands/vimscript. But it enables shada by default, which is
usually not wanted.

Solution:
- Disable shada by default for `nvim -es/-Es`. This can be overridden by
  `-i foo` if needed.
- Do NOT change the 'loadplugins' default.
  - User config + packages _should_ be enabled by default, for both `nvim
    -es` and `nvim -l`. Else any Lua packages you have can't be accessed
    without `-u path/to/config`, which is clumsy.
      - Use-cases:
        ```
        nvim --headless "+Lazy! sync" +qa
            would become: nvim -es "+Lazy! sync"
        nvim --headless +PlugInstall +qall
            would become: nvim -es +PlugInstall
        ```
  - Opt-out (`--clean` or `-u NONE`) is much easier than opt-in (`-u
    path/to/config`).
  -  User config/packages are analogous to pip packages, which are
     expected when doing `python -c ...`.

related: 7c94bcd2d7
related: ddd0eb6f51
2025-01-05 17:10:16 -08:00
Justin M. Keyes
570a8da01b fix(health): "q" should not close last window #31876 2025-01-05 11:31:39 -08:00
Daiki Noda
ac5a6d9ff5 build: fix RelWithDebInfo optimization flags #31802
Problem:
RelWithDebInfo generates redundant flags:

    Compilation: /usr/bin/cc -O2 -g -Og -g

The `CMAKE_C_FLAGS_RELWITHDEBINFO` variable is being modified in a way
that caused duplicate `-Og` and `-g` flags to be added. The resulting
flags were `-O2 -g -Og -g`.

- `-Og` (Optimize for debugging) and `-O2` (Optimize for performance)
  are different optimization levels. We can't use both at once.
- The duplicate `-g` flag is redundant and no effect.

multiple -O flags has no effect for code, just redundant.

> If you use multiple -O options, with or without level numbers, the last such option is the one that is effective.

https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html

Solution:
Adjust the flags to use the more appropriate `-O2 -g`.

    Compilation: /usr/bin/cc -O2 -g

BEFORE:

```
:verbose version
NVIM v0.11.0-dev-1443+ge00cd1ab40
Build type: RelWithDebInfo
LuaJIT 2.1.1734355927
Compilation: /usr/bin/cc -O2 -g -Og -g -flto -fno-fat-lto-ob
jects -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict
...
```

AFTER:

```
:verbose version
NVIM v0.11.0-dev-e00cd1ab4-dirty
Build type: RelWithDebInfo
LuaJIT 2.1.1734355927
Compilation: /usr/bin/cc -O2 -g -flto -fno-fat-lto-objects -
Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-protot
...
```
2025-01-05 11:28:31 -08:00
Maria José Solano
548f19ccc3 feat(health): close checkhealth buffers with q #31870 2025-01-05 09:51:51 -08:00
Christian Clason
bd2a4edf1b vim-patch:202ebc6: runtime(zsh): sync syntax script with upstream repo
fixes: vim/vim#16371

202ebc6ced

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-01-05 17:13:00 +01:00
luukvbaal
847c28f6f6 fix(cmdline): always show cmdline when it is a prompt #31866
Cmdline prompts should ignore `cmd_silent`.
2025-01-05 05:59:50 -08:00
glepnir
bf48dfadec fix(api): nvim__complete_set requires completeopt=popup #31177
Problem:
If completeopt does not include "popup" flag, nvim__complete_set still
auto-creates a floating preview window.

Solution:
Fail if completeopt does not include the "popup" flag.
2025-01-05 05:57:53 -08:00
glepnir
d288f7003d fix(popup): wrong extmark data sync when lines changed in popup preview #30246
Problem: when popup preview buffer has filetype like markdown and ts
is enabled, the extmark clean and update not correct, if add the extmark
sync there has lots of duplicate codes like nvim_buf_set_lines.

Solution: use nvim_buf_set_lines api internally to set info to popup
preview buffer.
2025-01-05 05:52:50 -08:00
Riley Bruins
b61051ccb4 feat(func): allow manual cache invalidation for _memoize
This commit also adds some tests for the existing memoization
functionality.
2025-01-05 12:28:01 +01:00
luukvbaal
54ac406649 vim-patch:9.1.0990: Inconsistent behavior when changing cmdheight (#31830)
Problem:  Inconsistent behavior when changing cmdheight by resizing the
          topframe through wincmds and dragging laststatus. Changing
          cmdheight by resizing the topframe does not trigger OptionSet.
Solution: Consolidate logic for changing the cmdheight, set the option
          value to handle side-effects (Luuk van Baal)

e15cbc1af4

vim-patch:9.0.0187: command line height changes when maximizing window height

Problem:  Command line height changes when maximizing window height.
Solution: Do not change the command line height. (closes vim/vim#10885)

96bde99bf8
2025-01-05 19:09:38 +08:00
Maria José Solano
5e90406487 fix(health): set nomodifiable in checkhealth buffers 2025-01-05 09:43:59 +01:00
Justin M. Keyes
64b0e6582a refactor(tests): merge n.spawn/n.spawn_argv into n.new_session #31859
Problem:
- `n.spawn()` is misleading because it also connects RPC, it's not just
  "spawning" a process.
- It's confusing that `n.spawn()` and `n.spawn_argv()` are separate.

Solution:
- Replace `n.spawn()`/`n.spawn_argv()` with a single function `n.new_session()`.
  This name aligns with the existing functions `n.set_session`/`n.get_session`.
    - Note: removes direct handling of `prepend_argv`, but I doubt that was
      important or intentional. If callers want to control use of `prepend_argv`
      then we should add a new flag to `test.session.Opts`.
- Move `keep` to first parameter of `n.new_session()`.
- Add a `merge` flag to `test.session.Opts`
- Mark `_new_argv()` as private. Test should use clear/new_session/spawn_wait
  instead.
2025-01-04 16:48:00 -08:00
dundargoc
a8ace2c58a fix(vim.fs.normalize): normalize case for windows drive letter
Also add tests for the current path casing behavior so it doesn't get
accidentally changed.
2025-01-04 21:48:45 +01:00
Emilia Simmons
69aa33d890 fix(runtime): let matchit and matchparen skips fallback on treesitter captures
When treesitter is enabled, by default syntax groups are not defined, but these
groups are used to identify where to skip matches in matchit and matchparen.

This patch does three things:
1. If syntax is enabled regardless of treesitter (`vim.bo.syntax='on'`):
   Use original implementation.
2. If treesitter is enabled and syntax is not:
   Match the syntax groups (i.e. `comment\|string`) against treesitter captures
   to check for skipped groups.
3. Add an explicit treesitter syntax for marking captures to skip:
   matchit uses `b:match_skip` to determine what counts as skippable
   Where 's:comment\|string' uses a match of the named syntax groups against
   a regex match of comment\|string, 't:comment\|string' now uses vim regex
   to match against the names of the treesitter capture groups.
2025-01-04 20:11:43 +01:00
Gregory Anders
4eaf9371ca docs: cleanup news.txt (#31854)
Move non-breaking changes out of the breaking changes section
2025-01-04 12:39:57 -06:00
Justin M. Keyes
975c2124a6 test: use spawn_wait() instead of system() #31852
Problem:
Tests that need to check `nvim` CLI behavior (no RPC session) create
their own ad-hoc `system()` wrappers.

Solution:
- Use `n.spawn_wait` instead of `system()`.
- Bonus: this also improves the tests by explicitly checking for
  `stdout` or `stderr`. And if a signal is raised, `ProcStream.status`
  will reflect it.
2025-01-04 06:29:13 -08:00
Christian Clason
7ddadd0fee vim-patch:cd96075: runtime(java): Quietly opt out for unsupported markdown.vim versions
fixes vim/vim#16349
closes: vim/vim#16369

cd96075cde

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2025-01-04 10:35:00 +01:00
Justin M. Keyes
a09c7a5d57 Merge #30384 test: spawn_wait() 2025-01-03 10:46:20 -08:00
Justin M. Keyes
700a25e621 test: include stderr in EOF failure message 2025-01-03 19:24:04 +01:00
Justin M. Keyes
a1ba655dee test: spawn_wait() starts a non-RPC Nvim process
Problem:
Can't use `n.clear()` to test non-RPC `nvim` invocations. So tests end
up creating ad-hoc wrappers around `system()` or `jobstart()`.

Solution:
- Introduce `n.spawn_wait()`
- TODO (followup PR): Rename `n.spawn()` and `n.spawn_wait()`.
  It's misleading that `n.spawn()` returns a RPC session...
2025-01-03 19:24:04 +01:00
Justin M. Keyes
fe87656f29 fix(grid): grid_line_start NULL access with 'redrawdebug'
Problem:
This test causes a null pointer dereference:

    local proc = n.spawn_wait('-l', 'test/functional/fixtures/startup-fail.lua')

    RUN      T1565 startup -l Lua Lua-error sets Nvim exitcode: 241.00 ms OK
    ==================== File …/build/log/asan.13763 ====================
    = …/src/nvim/grid.c:389:12: runtime error: null pointer passed as argument 1, which is declared to never be null
    = /usr/include/string.h:61:62: note: nonnull attribute specified here
    =     0 0x55cc2d869762 in grid_line_start …/src/nvim/grid.c:389:5
    =     1 0x55cc2d8717ca in grid_clear …/src/nvim/grid.c:618:5
    =     2 0x55cc2dbe0f6f in msg_clr_eos_force …/src/nvim/message.c:3085:3
    =     3 0x55cc2dbbbdec in msg_clr_eos …/src/nvim/message.c:3061:5
    =     4 0x55cc2dbbae2c in msg_multiline …/src/nvim/message.c:281:9
    =     5 0x55cc2dbba2b4 in msg_keep …/src/nvim/message.c:364:5
    =     6 0x55cc2dbc4992 in emsg_multiline …/src/nvim/message.c:773:10
    =     7 0x55cc2dbc5d43 in semsg_multiline …/src/nvim/message.c:824:9
    =     8 0x55cc2d9c5945 in nlua_error …/src/nvim/lua/executor.c:158:5
    =     9 0x55cc2d9c89fd in nlua_exec_file …/src/nvim/lua/executor.c:1862:5
    =     10 0x55cc2d9f4d69 in main …/src/nvim/main.c:637:19
    =     11 0x7f319b62a1c9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    =     12 0x7f319b62a28a in __libc_start_main csu/../csu/libc-start.c:360:3
    =     13 0x55cc2ced0f64 in _start (…/build/bin/nvim+0xc48f64) (BuildId: 309c83f8d74297c89719dae9c271dd8ec23e64c3)

Cause:
The tests use `redrawdebug=invalid` by default, but `default_grid_alloc`
skips calling `grid_alloc` when not `full_screen`.

Solution:
Check for `full_screen`.
2025-01-03 18:02:33 +01:00
Justin M. Keyes
b52531a9cb docs: misc #31822
* docs: drop "lua-" prefix from most treesitter tags
* docs: move mouse section from tui.txt to gui.txt
* docs: misc
2025-01-03 08:29:36 -08:00
luukvbaal
21718c67dd fix(messages): better formatting for ext_messages #31839
Problem:  Message grid newline formatting based on `msg_col` is not
          utilized with ext_messages.
Solution: Increment `msg_col` with the cell width of the chunk. Allowing
          message code that uses `msg_col` to determine when to place a
          newline to do so. E.g. when the message goes beyond `Columns`;
          this is not necessarily where the ext_messages implementation
          would want to place a newline, but it is a best guess. Message
          parsing and manipulation is still possible.
2025-01-03 08:25:06 -08:00
zeertzjq
c26951b1d6 vim-patch:fc61cfd: runtime(vim): Update matchit pattern, no Vim9 short names (#31843)
Abbreviated :enum and :interface commands are no longer supported.

fc61cfd60e

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-01-03 19:20:21 +08:00
Christian Clason
fa298fd2f4 vim-patch:9.1.0987: filetype: cake files are not recognized
Problem:  filetype: cake files are not recognized
Solution: detect '*.cake' files as cs filetype
          (Zoe Roux)

References:
https://cakebuild.net/

closes: vim/vim#16367

a407573f30

Co-authored-by: Zoe Roux <zoe.roux@zoriya.dev>
2025-01-03 11:45:21 +01:00
Christian Clason
b365036ab3 vim-patch:9.1.0986: filetype: 'jj' filetype is a bit imprecise
Problem:  filetype: 'jj' filetype is a bit imprecise
Solution: rename 'jj' filetype to 'jjdescription'
          (Gregory Anders)

closes: vim/vim#16364

58c44e8833

Co-authored-by: Gregory Anders <greg@gpanders.com>
2025-01-03 11:45:10 +01:00
Christian Clason
f1f42ec063 vim-patch:bde76da: runtime(jj): Support diffs in jj syntax
related: vim/vim#16364

bde76da4d0

Co-authored-by: Gregory Anders <greg@gpanders.com>
2025-01-03 11:45:10 +01:00
bfredl
6aceab7c20 Merge pull request #31635 from bfredl/vtermpirates
feat(terminal): support grapheme clusters, including emoji
2025-01-03 10:43:22 +01:00
luukvbaal
43d552c566 feat(ui): more intuitive :substitute confirm prompt #31787
Problem:  Unknown key mappings listed in substitute confirm message.
Solution: Include hints as to what the key mappings do.
2025-01-02 06:40:39 -08:00
luukvbaal
48e2a73610 feat(ui)!: emit prompt "messages" as cmdline events #31525
Problem:  Prompts are emitted as messages events, where cmdline events
          are more appropriate. The user input is also emitted as
          message events in fast context, so cannot be displayed with
          vim.ui_attach().
Solution: Prompt for user input through cmdline prompts.
2025-01-02 05:51:03 -08:00
bfredl
e3bfcf2fd4 feat(terminal): support grapheme clusters, including emoji 2025-01-02 12:55:11 +01:00
Jaehwang Jung
9d9ee3476e fix(lsp): ensure watcher cancel
* Cancel watcher in the "force" case.
* Cancel watcher outside the async callback. It seems nvim doesn't wait
  async jobs on quitting, leaving detached inotifywait processes.
* Clean up cancelling callbacks.
2025-01-02 10:23:06 +00:00
Gregory Anders
efe1732c6f fix(jobs): do not block UI when jobwait() doesn't block (#31803) 2025-01-01 18:43:16 -06:00
dundargoc
6dc0eb9f41 fix(vim.fs.abspath): correctly handle UNC paths 2025-01-01 23:42:42 +01:00
Justin M. Keyes
dc692f553a docs: misc #31479 2025-01-01 12:29:51 -08:00
Famiu Haque
9d114b7205 refactor(options): use const in more places (#31791) 2025-01-01 07:45:14 -06:00
Christian Clason
59cbe64023 build(deps): bump utf8proc to v2.10.0 2025-01-01 00:04:27 +01:00
Gregory Anders
b5cb69f8a4 fix(tui): handle key events for arrow and function keys (#31804)
Arrow and function keys do not use CSI u with the kitty keyboard
protocol. For example, the Up arrow key uses CSI A, and the function
keys use a variety of different CSI sequences.

Until now, termkey only parsed subparams used by key events for CSI u
sequences. The result being that any key which did not use CSI u (e.g.
arrow and function keys) was being emitted twice by termkey since it was
not recognizing the separate press and release events.

This commit makes termkey also parse subparams for other key sequences
so that the release key events do not send duplicate keys.
2024-12-31 12:16:25 -06:00
Gregory Anders
a389dc2f95 feat(clipboard)!: use OSC 52 as fallback clipboard provider (#31730)
We currently enable the OSC 52 clipboard provider by setting g:clipboard
when a list of conditions are met, one of which is that $SSH_TTY must be
set. We include this condition because often OSC 52 is not the best
clipboard provider, so if there are "local" providers available Nvim
should prefer those over OSC 52.

However, if no other providers are available, Nvim should use OSC 52
even when $SSH_TTY is not set. When a user is in an SSH session then the
checks for the other clipboard providers will still (typically) fail, so
OSC 52 continues to be enabled by default in SSH sessions.

This is marked as a breaking change because there are some cases where
OSC 52 wasn't enabled before and is now (or vice versa).
2024-12-31 09:59:03 -06:00
Gustav Eikaas
0bef3b911c fix(vim.fs): joinpath() does not normalize slashes on Windows #31782 2024-12-31 07:40:05 -08:00
dundargoc
b3bdba5cb1 ci(news): trigger job for perf commit type
There is a "performance" section in news.txt so it makes sense we should
also give a reminder to update news for performance improvements.
2024-12-31 16:36:33 +01:00
dundargoc
1925000245 test: skip flaky watchdirs() test on macos 2024-12-31 15:54:06 +01:00
Gregory Anders
4fb3b57a19 feat(tui): handle kitty key events in libtermkey (#31727)
Enable key event reporting in the kitty keyboard protocol. This causes
supporting terminals to send key events for presses, repeats, and key
releases. For now we ignore release events, but eventually we will
support users mapping those.
2024-12-31 08:29:14 -06:00
Mathias Fussenegger
e00cd1ab40 feat(lsp): return resolved config for vim.lsp.config[name]
Allows to retrieve the configuration as it will be used by `lsp.enable`
- including the parts merged from `*` and rtp.

This is useful for explicit startup control
(`vim.lsp.start(vim.lsp.config[name])`)

Closes https://github.com/neovim/neovim/issues/31640
2024-12-31 13:18:05 +01:00
Christian Clason
1877cd5fcd vim-patch:9.1.0982: TI linker files are not recognized
Problem:  TI linker files are not recognized
Solution: inspect '*.cmd' files and detect TI linker files
          as 'lnk' filetype, include a lnk ftplugin and syntax
          script (Wu, Zhenyu)

closes: vim/vim#16320

39a4eb0b2c

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-12-31 12:29:35 +01:00
Christian Clason
7ecd348b3d vim-patch:8dc98bf: runtime(chordpro): update syntax script
References:
https://chordpro.org/beta/directives-define/#defining-chords-for-keyboard-instruments

8dc98bf427

Co-authored-by: nibo <nibo@relim.de>
2024-12-31 12:17:54 +01:00
glepnir
bdc0b5f505 vim-patch:9.1.0983: not able to get the displayed items in complete_i… (#31796)
vim-patch:9.1.0983: not able to get the displayed items in complete_info()

Problem:  not able to get the displayed items in complete_info()
          (Evgeni Chasnovski)
Solution: return the visible items via the "matches" key for
          complete_info() (glepnir)

fixes: vim/vim#10007
closes: vim/vim#16307

d4088edae2
2024-12-31 19:12:50 +08:00
zeertzjq
57f10abbc2 vim-patch:9.1.0981: tests: typo in test_filetype.vim (#31794)
Problem:  tests: typo in test_filetype.vim
Solution: fix comment, update lnkmap syntax file and add
          DESCT keyword
          (Wu, Zhenyu)

closes: vim/vim#16348

2bee7e43e1

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-12-31 08:41:54 +08:00
Gregory Anders
e9c077d197 fix(termkey): fix null pointer dereference (#31792) 2024-12-30 16:36:47 -06:00
Christian Clason
259573db83 vim-patch:48fa319: syntax(sh): Improve the recognition of bracket expressions
- Define a general non-"contained" "shBracketExpr" group,
  and replace with it the "contained" bracket variant of
  "shOperator", adjusting the patterns for the competing
  conditional commands "[" and "[[".
- Accommodate some unbalanced brackets (e.g. "[!][!]").
- Make the leading "!" (or "^") stand out in NON-matching
  bracket expressions.
- Support literal newlines in parametric patterns (along
  with pathname globbings and "case" patterns).
- Also match bracket expressions in:
  * parametric patterns (e.g. "${1#[ab]_}");
  * pathname globbings (e.g. "[ab]*.txt");
  * arguments for the "[[", "echo", and "print" commands.
- Recognise collating symbols (e.g. "[.a.]") and equivalence
  classes (e.g. "[=a=]").
- Recognise end patterns for a pattern substitution form of
  parameter expansion and match bracket expressions in such
  patterns (e.g. "${1/%[.!]/;}").

fixes vim/vim#15799
closes: vim/vim#15941

References:
https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap09.html#tag_09_03_05
https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#tag_19_14
https://git.savannah.gnu.org/gitweb/?p=bash.git;a=blob_plain;f=doc/bash.html;hb=37b7e91d64ad10b1a1815d12128c9475636df670
http://www.mirbsd.org/htman/i386/man1/mksh.htm

48fa3198b7

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-12-30 12:11:11 +01:00
zeertzjq
d077e31cc9 vim-patch:9.1.0978: GUI tests sometimes fail when setting 'scroll' options (#31785)
Problem:  GUI tests sometimes fail when setting 'scroll' options
Solution: decrease the 'scroll' and 'scrolljump' option value from 20 to
          15, in case the Gui window is not large enough to handle 20.

tests: decrease the scroll and scrolljump values

the gui tests sometimes fail with:

```
From test_options_all.vim:
Found errors in Test_opt_set_scroll():
Caught exception in Test_opt_set_scroll(): Vim(set):E49: Invalid scroll size: scroll=20 @ command line..script /home/runner/work/vim/vim/src/testdir/runtest.vim[617]..function RunTheTest[57]..Test_opt_set_scroll, line 7
Found errors in Test_opt_set_scrolljump():
Caught exception in Test_opt_set_scrolljump(): Vim(set):E49: Invalid scroll size: scrolljump=20 @ command line..script /home/runner/work/vim/vim/src/testdir/runtest.vim[617]..function RunTheTest[57]..Test_opt_set_scrolljump, line 9
```

closes: vim/vim#16337

2e1f757f7b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-12-30 19:06:31 +08:00
Christian Clason
7b739248a1 vim-patch:9.1.0977: filetype: msbuild filetypes are not recognized
Problem:  filetype: msbuild filetypes are not recognized
Solution: detect msbuild files as xml filetype
          (Gustav Eikaas)

closes: vim/vim#16339

32b7e3a8c9

Co-authored-by: GustavEikaas <gustav.eikaas@gmail.com>
2024-12-30 12:01:26 +01:00
Igor
e4bc8b5967 fix(treesitter.foldexpr): only refresh valid buffers
Problem: autocmd to refresh folds always uses the current buffer if the
option type is local. However, the current buffer may not have a parser,
and thus the assert that checks for a parser could fail.

Solution: check if the foldinfo contains the buffer, and only refresh if
so.
2024-12-29 16:24:19 +00:00
Maria José Solano
02097e43c8 fix(lsp): check if sig_help window is focusable when configuring cycle keymap 2024-12-29 16:23:23 +00:00
Christian Clason
0e880b5612 vim-patch:9.1.0972: filetype: TI linker map files are not recognized
Problem:  filetype: TI linker map files are not recognized
Solution: detect TI linker map files as lnkmap filetype
          (Wu, Zhenyu)

References:
https://downloads.ti.com/docs/esd/SPRUI03A/Content/SPRUI03A_HTML/linker_description.html

closes: vim/vim#16324

5113831d16

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-12-29 16:15:00 +01:00
Christian Clason
493b6899ee vim-patch:9.1.0971: filetype: SLNX files are not recognized
Problem:  filetype: SLNX files are not recognized
Solution: detect '*.slnx' files as xml filetype
          (Gustav Eikaas)

References:
https://blog.ndepend.com/slnx-the-new-net-solution-xml-file-format/
https://blog.jetbrains.com/dotnet/2024/10/04/support-for-slnx-solution-files/

closes: vim/vim#16334

3b3318b640

Co-authored-by: GustavEikaas <gustav.eikaas@gmail.com>
2024-12-29 16:15:00 +01:00
Christian Clason
76abe6bab5 vim-patch:df67fc0: runtime(sh): set shellcheck as the compiler for supported shells
closes: vim/vim#16311

df67fc0e69

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2024-12-29 16:06:59 +01:00
zeertzjq
d7784225bc vim-patch:f2e08a1: runtime(doc): Fix documentation typos (#31768)
closes: vim/vim#16333

f2e08a1e54

Numbers with quotes are N/A.

Co-authored-by: h-east <h.east.727@gmail.com>
2024-12-29 20:50:38 +08:00
Jaehwang Jung
48acbc4d64 fix(treesitter.foldexpr): refresh in the buffers affected by OptionSet 2024-12-29 07:35:39 +00:00
zeertzjq
d3951be4a0 vim-patch:9.1.0968: tests: GetFileNameChecks() isn't fully sorted by filetype name (#31763)
Problem:  tests: GetFileNameChecks() isn't fully sorted by filetype name
Solution: re-sort the list

closes: vim/vim#16322

e51043ad9f
2024-12-29 08:56:32 +08:00
Luca Saccarola
2b07b14eac vim-patch:9.1.0965: filetype: sh filetype set when detecting the use of bash (#31749)
Problem:  filetype: sh filetype set when detecting the use of bash
Solution: when bash is detected, use 'bash' filetype instead
          (Luca Saccarola)

closes: vim/vim#16309

b9b762c21f
2024-12-28 19:20:50 +08:00
zeertzjq
bc624ccffd vim-patch:e6ccb64: runtime(doc): fix doc error in :r behaviour (#31755)
closes: vim/vim#16316

e6ccb643a6

Co-authored-by: Martino Ischia <ischiamartino@gmail.com>
2024-12-28 11:06:18 +00:00
Famiu Haque
5180707310 feat(lua): add vim.fs.abspath
Problem: There is currently no way to check if a given path is absolute or convert a relative path to an absolute path through the Lua stdlib. `vim.fs.joinpath` does not work when the path is absolute. There is also currently no way to resolve `C:foo\bar` style paths in Windows.

Solution: Add `vim.fs.abspath`, which allows converting any path to an absolute path. This also allows checking if current path is absolute by doing `vim.fs.abspath(path) == path`. It also has support for `C:foo\bar` style paths in Windows.
2024-12-28 11:40:39 +01:00
Christian Clason
48c09ed4d9 vim-patch:6c57c30: runtime(compiler): include a basic bash syntax checker compiler
See @saccarosium 's suggestion at
https://github.com/vim/vim/pull/16311#issuecomment-2563447885

closes: vim/vim#16314

6c57c30ad4

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-12-28 00:35:32 +01:00
Gregory Anders
35247b00a4 feat(lsp): support function for client root_dir (#31630)
If root_dir is a function it is evaluated when the client is created to
determine the root directory.

This enables dynamically determining the root directory based on e.g.
project or directory structure (example: finding a parent Cargo.toml
file that contains "[workspace]" in a Rust project).
2024-12-27 10:09:22 -06:00
Christian Clason
6d2c67350a build(deps): bump tree-sitter to v0.24.6 2024-12-27 12:23:22 +01:00
Christian Clason
69fbb58385 vim-patch:9.1.0962: filetype: bun.lock file is not recognized
Problem:  filetype: bun.lock file is not recognized
Solution: detect 'bun.lock' file as jsonc filetype
          (Anton Kastritskii)

closes: vim/vim#16308

f07ae5b3bd

Co-authored-by: Anton Kastritskii <halloy52@gmail.com>
2024-12-27 11:40:38 +01:00
glepnir
46c7faa00b vim-patch:9.1.0963: fuzzy-matching does not prefer full match (#31741)
Problem:  fuzzy-matching does not prefer full match
          (Maxim Kim)
Solution: add additional score for a full match
          (glepnir)

fixes: vim/vim#15654
closes: vim/vim#16300

5a04999a74
2024-12-27 14:23:06 +08:00
zeertzjq
557f2d9700 vim-patch:9b67a2e: runtime(vim): Update base-syntax, allow parens in default arguments (#31738)
Allow parentheses in default arguments specified in :def and :function
definitions.

fixes vim/vim#16243
closes: vim/vim#16269

9b67a2e1dd

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-12-27 09:11:03 +08:00
Famiu Haque
6257270040 refactor(options): set option value for non-current context directly
Problem: Currently, we use `switch_option_context` to temporarily switch the current option context before setting an option for a different buffer / window. This is not ideal because we already support getting and setting option values for non-current contexts in the underlying implementation.

Solution: Set option value for non-current context by passing the context directly to the lower level functions. Also introduce a new `OptCtx` struct to store option context information, this will scale much better if we add more option scopes and other context information in the future.
2024-12-26 20:55:13 +06:00
Famiu Haque
98763ce4e9 refactor(autocmd): allow specifying window for autocmd context
Problem: Currently we can only specify a buffer to use for an autocmd context through `aucmd_prepbuf()`, which finds a window that uses that buffer in the current tabpage, or creates an autocmd window. This means it's not possible to actually specify a window to use for an autocmd.

Solution: Add an `aucmd_prepbuf_win()` function which also takes a window as a parameter and uses it for the autocmd. If the window is not provided, then it behaves similarly to `aucmd_prepbuf()`
2024-12-26 19:51:13 +06:00
Artem
487c48ec86 fix(api): clamp range lines in nvim__redraw() (#31710)
Problem:
`nvim__redraw()` doesn't clamp the lines in the `range` parameter before truncating to int. The resulting range may be empty when the original range contained buffer lines and vice versa.

E.g. for a buffer with 4 lines, these are the redrawn lines:

```lua
{ 2, 2 ^ 31 } -> none (should be { 2, 3 })
{ 2, 2 ^ 32 } -> none (should be { 2, 3 })
{ 2 ^ 32 - 1, 2 } -> { 0, 1 } (should be none)
```

Solution:
Clamp `range` values before truncating to int.
2024-12-25 21:12:40 +01:00
Christian Clason
7567f7d322 vim-patch:9.1.0961: filetype: TI gel files are not recognized
Problem:  filetype: TI gel files are not recognized
Solution: detect '*.gel' files as gel filetype, include
          get filetype and syntax plugins
          (Wu, Zhenyu)

References:
https://downloads.ti.com/ccs/esd/documents/users_guide/ccs_debug-gel.html

closes: vim/vim#16226

9360de9027

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-12-25 13:38:45 +01:00
Christian Clason
01e1598072 vim-patch:9.1.0960: filetype: hy history files are not recognized
Problem:  filetype: hy history files are not recognized
Solution: detect '*.hy', '.hy-history' files as hy filetype,
          detect '.lips_repl_history' files are scheme filetype
          (Wu, Zhenyu)

closes: vim/vim#16298

a32daed559

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-12-25 13:38:45 +01:00
Shihua Zeng
b51110f4a1 docs(api): return type of nvim_get_keymap() #31708 2024-12-24 09:56:10 -08:00
zeertzjq
f8df96d276 Merge pull request #31713 from glepnir/vim-9.1.0954
vim-patch:9.1.{0954,0956}
2024-12-24 19:34:47 +08:00
Mathias Fussenegger
34cd94812d feat(test): support and document lua test case debugging
Similar to how there is a `GDB` environment variable to let the nvim
test instances to be run under `gdbserver` this adds a `OSV_PORT`
variable to start nvim test instances with `osv` in blocking mode to let
a debug client attach to it for debugging of `exec_lua` code blocks.
2024-12-24 12:29:39 +01:00
glepnir
05eca4c04d vim-patch:9.1.0956: completion may crash, completion highlight wrong with preview window
Problem:  completion may crash, completion highlight wrong with preview
          window (after v9.1.0954)
Solution: correctly calculate scroll offset, check for preview window
          when adding extra highlighting
          (glepnir)

when there have a preview window prepare_tagpreview
will change curwin to preview window and this may cause
ComplMatchIns check condition not correct. check wp is curwin
and also the type of wp is not a preview or poup info

fixes: https://github.com/vim/vim/issues/16284
closes: https://github.com/vim/vim/pull/16283

8d0bb6dc9f
2024-12-24 18:56:40 +08:00
glepnir
a103ec7449 vim-patch:9.1.0954: popupmenu.c can be improved
Problem:  popupmenu.c can be improved
Solution: slightly refactor the logic
          (glepnir)

closes: vim/vim#16271

Replace some if blocks and combine user attr abstract to an inline
function.

89a107efd1

Co-authored-by: glepnir <glephunter@gmail.com>
2024-12-24 18:56:40 +08:00
Christian Clason
14ee1de7e5 vim-patch:9.1.0958: filetype: supertux2 config files detected as lisp
Problem:  filetype: supertux2 config files detected as lisp
Solution: detect supertux2 config files as scheme instead
          (Wu, Zhenyu)

References:
https://github.com/SuperTux/supertux/wiki/S-Expression

supertux uses #t and #f as bool type, which is same as scheme, not
common lisp

closes: vim/vim#16287

e62d93ead1

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-12-24 11:55:06 +01:00
Gregory Anders
c51bf5a6b2 fix(terminal): set cursor cell percentage (#31703)
Fixes: https://github.com/neovim/neovim/issues/31685
2024-12-23 15:39:36 -06:00
Yorick Peterse
4cbeb6fa3c fix(diagnostic): silence :chistory #31701
vim.diagnostic.set_list() uses chistory to restore the actively selected
entry whenever necessary. This however also results in it displaying
some output in the message bar, but this output isn't useful (and can
even be distracting) when opening the quickfix window. This fixes this
by silencing the chistory command.
2024-12-23 11:57:15 -08:00
Justin M. Keyes
ffaab09e99 fix(build): <termios.h> is system-dependent #31705
Problem:
Since 2a7d0ed614, build fails with glibc
version 2.28 / RHEL8 (where `termios.h` does not include unistd.h and is
therefore missing `_POSIX_VDISABLE`):

    …/src/nvim/tui/termkey/termkey.c: In function 'termkey_start':
    …/src/nvim/tui/termkey/termkey.c:516:31: error: '_POSIX_VDISABLE' undeclared (first use in this function)
      516 |         termios.c_cc[VQUIT] = _POSIX_VDISABLE;
          |                               ^~~~~~~~~~~~~~~
    …/src/nvim/tui/termkey/termkey.c:516:31: note: each undeclared identifier is reported only once for each function it appears in

Solution:
- Undo the `<termios.h>` change and mark the imports with `IWYU pragma: keep`.
2024-12-23 11:13:19 -08:00
dundargoc
d74c74aae3 build: remove lintcommit from lint target
Previously, `make lint` would invoke `lintcommit` which would fail if
there were fixup or other disallowed commits. This would disrupt local
development as developers would often want non-commit linting to work
early on without needing to adhere to the strict commit rules.
2024-12-23 17:42:39 +01:00
Justin M. Keyes
a1fa2b3a4e refactor(eval): move funcs to deprecated.c #31650 2024-12-23 07:39:25 -08:00
dundargoc
25abcd243e fix: fix broken wasmtime build
Regression from 2a7d0ed614, which removed
header that is only needed if wasmtime support is enabled. Prevent this
from happening again by wrapping the include in a `HAVE_WASMTIME` check.
2024-12-23 16:07:09 +01:00
Justin M. Keyes
2a7d0ed614 refactor: iwyu #31637
Result of `make iwyu` (after some "fixups").
2024-12-23 05:43:52 -08:00
Lukasz Piepiora
55c5d0de26 docs(api): vim.version.range():has() method #31622
Problem:
The :has() method of the vim.version.range() result is not documented
though it's mentioned in examples.

Solution:
Mention it in the range() result doc.
2024-12-23 05:08:20 -08:00
Christian Clason
adcd9360df vim-patch:4ce1cb5: runtime(graphql): contribute vim-graphql to Vim core
Contribute the core of my vim-graphql project (ftplugin, indent, syntax)
to the Vim project. This replaces the basic ftplugin support that was
already in the runtime with a more complete set of filetype settings. I
can assume maintainership for all of these files.

I'll continue to maintain the higher-level embedded filetype support
separately (in vim-graphql) for now, because it's fairly complex, but we
can consider integrating that code directly into vim later.

runtime files use the MIT license.

closes: vim/vim#16273

4ce1cb5bf1

Co-authored-by: Jon Parise <jon@indelible.org>
2024-12-23 11:34:23 +01:00
Justin M. Keyes
7e1c1ff7fc Merge #31661 cmdline_show/hide events 2024-12-22 16:06:46 -08:00
Luuk van Baal
a10636fbe7 feat(ui): specify whether msg_show event is added to history
Pass along whether message in msg_show event is added to the internal
:messages history.
2024-12-23 00:37:28 +01:00
Christian Clason
665a0e85c4 vim-patch:9.1.0953: filetype: APKBUILD files not correctly detected
Problem:  filetype: APKBUILD files not correctly detected
Solution: detect 'APKBUILD' files as apkbuild filetype,
          include a apkbuild syntax script (which basically
          just sources the sh.vim syntax file)
          (Hugo Osvaldo Barrera)

Vim plugins (e.g.: ALE, nvim-lspconfig, etc) rely on filetype to
determine which integrations/helpers are applicable. They expect
filetype=apkbuild for APKBUILD files.

On the other hand, plugins also enable bash-specific linters and
functionality when filetype=bash, but APKBUILD files are POSIX sh, not
bash, so these often provide bogus results.

Change the filetype for APKBUILD to a 'apkbuild', so that tools and
ftplugin can properly target these files. This filetype will use the
existing `sh` syntax rules, since these are applicable for them.

7cb24917a1

Co-authored-by: Hugo Osvaldo Barrera' via vim_dev <vim_dev@googlegroups.com>
2024-12-22 18:05:07 +01:00
luukvbaal
d1e00a5f6d fix(messages): typo and unwanted truncation in msg_outtrans_long #31669
- Typo/bug in msg_outtrans_long passing string length as "hist" argument.
- Avoid truncating message in msg_outtrans_long with ext_messages (followup to 
  1097d239c3).
- Remove `_hl` from `msg_keep`, `smsg_keep` as there is no non-`_hl` variant.
- `msg_printf_hl` is removed (identical to `smsg` except it sets
  `msg_scroll = true`, seemingly as a caveat to force a more prompt in
  cmdline mode). Move this logic to the only the only place this was
  used in ex_getln.c.
2024-12-22 06:42:48 -08:00
Luuk van Baal
394f69a25d feat(ui): additional arguments for cmdline_show/hide events
Problem:  Unable to tell what highlight the prompt part of a
          cmdline_show event should have, and whether cmdline_hide was
          emitted after aborting.
Solution: Add additional arguments hl_id to cmdline_show, and abort to
          cmdline_hide.
2024-12-22 15:23:43 +01:00
Christian Clason
c7a4197a5c vim-patch:9.1.0951: filetype: jshell files are not recognized
Problem:  filetype: jshell files are not recognized
Solution: detect '*.jsh' files as java filetype
          (Konfekt)

closes: vim/vim#16260

62e3014ab1

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-12-22 11:58:51 +01:00
dundargoc
fd05c7f19d test: format C test files and fix clang-tidy warnings
It's probably not worth adding the C test files to regular formatting as
they're pretty much never touched, but ensuring the files are formatted
according to our standards and getting rid of warnings is a cheap
one-time fix.
2024-12-21 16:01:58 +01:00
Gregory Anders
130b5fd85f feat(lsp): return table from lsp/ files on runtimepath (#31663)
Problem: LSP configs on the runtimepath must have the same name as the
LSP server and must also explicitly set the name in vim.lsp.config. This
is redundant and creates a footgun where a user may accidentally use the
wrong name when assigning to the vim.lsp.config table.

Solution: Return a table from lsp/ runtimepath files instead
2024-12-21 08:27:27 -06:00
dundargoc
382eb878bc build: bump lua dev dependencies
busted: 2.1.1 -> 2.2.0
https://github.com/lunarmodules/busted/releases/tag/v2.1.2
https://github.com/lunarmodules/busted/releases/tag/v2.2.0

luacheck: 1.1.0 -> 1.2.0
https://github.com/lunarmodules/luacheck/releases/tag/v1.1.1
https://github.com/lunarmodules/luacheck/releases/tag/v1.1.2
https://github.com/lunarmodules/luacheck/releases/tag/v1.2.0
2024-12-21 13:07:34 +01:00
Christian Clason
5f8fac00bf vim-patch:70881ba: runtime(dockerfile): do not set commentstring in syntax script
fixes: vim/vim#16268

70881ba195

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-12-21 11:31:04 +01:00
Christian Clason
0fea57bc71 vim-patch:9.1.0950: filetype: fennelrc files are not recognized
Problem:  filetype: fennelrc files are not recognized
Solution: detect 'fennelrc' files as fennel filetype
          (Wu Zhenyu)

References:
https://github.com/bakpakin/Fennel/issues/193

closes: vim/vim#16262

f173f4249f

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-12-21 11:30:52 +01:00
zeertzjq
725d3e25a3 vim-patch:c673b80: runtime(netrw): more reformating vim/vim#16248 (#31662)
closes: vim/vim#16266

c673b805ad

Co-authored-by: shane.xb.qian <shane.qian@foxmail.com>
2024-12-21 01:17:23 +00:00
luukvbaal
e1c2179dd9 fix(coverity): INTEGER_OVERFLOW #31657
CID 516419:  Integer handling issues  (INTEGER_OVERFLOW)
    /src/nvim/message.c: 2242 in msg_puts_display()
    2236         }
    2237         // Concat pieces with the same highlight
    2238         size_t len = maxlen < 0 ? strlen(str) : strnlen(str, (size_t)maxlen);
    2239         ga_concat_len(&msg_ext_last_chunk, str, len);
    2240         msg_ext_cur_len += len;
    2241         // When message ends in newline, reset variables used to format message: msg_advance().
    >>>     CID 516419:  Integer handling issues  (INTEGER_OVERFLOW)
    >>>     Expression "len - 1UL", which is equal to 18446744073709551615, where "len" is known to be equal to 0, underflows the type that receives it, an unsigned integer 64 bits wide.
    2242         if (str[len - 1] == '\n') {
    2243           msg_ext_cur_len = 0;
    2244           msg_col = 0;
    2245         }
    2246         return;
    2247       }
2024-12-20 07:48:40 -08:00
Tomasz N
909b18d05a fix(messages): no message kind for completion menu messages #31646 2024-12-20 04:41:57 -08:00
Dan Pascu
4e130c1ee4 fix(vim.system): invalid MAX_TIMEOUT for 32-bit systems #31638
The maximum signed value on 32-bit systems is 2 ^ 31 - 1. When using 2 ^ 31 for
the default timeout, the value would overflow on such systems resulting in
a negative value, which caused a stack trace when calling wait() without
a timeout.
2024-12-20 01:43:56 -08:00
zeertzjq
39781be14b vim-patch:c363ca1: runtime(netrw): change indent size from 1 to 2 (#31648)
closes: vim/vim#16248

c363ca1ecd

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2024-12-20 11:33:05 +08:00
zeertzjq
889f9a0c5d vim-patch:9.1.0948: Missing cmdline completion for :pbuffer (#31645)
Problem:  Missing cmdline completion for :pbuffer.
Solution: Add cmdline completion for :pbuffer like :buffer.
          (zeertzjq)

fixes: vim/vim#16250
closes: vim/vim#16251

3baf19a2b1
2024-12-20 08:04:46 +08:00
Justin M. Keyes
8ef41f5902 feat(jobs): jobstart(…,{term=true}), deprecate termopen() #31343
Problem:
`termopen` has long been a superficial wrapper around `jobstart`, and
has no real purpose. Also, `vim.system` and `nvim_open_term` presumably
will replace all features of `jobstart` and `termopen`, so centralizing
the logic will help with that.

Solution:
- Introduce `eval/deprecated.c`, where all deprecated eval funcs will live.
- Introduce "term" flag of `jobstart`.
- Deprecate `termopen`.
2024-12-19 07:07:04 -08:00
luukvbaal
a5a4149e97 docs(api): specify when decor provider on_buf is called #31634 2024-12-19 07:04:33 -08:00
luukvbaal
31d6885deb fix(messages): better formatting for :highlight with ext_messages #31627
Also avoid going down message callstack with empty message, and remove expected grid for some tests where it did not change, and we are just testing for expected messages.
2024-12-19 06:24:48 -08:00
zeertzjq
02bc40c194 vim-patch:9.1.0945: ComplMatchIns highlight doesn't end after inserted text (#31628)
Problem:  ComplMatchIns highlight doesn't end after inserted text.
Solution: Handle ComplMatchIns highlight more like search highlight.
          Fix off-by-one error. Handle deleting text properly.
          (zeertzjq)

closes: vim/vim#16244

f25d8f9312
2024-12-18 23:59:03 +00:00
luukvbaal
160cbd0ef4 test(cursor_spec): global highlight definitions (#31613) 2024-12-18 19:06:16 +00:00
Gregory Anders
3db3947b0e fix(terminal): restore cursor from 'guicursor' on TermLeave (#31620)
Fixes: https://github.com/neovim/neovim/issues/31612
2024-12-18 11:41:05 -06:00
Lewis Russell
7121983c45 refactor(man.lua): various changes
- Replace all uses of vim.regex with simpler Lua patterns.
- Replace all uses of vim.fn.substitute with string.gsub.
- Rework error handling so expected errors are passed back via a return.
  - These get routed up an passed to `vim.notify()`
  - Any other errors will cause a stack trace.
- Reworked the module initialization of `localfile_arg`
- Updated all type annotations.
- Refactored CLI completion by introduction a parse_cmdline()
  function.
- Simplified `show_toc()`
- Refactor highlighting
- Inline some functions
- Fix completion on MacOS 13 and earlier.
  - Prefer `manpath -q` over `man -w`
- Make completion more efficient by avoiding vim.fn.sort and vim.fn.uniq
  - Reimplement using a single loop
2024-12-18 14:40:36 +00:00
phanium
888a803755 fix(lsp): vim.lsp.start fails if existing client has no workspace_folders #31608
Problem:
regression since https://github.com/neovim/neovim/pull/31340

`nvim -l repro.lua`:
```lua
vim.lsp.start { cmd = { 'lua-language-server' }, name = 'lua_ls' }
vim.lsp.start { cmd = { 'lua-language-server' }, name = 'lua_ls', root_dir = 'foo' }

-- swapped case will be ok:
-- vim.lsp.start { cmd = { 'lua-language-server' }, name = 'lua_ls', root_dir = 'foo' }
-- vim.lsp.start { cmd = { 'lua-language-server' }, name = 'lua_ls' }
```

Failure:
```
E5113: Error while calling lua chunk: /…/lua/vim/lsp.lua:214: bad argument #1 to
'ipairs' (table expected, got nil)
stack traceback:
        [C]: in function 'ipairs'
        /…/lua/vim/lsp.lua:214: in function 'reuse_client'
        /…/lua/vim/lsp.lua:629: in function 'start'
        repro.lua:34: in main chunk
```
2024-12-18 06:37:12 -08:00
Peter Lithammer
07d5dc8938 feat(lsp): show server version in :checkhealth #31611
Problem:
Language server version information missing from `:checkhealth vim.lsp`.

Solution:
Store `InitializeResult.serverInfo.version` from the `initialize`
response and display for each client in `:checkhealth vim.lsp`.
2024-12-18 06:31:25 -08:00
Justin M. Keyes
f9eb68f340 fix(coverity): error handling CHECKED_RETURN #31618
CID 516406:  Error handling issues  (CHECKED_RETURN)
    /src/nvim/api/vimscript.c: 284 in nvim_call_dict_function()
    278       Object rv = OBJECT_INIT;
    279
    280       typval_T rettv;
    281       bool mustfree = false;
    282       switch (dict.type) {
    283       case kObjectTypeString:
    >>>     CID 516406:  Error handling issues  (CHECKED_RETURN)
    >>>     Calling "eval0" without checking return value (as is done elsewhere 10 out of 12 times).
    284         TRY_WRAP(err, {
    285           eval0(dict.data.string.data, &rettv, NULL, &EVALARG_EVALUATE);
    286           clear_evalarg(&EVALARG_EVALUATE, NULL);
    287         });
    288         if (ERROR_SET(err)) {
    289           return rv;
2024-12-18 06:05:37 -08:00
zeertzjq
738320188f test(old): fix incorrect comment in test_preview.vim (#31619) 2024-12-18 10:21:52 +08:00
zeertzjq
38f554e9c4 vim-patch:a977883: runtime(doc): Fix style in fold.txt (#31617)
closes: vim/vim#16236

a977883ef3

Co-authored-by: h-east <h.east.727@gmail.com>
2024-12-18 09:12:04 +08:00
zeertzjq
f7c42433c5 vim-patch:9.1.0940: Wrong cursor shape with "gq" and 'indentexpr' executes :normal (#31616)
Problem:  Wrong cursor shape with "gq" and 'indentexpr' executes :normal
Solution: Update cursor and mouse shape after restoring old_State.
          (zeertzjq)

closes: vim/vim#16241

Solution: Update cursor and mouse shape after restoring old_State.

6c3027744e
2024-12-18 09:04:32 +08:00
zeertzjq
51c380238c Merge pull request #31615 from zeertzjq/vim-9.1.0936
vim-patch:9.1.{0936,0941,0942}: ComplMatchIns highlight
2024-12-18 08:40:23 +08:00
zeertzjq
b7da54aa9e vim-patch:9.1.0942: a few typos were found
Problem:  a few typos were found
Solution: fix them (zeertzjq)

closes: vim/vim#16232

d32bf0a067
2024-12-18 08:15:31 +08:00
zeertzjq
2f7b385f2e vim-patch:9.1.0941: ComplMatchIns doesn't work after multibyte chars
Problem:  ComplMatchIns doesn't work after multibyte chars
          (after v9.1.0936)
Solution: Use (ptr - line) instead of wlv.col (zeertzjq).

closes: vim/vim#16233

f4ccada5c3
2024-12-18 08:15:31 +08:00
zeertzjq
c830901e8c vim-patch:9.1.0936: cannot highlight completed text
Problem:  cannot highlight completed text
Solution: (optionally) highlight auto-completed text using the
          ComplMatchIns highlight group (glepnir)

closes: vim/vim#16173

6a38aff218

Co-authored-by: glepnir <glephunter@gmail.com>
2024-12-18 08:15:31 +08:00
Gregory Anders
0dd933265f feat(terminal)!: cursor shape and blink (#31562)
When a terminal application running inside the terminal emulator sets
the cursor shape or blink status of the cursor, update the cursor in the
parent terminal to match.

This removes the "virtual cursor" that has been in use by the terminal
emulator since the beginning. The original rationale for using the
virtual cursor was to avoid having to support additional UI methods to
change the cursor color for other (non-TUI) UIs, instead relying on the
TermCursor and TermCursorNC highlight groups.

The TermCursor highlight group is now used in the default 'guicursor'
value, which has a new entry for Terminal mode. However, the
TermCursorNC highlight group is no longer supported: since terminal
windows now use the real cursor, when the window is not focused there is
no cursor displayed in the window at all, so there is nothing to
highlight. Users can still use the StatusLineTermNC highlight group to
differentiate non-focused terminal windows.

BREAKING CHANGE: The TermCursorNC highlight group is no longer supported.
2024-12-17 07:11:41 -06:00
Shougo
df367cf91c test: unreliable test "messages &messagesopt wait" #31548 2024-12-17 04:19:55 -08:00
luukvbaal
6bf2a6fc5b refactor(api): always use TRY_WRAP #31600
Problem:  Two separate try/end wrappers, that only marginally differ by
          restoring a few variables. Wrappers that don't restore
          previous state are dangerous to use in "api-fast" functions.
Solution: Remove wrappers that don't restore the previous state.
          Always use TRY_WRAP.
2024-12-17 04:12:22 -08:00
zeertzjq
b03e790cdd vim-patch:9.1.0934: hard to view an existing buffer in the preview window (#31605)
Problem:  hard to view an existing buffer in the preview window
Solution: add the :pbuffer command (Yinzuo Jiang)

Similar as `:pedit` and `:buffer` command. `:pbuffer` edits buffer [N]
from the buffer list in the preview window.

`:pbuffer` can also open special buffer, for example terminal buffer.

closes: vim/vim#16222

a2a2fe841e

Cherry-pick Test_popup_and_previewwindow_dump() changes from patch
9.0.0625.
Cherry-pick Run_noroom_for_newwindow_test() changes from patches
8.2.0432 and 9.0.0363.

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-12-17 03:34:30 +00:00
zeertzjq
15153c4cd5 vim-patch:9.1.0938: exclusive selection not respected when re-selecting block mode (#31603)
Problem:  exclusive selection not respected when re-selecting block mode
          (Matt Ellis)
Solution: advance selection by another character when using
          selection=exclusive and visual block mode

fixes: vim/vim#16202
closes: vim/vim#16219

bb95589473

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-12-17 09:03:26 +08:00
zeertzjq
137308a3c9 Merge pull request #31602 from zeertzjq/vim-0a4e57f
vim-patch: doc updates
2024-12-17 09:01:59 +08:00
zeertzjq
7d082d4816 vim-patch:3920bb4: runtime(doc): document how to minimize fold computation costs
closes: vim/vim#16224

3920bb4356

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-12-17 08:27:44 +08:00
zeertzjq
59f38ef3c4 vim-patch:0a4e57f: runtime(doc): fix a few minor errors from the last doc updates
1) move the section at :h inclusive-motion-selection-exclusive a few
lines below, so that it doesn't live in between the 2 exceptions.

2) remove the tag :h :!-range. It's not accurate (because it is actually
a filter) and this command is already described at :h :range!

0a4e57f44a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-12-17 08:21:31 +08:00
zeertzjq
98e3610316 vim-patch:41d6de2: runtime(doc): update the change.txt help file
41d6de2974

Co-authored-by: Antonio Giovanni Colombo <azc100@gmail.com>
2024-12-17 08:20:18 +08:00
Justin M. Keyes
022449b522 fix(api): generic error messages, not using TRY_WRAP #31596
Problem:
- API functions using `try_start` directly, do not surface the
  underlying error message, and instead show generic messages.
- Error-handling code is duplicated in the API impl.
- Failure modes are not tested.

Solution:
- Use `TRY_WRAP`.
- Add tests.
2024-12-16 08:34:16 -08:00
Christian Clason
fb8372adb3 build(deps): bump luajit to HEAD - f73e649a9 2024-12-16 17:08:52 +01:00
Lewis Russell
47f2769b46 fix(Man): completion on Mac
Problem:
`man -w` does not work on recent versions of MacOs.

Solution:
Make it so an empty result is interpreted as an error unless silent=true
2024-12-16 16:05:08 +00:00
dundargoc
b5c0290803 ci(build.yml): disable security restriction
A new security restriction in Ubuntu 24.04 prevents users from using
`unshare`, so we need to disable it in order for the test to work
properly.
2024-12-16 16:26:19 +01:00
Juan Cruz De La Torre
6c975515c5 fix(diagnostic): vim.diagnostic.setqflist() opens loclist on first call #31585
Problem:
Regression from de794f2d24: `vim.diagnostic.setqflist{open=true}` attempts to
open the location list instead of the diagnostics quickfix list if it didn't
exist before. This is because we are using `qf_id` to decide which to open, but
`qf_id=nil` when there is no existing diagnostics quickfix list with a given
title ("Diagnostics" by default).

Solution:
- Revert to using `loclist` to decide which to open.
- Add tests.
2024-12-16 06:38:57 -08:00
bfredl
798f928479 Merge pull request #31539 from bfredl/wininfo
refactor(wininfo): change wininfo from a linked list to an array
2024-12-16 13:24:09 +01:00
Justin M. Keyes
167a2383b9 fix(api): not using TRY_WRAP, generic error messages #31595
Problem:
- API functions using `try_start` directly instead of `TRY_WRAP`, do not
  surface the underlying error message, and instead show generic things
  like "Failed to set buffer".
- Error handling code is duplicated in the API impl, instead of
  delegating to the vim buffer/window handling logic.

Solution:
- Use `TRY_WRAP`.
2024-12-16 04:00:20 -08:00
bfredl
2d6f57b289 refactor(wininfo): change wininfo from a linked list to an array
"wininfo" is going to be my next victim. The main problem with wininfo
is that it is "all or nothing", i e either all state about a buffer in a
window is considered valid or none of it is. This needs to be fixed to
address some long running grievances.

For now this is just a warmup: refactor it from a linked list to a
vector.
2024-12-16 12:46:59 +01:00
Tomasz N
9c6a3703bb fix(messages): no message kind for :undo messages #31590
Problem: cannot handle `:undo` and `:redo` messages in a special way,
e.g. replace one by another.

Solution: add `undo` kind.
2024-12-16 03:07:27 -08:00
phanium
01a97d2ad7 fix(api): nvim_win_set_buf(0, 0) fails if 'winfixbuf' is set #31576
## Problem
With 'winfixbuf' enabled, `nvim_win_set_buf` and `nvim_set_current_buf` fail
even if targeting the already-current buffer.

    vim.wo.winfixbuf = true
    vim.api.nvim_win_set_buf(0, 0)
    vim.api.nvim_set_current_buf(0)

Solution:
Check for this condition.
2024-12-16 00:59:24 -08:00
Christian Clason
cc38630d39 vim-patch:9.1.0929: filetype: lalrpop files are not recognized
Problem:  filetype: lalrpop files are not recognized
Solution: detect '*.lalrpop' files as lalrpop filetype
          (David Thievon)

References:
https://github.com/lalrpop/lalrpop

closes: vim/vim#16223

5a2e0cf5f1

Co-authored-by: David Thievon <pdkfan@gmail.com>
2024-12-16 00:19:16 +01:00
Christian Clason
6c2c77b128 vim-patch:9.1.0926: filetype: Pixi lock files are not recognized
Problem:  filetype: Pixi lock files are not recognized
Solution: detect "pixi.lock" file as yaml filetype
          (Brandon Maier)

Reference:
https://pixi.sh/latest/features/lockfile/

closes: vim/vim#16212

7d1bb90dcf

Co-authored-by: Brandon Maier <brandon.maier@gmail.com>
2024-12-15 12:42:27 +01:00
Christian Clason
820984daea build(deps): bump tree-sitter to v0.24.5 2024-12-15 12:35:11 +01:00
zeertzjq
852b6a6bce vim-patch:9.1.0927: style issues in insexpand.c (#31581)
Problem:  style issues in insexpand.c
Solution: add braces, use ternary operator to improve style
          (glepnir)

closes: vim/vim#16210

6e19993991

vim-patch:9.1.0922: wrong MIN macro in popupmenu.c
vim-patch:9.1.0923: too many strlen() calls in filepath.c
vim-patch:9.1.0924: patch 9.1.0923 causes issues

Co-authored-by: glepnir <glephunter@gmail.com>
2024-12-15 08:19:18 +08:00
zeertzjq
805b84c619 Merge pull request #31580 from zeertzjq/vim-ed89206
vim-patch: doc updates
2024-12-15 08:16:03 +08:00
zeertzjq
3406b00911 vim-patch:fbe9a69: runtime(doc): Add a reference to |++opt| and |+cmd| at :h :pedit
closes: vim/vim#16217

fbe9a6903a

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-12-15 07:10:12 +08:00
zeertzjq
caa93b5e1e vim-patch:ed89206: runtime(doc): add a note about inclusive motions and exclusive selection
related: vim/vim#16202

ed89206efe

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-12-15 07:09:39 +08:00
luukvbaal
433b342baa feat(ui): sign/statuscolumn can combine highlight attrs #31575
Problem:
Since e049c6e4c0, most statusline-like UI elements can combine
highlight attrs, except for sign/statuscolumn.

Solution:
Implement for sign/statuscolumn.
2024-12-14 10:21:50 -08:00
Colin Kennedy
f9dd682621 docs(annotations): added ---@generic support 2024-12-13 17:05:38 +00:00
Justin M. Keyes
65b1733405 Revert "fix(Man.lua): trigger completion even without arguments" #31572
This reverts commit 7940ec6913.
2024-12-13 06:46:40 -08:00
Lewis Russell
9c20342297 fix(lsp): reuse client if configs match and no root dir
Problem:
An LSP configuration that creates client with no root_dir or
workspace_folders can result in vim.lsp.enable attaching to it multiple
times.

Solution:
When checking existing clients, reuse a client if it wasn't initially
configured have any workspace_folders. This more closely matches the
behaviour we had prior to d9235ef
2024-12-13 14:36:24 +00:00
Luca Saccarola
7940ec6913 fix(man.lua): :Man <tab> does not complete #31569
closes: #31512
2024-12-13 06:26:20 -08:00
zeertzjq
c0ae39ee53 Merge pull request #31566 from zeertzjq/vim-9.1.0921
vim-patch:9.1.{0921,0922}
2024-12-13 21:58:18 +08:00
zeertzjq
1386d36e76 vim-patch:9.1.092: vim-patch:9.1.0923: wrong MIN macro in popupmenu.c
Problem:  wrong MIN macro in popupmenu.c (after v9.1.0921)
          (zeertzjq)
Solution: change it to MAX()

618c4d36ca

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: glepnir <glephunter@gmail.com>
2024-12-13 21:33:26 +08:00
zeertzjq
8a0b203875 vim-patch:9.1.0921: popupmenu logic is a bit convoluted
Problem:  popupmenu logic is a bit convoluted
Solution: slightly refactor logic and use MIN/MAX() macros to simplify
          (glepnir)

Define the MAX/MIN macros. Since we support some older platforms, C
compilers may not be as smart. This helps reduce unnecessary if
statements and redundant ternary expressions. Pre-calculate some
expressions by defining variables. Remove unnecessary parentheses.
Adjust certain lines to avoid exceeding 80 columns.

closes: vim/vim#16205

c942f84aad

Co-authored-by: glepnir <glephunter@gmail.com>
2024-12-13 20:01:26 +08:00
Christian Clason
3e3a984300 vim-patch:5c42c77: runtime(netrw): do not pollute search history with symlinks
fixes: vim/vim#16206

5c42c77315

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-12-13 09:38:19 +01:00
Christian Clason
2e73ba102a vim-patch:9.1.0919: filetype: some assembler files are not recognized
Problem:  filetype: some assembler are files not recognized
Solution: detect '*.nasm' files as nasm filetype and '*.masm' as masm
          filetype (Wu, Zhenyu)

closes: vim/vim#16194

d66d68763d

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-12-13 09:38:08 +01:00
glepnir
17383870dd fix(float): re-sort layers when grid zindex changed #30259
Problem: when zindex is changed in vim.schedule the zindex sort in
layers not changed.

Solution: resort layers when zindex changed.
2024-12-12 02:45:57 -08:00
Jeremy Fleischman
de794f2d24 fix(diagnostic): broken variable reference #31557 2024-12-12 02:41:57 -08:00
Lewis Russell
130f4344cf refactor(lsp/rpc): move transport logic to separate module 2024-12-12 09:52:08 +00:00
Jeremy Fleischman
5eda7aafe9 fix(diagnostic): setqflist() is stuck after vim.lsp.buf.document_symbol #31553
Previously, when updating the quickfix diagnostics list, we'd update it,
and then open the quickfix buffer, but there was no guarantee that the
quickfix buffer would be displaying the quickfix diagnostics list (it
could very possibly be displaying some other quickfix list!).

This fixes things so we first select the quickfix list before opening the
quickfix buffer. If `open` is not specified, the behavior is the same as
before: we update the diagnostics quickfix list, but do not navigate to
it.

fixes https://github.com/neovim/neovim/issues/31540
2024-12-11 17:32:07 -08:00
Jeremy Fleischman
21961967ff feat(diagnostic): update quickfix list by title #31486
Previously, there was a singleton diagnostics quickfix list. Now there's
effectively one per title (up to vim's internal limit on quickfix
lists).

Suggested by mfussenegger https://github.com/neovim/neovim/pull/30868#pullrequestreview-2385761374.
2024-12-11 17:29:54 -08:00
Jonny Kong
442d338cb5 fix(uri): uri_encode encodes brackets incorrectly for RFC2732 #31284
**Problem:**
The brackets in the RFC2732 regular expression are currently unescaped,
causing them to be misinterpreted as special characters denoting
character groups rather than as literal characters.

**Solution:**
Escape the brackets.
Fix #31270
2024-12-11 05:48:17 -08:00
glepnir
ff1791c9e5 fix(float): close preview float window when no selected #29745
Problem: Float preview window still exist when back at original.
Or no info item is selected.

Solution: if selected is -1 or no info is selected, if float preview
window exist close it first.
2024-12-11 05:20:10 -08:00
Riley Bruins
3dfb9e6f60 feat(treesitter): include capture id in return value of get_captures_at_pos() #30559
**Problem:** Currently, it is difficult to get node(s)-level metadata
for a capture returned by `get_captures_at_pos()`. This is because it is
stored in `metadata[id]` and we do not have access to the value of `id`,
so to get this value we have to iterate over the keys of `metadata`. See
[this commit](d636229300 (diff-8bd4742121c2f359d0345f3c6c253a58220f1a28670cc4e1c957992232059a6cR16)).

Things would be much simpler if we were given the `id` of the capture so
we could use it to just index `metadata` directly.

**Solution:** Include `id` in the data returned by
`get_captures_at_pos()`
2024-12-11 04:34:24 -08:00
Colin Kennedy
492ae57aa6 docs(annotation): return types for Vimscript functions #31546 2024-12-11 03:27:08 -08:00
Lewis Russell
3f1d09bc94 feat(lsp): add vim.lsp.config and vim.lsp.enable
Design goals/requirements:
- Default configuration of a server can be distributed across multiple sources.
  - And via RTP discovery.
- Default configuration can be specified for all servers.
- Configuration _can_ be project specific.

Solution:

- Two new API's:
  - `vim.lsp.config(name, cfg)`:
    - Used to define default configurations for servers of name.
    - Can be used like a table or called as a function.
    - Use `vim.lsp.confg('*', cfg)` to specify default config for all
      servers.
  - `vim.lsp.enable(name)`
    - Used to enable servers of name. Uses configuration defined
    via `vim.lsp.config()`.
2024-12-10 17:16:01 +00:00
Tomasz N
ca760e645b fix(messages): no message kind for :write messages #31519
- Problem: cannot replace the initial bufwrite message (from `filemess`) by the final one (`"test.lua" [New] 0L, 0B written`), when using `vim.ui_attach`.
- Solution: add kind to both messages.
2024-12-10 02:39:41 -08:00
bfredl
c87ca1e2eb Merge pull request #30869 from vanaigr/decor_long_lines_perf
perf(decor): improve performance for long lines
2024-12-10 10:26:03 +01:00
Christian Clason
4182e98752 vim-patch:b66cac1: runtime(typst): add definition lists to formatlistpat, update maintainer
closes: vim/vim#16192

b66cac1a8e

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2024-12-10 08:06:35 +01:00
Christian Clason
c3899419d4 vim-patch:ad4764f: runtime(proto): include filetype plugin for protobuf
closes: vim/vim#16199

ad4764f65b

Co-authored-by: David Pedersen <limero@me.com>
2024-12-10 08:06:35 +01:00
zeertzjq
d1fd674df3 fix(ui): update title in more cases (#31508) 2024-12-10 14:53:02 +08:00
zeertzjq
98694c3675 Merge pull request #31534 from zeertzjq/vim-9.0.2112
vim-patch: line shifting fixes
2024-12-10 14:50:27 +08:00
zeertzjq
e4bb185441 vim-patch:9.1.0917: various vartabstop and shiftround bugs when shifting lines
Problem:  various vartabstop and shiftround bugs when shifting lines
Solution: Fix the bugs, add new tests for shifting lines in various ways
          (Gary Johnson)

fixes: vim/vim#14891
closes: vim/vim#16193

eed63f96d2

Co-authored-by: Gary Johnson <garyjohn@spocom.com>
2024-12-10 14:29:24 +08:00
zeertzjq
6c81c16e1b vim-patch:9.0.2124: INT overflow detection logic can be simplified
Problem:  INT overflow logic can be simplified
Solution: introduce trim_to_int() function

closes: vim/vim#13556

2b0882fa65

vim-patch:9.0.2138: Overflow logic requires long long

Problem:  Overflow logic requires long long
Solution: Define vimlong_T data type to make life easier
          for porters

closes: vim/vim#13598

fda700cb04

Cherry-pick ops.c change from patch 9.1.0608.

Co-authored-by: Ernie Rael <errael@raelity.com>
2024-12-10 14:29:24 +08:00
zeertzjq
7a7ed0c8ac vim-patch:9.0.2122: [security]: prevent overflow in indenting
Problem:  [security]: prevent overflow in indenting
Solution: use long long and remove cast to (int)

The shiftwidth option values are defined as being long. However, when
calculating the actual amount of indent, we cast down to (int), which
may cause the shiftwidth value to become negative and later it may even
cause Vim to try to allocate a huge amount of memory.

We already use long and long long variable types to calculate the indent
(and detect possible overflows), so the cast to (int) seems superfluous
and can be safely removed. So let's just remove the (int) cast and
calculate the indent using longs.

Additionally, the 'shiftwidth' option value is also used when determining
the actual 'cino' options. There it can again cause another overflow, so
make sure it is safe in parse_cino() as well.

fixes: vim/vim#13554
closes: vim/vim#13555

3770574e4a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-12-10 14:29:24 +08:00
zeertzjq
ac230370f3 vim-patch:9.0.2113: Coverity warns for another overflow in shift_line()
Problem:  Coverity warns for another overflow in shift_line()
Solution: Test for INT_MAX after the if condition, cast integer values
          to (long long) before multiplying.

22a97fc241

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-12-10 14:29:24 +08:00
zeertzjq
2336389d23 vim-patch:9.0.2112: [security]: overflow in shift_line
Problem:  [security]: overflow in shift_line
Solution: allow a max indent of INT_MAX

[security]: overflow in shift_line

When shifting lines in operator pending mode and using a very large
value, we may overflow the size of integer. Fix this by using a long
variable, testing if the result would be larger than INT_MAX and if so,
indent by INT_MAX value.

Special case: We cannot use long here, since on 32bit architectures (or
on Windows?), it typically cannot take larger values than a plain int,
so we have to use long long count, decide whether the resulting
multiplication of the shiftwidth value * amount is larger than INT_MAX
and if so, we will store INT_MAX as possible larges value in the long
long count variable.

Then we can safely cast it back to int when calling the functions to set
the indent (set_indent() or change_indent()). So this should be safe.

Add a test that when using a huge value in operator pending mode for
shifting, we will shift by INT_MAX

closes: vim/vim#13535

6bf131888a

Skip the test for now, as it takes too long and requires other fixes.

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-12-10 14:29:24 +08:00
luukvbaal
4889935a7a docs(vvars): adjust lua types for vim.v variables #31510
- classes for v:event and v:completed_item
- add remaining unknown types
2024-12-09 16:27:39 -08:00
Eisuke Kawashima
1b90f4a9c4 build: mark CMake variables advanced #31412
The variables are not marked as advanced, thus they appear in e.g. `ccmake`.
2024-12-09 16:10:27 -08:00
Maria José Solano
3bb2d02759 docs: fix type of vim.validate value 2024-12-09 07:59:51 +00:00
zeertzjq
30726c778c Merge pull request #31523 from zeertzjq/vim-eda923e
vim-patch: netrw fixes
2024-12-09 09:35:11 +08:00
zeertzjq
3d318be8cd vim-patch:92b3666: runtime(netrw): only check first arg of netrw_browsex_viewer for being executable
fixes: vim/vim#16185

92b36663f8

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-12-09 08:08:44 +08:00
zeertzjq
d7b3add63e vim-patch:eda923e: runtime(netrw): do not detach when launching external programs in gvim
On Debian 12 when detaching the program wouldn't launch at all

closes: vim/vim#16168

eda923e9c9

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-12-09 08:07:06 +08:00
zeertzjq
84d9f4f9f9 vim-patch:9.1.0915: GVim: default font size a bit too small (#31516)
Problem:  GVim: default font size a bit too small
Solution: increase guifont size to 12 pt on GTK builds
          of gVim (matveyt).

fixes: vim/vim#16172
closes: vim/vim#16178

ad3b6a3340

Co-authored-by: matveyt <matthewtarasov@yandex.ru>
2024-12-08 20:29:25 +08:00
Lewis Russell
4bfdd1ee9d refactor(lsp): better tracking of requests
Not essential, but adds robustness and hardening for future
changes.
2024-12-08 10:10:29 +00:00
zeertzjq
ca4f688ad4 vim-patch:9.1.0913: no error check for neg values for 'messagesopt' (#31511)
Problem:  no error check for neg values for 'messagesopt'
          (after v9.1.0908)
Solution: add additional error checks and tests (h-east)

closes: vim/vim#16187

65be834c30

Nvim's getdigits() checks for overflow, so the code change isn't needed.

Co-authored-by: h-east <h.east.727@gmail.com>
2024-12-08 17:53:01 +08:00
zeertzjq
fe1e2eff06 fix(lua): avoid vim._with() double-free with cmdmod (#31505) 2024-12-08 09:25:43 +08:00
brianhuster
7008487b83 vim-patch:336fb22: translation(vi): Update Vietnamese translation
closes: vim/vim#16144

336fb22eae
2024-12-08 08:46:33 +08:00
zeertzjq
bf7e534c88 vim-patch:41afa30: runtime(doc): Add vietnamese.txt to helps main TOC
closes: vim/vim#16177

41afa308d6

Co-authored-by: h-east <h.east.727@gmail.com>
2024-12-08 08:46:33 +08:00
brianhuster
99a24d511f vim-patch:8a52587: runtime(doc): fix wrong syntax and style of vietnamese.txt
8a52587ee0

vim-patch:72212c9: runtime(doc): update wrong Vietnamese localization tag

72212c9bea

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-12-08 08:46:33 +08:00
brianhuster
5549115bee vim-patch:189e24b: runtime(doc): include vietnamese.txt
Since Vietnamese keymaps in Vim is quite differences from the
corresponding input methods, let's document the Vietnamese specifics in
vietnames.txt

related: vim/vim#16144

189e24bb14
2024-12-08 08:46:33 +08:00
zeertzjq
4fcc5cd34a Merge pull request #31504 from zeertzjq/vim-9.1.0910
vim-patch:9.1.{0910,0911}: 'messagesopt' followup
2024-12-08 07:35:58 +08:00
zeertzjq
96329910b0 vim-patch:9.1.0911: Variable name for 'messagesopt' doesn't match short name
Problem:  Variable name for 'messagesopt' doesn't match short name
          (after v9.1.0908)
Solution: Change p_meo to p_mopt.  Add more details to docs.

closes: vim/vim#16182

8cc43daee1
2024-12-08 07:06:16 +08:00
zeertzjq
f3fa6507f2 vim-patch:9.1.0910: 'messagesopt' does not check max wait time
Problem:  'messagesopt' does not check max wait time
          (after v9.1.0908)
Solution: Check for max wait value
          (Shougo Matsushita)

closes: vim/vim#16183

d9e9f89e0f

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2024-12-08 07:01:50 +08:00
Lewis Russell
668d2569b4 refactor: add vim._resolve_bufnr 2024-12-07 16:58:40 +00:00
Christian Clason
b52ffd0a59 fix(inspect): always show priority
Problem: It is not obvious if a treesitter highlight priority shown in
`:Inspect` is higher or lower than the default.

Solution: Also print default priority (`vim.hl.priorities.treesitter`).
Add padding for better readability.
2024-12-07 17:26:27 +01:00
zeertzjq
4817547ec4 feat(ex_cmds): :sleep! hides the cursor while sleeping (#31493)
Problem:  :sleep! not hiding the cursor is an arbitrary difference from
          Vim without obvious justification, and Vim's behavior isn't
          easily achievable in Nvim.
Solution: Make :sleep! hide the cursor while sleeping.

Ref:
6a01b3fcc3
b5c0ade437
2024-12-07 21:42:44 +08:00
bfredl
92e61072ac Merge pull request #31475 from luukvbaal/delgravity
fix(marks): check gravity at range bounds when deleting text
2024-12-07 12:06:58 +01:00
Riley Bruins
c63e49cce2 fix(treesitter): #trim! range for nodes ending at col 0 #31488
Problem:
char-wise folding for `#trim!` ranges are improperly calculated for nodes that
end at column 0, due to the way `get_node_text` works.

Solution:
Add the blank line that `get_node_text` removes for for nodes ending at column
0. Also properly set column positions when performing linewise trims.
2024-12-07 03:01:59 -08:00
Lewis Russell
5c245ec3e9 fix: remove vim.lsp._with_extend
Not used anywhere.
2024-12-07 10:08:58 +00:00
tris203
bdfba8598b fix(lsp): cancel pending requests before refreshing
Problem:
Diagnostics and inlay hints can be expensive to calculate, and we
shouldn't stack them as this can cause noticeable lag.

Solution:
Check for duplicate inflight requests and cancel them before issuing a new one.
This ensures that only the latest request is processed, improving
performance and preventing potential conflicts.
2024-12-07 10:08:33 +00:00
Maria José Solano
c2bf09ddff fix(lsp): check for configuration workspace folders when reusing clients 2024-12-07 09:43:45 +00:00
Christian Clason
9c278af7cc fix(inspect): show priority for treesitter highlights
Problem: `:Inspect` does not show priority for treesitter highlights,
leading to confusion why sometimes earlier highlights override later
highlights.

Solution: Also print priority metadata if set.
2024-12-07 10:26:24 +01:00
zeertzjq
ec94c2704f vim-patch:9.1.0908: not possible to configure :messages (#31492)
Problem:  not possible to configure :messages
Solution: add the 'messagesopt' option (Shougo Matsushita)

closes: vim/vim#16068

51d4d84d6a

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Co-authored-by: h_east <h.east.727@gmail.com>
2024-12-07 02:17:36 +00:00
Bartłomiej Maryńczak
517ecb85f5 feat(stdlib): vim.json.encode(...,{escape_slash:boolean}) #30561
Problem:
vim.json.encode escapes every slash in string values (for example in
file paths), and is not optional. Use-case is for preventing HTML
injections (eg. injecting `</script>` closing tag); in the context of
Nvim this is rarely useful.

Solution:
- Add a `escape_slash` flag to `vim.json.encode`.
- Defaults to `false`. (This is a "breaking" change, but more like
  a bug fix.)
2024-12-06 12:43:41 -08:00
Tristan Knight
fac96b72a5 fix(lsp): add foldingrange method support check #31463
Problem: The folding_range request method assumes that the client
supports the method

Solution: Add a capability guard to the call
2024-12-06 10:09:07 -08:00
Gregory Anders
2550b5e9bd docs: do not escape Lua keywords #31467 2024-12-06 10:08:46 -08:00
Justin M. Keyes
ba7370a902 Merge #30085 #trim! all whitespace 2024-12-06 10:08:20 -08:00
Riley Bruins
f0ea38a4bc test(treesitter): add a simple testutil file
The util file, for now, just abstracts the common `run_query` function.
2024-12-06 08:36:28 -08:00
Riley Bruins
b8c75a31e6 feat(treesitter): #trim! can trim all whitespace
This commit also implements more generic trimming, acting on all
whitespace (charwise) rather than just empty lines.

It will unblock
https://github.com/nvim-treesitter/nvim-treesitter/pull/3442 and allow
for properly concealing markdown bullet markers regardless of indent
width, e.g.
2024-12-06 08:36:08 -08:00
Micah Halter
e8e3b443f8 feat(defaults): disable 'foldcolumn' in terminal buffers (#31480) 2024-12-06 10:19:24 -06:00
zeertzjq
1077843b9b fix(filetype): make filetype detection work with :doautocmd (#31470) 2024-12-06 20:57:21 +08:00
Brian A. Weston
367182abd5 docs: delineate blocks/list items #30973
Problem: Paragraph below bulleted list was joined to last list item instead of dropping below as expected. Same with "Notes:" paragraph below it.

Solution: Added necessary newlines.
2024-12-06 04:48:50 -08:00
luukvbaal
e788d1a3a9 fix(completion): avoid deleting text when completion leader changes #31448
Problem:  When completion leader changes, text that might be reinserted
          immediately after is deleted. This unnecessarily affects
          extmarks. #31387 restored the original extmarks but that
          prevents end_right_gravity marks from growing.
Solution: Avoid deleting leader text that will be reinserted.
2024-12-06 04:07:52 -08:00
zeertzjq
e9f4ceeb74 fix(events): don't expand args.file for Lua callback (#31473)
Problem:  In an autocommand Lua callback whether `args.file` is expanded
          depends on whether `expand('<afile>')` has been called.
Solution: Always use the unexpanded file name for `args.file`.

Related to #31306 and vim/vim#16106. This doesn't provide `sfname`, but
at least makes `args.file` have a consistent value.
2024-12-06 20:01:28 +08:00
Luuk van Baal
c4f76299f0 fix(marks): skip right_gravity marks when deleting text
Problem:  Marks that are properly restored by the splice associated with
          an undo edit, are unnecessarily pushed to the undo header. This
          results in incorrect mark tracking in the "copy_only"
          save/restore completion path.
Solution: Avoid pushing left gravity marks at the beginning of the range,
          and right gravity marks at the end of the range to the undo
          header.
2024-12-06 11:57:07 +01:00
Christian Clason
812d029702 vim-patch:9.1.0906: filetype: Nvidia PTX files are not recognized
Problem:  filetype: Nvidia PTX files are not recognized
Solution: detect '*.ptx' files as ptx filetype (Yinzuo Jiang)

Reference: https://docs.nvidia.com/cuda/parallel-thread-execution/

closes: vim/vim#16171

bdb5f85a51

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-12-06 09:40:44 +01:00
zeertzjq
bf5c1346c5 vim-patch:ea0e41a: runtime(doc): make tag alignment more consistent in filetype.txt (#31459)
closes: vim/vim#16169

ea0e41a115

Omit Lua folding.

N/A patch:
vim-patch:fdfcce5: runtime(lua): add optional lua function folding
2024-12-06 07:22:44 +08:00
Jeremy Fleischman
fd902b1cb2 fix(diagnostic): only store quickfix id when creating a new one #31466
The old code would always update `_qf_id` with the current quickfix,
even if you're currently looking at a completely different,
non-diagnostics quickfix list. This completely defeats the intent of
<https://github.com/neovim/neovim/pull/30868>, whoops!
2024-12-05 13:59:33 -08:00
Justin M. Keyes
12901447cb docs: graduate intro.txt to "flow layout" #31462
- move credits and backers to credits.txt
2024-12-05 07:18:27 -08:00
vanaigr
fccef5ec35 refactor: comments, variable names 2024-12-05 08:45:22 -06:00
vanaigr
c57397f981 docs: add comments for DecorRangeSlot struct 2024-12-05 08:45:22 -06:00
vanaigr
3abd7ed4a4 perf: consider only active decorations when drawing lines 2024-12-05 08:45:22 -06:00
Justin M. Keyes
845e563421 Merge #31451 docs 2024-12-05 04:02:34 -08:00
zeertzjq
8323398bc6 fix(defaults): don't replace keycodes in Visual search mappings (#31460)
Also remove "silent" to be more consistent with Normal mode search.
2024-12-05 19:03:58 +08:00
glepnir
6a929b15c9 vim-patch:9.1.0903: potential overflow in spell_soundfold_wsal() (#31456)
Problem:  potential overflow in spell_soundfold_wsal()
Solution: Protect wres from buffer overflow, by checking the
          length (Zdenek Dohnal)

Error: OVERRUN (CWE-119):
vim91/src/spell.c:3819: cond_const: Checking "reslen < 254" implies that
"reslen" is 254 on the false branch.
vim91/src/spell.c:3833: incr: Incrementing "reslen". The value of "reslen"
is now 255.
vim91/src/spell.c:3792: overrun-local: Overrunning array "wres" of 254
4-byte elements at element index 254 (byte offset 1019) using index
"reslen - 1" (which evaluates to 254).
 3789|   		    {
 3790|   			// rule with '<' is used
 3791|-> 			if (reslen > 0 && ws != NULL && *ws != NUL
 3792|   				&& (wres[reslen - 1] == c
 3793|   						    || wres[reslen - 1] == *ws))

Error: OVERRUN (CWE-119):
vim91/src/spell.c:3819: cond_const: Checking "reslen < 254" implies that
"reslen" is 254 on the false branch.
vim91/src/spell.c:3833: overrun-local: Overrunning array "wres" of 254
4-byte elements at element index 254 (byte offset 1019) using index
"reslen++" (which evaluates to 254).
 3831|                         {
 3832|                             if (c != NUL)
 3833|->                               wres[reslen++] = c;
 3834|                             mch_memmove(word, word + i + 1,
 3835|                                        sizeof(int) * (wordlen -
(i + 1) + 1));

related: vim/vim#16163

39a94d2048

Co-authored-by: Zdenek Dohnal <zdohnal@redhat.com>
2024-12-05 09:51:58 +00:00
glepnir
2f5e7cbac4 vim-patch:9.1.0905: Missing information in CompleteDone event (#31455)
Problem:  Missing information in CompleteDone event
Solution: add complete_word and complete_type to v:event dict
          (glepnir)

closes: vim/vim#16153

1c5a120a70
2024-12-05 17:49:39 +08:00
zeertzjq
540def7d2c test(system_spec): check for .git dir before using git (#31458) 2024-12-05 09:13:22 +00:00
Justin M. Keyes
5413c6475e docs: graduate gui.txt to "flow layout" 2024-12-05 01:38:44 +01:00
Lewis Russell
8f84167c30 refactor(runtime.c): misc 2024-12-04 16:26:04 +00:00
Gregory Anders
0a15cd2500 misc: keep deprecated vim.loader.disable stub (#31450)
Transitional stub to minimize breaking change pain, to be removed after
0.11 release.
2024-12-04 10:17:46 -06:00
Gregory Anders
52481eecf0 docs: mention new terminal defaults (#31449) 2024-12-04 10:17:19 -06:00
Jeremy Fleischman
7579af3c51 feat(diagnostic): vim.diagnostic.setqflist improvements #30868
1. Use the new "u" action to update the quickfix list so we don't lose
   our position in the quickfix list when updating it.
2. Rather than creating a new quickfix list each time, update the
   exiting one if we've already created one.
2024-12-04 07:49:57 -08:00
Justin M. Keyes
6586645d78 docs: help tags for neovim.io searches 2024-12-04 16:34:44 +01:00
luukvbaal
e2a91876ac test(screen): adjust screen state per stylua #31441
Before:
screen:expect({        | screen:expect({
  grid = [[            |   grid = [[
    {10:>!}a        |  |     line ^1                   |
    {7:  }b        |   |     {1:~                        }|*4
    {10:>>}c        |  |   ]], messages={ {
    {7:  }^         |  |     content = { { "\ntest\n[O]k: ", 6, 11 } },
    {1:~          }|*9 |     kind = "confirm"
               |       |   } }
  ]]                   | })
})

After:
screen:expect([[         | screen:expect({
  {10:>!}a            |  |   grid = [[
  {7:  }b            |   |     line ^1                   |
  {10:>>}c            |  |     {1:~                        }|*4
  {7:  }^             |  |   ]],
  {1:~              }|*9 |   messages = { {
                 |       |     content = { { "\ntest\n[O]k: ", 6, 11 } },
]])                      |     kind = "confirm"
                         |   } },
                         | })
2024-12-04 07:31:08 -08:00
Justin M. Keyes
6551e30630 Merge #31358 fix test failures for release / tarball builds 2024-12-04 07:20:04 -08:00
Lewis Russell
734dba04d1 fix(vim.system): close pipe handles after process handle
Fixes #30846
2024-12-04 14:44:40 +00:00
Gregory Anders
56d11b494b defaults: disable 'number', 'relativenumber', and 'signcolumn' in terminal buffers (#31443) 2024-12-04 08:40:01 -06:00
luukvbaal
3cb1e825e6 fix(column): check if signcolumn changed in all windows #31439 2024-12-04 05:20:24 -08:00
Maria José Solano
e56437cd48 feat(lsp): deprecate vim.lsp.start_client #31341
Problem:
LSP module has multiple "start" interfaces.

Solution:
- Enhance vim.lsp.start
- Deprecate vim.lsp.start_client
2024-12-04 05:14:47 -08:00
zeertzjq
b079a9d2e7 vim-patch:9.1.0902: filetype: Conda configuration files are not recognized (#31445)
Problem:  filetype: Conda configuration files are not recognized
Solution: detect '.condarc' and 'condarc' files as yaml filetype.
          (zeertzjq)

closes: vim/vim#16162

876de275cb
2024-12-04 17:49:12 +08:00
Justin M. Keyes
ae93c7f369 docs: misc, help tags for neovim.io searches #31428
Problem:
Various keywords are commonly searched-for on https://neovim.io, but
don't have help tags.

Solution:
Add help tags.

fix #31327
2024-12-03 09:44:28 -08:00
wzy
2495e7e22a fix(clipboard): tmux clipboard depends on $TMUX #31268
Problem:
tmux clipboard not used when tmux is a daemon and $TMUX is empty.

Solution:
If `tmux list-buffers` succeeds, use tmux clipboard.
2024-12-03 05:06:54 -08:00
JD
0e299ebf75 fix(decorator): noisy errors from decoration provider #31418
Problem:
A broken decoration provider can cause endless errors. #27235

Solution:
Don't show decorator errors when they exceed `DP_MAX_ERROR`.
2024-12-03 03:41:37 -08:00
James McCoy
48bdbf12d0 test(marktree): expose test functions in release builds
In order to run the marktree unit test in release mode, the test functions need to be available even when NDEBUG is defined.

Keep the body of marktree_check a nop during release builds, which limits the usefulness of the testing, but at least lets the tests run.
2024-12-03 06:34:07 -05:00
James McCoy
c410375d4d ci: run tests directly rather than via the Makefile
Since the Makefile is not used to build, running the tests via the Makefile causes cmake to reconfigure and revert the release build back to debug.
2024-12-03 06:31:09 -05:00
James McCoy
9123bc0f3f test(main_spec): make "nvim -v" test agnostic to build type
In release builds, the Compilation: line is omitted so the build is reproducible. Since the "fall-back for $VIM" line is always present, check for that instead.
2024-12-03 06:31:09 -05:00
James McCoy
25bd2782a5 test(version_spec): expect vim.NIL, not nil, for "build" if not in a git clone 2024-12-03 06:31:09 -05:00
James McCoy
e5d96a69fd test(main_spec): use CMakePresets.json instead of .git for root marker 2024-12-03 06:31:09 -05:00
James McCoy
05dd41f3e9 ci(test): remove the .git directory for Linux
Tests should not rely on being run inside a git clone, so the Linux
builds cover this use case. The macOS builds will continue running with
the .git directory so there's still unix-ish coverage within a git
clone.
2024-12-03 06:31:09 -05:00
James McCoy
747e84a256 ci: run one set of tests with a release build
This ensures that no tests fail due to differences between release and debug builds.

The release build-type check is now unnecessary, too, so remove it.
2024-12-03 06:31:01 -05:00
James McCoy
588ca99e12 Merge pull request #31408 from jamessan/vterm-test-fixture
test(vterm): move test functions into vterm_test fixture
2024-12-03 04:30:42 -07:00
James McCoy
7a367c6967 test(vterm): move test functions into vterm_test fixture
In order to run unittests with a release build, we need the test
functions to be accessible when NDEBUG is defined. Moving the functions
into the test fixture ensures they are available and only available for
use by the unit tests.
2024-12-02 21:49:14 -05:00
zeertzjq
3d3a99e69c vim-patch:9.1.0900: Vim9: digraph_getlist() does not accept bool arg (#31431)
Problem:  Vim9: digraph_getlist() does not accept bool argument
          (Maxim Kim)
Solution: accept boolean as first argument (Yegappan Lakshmanan)

fixes: vim/vim#16154
closes: vim/vim#16159

198ada3d9f

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-12-03 00:32:23 +00:00
Gregory Anders
49d6cd1da8 docs: provide example for configuring LSP foldexpr (#31411)
Using the "supports_method" function with a client capability inside of
an LspAttach autocommand is the preferred method to do this, so we
should be showing users how to do it.
2024-12-02 12:13:09 -06:00
luukvbaal
c7ec010ade fix(extmark): builtin completion can still affect nearby extmarks #31387
Problem:
Built-in completion can still affect nearby extmarks. #31384

Solution:
Restore extmarks when completion leader changes.
2024-12-02 06:11:38 -08:00
luukvbaal
9d0117fd30 test(treesitter): global highlight definitions and fold test #31407
Add test for foldtext= highlighting. Change file to global highlight
definitions while at it.
2024-12-02 06:08:26 -08:00
Justin M. Keyes
716adbcc45 fix(api): deprecate nvim_subscribe, nvim_unsubscribe #30456
Problem:
- nvim_subscribe, nvim_unsubscribe were deprecated in
  aec4938a21 but this wasn't set in the
  API metadata.
- The function annotations
  ```
  FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY FUNC_API_DEPRECATED_SINCE(13)
  ```
  cause this test to fail:
   ```
   RUN T3 api metadata functions are compatible with old metadata or have new level: 3.00 ms ERR
   test/functional/api/version_spec.lua:135: function vim_subscribe was removed but exists in level 0 which nvim should be compatible with
   stack traceback:
     test/functional/api/version_spec.lua:135: in function <test/functional/api/version_spec.lua:128>
   ```

Solution:
- Set the API metadata.
- Rearrange the annotations so that FUNC_API_DEPRECATED_SINCE is 2nd:
  ```
  FUNC_API_SINCE(1) FUNC_API_DEPRECATED_SINCE(13) FUNC_API_REMOTE_ONLY
  ```
2024-12-02 04:16:44 -08:00
dundargoc
c1378413c1 vim-patch:768728b: runtime(doc): Update documentation for "noselect" in 'completeopt'
In particular, make the distinction and interaction between "noinsert"
and "noselect" clearer as it was very confusing before.

closes: vim/vim#16148

768728b487

Co-authored-by: dundargoc <gocdundar@gmail.com>
2024-12-02 08:23:10 +01:00
Christian Clason
36b714e9b7 vim-patch:9a39483: runtime(typst): provide a formatlistpat in ftplugin
closes: vim/vim#16134

9a39483adb

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2024-12-02 08:19:50 +01:00
zeertzjq
6cdcac4492 fix(ui): clamp 'cmdheight' for other tabpages on screen resize (#31419) 2024-12-02 10:05:49 +08:00
Evgeni Chasnovski
8de1dc6923 fix(api): make nvim_set_hl() respect all cterm attributes (#31390) 2024-12-02 08:24:58 +08:00
zeertzjq
fb689d7ebd vim-patch:9.1.0899: default for 'backspace' can be set in C code (#31416)
Problem:  default for 'backspace' can be set in C code
Solution: promote the default for 'backspace' from defaults.vim to the C
          code (Luca Saccarola)

closes: vim/vim#16143

959ef61430

N/A patches:
vim-patch:9.1.0895: default history value is too small
vim-patch:075aeea: runtime(doc): document changed default value for 'history'

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2024-12-02 00:06:57 +00:00
C.D. MacEachern
feb62d5429 docs: example keybind for :Inspect #31391 2024-12-01 13:58:28 -08:00
zeertzjq
ab9cfc4dc3 Merge pull request #31370 from glepnir/vim-9.1.0867
vim-patch:9.1.{0867,0891,0896}
2024-11-30 20:46:46 +08:00
Christian Clason
9d174a7dac vim-patch:9.1.0898: runtime(compiler): pytest compiler not included
Problem:  runtime(compiler): pytest compiler not included
Solution: include pytest compiler, update the compiler completion test
          (Konfekt)

closes: vim/vim#16130

3c2596a9e9

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-11-30 13:40:08 +01:00
glepnir
1af1e918d3 vim-patch:9.1.0896: completion list wrong after v9.1.0891
Problem:  completion list wrong after v9.1.0891
Solution: update compl_mach_array after leader change
          (glepnir)

compl_shown_match update not correct after refactoring in v9.1.0891
Unfortunately, this regressed what item is selected after leader change.

So generate compl_match_array before updating compl_shown_match range,
and split generate compl_match_array into range match_head

fixes: https://github.com/vim/vim/issues/16128
closes: https://github.com/vim/vim/pull/16129

a49c077a88
2024-11-30 20:22:53 +08:00
glepnir
d512479115 vim-patch:9.1.0891: building the completion list array is inefficient
Problem:  building the completion list array is inefficient
Solution: refactor and improve ins_compl_build_pum() func
          (glepnir)

current time complexity is O(n^2). I guess garray is not used here to save memory and avoid efficiency
is caused by heap memory allocation. A simple way is to add an extra pointer as a single linked list
to store the matching compl_T, and traverse this single linked list to generate compl_match_array.
The time complexity is O(n x m). The worst case is m=n, but we can still get a little improvement.
Because the if condition does not need to be run at one time. This should be a good solution for now.
Later we may be able to complete it in O(lgn) time. But this requires more reconstruction. So this is
the first step.

closes: #16125

80b662009c
2024-11-30 18:53:29 +08:00
Christian Clason
4426a326e2 vim-patch:9.1.0897: filetype: pyrex files are not detected
Problem:  filetype: pyrex files are not detected
Solution: detect '*.pxi' and '*.pyx+' as pyrex filetype
          (user202729)

References:
https://cython.readthedocs.io/en/latest/src/userguide/language_basics.html#cython-file-types
https://www.csse.canterbury.ac.nz/greg.ewing/python/Pyrex/version/Doc/Manual/using_with_c++.html

closes: vim/vim#16136

aa16b30552

Co-authored-by: user202729 <25191436+user202729@users.noreply.github.com>
2024-11-30 11:41:23 +01:00
Christian Clason
fd865fbd92 vim-patch:dd21c89: runtime(compiler): update eslint compiler
compact formatter is no longer distributed with eslint, so:

- switch to '--format stylish' in makeprg
- update 'errorformat' for the 'stylish' format output

fixes: vim/vim#16126
closes: vim/vim#16137

dd21c89626

Co-authored-by: Romain Lafourcade <romainlafourcade@gmail.com>
2024-11-30 11:39:36 +01:00
Yochem van Rosmalen
2833925cfc docs(diagnostics): location list / quickfix example #31371 2024-11-29 10:07:08 -08:00
Lewis Russell
3056115785 refactor: gen_declarations.lua
Problem:
gen_declarations.lua is complex and has duplicate logic with
c_grammar.lua

Solution:
Move all lpeg logic to c_grammar.lua and refactor gen_declarations.lua.
2024-11-29 13:25:53 +00:00
Yi Ming
a1e313ded6 feat(lsp): support textDocument/foldingRange (#31311)
* refactor(shared): extract `vim._list_insert` and `vim._list_remove`

* feat(lsp): add `vim.lsp.foldexpr()`

* docs(lsp): add a todo for state management

* feat(lsp): add `vim.lsp.folding_range.foldclose()`

* feat(lsp): schedule `foldclose()` if the buffer is not up-to-date

* feat(lsp): add `vim.lsp.foldtext()`

* feat(lsp): support multiple folding range providers

* refactor(lsp): expose all folding related functions under `vim.lsp.*`

* perf(lsp): add `lsp.MultiHandler` for do `foldupdate()` only once
2024-11-29 12:40:32 +00:00
Christian Clason
c867a4f5e3 build(deps): bump luajit to HEAD - 19878ec05 2024-11-29 09:08:52 +01:00
Christian Clason
e74316bf48 vim-patch:511eb84: runtime(po): remove poDiffOld/New, add po-format flags to syntax file
fixes: vim/vim#16120
closes: vim/vim#16132

511eb84c08

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2024-11-29 08:10:51 +01:00
zeertzjq
b1c907f219 vim-patch:9.1.0892: the max value of 'cmdheight' is limited by other tabpages (#31378)
Problem:  the max value of 'cmdheight' is limited by other tabpages
Solution: Limit the maximum value of 'cmdheight' to the current tabpage only.
          (Milly)

The Help says that cmdheight is local to the tab page, but says nothing
about the maximum value depending on the state of all tab pages. Users
may wonder why they can't increase cmdheight when there are still rows
available on the current tab page. This PR changes the behavior of
cmdheight so that its maximum value depends only on the state of the
current tab page.

Also, since magic numbers were embedded in various places with the
minimum value of cmdheight being 1, we defined a constant to make it
easier to understand.

closes: vim/vim#16131

2cddf0e85a

Cherry-pick Test_cmdheight_not_changed() from patch 9.0.0187.

Co-authored-by: Milly <milly.ca@gmail.com>
2024-11-29 10:12:30 +08:00
zeertzjq
1536f79d86 vim-patch:8.2.2993: 'fileencodings' default value should depend on 'encoding' (#31379)
Problem:    'fileencodings' default value should depend on 'encoding'. (Gary
            Johnson)
Solution:   When 'encoding' is "utf-8" use a different default value for
            'fileencodings'.

5ffefbb35a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-11-29 02:06:12 +00:00
zeertzjq
27965627a4 Merge pull request #31377 from zeertzjq/vim-65311c6
vim-patch: :compiler spotbugs
2024-11-29 09:19:51 +08:00
zeertzjq
cfa8418c21 vim-patch:9.1.0894: No test for what the spotbug compiler parses
Problem:  No test for what the spotbug compiler parses
          (after commit: 65311c6f472de67b368)
Solution: Test &makeprg for the SpotBugs compiler plugin
          (Aliaksei Budavei)

closes: vim/vim#16096

60ddb1a140

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-11-29 08:58:47 +08:00
zeertzjq
8d7d225caa vim-patch:65311c6: runtime(compiler): include spotbugs Java linter
closes: vim/vim#16001

65311c6f47

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-11-29 08:57:00 +08:00
vanaigr
731f83ea4a test: add decor benchmarks 2024-11-28 14:11:52 -06:00
Yi Ming
146b8300a1 docs(lsp): update example, optional parameters #31299 2024-11-28 08:08:27 -08:00
Riley Bruins
864f25d6b0 docs: more accurate typing for LSP references context
**Problem:** The `context` parameter for `references()` is just typed as
a table, which is unhelpful.

**Solution:** Properly type it as an `lsp.ReferenceContext`!
2024-11-28 09:05:17 +01:00
glepnir
344923fe9a vim-patch:9.1.0867: ins_compl_add() has too many args
Problem:  ins_compl_add() has too many args
Solution: refactor it and use an int array instead of 2 separate int
          args (glepnir)

closes: vim/vim#16062

5c66e23c62

Co-authored-by: glepnir <glephunter@gmail.com>
2024-11-28 13:58:42 +08:00
zeertzjq
5897994cb7 vim-patch:9.1.0890: %! item not allowed for 'rulerformat' (#31369)
Problem:  %! item not allowed for 'rulerformat'
          (yatinlala)
Solution: also allow to use %! for rulerformat option
          (Yegappan Lakshmanan)

fixes: vim/vim#16091
closes: vim/vim#16118

ac023e8baa

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-11-28 09:02:10 +08:00
dundargoc
76dcc7029b docs: add tag vim.fs.exists() and document suggested replacement 2024-11-27 19:56:08 +01:00
glepnir
203e7a43d1 fix(lsp): mention function name in warning #31301
Problem: The warning message is the same in different functions.
It is not convenient to locate the specific function name

Solution: add function name in warning message
2024-11-27 05:44:29 -08:00
Mathias Fussenegger
c24e6e66dd ci: remove myself from lsp reviewers 2024-11-27 13:16:06 +01:00
Christian Clason
078e8e57d3 vim-patch:7e501f4: runtime(gzip): load undofile if there exists one
fixes: vim/vim#16102
closes: vim/vim#16122

7e501f4d99

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-27 08:45:22 +01:00
Gregory Anders
d460928263 feat(tui): update 'background' on theme change events (#31350)
Enabling private DEC mode 2031 tells the terminal to notify Nvim
whenever the OS theme changes (i.e. light mode to dark mode or vice
versa) or the terminal emulator's palette changes. When we receive one
of these notifications we query the terminal color's background color
again to see if it has changed and update the value of 'background' if
it has.

We only do this though if the user has not explicitly set the value of
'bg' themselves. The help text is updated slightly to hint to users that
they probably shouldn't set this value: on modern terminal emulators
Nvim is able to completely determine this automatically.
2024-11-26 14:22:01 -06:00
Gregory Anders
99b5ffd688 perf(vim.text): use lookup table implementation for hex encoding (#30080)
Co-authored-by: glepnir <glephunter@gmail.com>
2024-11-26 13:56:01 -06:00
zeertzjq
e8450ef236 vim-patch:9.1.0889: Possible unnecessary redraw after adding/deleting lines (#31356)
Problem:  Possible unnecessary redraw after adding/deleting lines.
Solution: Check b_mod_set before using b_mod_xlines to avoid using stale
          b_mod_xlines value (zeertzjq).

closes: vim/vim#16124

9f25a3a237
2024-11-26 14:55:05 +00:00
Justin M. Keyes
3d707e6f14 fix(lua): remove vim.loader.disable() #31344
Problem:
`vim.loader.disable` does not conform to `:help dev-name-common` and
`:help dev-patterns`.

Solution:
- Add `enable` parameter to `vim.loader.enable`
- Remove `vim.loader.disable`
- Note the change in `:help news-breaking-dev` (HEAD changes).
  - This is not a breaking change (except to "HEAD") because
    `vim.loader` is marked "experimental".

previous: 26765e8461
2024-11-26 06:15:50 -08:00
zeertzjq
66bb1e577c vim-patch:9.1.0888: leftcol property not available in getwininfo() (#31349)
Problem:  leftcol property not available in getwininfo()
Solution: add leftcol property property (glepnir)

closes: vim/vim#16119

0a850673e3

Co-authored-by: glepnir <glephunter@gmail.com>
2024-11-26 07:53:07 +08:00
Marcus Caisey
c644228e1d fix(defaults): omit empty line from unimpaired mapping messages (#31347)
Problem:
The default unimpaired mappings display an empty line after the
command's output. This results (with default configuration) in the
`Press ENTER or type command to continue` prompt to be displayed, like
so:
```
(2 of 16): item2

Press ENTER or type command to continue
```

Solution:
The cause is that we're checking the second return value from
`pcall(vim.api.nvim_cmd, opts, {})` to determine whether the call was
successful. `nvim_cmd` returns an empty string on success, so this value
is an empty string in the successful path which we then display.

The fix is simple: check the first return value instead which is the
"status code" of the call.
2024-11-25 16:33:11 -06:00
Gregory Anders
f81131cca2 fix(tui): also reset cursor color if it was invisible (#31348) 2024-11-25 16:32:03 -06:00
Gregory Anders
29c72cdf4a fix(lsp): retrigger diagnostics request on server cancellation (#31345)
Co-authored-by: Jesse <github@jessebakker.com>
2024-11-25 11:48:11 -06:00
Lewis Russell
8d55cc218c feat(keysets): teach Union and LuaRefOf 2024-11-25 17:34:02 +00:00
Mathias Fußenegger
99e7323aa3 feat(diagnostic): inherit parent 'path' option in open_float (#31273)
Diagnostics sometimes contain stack traces, it's useful being able to
use `CTRL-W F` on them to open related files from within the diagnostic
window.
2024-11-25 17:11:22 +01:00
Yi Ming
165b099fa3 refactor(lsp): rename offset_encoding to position_encoding #31286
Problem:
LSP spec uses the term "position encoding" where we say "offset encoding".

Solution:
- Rename it everywhere except `vim.lsp.Client.offset_encoding` (which would be breaking).
- Mention "position encoding" in the documentation for `vim.lsp.Client.offset_encoding`.
2024-11-25 08:06:05 -08:00
Gregory Anders
a811d4babd fix(tui): only reset cursor color if it was changed (#31337)
We already track this information so we might as well use it. This
eliminates a bunch of unnecessary OSC sequences.
2024-11-25 15:00:42 +00:00
luukvbaal
b47b0b3f75 fix(grid): double grid_line_start() with ext_messages #31292
Problem:  Hit double grid_line_start() assert when redrawing from
          ext_messages msg_ruler event.
Solution: Do not start() batched grid calls when win_redr_ruler() will not
          puts() anything.
2024-11-25 05:54:43 -08:00
Famiu Haque
beec377e90 refactor(options): fix confusing naming of scope and req_scope (#31317)
Problem: The name `scope` is often used to refer to option flags because
`OPT_LOCAL` and `OPT_GLOBAL` are often used to determine the option
scope. This leads to the name `req_scope` being used for actual option
scopes instead.

Solution: Since the end-goal is to remove `OPT_LOCAL` and `OPT_GLOBAL`
entirely and replace them with `OptScope`, rename `OptScope` variables
to `scope` and the old scope flag variables to `opt_flags`.
2024-11-25 17:07:56 +08:00
Theo Fabi
9e7b0bcf51 fix(editorconfig): fix indent style for local.mk (#31342) 2024-11-24 22:04:27 -06:00
Christian Clason
ff00d583af vim-patch:9.1.0886: filetype: debian control file not detected
Problem:  filetype: debian control file not detected
Solution: detect 'debian/control' files as debcontrol filetype
          (author)

closes: vim/vim#16067

57b947e3c3

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-11-25 00:05:12 +01:00
Axel
af112e605d docs(build): suggest ucrt64 for msys2 #31312
Problem:
The default invocation would install the non-ucrt gcc package, the build would
fail now that UCRT is not supported. #22534

Solution:
Mention mingw-w64-ucrt pacman package instead.
2024-11-24 07:44:37 -08:00
zeertzjq
21371c9259 vim-patch:d7745ac: runtime(netrw): Fixing powershell execution issues on Windows (#31333)
closes: vim/vim#16094

d7745acbd8

Co-authored-by: GuyBrush <miguel.barro@live.com>
2024-11-24 14:46:21 +00:00
zeertzjq
5c60306442 vim-patch:9.1.0883: message history cleanup is missing some tests (#31331)
Problem:  message history cleanup is missing some tests
Solution: Add tests, refactor common code into did_set_msghistory()
          (Shougo Matsushita)

closes: vim/vim#16078

9f860a14c3

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Co-authored-by: Milly <milly.ca@gmail.com>
2024-11-24 14:36:33 +00:00
Christian Clason
ef4f13d85c vim-patch:c1e6621: runtime(c3): include c3 filetype plugin
closes: vim/vim#16090

c1e6621a59

Co-authored-by: Turiiya <34311583+ttytm@users.noreply.github.com>
2024-11-24 15:24:08 +01:00
Christian Clason
9738b405fd vim-patch:ccc024f: runtime(apache): Update syntax directives for apache server 2.4.62
closes: vim/vim#16109

ccc024f3a7

Co-authored-by: nisbet-hubbard <87453615+nisbet-hubbard@users.noreply.github.com>
2024-11-24 15:24:08 +01:00
glepnir
2a1f604c77 fix(lsp): delete bufvar inside WinClosed event
Problem: floaing preview window can be closed by some
ex commands like `only` `fclose` which will not clean the bufvar

Solution: use WinClosed event with floating_winnr for clean
bufnr, and add test cases for vim.lsp.util.open_floating_preview
2024-11-24 10:47:05 +00:00
zeertzjq
d9b08c58c3 vim-patch:partial:a01148d: runtime(doc): Expand docs on :! vs. :term (#31321)
fixes: vim/vim#16071
closes: vim/vim#16089

a01148d2cb

Co-authored-by: matveyt <matthewtarasov@yandex.ru>
2024-11-24 06:54:39 +08:00
Christian Clason
46d124a933 vim-patch:cacfccf: runtime(netrw): update netrw's decompress logic
Detect a few more default archive types, correctly handle file
extensions with digits in it.

fixes: vim/vim#16099
closes: vim/vim#16104

cacfccf803

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-23 14:08:16 +01:00
Christian Clason
91295db97d vim-patch:4dd6c22: runtime(apache): Update syntax keyword definition
closes: vim/vim#16105

4dd6c22ebe

Co-authored-by: nisbet-hubbard <87453615+nisbet-hubbard@users.noreply.github.com>
2024-11-23 14:08:16 +01:00
Famiu Haque
8516c2dc1f refactor(options): autogenerate valid values and flag enums for options (#31089)
Problem: Option metadata like list of valid values for an option and
option flags are not listed in the `options.lua` file and are instead
manually defined in C, which means option metadata is split between
several places.

Solution: Put metadata such as list of valid values for an option and
option flags in `options.lua`, and autogenerate the corresponding C
variables and enums.

Supersedes #28659

Co-authored-by: glepnir <glephunter@gmail.com>
2024-11-23 08:22:06 +00:00
andrew snelling
9a681ad09e fix(lsp): hover keymap (#31208)
* fix: use function call in keymap

* fix: test
2024-11-22 12:51:30 +00:00
Famiu Haque
bff07f6dd0 fix(api): don't try to get/set option for invalid option name (#31302)
Problem:
`validate_option_value_args()` returns `OK` even if option name is
invalid or if option doesn't have the supported scope, which leads to
Neovim still trying to erroneously get/set the option in those cases,
which can lead to an assertion failure when `option_has_scope()` is
invoked. This issue miraculously doesn't exist in release builds since
the assertion is skipped and `(get/set)_option_value_for` returns if
there is an error set, but that is not the intended location for that
error to be caught.

Solution:
Make `validate_option_value_args()` return `FAIL` if there is an error
set, which causes the API option functions to return early instead of
trying to get/set an invalid option.
2024-11-22 20:32:51 +08:00
zeertzjq
c697c49a76 test(filetype): symlink detection works after expand('<afile>') (#31307)
Also add a test for #31306, which currently fails.
2024-11-22 11:16:54 +00:00
glepnir
7d8db54441 fix(lsp): delete b:lsp_floating_preview buf var after win close
Problem: After floating preview window closed the buf var still exist

Solution: delete  after floating window closed.
2024-11-22 10:16:40 +00:00
Christian Clason
6e44a6a289 fix(treesitter): update queries 2024-11-22 09:39:45 +01:00
Christian Clason
c2f08d294a build(deps): bump tree-sitter-c to v0.23.2 2024-11-22 09:39:45 +01:00
zeertzjq
3597633075 test(autocmd/termxx_spec): fix TextChangedT test flakiness (#31296)
Problem:  The E937 error appears for too short in TextChangedT test.
Solution: Only feed an Enter key after seeing the error.
2024-11-22 08:08:12 +08:00
zeertzjq
ff75f345ab fix(highlight): 'winhl' shouldn't take priority over API (#31288) 2024-11-22 06:52:32 +08:00
bfredl
92a83f671b Merge pull request #31193 from bfredl/winrt
refactor(windows)!: only support UCRT, even for mingw
2024-11-21 18:58:51 +01:00
bfredl
be89d520d7 refactor(windows)!: only support UCRT, even for mingw
The newer UCRT runtime has native support for UTF-8, including forcing
it as the active codepage even before `main()` is called. This means
the c runtime will properly convert windows WCHAR:s into UTF-8 bytes,
as early as the argv/argc params to `main()` . Whereas MSVCRT does not
support this reliably and required us to use `wmain()`.

Only MSVC supports using manifest files directly as source files.
The solution for other Windows toolchains is to use a .rc file.
2024-11-21 12:41:15 +01:00
Lewis Russell
534544cbf7 test: move exec_lua logic to separate module
By making it a separate module, the embedded Nvim session can require
this module directly instead of setup code sending over the module via
RPC.

Also make exec_lua wrap _G.print so messages can be seen
in the test output immediately as the exec_lua returns.
2024-11-21 11:35:16 +00:00
zeertzjq
01026ba47b vim-patch:9.1.0862: 'wildmenu' not enabled by default in nocp mode (#31261)
Problem:  'wildmenu' not enabled by default in nocp mode
Solution: promote the default Vim value to true, it has been enabled
          in defaults.vim anyhow, so remove it there (Luca Saccarola)

closes: vim/vim#16055

437bc13ea1

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2024-11-21 15:37:35 +08:00
dundargoc
07db909eb5 docs: misc (#31138)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-11-21 06:50:30 +08:00
zshuzh
cedf155fb5 refactor(options): impl default 'titlestring' by format flags #30843
Problem:
Unnecessary C impl of default 'titlestring'.

Solutin:
Define it using format flags.
2024-11-20 14:01:59 -08:00
Yi Ming
629483e24e feat(lsp): require offset_encoding param #31249
Problem:
Since [version 3.17](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocuments),
LSP supports specifying the position encoding (aka offset encoding) supported by
the client through `positionEncoding`. Since #31209, Nvim fully supports
`utf-8`, `utf-16`, and `utf-32` encodings.

Previously, nvim assumed all clients for a buffer had the same
`offset_encoding`, so:
* Nvim provides `vim.lsp._get_offset_encoding()` to get `offset_encoding`, but
  this function is incorrect because `offset_encoding` is per-client, not
  per-buffer.
* Based on the strategy of `vim.lsp._get_offset_encoding()`,
  `vim.lsp.util.make_position_params()`, `vim.lsp.util.make_range_params()`, and
  `vim.lsp.util.make_given_range_params()` do not require the caller to pass
  `offset_encoding`, which is invalid.
* https://github.com/neovim/neovim/issues/25272

Solution:
* Mark `vim.lsp._get_offset_encoding()` as `@deprecated`.
* Change the type annotations of `vim.lsp.util.make_position_params()`,
  `vim.lsp.util.make_range_params()`, `vim.lsp.util.make_given_range_params()`
  to require the `offset_encoding` param.
2024-11-20 12:19:07 -08:00
luukvbaal
1b6442034f fix(messages): more ext_messages kinds #31279
Add kinds for various commands that output a list, the 'wildmode'
list, and for number prompts.
2024-11-20 12:11:20 -08:00
zeertzjq
0e2f92ed79 build(clint): make NOLINT work with header checks (#31281)
Problem:  NOLINT doesn't work with header checks.
Solution: Move these checks after ProcessLine() calls.
2024-11-20 22:51:58 +08:00
Lewis Russell
454ae672aa feat(lsp): deprecate non-method client functions
Deprecated:
- `client.request()` -> `client:request()`
- `client.request_sync()` -> `client:request_sync()`
- `client.notify()` -> `client:notify()`
- `client.cancel_request()` -> `client:cancel_request()`
- `client.stop()` -> `client:stop()`
- `client.is_stopped()` `client:is_stopped()`
- `client.supports_method()` -> `client:supports_method()`
- `client.on_attach()` -> `client:on_attach()`

Fixed docgen to link class fields to the full function doc.
2024-11-20 08:51:45 +00:00
Christian Clason
f55c842ec7 vim-patch:9.1.0880: filetype: C3 files are not recognized
Problem:  filetype: C3 files are not recognized
Solution: detect '*.c3*' files as c3 filetype (Turiiya)

closes: vim/vim#16087

c8dfcfc53b

Co-authored-by: Turiiya <34311583+ttytm@users.noreply.github.com>
2024-11-20 09:31:15 +01:00
Christian Clason
23ead4f2cb vim-patch:9.1.0876: filetype: openCL files are not recognized
Problem:  filetype: openCL files are not recognized
Solution: detect '*.cl' files as opencl or lisp filetype,
          include a opencl syntax and filetype plugin (Wu, Zhenyu)

closes: vim/vim#15825

e2c27ca8ef

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-11-20 09:31:15 +01:00
Christian Clason
4c85c217d3 vim-patch:9.1.0875: filetype: hyprlang detection can be improved
Problem:  filetype: hyprlang detection can be improved
Solution: detect '/hypr/*.conf' files as hyprlang filetype,
          include basic syntax highlighting (Luca Saccarola)

fixes: vim/vim#15875
closes: vim/vim#16064

a13bd294ab

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2024-11-20 09:31:15 +01:00
Christian Clason
de9ed1ca54 vim-patch:9.1.0874: filetype: karel files are not detected
Problem:  filetype: karel files are not detected
Solution: detect '*.kl' files as karel filetype,
          include syntax and filetype plugin
          (Kirill Morozov)

closes: vim/vim#16075

fdac54d7bb

Co-authored-by: Kirill Morozov <kirill@robotix.pro>
Co-authored-by: KnoP-01 <knosowski@graeffrobotics.de>
2024-11-20 09:31:15 +01:00
Christian Clason
fd57f39766 vim-patch:4927dae: runtime(compiler): fix escaping of arguments passed to :CompilerSet
See newly added help entry referring to option-backslash

closes: vim/vim#16084

4927daef60

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-11-20 09:27:36 +01:00
zeertzjq
ac7e0ff32f fix(move): redraw for 'concealcursor' after changing w_wcol (#31276) 2024-11-20 08:24:58 +08:00
Tomasz N
f111c32ff9 fix(messages): no message kind for search pattern #31272 2024-11-19 16:06:36 -08:00
Lewis Russell
081beb3659 fix(lsp): restore get_language_id behaviour
Ensure filetype is always passed.

Fixes #31262
2024-11-19 12:19:05 +00:00
zeertzjq
0183c32474 vim-patch:9.1.0870: too many strlen() calls in eval.c (#31267)
Problem:  too many strlen() calls in eval.c
Solution: Refactor eval.c to remove calls to STRLEN()
          (John Marriott)

closes: vim/vim#16066

bd4614f43d

Co-authored-by: John Marriott <basilisk@internode.on.net>
2024-11-19 11:03:29 +00:00
Christian Clason
c12be1249f vim-patch:9.1.0873: filetype: Vivado files are not recognized
Problem:  filetype: Vivado files are not recognized
Solution: detect '*.mss' files as 'mss' filetype
          (Wu, Zhenyu)

references:
https://docs.amd.com/r/2020.2-English/ug1400-vitis-embedded/Microprocessor-Software-Specification-MSS

closes: vim/vim#15907

a87462a498

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-11-19 10:44:30 +01:00
Lewis Russell
989a37a594 refactor(lsp): fold in dynamic_registration code into the client
Problem:

Capability register logic is spread across 3 files.

Solution:

- Consolidate (and simplify) logic into the client.
- Teach client.supports_method about resolve methods
2024-11-18 17:09:53 +00:00
altermo
e2ad251c8d fix(api): nvim_get_option_value does not clean up on FileType error #31219
Problem:
If there's an error in `FileType` autocmd, the filetype get-opt buffer
doesn't get cleaned up.

Solution:
Call `aucmd_restbuf`.
2024-11-18 06:40:51 -08:00
luukvbaal
40347f6e27 fix(api): only flush nvim__redraw when necessary #31250
Problem:  Not possible to only set a "redraw later" type with
          nvim__redraw, which seems to be desired for the
          treesitter highlighter.
Solution: Do not update the screen when "flush" is explicitly set to
          false and only redraw later types are present. In that case,
          do not call ui_flush() either.
2024-11-18 06:35:21 -08:00
zeertzjq
1763eddede vim-patch:9.1.0869: Problem: curswant not set on gm in folded line (#31247)
Problem:  curswant not set on gm in folded line
          (citizenmatt)
Solution: in a folded line, call update_curswant_force()

fixes: vim/vim#11596
closes: vim/vim#11994
closes: vim/vim#15398

9848face74

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-18 09:52:11 +08:00
Yochem van Rosmalen
965dc81f81 fix(checkhealth): disable 'listchars' #31245
Problem:
'listchars' (in particular multispace) breaks visual heading due to
`Whitespace` highlight group.

Solution:
Disable 'list' (and thus all listchars) by default for `checkhealth`
files.

Fixes #31145
2024-11-17 15:33:34 -08:00
Peter Aronoff
cc6992f1ca feat(defaults): dot-repeat [<Space> #31186
Problem: `[<Space>` and `]<Space>` do not support repetition.

Solution: use `operatorfunc` and `g@l` to make these mappings dot
repeatable.
2024-11-17 13:31:24 -08:00
Riley Bruins
44229bb85b feat(lsp): highlight hover target/range #31110
**Problem:** Despite the LSP providing the option for language servers
to specify a range with a hover response (for highlighting), Neovim does
not give the option to highlight this range.

**Solution:** Add an option to `buf.hover()` which causes this range to
be highlighted.

Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
2024-11-17 12:31:32 -08:00
luukvbaal
235cb5bc5f fix(api): update "range" windows in nvim__redraw #31042
Problem:  nvim__redraw's "range" marks a buffer range for redraw, and subsequently
          flushes the UI without updating the windows containing that buffer.
Solution: Implicitly update the screen, unless specified otherwise.
          Only update the screen with the last call of the treesitter
          on_changedtree() callback.
2024-11-17 11:43:36 -08:00
luukvbaal
e025f5a5b3 fix(messages): proper multiline Lua print() messages #31205
Problem:  Separate message emitted for each newline present in Lua
          print() arguments.
Solution: Make msg_multiline() handle NUL bytes. Refactor print() to use
          msg_multiline(). Refactor vim.print() to use print().
2024-11-17 10:21:50 -08:00
luukvbaal
6ea45031d5 fix(api): nvim_echo free text memory with invalid highlight (#31243)
Fix regression from #31195
2024-11-17 22:06:44 +08:00
Christian Clason
10beeee06f build(deps): bump uncrustify to uncrustify-0.80.1 2024-11-17 14:09:26 +01:00
Maria José Solano
38838fb00a fix(lsp): type-errors, other nits in vim.lsp.log #31235 2024-11-16 18:32:09 -08:00
luukvbaal
cdc9baeaf8 fix(treesitter): remove redundant on_bytes callback #31041
Problem:  Treesitter highlighter implements an on_bytes callback that
          just re-marks a buffer range for redraw. The edit that
          prompted the callback will already have done that.
Solution: Remove redundant on_bytes callback from the treesitter
          highlighter module.
2024-11-16 16:25:10 -08:00
luukvbaal
9c718bc2bc fix(api): validation, documentation of hl_group #31195
Problem:  Documentation for "hl_group" in nvim_buf_set_extmark() is
          unclear. "hl_group" in nvim_echo() does not accept
          highlight group id.
Solution: Move documentation for highlight group name/id to first
          mention of hl_group. Update nvim_echo() to accept highlight
          group id.
2024-11-16 15:36:11 -08:00
luukvbaal
f85bc41c80 feat(ui): don't show unfocusable windows in :tabs, 'tabline' #27984
Problem:  Floating windows with focusable set to false can reasonably be
          expected to be UI elements but are listed in some outputs that
          should contain only regular windows.
Solution: Hide unfocusable floating windows from the default tabline and
          :tabs.
2024-11-16 15:32:36 -08:00
Famiu Haque
29ded88957 refactor(options): remove .indir, redesign option scopes #31066
Problem:
The way option scopes currently work is inflexible and does not allow for nested
option scopes or easily finding the value of an option at any arbitrary scope
without having to do long handwritten switch-case statements like in
`get_varp()`. `.indir` is also confusing and redundant since option indices for
each scope can be autogenerated.

Solution:
Expand option scopes in such a way that an option can support any amount of
scopes using a set of scope flags, similarly to how it's already done for option
types. Also make options contain information about its index at each scope it
supports. This allows for massively simplifying `get_varp()` and
`get_varp_scope()` in the future by just using a struct for options at each
scope. This would be done by creating a table that stores the offset of an
option's variable at a scope by using the option's index at that scope as a key.
This PR also autogenerates enums for option indices at each scope to remove the
need for `.indir` entirely, and also to allow easily iterating over options all
options that support any scope.

Ref: #29314
2024-11-16 12:56:16 -08:00
Christian Clason
be8648f345 build(deps): bump uncrustify to uncrustify-0.80.0 2024-11-16 15:42:55 +01:00
zeertzjq
f164e1e35c vim-patch:partial:9.1.0851: too many strlen() calls in getchar.c (#31230)
Problem:  too many strlen() calls in getchar.c
Solution: refactor code and reduce strlen() calls
          (John Marriott)

closes: vim/vim#16017

e7a1bbf210

Co-authored-by: John Marriott <basilisk@internode.on.net>
2024-11-16 09:55:41 +08:00
errael
2f7b0018b0 docs: standardize doc for ChanInfo/ChanOpen autocmds/v:event (#31099) 2024-11-16 09:37:36 +08:00
zeertzjq
2eb227f5b6 test(lua/ui_event_spec): avoid polluting log file (#31229) 2024-11-16 08:56:42 +08:00
zeertzjq
fbbb9d6f7b vim-patch:9.1.0866: filetype: LLVM IR files are not recognized (#31228)
Problem:  filetype: LLVM IR files are not recognized
Solution: detect '*.ll' files either as lifelines or llvm filetype
          (Wu, Zhenyu)

closes: vim/vim#15824

bc32bbddcf

N/A patch:
vim-patch:7e4b861: runtime(filetype): remove duplicated *.org file pattern

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-11-16 00:42:12 +00:00
luukvbaal
6e4df18b45 fix(ui): no fast context for prompt message kinds #31224
Problem:  No longer able to show prompt messages with vim.ui_attach().
Solution: Do not execute callback in fast context for prompt message
          kinds. These events must be safe to show the incoming message
          so the event itself serves to indicate that the message
          should be shown immediately.
2024-11-15 14:34:42 -08:00
Yi Ming
f1748b78e3 feat(default): bind vim.lsp.buf.signature_help in select mode (#31223) 2024-11-15 10:13:41 -06:00
Christian Clason
c33ec2d7ce vim-patch:7c3b65e: runtime(cfg): only consider leading // as starting a comment
fixes: vim/vim#16051

7c3b65eb3e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-15 09:32:15 +01:00
Christian Clason
a785be9cc7 vim-patch:0acd3ab: runtime(sh): better function support for bash/zsh in indent script
closes: vim/vim#16052

0acd3abfad

Co-authored-by: Lukas Zapletal <lzap+git@redhat.com>
2024-11-15 09:32:15 +01:00
Christian Clason
c9045f5ba3 vim-patch:460799d: runtime(netrw): small fixes to netrw#BrowseX
- do not enter dir in Netrw on opening
- double quotes after start cause error on Windows

See @chrisbra 's comments at
[0]

[0]: ff82e7a9db (diff-39baf27d8f62071617bbef12f874cce31c0ebd02ec99e7b119474ca870c636a3R5279)

460799d885

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-11-15 09:32:15 +01:00
Christian Clason
f0fd9acc4b vim-patch:9.1.0865: filetype: org files are not recognized
Problem:  filetype: org files are not recognized
Solution: detect '*.org' files as 'org' filetype,
          include filetype and syntax plugin
          (Luca Saccarola)

closes: vim/vim#16054

0684800c85

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2024-11-15 09:07:37 +01:00
Christian Clason
2024c10d74 ci(win): remove python workaround (#31212)
Explicitly installing Python 3.13 using (deprecated version of) `setup-python` looks to be no longer required for provider tests to pass.
2024-11-15 08:47:22 +01:00
Hyker
6ef80eb42c fix(treesitter): keep treeview open if source window is still open #31198
Problem: When there is a tree view opened by :InspectTree and the
source buffer is open in multiple windows, closing one of the source
windows will lead to the tree view being closed as well.
Regression by #31181.

Solution: Check how many source windows are open when trying to
quit one. If there are more than one, keep the tree view(s) open.
If the only source window is closed, also close the tree view(s).

fix #31196
2024-11-14 19:00:18 -08:00
zeertzjq
54c85bcb6d vim-patch:9.1.0855: setting 'cmdheight' may missing output (#31216)
Problem:  setting 'cmdheight' may cause hit-enter-prompt and echo output
          to be missing
Solution: Before cleaning the cmdline, check the need_wait_return flag
          (nwounkn)

closes: vim/vim#13432

2e48567007

Co-authored-by: nwounkn <nwounkn@gmail.com>
2024-11-15 00:18:53 +00:00
zeertzjq
fa0dcde3d9 vim-patch:9.1.0864: message history is fixed to 200 (#31215)
Problem:  message history is fixed to 200
Solution: Add the 'msghistory' option, increase the default
          value to 500 (Shougo Matsushita)

closes: vim/vim#16048

4bd9b2b246

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Co-authored-by: Milly <milly.ca@gmail.com>
2024-11-15 08:04:49 +08:00
bfredl
05d354e216 Merge pull request #27874 from luukvbaal/funcerr
fix(messages)!: vim.ui_attach message callbacks are unsafe
2024-11-14 18:56:56 +01:00
Christian Clason
434d5936b6 build(deps): bump luajit to HEAD - fe71d0fb5 2024-11-14 18:00:30 +01:00
Lewis Russell
d3e4ffafff feat(lsp): support utf-8 and utf-32 position encodings
Resolves #30034
2024-11-14 15:32:49 +00:00
Luuk van Baal
de48fbbd5f fix(messages)!: vim.ui_attach message callbacks are unsafe
Problem:  Lua callbacks for "msg_show" events with vim.ui_attach() are
          executed when it is not safe.
Solution: Disallow non-fast API calls for "msg_show" event callbacks.
          Automatically detach callback after excessive errors.
          Make sure fast APIs do not modify Nvim state.
2024-11-14 13:23:11 +01:00
bfredl
7d771c3eee Merge pull request #31168 from bfredl/noattach
fix(tests): needing two calls to setup a screen is cringe
2024-11-14 13:10:32 +01:00
bfredl
e61228a214 fix(tests): needing two calls to setup a screen is cringe
Before calling "attach" a screen object is just a dummy container for
(row, col) values whose purpose is to be sent as part of the "attach"
function call anyway.

Just create the screen in an attached state directly. Keep the complete
(row, col, options) config together. It is still completely valid to
later detach and re-attach as needed, including to another session.
2024-11-14 12:40:57 +01:00
Christian Clason
40dee8a2dc vim-patch:c4208da: runtime(compiler): include a Java Maven compiler plugin
@Konfekt suggested adding this [1]; I confirmed that both source
repositories have permissive licenses [2], [3] that permit copying the
code (at least where the compiler scripts are concerned).

[1]: 570b1006fd
[2]: https://github.com/JalaiAmitahl/maven-compiler.vim
[3]: https://github.com/mikelue/vim-maven-plugin/issues/13

closes: vim/vim#16041

c4208da0f4

Co-authored-by: D. Ben Knoble <ben.knoble+github@gmail.com>
2024-11-14 09:35:11 +01:00
Christian Clason
c905f16507 vim-patch:8e013b1: runtime(racket): update Racket runtime files
This brings the included Racket runtime files to commit c41bc5a (indent
for[*]/lists with accumulator clause correctly, 2024-11-12) of
https://github.com/benknoble/vim-racket.

Note that not all files from that repository are included.

closes: vim/vim#16046

8e013b1421

Co-authored-by: D. Ben Knoble <ben.knoble+github@gmail.com>
2024-11-14 09:35:11 +01:00
zeertzjq
b820b0e47e Merge pull request #31204 from zeertzjq/vim-8b96858
vim-patch: doc updates
2024-11-14 08:08:35 +08:00
zeertzjq
41be1bfe05 vim-patch:9b05326: runtime(doc): improve indentation in examples for netrw-handler
related: vim/vim#16043

9b05326afd

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-14 07:21:38 +08:00
zeertzjq
d410583e7d vim-patch:8b96858: runtime(doc): improve examples for netrw-handler functions
fixes: vim/vim#16043

8b96858996

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-14 07:21:25 +08:00
Christian Clason
e5cd5098f8 build(deps): bump luajit to HEAD - 69bbf3c1b 2024-11-13 16:57:25 +01:00
Kristijan Husak
33d10db5b7 fix(lsp): filter completion candidates based on completeopt (#30945) 2024-11-13 15:18:29 +00:00
Riley Bruins
36990f324d fix(treesitter): show proper node name error messages
**Problem:** Currently node names with non-alphanumeric, non
underscore/hyphen characters (only possible with anonymous nodes) are
not given a proper error message. See tree-sitter issue 3892 for more
details.

**Solution:** Apply a different scanning logic to anonymous nodes to
correctly identify the entire node name (i.e., up until the final double
quote)
2024-11-13 13:32:58 +01:00
bfredl
37f665c504 Merge pull request #31164 from bfredl/hlf_enum
refactor(highlight): make enum of builtin highlights start with 1
2024-11-13 12:34:09 +01:00
bfredl
ff7518b83c refactor(highlight): make enum of builtin highlights start with 1
This makes it possible to use HLF_ values directly as highlight id:s
and avoids +1 adjustments especially around messages.
2024-11-13 11:20:10 +01:00
zeertzjq
eaf5ae6cc6 vim-patch:210c49b: runtime(compiler): update pylint linter (#31191)
closes: vim/vim#16039

210c49bbe8

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-11-13 08:00:35 +00:00
Christian Clason
28bf25d012 build(deps): bump tree-sitter to e3c826333 2024-11-13 08:52:14 +01:00
Christian Clason
096cb572af vim-patch:5ca8f22: runtime(idris2): include filetype,indent+syntax plugins for (L)Idris2 + ipkg
closes: vim/vim#15993

5ca8f223f0

Co-authored-by: Serhii Khoma <srghma@gmail.com>
Co-authored-by: Christian Clason <ch.clason+github@icloud.com>
2024-11-13 08:24:14 +01:00
zeertzjq
17e00d0cc6 fix(startup): report --startuptime error to stderr (#31131)
Problem:  Crash when initializing for --startuptime errors.
Solution: Report the error to stderr, as neither logging nor messages
          have been initialized yet.
2024-11-13 13:22:40 +08:00
zeertzjq
1128d75550 vim-patch:f18987c: runtime(doc): clarify the use of filters and external commands (#31185)
related: vim/vim#16044

f18987caa5

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-12 23:38:59 +00:00
zeertzjq
1643c49514 vim-patch:9.1.0860: tests: mouse_shape tests use hard code sleep value (#31184)
Problem:  tests: mouse_shape tests use hard code sleep value
          (Bram Moolenaar)
Solution: Use WaitForAssert() instead (Yee Cheng Chin)

related: vim/vim#12157
closes: vim/vim#16042

24078e39cd

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2024-11-13 07:28:40 +08:00
hykerr
86b737649b fix(treesitter): add 'QuitPre' event to autocommands in inspect_tree
Problem: Quitting source buffer for ```:InspectTree``` command raises
```E855``` when source buffer and tree views are the only open buffers.

Solution: Add ```QuitPre``` event to autocmd handling closing/hiding the
source buffer to close all open tree views. This allows nvim to quit
when source and tree buffers are the only open windows.
2024-11-12 16:10:43 +00:00
Nicolas Hillegeer
9aab98a275 refactor(lsp): avoid redundant function wrapping
Leftover from #21026.
2024-11-12 16:10:16 +00:00
Christian Clason
295f98c8e0 vim-patch:9.1.0853: filetype: kubernetes config file not recognized
Problem:  filetype: kubernetes config file not recognized
Solution: detect '/.kube/config' file as yaml filetype
          (Jonathan Lopez)

closes: vim/vim#11076

6fbf63de86

Co-authored-by: Jonathan Lopez <jonathanglopez@gmail.com>
2024-11-12 08:18:38 +01:00
Christian Clason
c026a114b5 vim-patch:129a844: runtime(tar): Update tar.vim to support permissions
These changes enable tar.vim to keep permissions of files that were
edited intact instead of replacing them with the default permissions.

The major change for this is switching from "tar -OPxf", which reads out
the contents of the selected file from an tar archive to stdout to
"tar -pPxf" which extracts the selected file to the current directory
with permissions intact

This requirs the temporary directory to be created earlier.

closes: vim/vim#7379

129a8446d2

Co-authored-by: Lennart00 <73488709+Lennart00@users.noreply.github.com>
2024-11-12 08:18:22 +01:00
bfredl
72a1df6065 Merge pull request #31137 from bfredl/hlagain
refactor(tests): use more global highlight definitions
2024-11-11 20:08:26 +01:00
bfredl
c8c237ba2c Merge pull request #31167 from luukvbaal/msgid
fix(messages): pass previous highlight id to ext chunks
2024-11-11 20:04:07 +01:00
Lewis Russell
3e855d533f perf(lsp): use faster version of str_byteindex 2024-11-11 14:23:38 +00:00
Luuk van Baal
9fa3a0964e fix(messages): pass previous highlight id to ext chunks 2024-11-11 15:15:33 +01:00
Lewis Russell
ff575b3886 perf(filetype): optimize internal data structures
This changes the type for the sorted pattern table from
`vim.filetype.mapping[]` to `vim.filetype.mapping.sorted[]`

E.g. instead of:

```lua
{
  { ['/debian/changelog$'] = {'debchangelog', { parent = '/debian/' } },
  { ['%.git/']             = { detect.git   , { parent = 'git/', priority = -1 } },
}
```

It is now:

```lua
{
  { '/debian/, '/debian/changelog$', 'debchangelog' },
  { 'git/'   , '%.git/'            , detect.git    , -1 },
}
```

Overall this should roughly cut the amount of tables used by 3, and
replaces lots of hash indexes with array indexes.
2024-11-11 13:42:24 +00:00
bfredl
29fd5ed606 refactor(tests): use more global highlight definitions 2024-11-11 14:27:25 +01:00
bfredl
d0e78b5871 Merge pull request #27813 from luukvbaal/msgid
feat(ext_messages): add hl_id to ext_messages chunks
2024-11-11 12:26:35 +01:00
Christian Clason
7919aa9102 vim-patch:622f6f5: runtime(tex): extra Number highlighting causes issues
So let's revert "runtime(tex): add Number highlighting to syntax file"

This (partly) reverts commits 8e6b5034f32049fd0 and 6065755a39d838aab

fixes: vim/vim#16030

622f6f5b9a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-11 09:24:57 +01:00
zeertzjq
7906532e08 vim-patch:5b63b23: runtime(netrw): directory symlink not resolved in tree view (#31161)
closes: vim/vim#16020

5b63b236a0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-11 07:52:11 +00:00
Christian Clason
f37d290775 vim-patch:6065755: runtime(tex): update Last Change header in syntax script
related: vim/vim#11271

6065755a39

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-11 08:23:46 +01:00
zeertzjq
adbffff5d0 vim-patch:9.1.0849: there are a few typos in the source (#31159)
Problem:  there are a few typos in the source.
Solution: Correct typos (zeertzjq).

closes: vim/vim#16026

7c5152826f
2024-11-11 08:20:41 +08:00
zeertzjq
0e54931b99 vim-patch:060107c: runtime(doc): fix typo in g:termdebug_config (#31155)
closes: vim/vim#16023

060107cbc4
2024-11-10 21:47:24 +08:00
Christian Clason
f59aeb5a9a build(deps): bump tree-sitter to v0.24.4 2024-11-10 11:34:23 +01:00
Christian Clason
07b72d9036 vim-patch:8e6b503: runtime(tex): add Number highlighting to syntax file
closes: vim/vim#11271

8e6b5034f3

Co-authored-by: amarakon <amar.al-zubaidi45@tutanota.com>
2024-11-10 11:05:26 +01:00
Christian Clason
5ff9a9397e vim-patch:a14c457: runtime(dune): use :setl instead of :set in ftplugin
closes: vim/vim#11419

a14c457cad

Co-authored-by: Dani Dickstein <daniel.dickstein@gmail.com>
2024-11-10 11:05:26 +01:00
Riley Bruins
c5f217db01 refactor(lsp): simplify reference range logic 2024-11-10 09:40:37 +00:00
zeertzjq
0eae0bc804 Merge pull request #31150 from zeertzjq/vim-bbe5252
vim-patch: Vim syntax updates
2024-11-10 10:35:57 +08:00
zeertzjq
d090a02780 vim-patch:bbe5252: runtime(vim): Update base-syntax, improve :normal highlighting
Fix command name termination, match bang, and allow a line-continued
argument.

closes: vim/vim#15358

bbe5252c2c

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-11-10 10:03:41 +08:00
zeertzjq
93dbf1d86c vim-patch:818c641: runtime(vim): Update base-syntax file, improve class, enum and interface highlighting
- Enable folding of class, enum and interface declarations.
- Highlight constructor names with the Function highlight group, like
  other special methods.
- Mark function definitions using special method names as errors.
- Highlight :type arguments.

fixes: vim/vim#14393#issuecomment-2042796198.
closes: vim/vim#13810

818c641b6f

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-11-10 10:03:20 +08:00
zeertzjq
e9dc9be469 vim-patch:80aabaa: runtime(vim): Distinguish Vim9 builtin object methods from namesake builtin functions (vim/vim#14348)
Currently, the overriding object method definitions are
matched as vimFunctionError (:help builtin-object-methods,
v9.1.0148).

For example:
------------------------------------------------------------
vim9script

class Test
	def string(): string
		return "Test"
	enddef
endclass

echo string(Test.new()) == Test.new().string()
------------------------------------------------------------

Instead, let's introduce a new syntax group vimMethodName
and make these methods its members.  In order to emphasise
the link between the overriding methods and the overridden
functions for highlighting, vimMethodName is linked by
default to vimFuncName.

80aabaab66

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-11-10 10:03:20 +08:00
zeertzjq
f25ffc43a7 vim-patch:dfcef89: runtime(vim): Distinguish Vim9 constructor definitions from the :new ex command (vim/vim#14050)
With the arrival of Vim9 classes, the syntax must allow for
_new_ constructors; multiple constructor definitions are
supported for a class, provided distinct suffix-names are
used.  Currently, the defined constructors match either
vimCommand or vimFunctionError (for any newBar).

For example:
------------------------------------------------------------
vim9script

class Foo
    def new()
    enddef

    def newBar()
    enddef
endclass
------------------------------------------------------------

Since every constructor is required to bear a lower-cased
_new_ prefix name, it should suffice to distinguish them
from functions, and so there are no new highlight or syntax
groups introduced.

dfcef890cb

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-11-10 10:03:20 +08:00
zeertzjq
3da8f4c7ee vim-patch:5e7f43b: runtime(termdebug): allow to use decimal signs (#31149)
closes: vim/vim#16011

5e7f43b6ac

Co-authored-by: Ella Moss <ella.moss@utah.edu>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-10 09:24:27 +08:00
zeertzjq
7232b54aee vim-patch:partial:624bb83: runtime(doc): Tweak documentation style a bit (#31148)
closes: vim/vim#11419

624bb83619

Skip syncolor.vim and v:colornames

Co-authored-by: h-east <h.east.727@gmail.com>
2024-11-10 09:11:06 +08:00
dundargoc
7d8dd8234a ci: downgrade to clang 19
Clang 20 is still in development at the time of this commit and is
unsuitable for CI.
2024-11-09 15:42:52 +01:00
Luuk van Baal
4f9260d06a feat(ext_messages): add hl_id to ext_messages chunks
Problem:  Ext_messages chunks only contain the highlight attr id, which
          is not very useful for vim.ui_attach() consumers.
Solotion: Add highlight group id to message chunks, which can easily be
          used to highlight text in the TUI through nvim_buf_set_extmark():
          hl_group = synIDattr(id, "name").
2024-11-09 14:28:17 +01:00
bfredl
dd4c828c86 Merge pull request #31118 from bfredl/merehl
refactor(tests): continue the global highlight definition work
2024-11-09 13:48:45 +01:00
dundargoc
07b14c8e2e build: specify POST_BUILD when using add_custom_command
This is needed specifically for the second signature of
add_custom_command, which appends an operation to an existing target.
This will prevent the cmake warning CMP0175.

Reference: https://cmake.org/cmake/help/latest/policy/CMP0175.html
2024-11-09 13:07:16 +01:00
Lewis Russell
4b001f297a fix(lsp): fix infinite loop
Fixes #31129
2024-11-09 09:41:12 +00:00
zeertzjq
b7e1bbfb50 Merge pull request #31130 from zeertzjq/vim-3780c11
vim-patch: runtime file updates
2024-11-09 09:31:52 +08:00
zeertzjq
c914ecf4c9 vim-patch:0f60fbf: runtime(compiler): improve cppcheck
Properly escape the values for makeprg according to the :set rules

closes: vim/vim#16014

0f60fbf679

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-11-09 08:45:10 +08:00
zeertzjq
591884c9fb vim-patch:39f52a6: runtime(structurizr): Update structurizr syntax
closes: vim/vim#16003

39f52a6249

Co-authored-by: Duke <emersonalmeidax@gmail.com>
2024-11-09 08:44:44 +08:00
zeertzjq
6b6a3b3894 vim-patch:6e410c9: runtime(8th): updated 8th syntax
closes: vim/vim#16005

6e410c9112

Co-authored-by: Ron Aaron <ron@aaron-tech.com>
2024-11-09 08:44:20 +08:00
zeertzjq
b4c5e743ac vim-patch:6d9a145: runtime(compiler): add mypy and ruff compiler; update pylint linter
mypy and ruff come from
https://github.com/Konfekt/vim-compilers/tree/master/compiler and the
former was added by @pbnj-dragon

closes: vim/vim#16007

6d9a145d71

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-11-09 08:43:50 +08:00
zeertzjq
5c600370e0 vim-patch:64a536d: runtime(netrw): fix several bugs in netrw tree listing
fixes: vim/vim#5630
fixes: vim/vim#9807
fixes: vim/vim#14623
closes: vim/vim#15996

64a536d4fa

Co-authored-by: Tom Benham <tom.benham13@gmail.com>
2024-11-09 08:41:04 +08:00
zeertzjq
1d9eb84558 vim-patch:a063b22: runtime(netrw): prevent polluting the search history
a063b22b3b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-09 08:24:19 +08:00
zeertzjq
32566dc1c3 vim-patch:3780c11: runtime(compiler): fix typo in cppcheck compiler plugin
closes: vim/vim#16002

3780c11267

Co-authored-by: Enno <Konfekt@users.noreply.github.com>
2024-11-09 08:23:59 +08:00
dundargoc
5a27d02584 docs: misc (#30914)
Co-authored-by: Ernie Rael <errael@raelity.com>
Co-authored-by: Famiu Haque <famiuhaque@proton.me>
Co-authored-by: Jade <spacey-sooty@proton.me>
Co-authored-by: glepnir <glephunter@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-11-09 08:10:56 +08:00
Lewis Russell
ad3472e291 fix(vim.system): resolve executable paths on windows
Fixes #31107
2024-11-08 16:29:44 +00:00
Lewis Russell
7342e6b00d perf(lsp): do not apply semantic tokens to folded lines
Fixes #31106
2024-11-08 14:01:35 +00:00
Luuk van Baal
5cfa7a72f8 refactor(message): propagate highlight id instead of attrs
Problem:  Highlight group id is not propagated to the end of the message call
          stack, where ext_messages are emitted.
Solution: Refactor message functions to pass along highlight group id
          instead of attr id.
2024-11-08 13:21:35 +01:00
bfredl
abe6a07c54 refactor(tests): continue the global highlight definition work 2024-11-08 13:19:15 +01:00
bfredl
475f9f64ef Merge pull request #31073 from bfredl/cmdchar
fix(cmdline): simplify and correct grapheme cluster adjustment
2024-11-08 13:08:14 +01:00
bfredl
092042b43d fix(cmdline): simplify and correct grapheme cluster adjustment 2024-11-08 11:25:34 +01:00
bfredl
8ab1903092 Merge pull request #31040 from luukvbaal/cmdpreviewcurs
fix(inccommand): ensure cursor is where it belongs
2024-11-08 11:22:14 +01:00
zeertzjq
f83a31b49d refactor(options): use os_win/os_buf for local options (#31060)
Conversely, don't use them for global options.
2024-11-08 06:54:28 +00:00
Famiu Haque
8af1702647 refactor(options): remove varp argument for set_option (#31111)
Problem:
The `varp` argument for `set_option` is extraneous as the option's
variable pointer can be retrieved using the option's index and flags.

Solution:
Remove the `varp` argument for `set_option`
2024-11-08 13:28:18 +08:00
Luuk van Baal
59e130b6ca fix(inccommand): ensure cursor is where it belongs
Problem:  Inccommand preview callback may flush inaccurate cmdline cursor position.
Solution: Ensure cursor is where it belongs when doing command preview.
2024-11-07 13:12:30 +01:00
zeertzjq
5a86360400 test: add test for key following ignored mouse move (#31104) 2024-11-07 17:53:30 +08:00
errael
000129201c perf(mouse): only generate <MouseMove> for a new cell positon (#31103)
Problem: Can receive dozens of <MouseMove> events for same cell position. #30965
Solution: Leverage check_multiclick() to detect if cell position is unchanged.
2024-11-07 16:21:28 +08:00
Lewis Russell
f7e32fb6e6 fix(test): better management of tmpfiles
Problem:

When tmpdir is local. The returned values from tmpname may already
exist. This can cause problems for tests which pass `create=false` as
they may require the file to not exist yet.

Solution:

When creating tmp names, always remove it to ensure it doesn't exist,
and optionally open it if `create~=false`

Additionally refactor the tmpname code and flattrn some functions into
constants.

Also while debugging this issue. It was discovered that `exec_lua()`
doesn't report error messages properly. This has been fixed.
2024-11-06 11:37:33 +00:00
dundargoc
f8b193a01e ci: adjust reviewers 2024-11-06 11:22:09 +01:00
bfredl
c0f222d55b Merge pull request #31062 from famiu/refactor/options/ff_macro
refactor(options): remove fileformat macros
2024-11-06 10:19:28 +01:00
Famiu Haque
04274a4173 refactor(options): remove unnecessary call to find_option() (#31088) 2024-11-06 06:07:29 +08:00
Christian Clason
ba40a6dbe3 vim-patch:9.1.0839: filetype: leo files are not recognized
Problem:  filetype: leo files are not recognized
Solution: detect '*.leo' files as leo filetype, include
          a filetype plugin (Riley Bruins)

References:
https://github.com/ProvableHQ/leo

closes: vim/vim#15988

93f65a4ab8

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-11-05 08:31:45 +01:00
Christian Clason
65b9499e4a vim-patch:9.1.0840: filetype: idris2 files are not recognized
Problem:  filetype: idris2 files are not recognized
Solution: detect '*.idr' files as idris2, '*.lidr' files as lidris2
          and '*.ipkg' files as ipkg filetype (Serhii Khoma)

closes: vim/vim#15987

c04bc64ba6

Co-authored-by: Serhii Khoma <srghma@gmail.com>
2024-11-05 08:31:32 +01:00
Christian Clason
baf74ef975 vim-patch:59834ba: runtime(matchparen): Add matchparen_disable_cursor_hl config option
Set the "matchparen_disable_cursor_hl" config variable to disable
highlighting the cursor with the MatchParen highlighting group.

closes: vim/vim#15984

59834ba6df

Co-authored-by: Matteo Landi <matteo@matteolandi.net>
2024-11-05 08:31:19 +01:00
Christian Clason
fc8e786dae vim-patch:19bc76c: runtime(cook): include cook filetype plugin
References:
https://github.com/cooklang/spec?tab=readme-ov-file#comments

closes: vim/vim#15989

19bc76c929

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-11-05 08:31:19 +01:00
Christian Clason
9ee1c87591 vim-patch:9dadfe7: runtime(debversions): Update Debian versions
- Move mantic to unsupported
- Reorder names to maintain alphabetic order
- Bump date to submit upstream

closes: vim/vim#15991

9dadfe7a52

Co-authored-by: James McCoy <jamessan@jamessan.com>
2024-11-05 08:31:19 +01:00
zeertzjq
f5b84c1a44 vim-patch:9.1.0841: tests: still preferring python2 over python3 (#31083)
Problem:  tests: still preferring python2 over python3
Solution: prefer Python 3 when picking a Python program in Vim tests,
          by checking for the more specific python version first and
          only when python3 not found, check for the python binary
          (Yee Cheng Chin)

Most OSes have Python 3 mapped to `python3` instead of `python`. Vim
tests should prioritize using that instead of Python 2 in case that is
still installed on the host system.

closes: vim/vim#15986

cef8ab2c75

Cherry-pick test changes from patch 8.2.{2824,4684}.

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2024-11-04 23:26:33 +00:00
Famiu Haque
cbc9a03f58 refactor(options): remove fileformat macros 2024-11-05 02:36:51 +06:00
Yochem van Rosmalen
079e5f4f9b feat(defaults): unimpaired empty line below/above cursor #30984 2024-11-04 06:06:18 -08:00
Famiu Haque
a27419f3fc feat(options)!: disallow setting hidden options #28400
Problem:
There are three different ways of marking an option as hidden, `enable_if
= false`, `hidden = true` and `immutable = true`. These also have different
behaviors. Options hidden with `enable_if = false` can't have their value
fetched using Vim script or the API, but options hidden with `hidden = true` or
`immutable = true` can. On the other hand, options with `hidden = true` do not
error when trying to set their value, but options with `immutable = true` do.

Solution:
Remove `enable_if = false`, remove the `hidden` property for options, and use
`immutable = true` to mark an option as hidden instead. Also make hidden option
variable pointers always point to the default value, which allows fetching the
value of every hidden option using Vim script and the API. This does also mean
that trying to set a hidden option will now give an error instead of just being
ignored.
2024-11-04 05:00:12 -08:00
bfredl
04d178053f Merge pull request #30608 from bfredl/cchar2
feat(editor): handle new multibyte sequences in normal mode replacement
2024-11-04 13:59:24 +01:00
bfredl
23290e7676 feat(editor): handle new multibyte sequences in normal mode replacement
while the implementation is not tied to screen chars, it is a reasonable
expectation to support the same size. If nvim is able to display a
multibyte character, it will accept the same character as input,
including in normal mode commands like r{char}
2024-11-04 13:12:33 +01:00
Lewis Russell
6e68fed374 feat(lsp): multi-client support for signature_help
Signatures can be cycled using `<C-s>` when the user enters the floating
window.
2024-11-04 11:55:39 +00:00
dundargoc
0da4d89558 ci: work around flaky python tests (#31063)
It's the same workaround as 88ed9ffcd1,
which was later removed in f707ce76ac
after it turned out to be stable after a while.
2024-11-03 23:00:18 +08:00
zeertzjq
76643a1c0d Merge pull request #31059 from zeertzjq/vim-9.1.0832
vim-patch:9.1.{0832,0835}
2024-11-03 17:46:02 +08:00
zeertzjq
fe565ca382 vim-patch:9.1.0835: :setglobal doesn't work properly for 'ffu' and 'tsrfu'
Problem:  :setglobal doesn't work properly for 'ffu' and 'tsrfu' when
          the local value is set (after v9.1.0831)
Solution: Check os_flags instead of buffer option variable (zeertzjq).

closes: vim/vim#15980

6eda269600
2024-11-03 17:04:34 +08:00
zeertzjq
981fa11c91 vim-patch:9.1.0832: :set doesn't work for 'cot' and 'bkc' after :setlocal
Problem:  :set doesn't work for 'cot' and 'bkc' after :setlocal.
Solution: clear the local flags when using :set (zeertzjq).

closes: vim/vim#15981

46dcd84d24
2024-11-03 16:58:22 +08:00
zeertzjq
99acc9de55 fix(treesitter): close InspectTree/EditQuery window on BufUnload (#31036)
Problem:  The window opened :InspectTree or :EditQuery isn't closed when
          the source buffer is unloaded, even though it is closed when
          the buffer is hidden.
Solution: Also close the window on BufUnload.
2024-11-03 11:28:31 +08:00
zeertzjq
3075c69ff0 vim-patch:9.1.0831: 'findexpr' can't be used as lambad or Funcref (#31058)
Problem:  'findexpr' can't be used for lambads
          (Justin Keyes)
Solution: Replace the findexpr option with the findfunc option
          (Yegappan Lakshmanan)

related: vim/vim#15905
closes: vim/vim#15976

a13f3a4f5d

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-11-03 10:06:41 +08:00
zeertzjq
ed3fb1bb9a vim-patch:9.1.0830: using wrong highlight group for spaces for popupmenu (#31054)
Problem:  using wrong highlight group for spaces for popupmenu
Solution: use original attribute instead of combined attributed
          (glepnir)

closes: vim/vim#15978

bc10be7a40

Co-authored-by: glepnir <glephunter@gmail.com>
2024-11-03 08:27:15 +08:00
zeertzjq
f3606416f0 vim-patch:a95d6a3: runtime(doc): remove stray sentence in pi_netrw.txt (#31053)
closes: vim/vim#15971

a95d6a3d64

Co-authored-by: S. B. Tam <cpplearner@outlook.com>
2024-11-03 07:19:57 +08:00
Christian Clason
2e3f1069f4 fix(health): better layout of vim.treesitter health check
Problem: Long lists of available parsers make it hard to see WASM
status.

Solution: Add separate headings for "treesitter features" (ABI, WASM)
and "treesitter parsers". Also add minimum supported ABI version.
2024-11-02 23:51:00 +01:00
Christian Clason
db46b58569 vim-patch:9.1.0826: filetype: sway files are not recognized
Problem:  filetype: sway files are not recognized
Solution: detect '*.sw' files as sway filetype, include
          a filetype plugin (Riley Bruins)

References:
 https://github.com/FuelLabs/sway.

Comments taken from their syntax documentation. File extension taken
from the same documentation/GitHub's own recognition of these file types

closes: vim/vim#15973

84b5b1c660

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-11-02 23:33:38 +01:00
Christian Clason
f5933d196b vim-patch:d181baf: runtime(typst): synchronize updates from the upstream typst.vim
2 commits included from the upstream:

- 2a4a0e0662
- 50e89f4811

d181bafd0b

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-11-02 23:33:25 +01:00
Famiu Haque
86e54734bf refactor(options): remove get_option_value_strict
Problem: `get_option_value_for` can perfectly replace `get_option_value_strict`, making the latter redundant.

Solution: Remove `get_option_value_strict`
2024-11-02 15:53:49 +00:00
zeertzjq
3688a33354 fix(lua): show stacktrace for error in vim.on_key() callback (#31021) 2024-11-02 10:11:06 +08:00
zeertzjq
b25ae5d328 vim-patch:26113e5: runtime(doc): Include netrw-gp in TOC (#31032)
closes: vim/vim#7627

26113e5ae3

Co-authored-by: Ernesto Elsäßer <ernesto.elsaesser@me.com>
2024-11-02 07:11:15 +08:00
Famiu Haque
ec0c53b3da refactor(options): unify put_set(num|bool|string) (#30993)
Problem:
There are three separate functions for printing the `:set` command for
an setting an option to a file descriptor. These functions are used when
creating the session file for an option. Having a function for each type
increase code duplication and also makes it harder to add logic for new
option types.

Solution:
Replace `put_set(num|bool|string)` with a single `put_set` function
which works for all option types, this reduces code duplication and also
makes it trivial to add support for more option types in the future.
2024-11-02 06:44:56 +08:00
zeertzjq
7bf3a616e1 vim-patch:b5e7da1: runtime(doc): mention 'iskeyword' at :h charclass() (#31026)
fixes: vim/vim#15965

b5e7da1f27

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-11-01 18:22:08 +08:00
zeertzjq
cbd8b2c162 vim-patch:9.1.0824: too many strlen() calls in register.c (#31022)
Problem:  too many strlen() calls in register.c
Solution: refactor code, add string_T struct to keep track
          of string lengths (John Marriott)

closes: vim/vim#15952

79f6ffd388

Co-authored-by: John Marriott <basilisk@internode.on.net>
2024-11-01 09:34:19 +00:00
Lewis Russell
9b357e30fd feat(lsp)!: remove client-server handlers from vim.lsp.handlers
- Partition the handlers in vim.lsp.handlers as:
  - client to server response handlers (RCS)
  - server to client request handlers (RSC)
  - server to client notification handlers (NSC)

  Note use string indexes instead of protocol.methods for improved
  typing in LuaLS (tip: use hover on RCS, RSC or NSC).
2024-11-01 09:17:39 +00:00
nikolightsaber
f54266dbed fix(lsp): hover border type can be string (#31013)
Border type can also be a string as defined in `api-win_config`

Co-authored-by: Nikolai Devolder <nikolai.devolder@yamabiko.eu>
2024-11-01 10:03:09 +01:00
errael
b34e137e43 feat(lua): allow vim.on_key() callback to consume the key (#30939) 2024-11-01 09:11:15 +08:00
Lewis Russell
8585183ba2 Merge pull request #31011 from lewis6991/refactor/loader 2024-10-31 16:06:18 +00:00
Lewis Russell
be04bbf781 refactor(loader): format annotations 2024-10-31 15:20:29 +00:00
Lewis Russell
086e598a6e refactor(loader): use the term stat instead of hash 2024-10-31 15:20:29 +00:00
Lewis Russell
8d68d883a9 refactor(loader): remove Loader table and use locals 2024-10-31 15:20:29 +00:00
Lewis Russell
4a0010e267 refactor(loader): rename types 2024-10-31 15:20:29 +00:00
Lewis Russell
7ccdd9235a refactor(loader): inline Loader.load into Loader.loadfile 2024-10-31 15:20:29 +00:00
Lewis Russell
ab2f2461b5 refactor(loader): simplify Loader.loader_lib 2024-10-31 15:20:27 +00:00
Lewis Russell
53536be62a refactor(loader): simplify Loader.write/read 2024-10-31 15:02:12 +00:00
Lewis Russell
f8fc6cb157 perf(loader): reduce calls to Loader.cache_file 2024-10-31 15:02:08 +00:00
Lewis Russell
03118c46ab refactor(loader): remove unused _topmods 2024-10-31 14:15:09 +00:00
Lewis Russell
1d4ba8c1ed fix: another round of type annotation fixes 2024-10-31 11:55:23 +00:00
zeertzjq
0ab4d36254 Merge pull request #31008 from zeertzjq/vim-3d7e567
vim-patch: netrw fixes
2024-10-31 19:28:24 +08:00
zeertzjq
9f79360b92 vim-patch:4d61800: runtime(netrw): fix E874 when browsing remote directory which contains ~ character
closes: vim/vim#15964

4d618006ec

Co-authored-by: Tom Benham <tom.benham13@gmail.com>
2024-10-31 19:00:06 +08:00
zeertzjq
35e07a24a3 vim-patch:8b0fa7a: runtime(netrw): make :Launch/Open autoloadable
fixes: vim/vim#15959
closes: vim/vim#15962

8b0fa7a565

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-10-31 18:59:49 +08:00
zeertzjq
d618fd3921 vim-patch:9f32069: runtime(netrw): fix regression with x mapping on Cygwin
related: vim/vim#13687

9f32069b8c

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: K.Takata <kentkt@csc.jp>
2024-10-31 18:59:27 +08:00
zeertzjq
65abfc86e4 vim-patch:aa2ce6f: runtime(netrw): fix filetype detection for remote files
fixes: vim/vim#15961

while at it, remove the Decho comments in the s:NetrwOptionsRestore()
function

aa2ce6f580

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-10-31 18:59:01 +08:00
zeertzjq
122cd35e4d vim-patch:d69ffbe: runtime(netrw): add missing change for s:redir()
Somehow, that change got lost in commit 70197885

d69ffbe4bc

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-10-31 18:56:02 +08:00
zeertzjq
2ce26010a6 vim-patch:7019788: runtime(netrw): improve netrw's open-handling further
closes: vim/vim#15956

70197885a8

Co-authored-by: Enno <Konfekt@users.noreply.github.com>
2024-10-31 18:55:48 +08:00
zeertzjq
64bca57dc6 vim-patch:7c96776: runtime(netrw): fix syntax error in netrwPlugin.vim
7c96776729

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-10-31 18:55:26 +08:00
zeertzjq
c1e020b7f3 vim-patch:3d7e567: runtime(netrw): simplify gx file handling
It did not work very well, at least on Debian 12, and I am not sure Git
Bash and WSL, for example, were taken care of as maintenance stalled.

The whole logic was somewhat convoluted with some parts repeatedly invoking
failed commands.

The file handling was outdated, for example, nowadays Netscape is rarely
used, and also opinionated, for example mainly Microsoft Paint and Gimp for
Image files.

Instead, let's use (xdg-)open and similar commands on other systems
which respects the user's preferences.

closes: vim/vim#15721

3d7e567ea7

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
Co-authored-by: Luca Saccarola <96259932+saccarosium@users.noreply.github.com>
2024-10-31 18:55:08 +08:00
Christian Clason
0a1eeb90cb vim-patch:6be21b9: runtime(debversions): Add plucky (25.04) as Ubuntu release name
closes: vim/vim#15882

6be21b937d

Co-authored-by: Simon Quigley <tsimonq2@ubuntu.com>
2024-10-31 11:47:25 +01:00
Christian Clason
82e5066a7f vim-patch:9.1.0823: filetype: Zephyr overlay files not recognized
Problem:  filetype: Zephyr overlay files not recognized
Solution: detect '*.overlay' files as dts filetype,
          include syntax tests for DTS files
          (Xudong Zheng)

Reference:
https://docs.zephyrproject.org/latest/build/dts/howtos.html

closes: vim/vim#15963

a68bd6f089

Co-authored-by: Xudong Zheng <7pkvm5aw@slicealias.com>
2024-10-31 10:24:37 +01:00
Evgeni Chasnovski
295920845e feat(highlight): make PmenuMatch and PmenuMatchSel bold
Problem: both `PmenuMatch` and `PmenuMatchSel` can provide helpful
  information about characters which actually match query in completion
  candidates. This is not as useful with default regular match, but much
  more useful with 'completopt+=fuzzy'.

Solution: make both highlight groups bold. This will also affect
  (i.e. benefit) other color schemes which do not define groups
  separately.
  This is possible since the recently merged changes to `PmenuMatch` and
  `PmenuMatchSel` combine attributes with underlying "base" groups.
  See PR 29980.
2024-10-31 09:47:40 +01:00
zeertzjq
8df6822507 test: fix files being left behind (#31004) 2024-10-31 00:04:51 +00:00
notomo
b4599acbf8 fix(lsp): correct hover result handling (#30995)
Problem: vim.lsp.buf.hover() displays "No information available" when client_id
is not 1.

Solution: use vim.tbl_isempty(tbl) instead of #tbl==0
2024-10-30 16:57:33 +01:00
zeertzjq
05d9e6a9e8 vim-patch:9.1.0822: topline might be changed in diff mode unexpectedly (#30988)
Problem:  topline might be changed in diff mode unexpectedly
          (Jaehwang Jung)
Solution: do not re-calculate topline, when using line() func
          in diff mode.

fixes: vim/vim#15812
closes: vim/vim#15950

05a40e07c2

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-10-30 09:05:11 +08:00
Gregory Anders
ff93cccbc1 fix(defaults): omit extraneous info from unimpaired mapping errors (#30983) 2024-10-29 10:06:14 -05:00
Kai Moschcau
4c7f5032af docs(options): shell-powershell #30969
`-NonInteractive` at least somewhat hints to pwsh/powershell, that shell
sessions created from :! are not interactive, though even that is not
foolproof, because powershell is weird.
`$PSStyle.OutputRendering='plaintext'` causes pwsh/powershell
to omit ANSI escape sequences in its output.
2024-10-29 07:36:58 -07:00
Lewis Russell
2cd6abf0d7 Merge pull request #30935 from lewis6991/feat/lsp_multi_hover 2024-10-29 09:51:14 +00:00
Lewis Russell
8260e4860b feat(lsp)!: multiple client support for vim.lsp.buf.hover()
Deprecate `vim.lsp.handlers.hover` and `vim.lsp.handlers['textDocument/hover']`
2024-10-29 09:06:05 +00:00
Lewis Russell
1471dfc859 refactor(lsp): buf_request_all 2024-10-29 09:06:05 +00:00
Christian Clason
8f9401f5c8 vim-patch:1e2007e: runtime(awk): Highlight more awk comments in syntax script
closes: vim/vim#15944

1e2007e643

Co-authored-by: John M Devin <john.m.devin@gmail.com>
2024-10-29 08:30:59 +01:00
zeertzjq
4a4b52dca4 vim-patch:9.1.0820: tests: Mac OS tests are too flaky (#30980)
Problem:  tests: Mac OS tests are too flaky
Solution: Increase max test timeout to 25 minutes,
          allow up to 10 retries on Mac OS runners,
          refactor runtest.vim (Milly).

closes: vim/vim#15940

baab7c0865

Co-authored-by: Milly <milly.ca@gmail.com>
Co-authored-by: K.Takata <kentkt@csc.jp>
2024-10-29 09:08:05 +08:00
zeertzjq
0e32c48060 Merge pull request #30979 from zeertzjq/vim-9.1.0810
vim-patch:9.1.{0810,0811,0821}: 'findexpr'
2024-10-29 09:01:46 +08:00
zeertzjq
60b3ccd850 vim-patch:9.1.0821: 'findexpr' completion doesn't set v:fname to cmdline argument
Problem:  'findexpr' completion doesn't set v:fname to cmdline argument.
Solution: Set v:fname to the cmdline argument as-is (zeertzjq).

closes: vim/vim#15934

20e045f781
2024-10-29 08:20:00 +08:00
zeertzjq
6b8c3d146e vim-patch:9.1.0811: :find expansion does not consider 'findexpr'
Problem:  :find expansion does not consider 'findexpr'
Solution: Support expanding :find command argument using 'findexpr'
          (Yegappan Lakshmanan)

closes: vim/vim#15929

2f6efaccfd

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-10-29 08:20:00 +08:00
zeertzjq
378d9135e7 vim-patch:9.1.0810: cannot easily adjust the |:find| command
Problem:  cannot easily adjust the |:find| command
Solution: Add support for the 'findexpr' option (Yegappan Lakshmanan)

closes: vim/vim#15901
closes: vim/vim#15905

aeb1c97db5

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-10-29 08:20:00 +08:00
zeertzjq
42fa3d080e refactor: sort various Lua tables in src/ alphabetically (#30977) 2024-10-29 07:57:25 +08:00
Famiu Haque
34c44c3556 refactor(options): option flags enum #30961
Problem: Currently we use macros with hardcoded flag values for option flags, which is messy and requires a lot of mental math for adding / removing option flags. Using macros for option flags also means that they cannot be used inside debuggers.

Solution: Create a new `OptFlags` enum that stores all the option flags in an organized way that is easier to understand.
2024-10-28 06:49:16 -07:00
Nikita Revenco
0b7cc014fc feat(defaults): map gO to LSP document_symbol #30781 2024-10-28 06:29:29 -07:00
Maria José Solano
0086ee90dd fix(lsp): list all workspace folders in healthcheck #30966 2024-10-28 06:14:56 -07:00
zeertzjq
ff29fd8c6e test(pum): add test for item selection with 'rightleft' (#30968) 2024-10-28 17:20:00 +08:00
zeertzjq
d24fb72c33 fix(pum): don't select item when clicking to the left/right (#30967)
Problem:  Selecting an item in the right-click menu when clicking to the
          left/right of it is confusing, especially in a UI that doesn't
          support 'mousemoveevent'.
Solution: Don't select an item when clicking to the left/right of the
          right-click menu.
2024-10-28 14:29:59 +08:00
Amaan Qureshi
7a20f93a92 fix(treesitter): correct condition in __has_ancestor 2024-10-27 17:56:06 +00:00
Donatas
a9e725b26e feat(diagnostics)!: sort underline severity_sort (#30898)
feat(diagnostics)!: sort underline with severity_sort

BREAKING CHANGE: underline will be applied with a higher value than `vim.hl.priorities.diagnostics`
2024-10-27 11:36:39 -05:00
Gregory Anders
adf7c98d60 fix(lsp): compare URI instead of workspace folder name (#30962)
The workspace folder name is meant to be a human-readable name which is
only used in the UI. Comparing the name against root_dir is thus not
a valid comparison. Instead, we should compare the workspace folder's
URI against the root dir URI.
2024-10-27 11:35:45 -05:00
echometerain
45e319ade6 feat(tutor): give hints to satisfy the line checker #30952
Problem: novice users relying on vimtutor won't know what to do when they follow the instructions and delete a couple lines and that breaks the line checker

Solution: tell the user to fix the line numbers after they're done
2024-10-27 06:50:17 -07:00
Famiu Haque
b136a9ee4c refactor(options): always allocate option values (#30917)
Instead of keeping `P_ALLOCED` and `P_DEF_ALLOCED` flags to check if an
option value is allocated, always allocate option values to simplify the
logic.

Ref: #25672
2024-10-27 13:09:24 +00:00
Maria José Solano
123c0b6b4e docs(lsp): document alternative for vim.lsp.util.jump_to_location 2024-10-27 09:26:52 +00:00
Riley Bruins
f60a1f9059 docs(treesitter): specify predicate boolean return value 2024-10-27 09:25:07 +00:00
Tristan Knight
25b53b593e refactor(lsp): drop str_byteindex/str_utfindex wrappers #30915
* deprecate old signatures
* move to new str_byteindex/str_utfindex signature
* use single-underscore name (double-underscore is reserved for Lua itself)
2024-10-26 07:38:25 -07:00
Famiu Haque
b922b7d6d7 refactor(options)!: use OptVal for option defaults #26691
Problem: We use `void *` for option default values, which is confusing and can cause problems with type-correctness. It also doesn't accomodate for multitype options. On top of that, it also leads to default boolean option values not behaving correctly on big endian systems.

Solution: Use `OptVal` for option default values.

BREAKING CHANGE:
- `:set {option}<` removes the local value for all global-local options instead of just string global-local options.
- `:setlocal {option}<` copies the global value to the local value for number and boolean global-local options instead of removing the local value.
2024-10-25 07:10:40 -07:00
Maria José Solano
01739d4673 fix(defaults): missing ]Q/[Q unimpaired mappings #30943 2024-10-25 06:45:27 -07:00
zeertzjq
e4a74e986c vim-patch:9.1.0814: mapset() may remove unrelated mapping (#30941)
Problem:  mapset() may remove unrelated mapping whose {rhs} matches the
          restored mapping's {lhs}.
Solution: only match by {lhs} when unmapping for mapset() (zeertzjq).

closes: vim/vim#15935

fdf135a052
2024-10-24 23:16:54 +00:00
Lewis Russell
54249d051c feat(lsp): deprecate vim.lsp.buf.completion
Use `vim.lsp.completion.trigger()` instead'
2024-10-24 16:36:14 +01:00
Lewis Russell
7a7747f1e4 feat(lsp): deprecate execute_command with client:exec_cmd 2024-10-24 15:37:34 +01:00
Lewis Russell
39d79efa1e fix(lsp): better multi-client support for callHierarchy
Only ever display a dialogue box once.

Switch from vim.fn.inpulist to vim.ui.select

refactor(lsp): merge call and type hierarchy functions
2024-10-24 13:15:25 +01:00
Lewis Russell
c8d7d65679 fix(lsp): use correct method for prepareTypehierarchy
Regression from #30902
2024-10-24 13:15:25 +01:00
Mathias Fussenegger
3c51058d76 fix(lsp): set tagstack on jump via goto methods
Follow up to https://github.com/neovim/neovim/pull/30877
Fixes https://github.com/neovim/neovim/issues/30926
2024-10-24 13:43:49 +02:00
Lewis Russell
5c44c02405 Merge pull request #30929 from lewis6991/fix/lsp_param_encodings 2024-10-24 11:19:38 +01:00
Lewis Russell
2dcbfe78fc fix(lsp.buf): use correct offset_encoding for all requests
Problem:

`lsp.buf_request` send the same params to all servers and many
calls to this pass PositionalParams which depends on the clients
offset_encoding. This can result with incorrect params being sent
to a server.

Solution:

`lsp.buf_request` `params` argument can now be passed as a function
which takes the client as the first argument. This is used in
lsp/buf.lua to construct correct params for each client request.
2024-10-24 10:53:06 +01:00
Lewis Russell
3275ae830d fix(lsp.protocal): improve typing of constants 2024-10-24 10:53:03 +01:00
Lewis Russell
2ee39b7eb4 refactor(lsp.buf): remove buf_request wrapper 2024-10-24 09:58:22 +01:00
Lewis Russell
ad4e14c201 refactor(lsp.buf): use alias for vim.lsp 2024-10-24 09:55:23 +01:00
Mathias Fussenegger
008782208d fix(lsp): handle mixed encoding in tagfunc params
Relates to https://github.com/neovim/neovim/issues/30034
2024-10-24 09:56:58 +02:00
zeertzjq
50e63c8171 fix(options): missing error check for global 'scl' and 'winhl' (#30919) 2024-10-24 10:03:38 +08:00
zeertzjq
fffcb88ad6 test(012_directory_spec): fix flakiness on Windows (#30920)
Problem:  012_directory_spec is flaky on Windows.
Solution: Use :%bwipe! instead :qall!.
2024-10-24 10:03:23 +08:00
zeertzjq
611c416359 Merge pull request #30918 from zeertzjq/vim-9.1.0802
vim-patch:9.1.{0802,0803,0804,0806,0812}: :setglobal fixes
2024-10-24 07:22:04 +08:00
zeertzjq
19204ebde9 test(old): remove unnecessary :setglobal skips 2024-10-24 06:56:12 +08:00
zeertzjq
a0ad35e3bb vim-patch:9.1.0812: Coverity warns about dereferencing NULL ptr
Problem:  Coverity warns about dereferencing NULL ptr
          in check_colorcolumn()
Solution: verify that wp is not null before accessing it

related: vim/vim#15914

d0809869d6

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-10-24 06:56:12 +08:00
zeertzjq
6b63fe798b vim-patch:9.1.0806: tests: no error check when setting global 'briopt'
Problem:  tests: no error check when setting global 'briopt'
Solution: also parse and check global 'briopt' value (Milly)

closes: vim/vim#15911

b38700ac81

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-24 06:56:12 +08:00
zeertzjq
5436d9b3c6 vim-patch:9.1.0804: tests: no error check when setting global 'cc'
Problem:  tests: no error check when setting global 'cc'
Solution: also parse and check global 'cc' value (Milly)

closes: vim/vim#15914

a441a3eaab

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-24 06:56:12 +08:00
zeertzjq
3d2aca83de vim-patch:9.1.0803: tests: no error check when setting global 'isk'
Problem:  tests: no error check when setting global 'isk'
Solution: also parse and check global 'isk' value (Milly)

closes: vim/vim#15915

5e7a6a4a10

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-24 06:56:12 +08:00
zeertzjq
6d2cf5ad31 vim-patch:9.1.0802: tests: no error check when setting global 'fdm' to empty value
Problem:  tests: no error check when setting global 'fdm' to empty value
Solution: Also check global 'fdm' value for being empty (Milly).

closes: vim/vim#15916

142cad1f88

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-24 06:56:11 +08:00
Tristan Knight
230b0c7f02 feat(stdlib): overload vim.str_byteindex, vim.str_utfindex #30735
PROBLEM:
There are several limitations to vim.str_byteindex, vim.str_utfindex:
1. They throw given out-of-range indexes. An invalid (often user/lsp-provided)
   index doesn't feel exceptional and should be handled by the caller.
   `:help dev-error-patterns` suggests that `retval, errmsg` is the preferred
   way to handle this kind of failure.
2. They cannot accept an encoding. So LSP needs wrapper functions. #25272
3. The current signatures are not extensible.
    * Calling: The function currently uses a fairly opaque boolean value to
      indicate to identify the encoding.
    * Returns: The fact it can throw requires wrapping in pcall.
4. The current name doesn't follow suggestions in `:h dev-naming` and I think
   `get` would be suitable.

SOLUTION:
- Because these are performance-sensitive, don't introduce `opts`.
- Introduce an "overload" that accepts `encoding:string` and
  `strict_indexing:bool` params.

```lua
local col = vim.str_utfindex(line, encoding, [index, [no_out_of_range]])
```

Support the old versions by dispatching on the type of argument 2, and
deprecate that form.

```lua
vim.str_utfindex(line)                             -- (utf-32 length, utf-16 length), deprecated
vim.str_utfindex(line, index)                      -- (utf-32 index, utf-16 index), deprecated
vim.str_utfindex(line, 'utf-16')                   -- utf-16 length
vim.str_utfindex(line, 'utf-16', index)            -- utf-16 index
vim.str_utfindex(line, 'utf-16', math.huge)        -- error: index out of range
vim.str_utfindex(line, 'utf-16', math.huge, false) -- utf-16 length
```
2024-10-23 06:33:57 -07:00
dundargoc
3a86b60032 docs: misc
Co-authored-by: David Pedersen <limero@me.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Leo Schlosser <Leo.Schlosser@Student.HTW-Berlin.de>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-10-23 14:13:42 +02:00
Maria José Solano
f6f2334ac2 fix(defaults): error messages UX for unimpaired mappings #30884 2024-10-23 04:40:12 -07:00
Christian Clason
02749de7d5 vim-patch:9.1.0809: filetype: petalinux config files not recognized
Problem:  filetype: petalinux config files not recognized
Solution: detect 'project-spec/*.conf' files as bitbake filetype
          (Wu, Zhenyu)

References:
https://www.amd.com/en/products/software/adaptive-socs-and-fpgas/embedded-software/petalinux-sdk.html

closes: vim/vim#15926

626b6ab486

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-10-23 10:00:52 +02:00
zeertzjq
6dad1f9f19 Merge pull request #30907 from zeertzjq/vim-9.1.0805
vim-patch:9.1.{0799,0805},19be0eb
2024-10-23 07:57:07 +08:00
zeertzjq
da45827787 vim-patch:9.1.0805: tests: minor issues in gen_opt_test.vim
Problem:  tests: minor issues in gen_opt_test.vim
Solution: fix restore value for 'undolevels', fix comment, fix
          wrong cpo value, add equality test for global-local options on
          switchback (Milly).

closes: vim/vim#15913

231480f975

Cherry-pick gen_opt_test.vim change from patch 9.1.0807.

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-23 07:38:11 +08:00
zeertzjq
4ad4225bdb vim-patch:19be0eb: runtime(doc): :ownsyntax also resets 'spelloptions'
closes: vim/vim#15919

19be0eb7f0
2024-10-23 07:38:11 +08:00
zeertzjq
c1330816dc vim-patch:9.1.0799: tests: gettwinvar()/gettabwinvar() tests are not comprehensive
Problem:  tests: gettwinvar()/gettabwinvar() tests are not comprehensive
Solution: Add more tests (Milly)

closes: vim/vim#15920

ceec8640df

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-23 07:38:10 +08:00
Lewis Russell
629a5b71b5 fix(lsp): support multiple clients in typehierarchy 2024-10-22 21:59:48 +01:00
dundargoc
4c25e60767 test: port libvterm unit test to neovim test suite
These were imported from the v0.3.3 git tag
https://github.com/neovim/libvterm/tree/v0.3.3 and not the latest
commit. This is for compatibility reasons as the libvterm code was
imported from v0.3.3.
2024-10-22 21:20:11 +02:00
Famiu Haque
07b4cb6ada docs(options): remove description for hidden options #30903
Problem:
Hidden options are documented despite being no-ops.

Solution:
Remove docs for hidden options.
Move tags for options that we plan to restore, to ":help nvim-missing".
Move tags for permanently removed options, to ":help nvim-removed".
2024-10-22 09:14:01 -07:00
Tom Scogland
e178331488 build(lpeg): search for lpeg.so on MacOS
Problem: Currently Neovim only searches for lpeg.dylib, liblpeg.dylib,
etc. on MacOS, but a normal installation of lpeg will produce lpeg.so
instead.  There are explicit workarounds for this by modifying lpeg's
package in Homebrew, and will shortly be another in spack.

Solution: also search for lpeg.so even if that's not the platform
default, because Lua and luarocks use it anyway.
2024-10-22 14:29:20 +02:00
dundargoc
573bcb2aaf build: remove enforcement of cmake build type
Forcing the build type to be one of the default types was intended to
prevent usage of custom build types which risks unpredictability.
Unfortunately, many distributions patch this check out so they can use
a custom type anyway, making the check moot in the first place. Instead,
allow custom build types but don't try to accomodate them in the code:
we're making the assumption that anyone who wants to use a custom build
type will be able to set any additional necessary flags needed for their
specific system.
2024-10-22 11:21:54 +02:00
zeertzjq
8c532a9ea8 fix(options): fix 'winhl' still accepting invalid value (#30896) 2024-10-22 08:10:15 +00:00
zeertzjq
772614f9cc refactor(eval): fix clear_evalarg() called with wrong argument (#30899) 2024-10-22 07:23:34 +00:00
Christian Clason
85e04d9b87 vim-patch:a7d4561: runtime(netrw): deprecate and remove netrwFileHandlers#Invoke()
closes: vim/vim#15895

a7d456191d

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-10-22 09:10:46 +02:00
Christian Clason
a25ec00f88 vim-patch:421ed14: runtime(typst): add folding to typst ftplugin
closes: vim/vim#15897

421ed14b8a

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2024-10-22 09:10:46 +02:00
Christian Clason
a6d1165771 vim-patch:9.1.0796: filetype: libtool files are not recognized
Problem:  filetype: libtool files are not recognized
Solution: detect '*.{lo,la,lai}' as sh filetype
          (Wu, Zhenyu)

closes: vim/vim#15751

bfe568d8c4

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-10-22 08:55:39 +02:00
Christian Clason
b7779aad41 vim-patch:9.1.0795: filetype: Vivado memory info file are not recognized
Problem:  filetype: Vivado memory info file are not recognized
Solution: detect '*.mmi' memory info file as xml filetype
          (Wu, Zhenyu)

References: https://docs.amd.com/r/en-US/ug1580-updatemem/MMI-File-Syntax

closes: vim/vim#15906

0887e62bce

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-10-22 08:55:39 +02:00
zeertzjq
ca7855c5ba vim-patch:9.1.0798: too many strlen() calls in cmdhist.c (#30895)
Problem:  too many strlen() calls in cmdhist.c
Solution: refactor code and remove strlen() calls
          (John Marriott)

closes: vim/vim#15888

8df07d0ca3

Co-authored-by: John Marriott <basilisk@internode.on.net>
2024-10-22 13:03:02 +08:00
zeertzjq
1b9dafa67b fix(options): fix :setglobal not working for 'spelloptions' (#30894) 2024-10-22 11:34:09 +08:00
zeertzjq
f663243e95 vim-patch:9.1.0797: testing of options can be further improved (#30893)
Problem:  testing of options can be further improved
Solution: split the generated option test into test_options_all.vim,
          add more test cases, save and restore values, fix use-after-free

closes: vim/vim#15894

6eca04e9f1

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-22 09:05:14 +08:00
Lewis Russell
c8e47f6480 fix(meta): do not use hyphens in param names
Fixes #30882
2024-10-21 12:09:33 +01:00
Lewis Russell
3572319b4c feat(vim.validate): improve fast form and deprecate spec form
Problem:

`vim.validate()` takes two forms when it only needs one.

Solution:

- Teach the fast form all the features of the spec form.
- Deprecate the spec form.
- General optimizations for both forms.
- Add a `message` argument which can be used alongside or in place
  of the `optional` argument.
2024-10-21 11:32:06 +01:00
Christian Clason
6fd13eedda test(rpc): retry flaky 'vim.rpcrequest and vim.rpcnotify' test
Problem: 'vim.rpcrequest and vim.rpcnotify' is flaky on Windows.

Solution: retry it.
2024-10-21 11:24:34 +02:00
Justin M. Keyes
86832dcd19 Merge #30840 from justinmk/renamehl 2024-10-20 16:44:39 -07:00
zeertzjq
8c2d45be77 fix(exit): close memfiles after processing events (#30872)
Problem:  When exiting, processed events may still use memfiles after
          they are closed.
Solution: Close memfiles after processing events.
2024-10-21 07:22:42 +08:00
Justin M. Keyes
18b43c331d refactor: rename vim.highlight => vim.hl
Problem:
- `vim.highlight` module does not follow `:help dev-name-common`, which
  documents the name for "highlight" as "hl".
- Shorter names are usually preferred.

Solution:
Rename `vim.highlight` to `vim.hl`.

This is not a breaking change until 2.0 (or maybe never).
2024-10-21 00:54:43 +02:00
Justin M. Keyes
960fdc775a fix(lua): vim.deprecate does not support major>0 2024-10-21 00:54:42 +02:00
Justin M. Keyes
c9c17fda80 feat(deprecations): vim._defer_deprecated_module() 2024-10-21 00:54:42 +02:00
Mathias Fußenegger
0083e03d6f feat(lsp)!: support multiple clients in goto methods (#30877)
Relates to:

- https://github.com/neovim/neovim/issues/30034
- https://github.com/neovim/neovim/issues/17712
- https://github.com/neovim/neovim/issues/16363

Closes:

- https://github.com/neovim/neovim/issues/26936 (but only provides bufnr
  and method)
- https://github.com/neovim/neovim/issues/22318

Might fix: https://github.com/neovim/neovim/issues/30737
2024-10-20 23:40:44 +02:00
zeertzjq
9b8907d905 feat(float): allow enabling mouse for non-focusable window (#30844)
Problem:  Cannot allow mouse interaction for non-focusable float window.
Solution: Add a "mouse" field to float window config.
2024-10-20 22:18:26 +08:00
Mathias Fussenegger
dff684fdb3 feat(lsp)!: support multiple clients in lsp.buf.references
Relates to:

- https://github.com/neovim/neovim/issues/17712
- https://github.com/neovim/neovim/issues/30034
2024-10-20 14:43:22 +02:00
zeertzjq
ce9a9b4700 vim-patch:9.1.0794: tests: tests may fail on Windows environment (#30874)
Problem:  tests: tests may fail on Windows environment
Solution: use shellcmdflag=/D to skip executing autorun from
          the registry (Milly)

closes: vim/vim#15900

4f5681dbdf

Cherry-pick Test_cursorhold_insert_with_timer_interrupt() change from
patch 8.2.1836.

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-20 18:02:05 +08:00
Christian Clason
573fcb8b66 fix(deps): revert accidental test commits (#30864)
* Revert "build(deps): bump libuv to 52a924331"

This reverts commit 54137a798f.

* Revert "build(deps): bump libuv to 18d48bc13"

This reverts commit 66753a2f0c.

* Revert "build(deps): bump libuv to 9cf0710d7"

This reverts commit 4c617f4a47.
2024-10-20 10:25:58 +02:00
zeertzjq
ed794c9a10 vim-patch:9.1.0792: tests: Test_set_values() is not comprehensive enough (#30870)
Problem:  tests: Test_set_values() is not comprehensive enough
Solution: Add a lot more test cases (Milly)

closes: vim/vim#15892

cc15bbcbc4

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-20 08:18:38 +08:00
zeertzjq
3cf602486c feat(terminal)!: make 'belloff' and 'visualbell' apply to terminal bell (#30859)
vim-patch:8.2.4744: a terminal window can't use the bell
vim-patch:8.2.4745: using wrong flag for using bell in the terminal

BREAKING CHANGE: Bells from :terminal are now silent by default, unless
'belloff' option doesn't contain "term" or "all".
2024-10-20 07:59:43 +08:00
bfredl
4833a63929 Merge pull request #30863 from neovim/ci-macos
ci: bump Intel macOS runners to 13
2024-10-19 14:51:59 +02:00
Christian Clason
f8632c51f1 ci: bump Intel macOS runners to 13
Problem: macos-12 GH runners are deprecated and will be removed soon.

Solution: use macos-13 runners instead.
2024-10-19 13:40:30 +02:00
Christian Clason
54137a798f build(deps): bump libuv to 52a924331 2024-10-19 12:54:15 +02:00
Christian Clason
66753a2f0c build(deps): bump libuv to 18d48bc13 2024-10-19 12:54:15 +02:00
Christian Clason
4c617f4a47 build(deps): bump libuv to 9cf0710d7 2024-10-19 12:54:15 +02:00
Christian Clason
f3241e19e0 build(deps): bump libuv to v1.49.2 2024-10-19 12:54:15 +02:00
zeertzjq
395f420fc6 fix(options): fix some 'belloff' flags not working properly (#30856)
Problem:  Some 'belloff' flags don't work properly.
Solution: Keep BO_ flags and p_bo_values[] in sync.
2024-10-18 14:39:27 +00:00
zeertzjq
b5e69b32d7 vim-patch: make gen_opt_test.vim work with Nvim (#30850)
Problem:  Insufficient test coverage for validation of option values.
Solution: Port Vim's gen_opt_test.vim and make it work with Nvim.

vim-patch:9.1.0760: tests: no error reported, if gen_opt_test.vim fails
vim-patch:9.1.0791: tests: errors in gen_opt_test.vim are not shown
2024-10-18 17:38:29 +08:00
Uthman Mohamed
f4b620c4e6 feat(vim.ui.open): support lemonade #30845 2024-10-18 02:22:15 -07:00
temhelk
564173e556 fix(lsp.util): wrong arguments to 'validate' function 2024-10-18 07:37:36 +01:00
Maria José Solano
31745b17e6 fix(types): add narrower vim.validate types 2024-10-18 07:36:54 +01:00
Christian Clason
27f3a2002c vim-patch:5e48e97: runtime(compiler): check for compile_commands in build dirs for cppcheck
closes: vim/vim#15889

5e48e97e42

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-10-18 01:00:01 +02:00
Christian Clason
ee16248458 vim-patch:f10db25: runtime(swayconfig): add flag for bindsym/bindcode to syntax script
Add the `--inhibited` flag for the bindsym/bindcode commands.

closes: vim/vim#15891

f10db25367

Co-authored-by: CismonX <admin@cismon.net>
2024-10-18 01:00:01 +02:00
Lewis Russell
3f3e4837d5 perf(validate): use lighter version
- Also fix `vim.validate()` for PUC Lua when showing errors for values
  that aren't string or number.
2024-10-17 16:53:52 +01:00
Lewis Russell
fa6ab0d909 Merge pull request #30825 from lewis6991/refactor/lsputil 2024-10-17 13:35:02 +01:00
Lewis Russell
a18fa2f11c feat(lsp.util): minor codestyle 2024-10-17 12:52:46 +01:00
Lewis Russell
cbc82011ce feat(lsp.util): improve offset_encoding type annotations 2024-10-17 12:52:45 +01:00
Lewis Russell
e954a16063 feat(lsp.util): remove some variables 2024-10-17 12:52:45 +01:00
Lewis Russell
97119a2369 feat(lsp.util): use vim.w/b 2024-10-17 12:52:45 +01:00
Lewis Russell
3f87e222f7 feat(lsp.util): remove some aliases 2024-10-17 12:52:45 +01:00
Lewis Russell
8ad000ef7c feat(lsp.util): remove unneeded table 2024-10-17 12:52:45 +01:00
Lewis Russell
acbc6a7f91 fix(lsp.util): inconsistent handling of offset_encoding 2024-10-17 12:52:45 +01:00
Lewis Russell
ff1d7d4299 feat(lsp.util): get_bufs_with_prefix -> get_writeable_bufs 2024-10-17 12:52:45 +01:00
Lewis Russell
1944c0d610 feat(lsp.util): refactor get_border_size() 2024-10-17 12:52:45 +01:00
Lewis Russell
d44d36b8ff feat(lsp.util): simplify some bounds checking 2024-10-17 12:52:45 +01:00
Lewis Russell
0621718e3b feat(lsp.util): remove metatable in locations_to_items 2024-10-17 12:52:45 +01:00
Lewis Russell
f0973d4227 feat(lsp.util): refactor symbols_to_items()
- Remove the trivial function vim.lsp.util._get_symbol_kind_name()
  and its tests.
2024-10-17 12:52:45 +01:00
Lewis Russell
5bec7288a5 feat(lsp.util): remove uneeded do-end 2024-10-17 12:52:45 +01:00
Lewis Russell
1edfe5c09e feat(lsp.util): use vim.api alias 2024-10-17 12:52:45 +01:00
Lewis Russell
92e4e3fb76 feat(lsp.util): fix type errors 2024-10-17 12:52:44 +01:00
Lewis Russell
21151144c6 feat(meta): add type for quickfix entries 2024-10-17 10:54:19 +01:00
Jordan
ce678043e3 feat(lsp): show server name in code actions #30830
Problem:
If there are multiple LSP clients, it's not clear which actions are provided by which servers. #30710

Solution:
Show the server name next to each action (only if there are multiple clients).
2024-10-17 01:35:19 -07:00
Christian Clason
e265363a88 vim-patch:5e53fca: runtime(jinja): Support jinja syntax as secondary filetype
fixes: #vim/vim#15880
closes: vim/vim#15885

5e53fca76f

Co-authored-by: Gregory Anders <greg@gpanders.com>
2024-10-17 10:12:26 +02:00
zeertzjq
fae4d3fa1b Merge pull request #30836 from zeertzjq/vim-4bfb899
vim-patch: doc updates
2024-10-17 08:14:58 +08:00
zeertzjq
c89150241d vim-patch:6c2fc37: runtime(help): Update help syntax
This commit makaes the following changes to the vim help syntax:

- fix excessive URL detection in help, because `file:{filename}` in
  doc/options.txt is determined to be a URL.
- update highlighting N for :resize in help
- split Italian-specific syntax into separate help script
- highlight `Note` in parentheses in help
- update 'titlestring' behaviour in documentation for invalid '%' format

closes: vim/vim#15883

6c2fc377bf

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-17 07:55:55 +08:00
zeertzjq
de74ed35af vim-patch:4bfb899: runtime(help): fix end of sentence highlight in code examples
closes: vim/vim#15745

4bfb89996f

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Danilo Rezende <returndanilo@users.noreply.github.com>
2024-10-17 07:55:55 +08:00
zeertzjq
1f7f83ff67 vim-patch:partial:8.2.4712: only get profiling information after exiting
18ee0f603e

Doc updates only.
Cherry-pick profiling doc change from patch 8.2.2400.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-10-17 07:55:51 +08:00
zeertzjq
852954ff6d vim-patch:9.1.0789: tests: ':resize + 5' has invalid space after '+' (#30835)
Problem:  tests: ':resize + 5' has invalid space after '+'
Solution: Correct the test (Milly)

closes: vim/vim#15884

c0cba184f5

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-17 07:28:25 +08:00
Tristan Knight
80e37aa533 fix(lsp): str_byteindex_enc bounds checking #30747
Problem:
Previously the index was only checked against the UTF8 length. This
could cause unexpected behaviours for strings containing multibyte chars

Solution:
Check indicies correctly against their max value before returning the
fallback length
2024-10-16 09:12:19 -07:00
Lewis Russell
0e8568d72c feat(lsp.util): remove lsp spec extract 2024-10-16 12:39:28 +01:00
Lewis Russell
0066dd0f65 feat(lsp.util): use faster version of vim.validate 2024-10-16 12:39:27 +01:00
zeertzjq
f72dc2b4c8 vim-patch:9.1.0786: tests: quickfix update test does not test location list (#30828)
Problem:  tests: quickfix update test does not test location list
          (after: v9.1.0.785)
Solution: update Test_quickfix_buffer_contents to test with location
          lists (Yegappan Lakshmanan)

closes: vim/vim#15879

6a1deaf5ad

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-10-16 08:01:08 +08:00
Christian Clason
82b02ae2f2 fix(runtime): clean up one-off scripts
Problem: Some runtime files no longer spark joy.

Solution: Kondo the place up.

Still sparks _some_ joy (moved to new `runtime/scripts` folder):
* `macros/less.*`
* `mswin.vim`
* `tools/emoji_list.lua`

No longer sparks joy (removed):
* `macmap.vim` (gvimrc file; not useful in Nvim)
* `tools/check_colors.vim` (no longer useful with new default colorscheme and treesitter)
* `macros/editexisting.vim` (throws error on current Nvim)
* `macros/justify.vim` (obsolete shim for `packadd! justify`)
* `macros/matchit.vim` (same)
* `macros/shellmenu.vim` (same)
* `macros/swapmous.vim` (same)
2024-10-15 20:50:21 +02:00
xudyang1
ea5b748f24 feat(man.vim): "q" always closes window #30819 2024-10-15 08:34:50 -07:00
zeertzjq
84623dbe93 vim-patch:9.1.0785: cannot preserve error position when setting quickfix list (#30820)
Problem:  cannot preserve error position when setting quickfix lists
Solution: Add the 'u' action for setqflist()/setloclist() and try
          to keep the closes target position (Jeremy Fleischman)

fixes: vim/vim#15839
closes: vim/vim#15841

27fbf6e5e8

Co-authored-by: Jeremy Fleischman <jeremyfleischman@gmail.com>
2024-10-15 18:53:59 +08:00
Maria José Solano
e0a5c3bb58 fix(lsp): handle multiline signature help labels #30460 2024-10-15 02:36:04 -07:00
Christian Clason
74a1614772 vim-patch:9.1.0782: tests: using wrong neomuttlog file name
Problem:  tests: using wrong neomuttlog file name
Solution: use correct file name

related: vim/vim#15858

0c59c30271

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-10-15 08:32:29 +02:00
zeertzjq
f25ebc2290 vim-patch:9.1.0783: 'spell' option setting has problems (#30818)
Problem:  'spell' option setting has problems
Solution: correctly check for comma for 'spellfile' option,
          remove unnecessary checks, refactor slightly (Milly)

closes: vim/vim#15873

322ad0c953

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-15 09:40:54 +08:00
zeertzjq
09e7f19511 Merge pull request #30817 from zeertzjq/vim-7b5e52d
vim-patch: doc updates
2024-10-15 08:39:08 +08:00
zeertzjq
dbd172e7e9 vim-patch:5bcfb5a: runtime(doc): add some docs for file-watcher programs
fixes: vim/vim#15733

5bcfb5a30c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-10-15 08:21:19 +08:00
zeertzjq
9701cbf036 vim-patch:7b5e52d: runtime(doc): add preview flag to statusline example
Problem:  The standard statusline example is missing the preview flag
          "%w"
Solution: Add the preview flag "%w"

closes: vim/vim#15874

7b5e52d16f

Co-authored-by: saher <msaher.shair@gmail.com>
2024-10-15 08:19:46 +08:00
zeertzjq
4846bf05dc fix(tui): avoid flushing buffer halfway an OSC 2 sequence (#30793)
Problem:  Setting title while TUI buffer is almost full may cause the
          end of a flush to be treated as a part of an OSC 2 or OSC 0
          sequence, leading to problems like invisible cursor.
Solution: Make the whole sequence to set title a unibi_ext string.
2024-10-15 07:34:13 +08:00
Christian Clason
b7e8966715 vim-patch:9.1.0781: tests: test_filetype fails
Problem:  tests: test_filetype fails (clason)
          (after v9.1.0779)
Solution: Use correct filename for neomuttlog filetype

related: vim/vim#15845

7d755d8ef3

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-10-14 09:31:24 +02:00
Christian Clason
d04d7bf65d vim-patch:9.1.0779: filetype: neomuttlog files are not recognized
Problem:  filetype: neomuttlog files are not recognized
Solution: detect '*.neomuttdebug' file as neomuttlog filetype,
          include neomuttlog syntax script (Richard Russon)

closes: vim/vim#15858

a2aa921f76

Co-authored-by: Richard Russon <rich@flatcap.org>
Co-authored-by: AvidSeeker <avidseeker7@protonmail.com>
2024-10-14 09:31:24 +02:00
Christian Clason
b3cb0f6bea vim-patch:6e91853: runtime(gleam): add ftplugin for gleam files
fixes: vim/vim#15864
closes: vim/vim#15866

6e918538b1

Co-authored-by: Trilowy <49493635+trilowy@users.noreply.github.com>
2024-10-14 08:27:48 +02:00
Christian Clason
15aa27bc1f vim-patch:9.1.0778: filetype: lf config files are not recognized
Problem:  filetype: lf config files are not recognized
Solution: detect lfrc files as lf filetype, include a syntax
          script for lf files (Andis Spriņķis).

References:
- https://github.com/gokcehan/lf

closes: vim/vim#15859

0f146b7925

Co-authored-by: Andis Spriņķis <spr.andis@protonmail.com>
2024-10-14 08:27:37 +02:00
zeertzjq
1189c5ce59 test(tui_spec): use Unicode in cursor_address test (#30807)
Now that #16425 is fixed, use Unicode again to reduce screen height.
Unfortunately composing chars still can't be used, as it turns out that
composing chars may be missing when sent separately from the base char
at the last char a screen line.
2024-10-14 06:10:14 +00:00
zeertzjq
a6d5e6b105 vim-patch:a420547: runtime(misc): Use consistent "Vim script" spelling (#30805)
References: https://groups.google.com/g/vim_dev/c/3Z5yM8KER2w/m/wAqws0QSEAAJ

closes: vim/vim#15863

a4205471ad

Co-authored-by: h-east <h.east.727@gmail.com>
2024-10-14 09:27:29 +08:00
zeertzjq
36890824c7 Merge pull request #30798 from zeertzjq/vim-8.2.0985
vim-patch:8.2.{0985,0986}: simplify() does not remove slashes from "///path"
2024-10-13 19:11:53 +08:00
zeertzjq
73309048cf vim-patch:8.2.0986: MS-Windows: functions test fails
Problem:    MS-Windows: functions test fails.
Solution:   Only simplify ///path on Unix.

c70222d12a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-10-13 18:52:46 +08:00
zeertzjq
8c8c6fb05a vim-patch:8.2.0985: simplify() does not remove slashes from "///path"
Problem:    Simplify() does not remove slashes from "///path".
Solution:   Reduce > 2 slashes to one. (closes vim/vim#6263)

fdcbe3c3fe

Omit Test_readdirex() change: changed again in patch 9.0.0323.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-10-13 18:52:46 +08:00
glepnir
2d24558c28 docs: update autotrigger description of vim.lsp.compleiton.BufferOpts (#30796)
Currently the behavior of autotrigger is not well documented.
2024-10-13 12:44:05 +02:00
zeertzjq
fb74fd2954 test(autocmd/termxx_spec): properly setup TextChangedT tests (#30787) 2024-10-13 11:02:28 +08:00
zeertzjq
b56aa80a26 vim-patch:9.1.0775: tests: not enough tests for setting options (#30785)
Problem:  tests: not enough tests for setting options
Solution: Add more comprehensive tests to test_options (Milly).

closes: vim/vim#15856

484facebe4

Restore behavior of &l:option for unset local boolean options that was
accidentally changed in #26429.

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-13 08:09:53 +08:00
Christian Clason
06625f9b3a vim-patch:9.1.0777: filetype: Some upstream php files are not recognized
Problem:  filetype: Some upstream php files are not recognized
Solution: Detect more config files from the PHP source
          distribution as filetype ini (nisbet-hubbard).

closes: vim/vim#15840

367499c5c3

Co-authored-by: nisbet-hubbard <87453615+nisbet-hubbard@users.noreply.github.com>
2024-10-13 00:46:29 +02:00
Christian Clason
5c2f2a0c65 vim-patch:05d0893: runtime(java): Define javaBlockStart and javaBlockOtherStart hl groups
And do not link either to any group.

Resolves zzzyxwvut/java-vim#2.

05d0893ed8

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-10-13 00:46:14 +02:00
zeertzjq
b0ddc1783a vim-patch:9.1.0776: test_strftime may fail because of missing TZ data (#30780)
Problem:  test_strftime may fail because of missing TZ data
Solution: Use GMT offsets to validate timezone differences (James McCoy)

Some systems only provide timezones that follow the geographical region
naming (e.g. America/New_York) by default and require an additional
install for other names (like EST).

The GMT+<offset> format must always be honored, so use that to generate
distinct data for the test.

closes: vim/vim#15848

ea997edc7a

Co-authored-by: James McCoy <jamessan@jamessan.com>
2024-10-13 06:30:20 +08:00
Riley Bruins
e049c6e4c0 feat(ui): statusline text inherits highlights #29976
Changes apply to the winbar, statusline, and tabline text.
2024-10-12 10:57:31 -07:00
Riley Bruins
4b90952851 fix(treesitter): mark supertype nodes as named
**Problem:** Tree-sitter 0.24.0 introduced a new symbol type to denote
supertype nodes (`TSSymbolTypeSupertype`). Now, `language.inspect()`
(and the query `omnifunc`) return supertype symbols, but with double
quotes around them.

**Solution:** Mark a symbol as "named" based on it *not* being an
anonymous node, rather than checking that it is a regular node (which a
supertype also is not).
2024-10-12 09:59:44 +02:00
zeertzjq
45f8f957c0 docs(lua): clarify when on_key "typed" will be empty (#30774) 2024-10-12 12:20:06 +08:00
zeertzjq
0e42c81c7f fix(lua): avoid recursive vim.on_key() callback (#30753) 2024-10-12 08:07:05 +08:00
Devon Gardner
c49030b75a fix(coverity/497375): f_strpart cast overflow (#30773)
Problem:
Casting long to int introduces risk of overflow.

Solution:
Work with all int64_t (long) rather than casting back and forth.
2024-10-12 07:43:07 +08:00
bfredl
555784612b Merge pull request #30766 from bfredl/filecase
fix(build): remove USE_FNAME_CASE, redundant with CASE_INSENSITIVE_FILENAME
2024-10-11 21:36:52 +02:00
bfredl
486076a0e1 fix(build): remove USE_FNAME_CASE, redundant with CASE_INSENSITIVE_FILENAME
It stands to reason, you need to "fix" case-insensitive filenames
if-and-only-if you have case-insensitive filenames.
2024-10-11 20:26:54 +02:00
Gregory Anders
26e765f905 feat(defaults): map gri to vim.lsp.buf.implementation() (#30764)
Continuing the default LSP maps under the "gr" prefix. Mnemonic: "i" for
"implementation".
2024-10-11 11:56:21 -05:00
Riley Bruins
d3193afc25 fix(treesitter): remove duplicate symbol names in language.inspect()
**Problems:**

- `vim.treesitter.language.inspect()` returns duplicate
  symbol names, sometimes up to 6 of one kind in the case of `markdown`
- The list-like `symbols` table can have holes and is thus not even a
  valid msgpack table anyway, mentioned in a test

**Solution:** Return symbols as a map, rather than a list, where field
names are the names of the symbol. The boolean value associated with the
field encodes whether or not the symbol is named.

Note that anonymous nodes are surrounded with double quotes (`"`) to
prevent potential collisions with named counterparts that have the same
identifier.
2024-10-11 18:15:07 +02:00
Riley Bruins
267c7525f7 feat(treesitter): introduce child_with_descendant()
This commit also marks `child_containing_descendant()` as deprecated
(per upstream's documentation), and uses `child_with_descendant()` in
its place. Minimum required tree-sitter version will now be `0.24`.
2024-10-11 17:29:45 +02:00
zeertzjq
c4762b3097 test(tui_spec): use child_exec_lua() more (#30757)
It is more readable.
2024-10-11 08:23:14 +00:00
Justin M. Keyes
c3cb702ac7 fix(lsp): set 'smoothscroll' in docs hover #30748 2024-10-11 00:50:09 -07:00
Christian Clason
165613ee72 build(deps): bump libuv to v1.49.1 2024-10-11 09:48:32 +02:00
Christian Clason
79c036747a vim-patch:9.1.0773: filetype: some Apache files are not recognized
Problem:  filetype: some Apache files are not recognized
Solution: Detect more config files from the Apache source
          distribution as filetype apache (nisbet-hubbard)

closes: vim/vim#15810

e58e9015cc

Co-authored-by: nisbet-hubbard <87453615+nisbet-hubbard@users.noreply.github.com>
2024-10-11 08:59:37 +02:00
Riley Bruins
a0e3fe5741 feat(ui): cascading style inheritance for Pmenu* highlights #29980
- `PmenuSel` and `PmenuMatch` inherit from `Pmenu`
- `PmenuMatchSel` inherits from both `PmenuSel` and `PmenuMatch`
2024-10-10 23:26:25 -07:00
zeertzjq
25665b365c test(tui_spec): better prevent race between paste and input (#30751)
Problem:
Using a single RPC request to child server isn't enough to prevent race
between nvim_paste and nvim_input.

Solution:
Ensure both child client and child server have processed pending events
by sending an empty DCS response to the child client and waiting for
TermResponse autocommand on the child server.
2024-10-11 09:45:44 +08:00
zeertzjq
6f1601a1b9 vim-patch:9.1.0774: "shellcmdline" doesn't work with getcompletion() (#30750)
Problem:  "shellcmdline" doesn't work with getcompletion().
Solution: Use set_context_for_wildcard_arg() (zeertzjq).

closes: vim/vim#15834

85f36d61e0
2024-10-10 22:48:45 +00:00
Tomasz N
b3109084c2 fix(lsp): fix cursor position after snippet expansion (#30659)
Problem: on `CompleteDone` cursor can jump to the end of line instead of
the end of the completed word.

Solution: remove only inserted word for snippet expansion instead of everything
until eol.

Fixes #30656

Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2024-10-10 11:40:03 +02:00
Christian Clason
641c4b1a2a build(deps): bump tree-sitter to v0.24.3 2024-10-10 08:31:23 +02:00
zeertzjq
112139ea9b Merge pull request #30742 from zeertzjq/vim-9.1.0771
vim-patch:9.1.{0771,0772}
2024-10-10 11:33:54 +08:00
zeertzjq
9612b3a905 vim-patch:9.1.0772: some missing changes from v9.1.0771
Problem:  some missing changes from v9.1.0771
Solution: use correct highlighting attribute and adjust comments
          (glepnir)

closes: vim/vim#15836

7baa014d0f

Co-authored-by: glepnir <glephunter@gmail.com>
2024-10-10 07:21:02 +08:00
zeertzjq
8450752f46 vim-patch:9.1.0771: completion attribute hl_group is confusing
Problem:  Currently completion attribute hl_group is combined with
          all items, which is redundant and confusing with kind_hlgroup
Solution: Renamed to abbr_hlgroup and combine it only with the abbr item
          (glepnir).

closes: vim/vim#15818

0fe17f8ffb

Co-authored-by: glepnir <glephunter@gmail.com>
2024-10-10 07:21:02 +08:00
Christian Clason
cd8e15e337 build(deps): bump wasmtime to v25.0.2 2024-10-09 20:02:30 +02:00
zeertzjq
8ef3dd3afa docs(lua): "vim.bo" is always equivalent to :setlocal (#30733)
vim.bo

    :lua vim.bo.textwidth = 80
    :setglobal textwidth?
      textwidth=0

:setlocal

    :setlocal textwidth=80
    :setglobal textwidth?
      textwidth=0

:set

    :set textwidth=80
    :setglobal textwidth?
      textwidth=80
2024-10-09 11:31:14 +00:00
Christian Clason
0264870c0a vim-patch:9.1.0769: filetype: MLIR files are not recognized
Problem:  filetype: MLIR files are not recognized
Solution: Detect '*.mlir' files as mlir filetype,
          include a mlir filetype plugin
          (Wu, Zhenyu)

closes: vim/vim#15826

347d43bd33

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-10-09 10:10:39 +02:00
Christian Clason
6d9c73042f vim-patch:830a802: runtime(nasm): Update nasm syntax script
830a802f91

Co-authored-by: Andrii Sokolov <andriy145@gmail.com>
Co-authored-by: sarvel <sarvel@protonmail.com>
2024-10-09 10:04:37 +02:00
Christian Clason
525352117b vim-patch:cb1d1dc: runtime(skill): Update syntax file to fix string escapes
The syntax script allowed for single backslash escapes like this
"string\""
But did not accommodate for the uncommon case:
"<key>\\"
Let's fix this by also skipping over double backslashes in the
skillString region.

closes: vim/vim#15832

cb1d1dcc87

Co-authored-by: Simão Afonso @ Powertools Tech <simao.afonso@powertools-tech.com>
2024-10-09 10:04:37 +02:00
zeertzjq
f449a38f6a vim-patch:9.1.0770: current command line completion is a bit limited (#30728)
Problem:  current command completion is a bit limited
Solution: Add the shellcmdline completion type and getmdcomplpat()
          function (Ruslan Russkikh).

closes: vim/vim#15823

0407d621bb

Co-authored-by: Ruslan Russkikh <dvrussk@yandex.ru>
2024-10-09 08:14:18 +08:00
zeertzjq
e98b1b0235 vim-patch:9.1.0767: A condition is always true in ex_getln.c (#30726)
Problem:  A cmdlen == 0 condition is always true as ccline.cmdlen == 0
          was already checked above (after v9.1.0766).
Solution: Remove the condition and the variable.
          (zeertzjq)

closes: vim/vim#15830

c9aa6e4f2a
2024-10-08 23:16:43 +00:00
zeertzjq
5f04e4ac4f vim-patch:d3b55d7: runtime(help): highlight CTRL-<Key> correctly (#30727)
d3b55d7f76

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-10-09 07:15:52 +08:00
Justin M. Keyes
214ce8d33c fix(gen_help_html): first tag in h2 is broken #30720
Problem:
In h2 headings, the first tag points to an invalid anchor. This used to
work but regressed a few months ago, possibly related to
ceea6898a8.

Solution:
- Simplify the logic, don't try to be clever:
  - Always use to_heading_tag() for the h2 `id`.
- Also:
  - Render tags as `<span>`, because `<code>` is unnecessary and doesn't
    look great in headings.
  - In the main h1, use "foo.txt" as the anchor `name` (rarely used),
    prefer the next found tag for the `href`.
2024-10-08 07:42:20 -07:00
Johnny Shaw
7737f89206 fix: deps build for ARM64 MSVC
Problem:

Neovim will not build for ARM64 using MSVC due to misconfigured
gettext dependency build settings.

Solution:

Fix the dependency build settings for gettext when building with MSVC.
2024-10-08 08:57:42 +02:00
Christian Clason
7de8bdaeb8 vim-patch:4f51f3a: runtime(spec): set comments and commentstring options
closes: vim/vim#15817

4f51f3a573

Co-authored-by: Andreas Schneider <asn@cryptomilk.org>
2024-10-08 08:21:35 +02:00
zeertzjq
f659699a26 vim-patch:9.1.0766: too many strlen() calls in ex_getln.c (#30715)
Problem:  too many strlen() calls in ex_getln.c
Solution: refactor the code to reduce the number of strlen() calls
          (John Marriott)

closes: vim/vim#15809

ccf8907570

Co-authored-by: John Marriott <basilisk@internode.on.net>
2024-10-08 08:43:44 +08:00
Devon Gardner
60e1862ccb fix(coverity/510275): linematch out of bounds access (#30687)
Problem:
Int pointer cast to unsigned long pointer causes potential memory
corruption.

Solution:
Cast and store value first, then pass the new pointer.
2024-10-07 23:22:09 +00:00
zeertzjq
5805716ca4 vim-patch:9.1.0765: No test for patches 6.2.418 and 7.3.489 (#30713)
Problem:  No test for patches 6.2.418 and 7.3.489
Solution: Add a test.  Fix some whitespace problems in test_mapping.vim.
          Document the behavior (zeertzjq).

closes: vim/vim#15815

5df3cb2898
2024-10-07 22:51:57 +00:00
zeertzjq
376de1483e fix(drawline): correct highlight priority with Visual selection (#30706) 2024-10-08 06:24:36 +08:00
Christian Clason
88085c2e80 vim-patch:7c3f9af: runtime(misc): unset compiler in various ftplugins
just to foster best practices

closes: vim/vim#15798

7c3f9af0ed

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-10-07 19:19:15 +02:00
Christian Clason
4ea0f1ec23 vim-patch:af449f6: runtime(compiler): add cppcheck linter compiler plugin
closes: vim/vim#15804

af449f69c7

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-10-07 19:19:15 +02:00
Justin M. Keyes
61f1b091ea docs: dev-arch, focusable windows #30510
- 'statuscolumn' is no longer experimental
- add tags for popular searches on neovim.io
2024-10-07 08:27:38 -07:00
Justin M. Keyes
50f006b617 fix(lsp): tagfunc fails in unusual buffer #30700
Problem:
tagfunc failed in a weird buffer (either a directory or some other
non-file buffer, I don't remember):

    E987: Invalid return value from tagfunc
    E5108: Error executing lua …/runtime/lua/vim/lsp/util.lua:311: EISDIR: illegal operation on a directory
    stack traceback:

at this line:

    local data = assert(uv.fs_read(fd, stat.size, 0))

Solution:
Check for directory.
2024-10-07 08:25:13 -07:00
Justin M. Keyes
7335988ce6 docs: generate params/returns in builtin.txt #30654 2024-10-07 05:32:49 -07:00
zeertzjq
2377443cd2 vim-patch:9.1.0764: [security]: use-after-free when closing a buffer (#30705)
Problem:  [security]: use-after-free when closing a buffer
Solution: When splitting the window and editing a new buffer,
          check whether the newly to be edited buffer has been marked
          for deletion and abort in this case

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-rj48-v4mq-j4vg

51b62387be

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-10-07 10:40:44 +08:00
zeertzjq
bf868e76e1 vim-patch:9.1.0762: 'cedit', 'termwinkey' and 'wildchar' may not be parsed correctly (#30704)
Problem:  'cedit', 'termwinkey' and 'wildchar' may not be parsed
          correctly
Solution: improve string_to_key() function in option.c
          (Milly)

- Problem: `^@` raises an error.
  Solution: Store as `<Nul>`.
- Problem: `<t_xx` does not raise an error.
  Solution: Raise an error if closing `>` is missing.
- Problem: Single `<` or `^` raises an error. It is inconvenient for users.
  Solution: They are stored as a single character.

closes: vim/vim#15811

a9c6f90918

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-07 02:22:52 +00:00
zeertzjq
40ec3d7bc0 vim-patch:9.1.0761: :cd completion fails on Windows with backslash in path (#30703)
Problem:  :cd completion fails on Windows with backslash in path
Solution: switch no_bslash argument to FALSE in file_pat_to_reg_pat()

Note: only fixes the problem on Windows. For Unix, we still need to
escape backslashes since those are taken as regex atoms (and could be
invalid regex atoms).

fixes: vim/vim#15643
closes: vim/vim#15808

1a31c430bb

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-10-07 10:16:47 +08:00
zeertzjq
d0dc2920e1 vim-patch:fd4e47e: runtime(doc): clarify the effect of 'startofline' option (#30701)
fixes: vim/vim#15794

fd4e47e06b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-10-07 07:30:50 +08:00
Justin M. Keyes
27f3750817 feat(lsp): improve LSP doc hover rendering #30695
Problem:
- Some servers like LuaLS add unwanted blank lines after multiline
  `@param` description.
- List items do not wrap nicely.

Solution:
- When rendering the LSP doc hover, remove blank lines in each `@param`
  or `@return`.
  - But ensure exactly one empty line before each.
- Set 'breakindent'.
2024-10-06 12:20:40 -07:00
Gregory Anders
5da2a171f7 docs: LspAttach, LspDetach examples #30661
The current LspAttach example shows setting options which are already
set by default. We should expect that users are going to copy-paste
these examples, so we shouldn't use examples that are superfluous and
unnecessary.
2024-10-06 11:53:29 -07:00
Justin M. Keyes
6628741ada feat(docs): improve @see meta docstrings #30693 2024-10-06 09:12:35 -07:00
dundargoc
00d1078ede ci: bump macos runner version to macos-15 2024-10-06 16:06:28 +02:00
Christian Clason
9788b81d7e fix(runtime): fully port emoji_list to Lua
Problem: `runtime/tools/emoji_list.vim` is a Lua script masquerading as
Vimscript, which is unnecessary now that `:source` works for Lua files.

Solution: Remove Vimscript wrapper.
2024-10-06 12:44:50 +02:00
Justin M. Keyes
056009f741 fix(docs): markdown instead of vimdoc in meta docstrings #30680
LuaLS/meta docstrings expect markdown, not vimdoc. This matters for lists, codeblocks, etc.

Also, line length doesn't matter for docstrings.
2024-10-06 03:24:21 -07:00
Devon Gardner
a2008118a0 fix(coverity/510436): shada_read_when_writing index out of bounds (#30686)
Problem:
Index for global and numbered marks out of bounds when indexing into
numbered marks array (contains 10 elements but indexed by values 26 through 35.

Solution:
Offset index by number of global marks to correctly index numbered marks array.
2024-10-06 11:21:26 +08:00
zeertzjq
dabd7ef906 Merge pull request #30684 from zeertzjq/vim-738ebfe
vim-patch: doc updates
2024-10-06 08:02:30 +08:00
zeertzjq
bd56c1e41f vim-patch:partial:89872f5: runtime(doc): update formatting and syntax
closes: vim/vim#15800

89872f58a9

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-06 07:44:40 +08:00
zeertzjq
dc704160b1 vim-patch:partial:738ebfe: runtime(doc): Fix style in documents
closes: vim/vim#15801

738ebfea41

Co-authored-by: h-east <h.east.727@gmail.com>
2024-10-06 07:44:34 +08:00
zeertzjq
a4ebea18f1 vim-patch:9.1.0003: Cannot build against Ruby 33 dynamically (#30683)
Problem:  Cannot build against Ruby 33 dynamically
Solution: Ruby 33 removed transient heap, so do not use
          rb_ary_transient anymore, NoMethodError format changed,
          so update test for expected error message
          (Isao Sato)

- ruby-3.3 removed transient heap for ruby/dyn

when +ruby/dyn with ruby-3.3 do command :ruby, E448 occur.
ruby-3.3 has no transient heap anymore, so disable rb_ary_transient etc.

$ LC_ALL=C VIMRUNTIME=runtime ./src/vim -u NONE -c 'ruby puts RUBY_VERSION'
"=> Error detected while processing command line:
"=> E448: Could not load library function rb_ary_detransient
"=> E266: Sorry, this command is disabled, the Ruby library could not be
    loaded.

- ruby-3.3 changed NoMethodError format:

$ rvm 3.2.2, 3.3.0-rc1 do ruby -e 'begin; nil.name; rescue => e; puts "%s : %s"%[RUBY_VERSION, e.message]; end '
=> 3.2.2 : undefined method `name' for nil:NilClass
=> 3.3.0 : undefined method `name' for nil

so loose pattern in Test_ruby_Vim_buffer_get()

closes: vim/vim#13741

443657b32b

Co-authored-by: Isao Sato <svardew@gmail.com>
2024-10-05 23:28:28 +00:00
zeertzjq
9f26bdc416 vim-patch:9.1.0759: screenpos() may return invalid position (#30681)
Problem:  screenpos() may return invalid position
          after switching buffers (Greg Hurrell)
Solution: reset w_leftcol if wrapping has been set
          after copying wrap option

fixes: vim/vim#15792
closes: vim/vim#15803

b065a10e24

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-10-06 06:49:23 +08:00
Justin M. Keyes
8801b77ed0 fix(docs): missing @returns desc in _meta/api.lua #30673 2024-10-05 08:52:57 -07:00
dundargoc
0c9b3ef34d ci: bump ubuntu runner version to ubuntu-24.04
Also bump clang to version 20.
2024-10-05 17:35:41 +02:00
Devon Gardner
ff7832ad3f fix(coverity/497355): shada_read_when_writing out of bounds read #30665
Problem:
There appears to be an intentional array out of bounds read when
indexing global and numbered marks since they are adjacent in the struct
that holds them.

Solution:
Explicitly index numeric marks array to avoid reading out of bounds from
global marks array.
2024-10-05 07:18:00 -07:00
Christian Clason
988482d942 vim-patch:60310a4: runtime(java): Manage circularity for every :syn-included syntax file
With "g:markdown_fenced_languages" defined and "java" added
to its list, a circular dependency between the Markdown and
Java syntax files will be made.  To break it, no Markdown
documentation comments will be recognised in fenced blocks
in Markdown files; in order to view Java source files,
"java" must be removed from "g:markdown_fenced_languages",
and this task can be automated as follows.

1) Add to "~/.after/ftplugin/java.vim":
------------------------------------------------------------
if exists("g:markdown_fenced_languages") &&
	\ !(exists("g:java_ignore_javadoc") ||
	\ exists("g:java_ignore_markdown"))
    let s:idx = index(g:markdown_fenced_languages, 'java')
    if s:idx > -1
	call remove(g:markdown_fenced_languages, s:idx)
    endif
    unlet s:idx
endif
------------------------------------------------------------

2) Optionally add to "~/.after/ftplugin/markdown.vim":
------------------------------------------------------------
if exists("g:markdown_fenced_languages") &&
	\ index(g:markdown_fenced_languages, 'java') < 0
    call add(g:markdown_fenced_languages, 'java')
endif
------------------------------------------------------------

(Make sure that the above snippets appear in the files under
the "ftplugin" NOT "syntax" directory.)

Finally, unless the new version of the syntax file is made
available from "$VIMRUNTIME" (and from "~/.vim/syntax" if
necessary), OTHER discoverable file versions will be used
whose behaviour may interfere with this fix.

related: vim/vim#15740
closes: vim/vim#15796

60310a4b26

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-10-05 11:27:05 +02:00
zeertzjq
ab98c5b5a0 vim-patch:9.1.0758: it's possible to set an invalid key to 'wildcharm' (#30662)
Problem:  it's possible to set an invalid key to 'wildcharm'
Solution: error out, if the 'wildcharm' value is an invalid key
          (Milly)

closes: vim/vim#15787

40c6babc17

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-05 07:20:38 +08:00
Gregory Anders
289380bc40 fix(defaults): use "range" instead of "count" for some mappings (#30642)
Some commands don't accept "count" and only work with "range". It's not
clear why. The issue is tracked at [1], but this is a workaround for
now.

[1]: https://github.com/neovim/neovim/issues/30641
2024-10-04 10:34:21 -05:00
Justin M. Keyes
9a5bbaf813 docs: more @since annotations #30660 2024-10-04 08:12:17 -07:00
Christian Clason
49b1af4e24 build(deps): bump tree-sitter to v0.24.1 2024-10-04 16:47:09 +02:00
Jongwook Choi
d5ae5c84e9 feat(lua): completion for vim.fn, vim.v, vim.o #30472
Problem: Lua accessors for
- global, local, and special variables (`vim.{g,t,w,b,v}.*`), and
- options (`vim.{o,bo,wo,opt,opt_local,opt_global}.*`),

do not have command-line completion, unlike their vimscript counterparts
(e.g., `g:`, `b:`, `:set`, `:setlocal`, `:call <fn>`, etc.).

Completion for vimscript functions (`vim.fn.*`) is incomplete and does
not list all the available functions.

Solution: Implement completion for vimscript function, variable and
option accessors in `vim._expand_pat` through:

- `getcompletion()` for variable and vimscript function accessors, and
- `nvim_get_all_options_info()` for option accessors.

Note/Remark:

- Short names for options are yet to be implemented.

- Completions for accessors with handles (e.g. `vim.b[0]`, `vim.wo[0]`)
  are also yet to be implemented, and are left as future work, which
  involves some refactoring of options.

- For performance reasons, we may want to introduce caching for
  completing options, but this is not considered at this time since the
  number of the available options is not very big (only ~350) and Lua
  completion for option accessors appears to be pretty fast.

- Can we have a more "general" framework for customizing completions?
  In the future, we may want to improve the implementation by moving the
  core logic for generating completion candidates to each accessor (or
  its metatable) or through some central interface, rather than writing
  all the accessor-specific completion implementations in a single
  function: `vim._expand_pat`.
2024-10-04 06:48:31 -07:00
zeertzjq
86c5c8724b fix(mouse): indicate X1 and X2 button clicks on statusline (#30655) 2024-10-04 21:31:28 +08:00
Yi Ming
305012ea07 fix(lsp): enable additionalPropertiesSupport 2024-10-04 12:22:46 +02:00
Justin M. Keyes
b45c50f314 docs: render @since versions, 0 means experimental #30649
An implication of this current approach is that `NVIM_API_LEVEL` should be
bumped when a new Lua function is added.

TODO(future): add a lint check which requires `@since` on all new functions.

ref #25416
2024-10-04 02:13:31 -07:00
Riley Bruins
f62728cd80 docs(treesitter): generate TSNode, TSTree docs #30643
**Problem:** The documentation for `TSNode` and `TSTree` methods is
incomplete from the LSP perspective. This is because they are written
directly to the vimdoc, rather than in Lua and generated to vimdoc.

**Solution:** Migrate the docs to Lua and generate them into the vimdoc.
This requires breaking up the `treesitter/_meta.lua` file into a
directory with a few different modules.

This commit also makes the vimdoc generator slightly more robust with
regard to sections that have multiple help tags (e.g. `*one* *two*`)
2024-10-03 16:57:19 -07:00
James Trew
385fbfb3e7 docs: improve luacats support #30580
Some composite/compound types even as basic as `(string|number)[]` are
not currently supported by the luacats LPEG grammar used by gen_vimdoc.
It would be parsed & rendered as just `string|number`.

Changeset adds better support for these types.
2024-10-03 03:45:51 -07:00
Lewis Russell
c6abc97006 perf(treesitter): do not use tree cursors with a small lifetime
Problem:
Tree cursors can only be efficient when they are re-used.
Short-lived cursors are very slow.

Solution:
Reimplement functions that use short-lived cursors.
2024-10-03 11:19:59 +01:00
glepnir
cc300e553b vim-patch:9.1.0756: missing change from patch v9.1.0754 (#30636)
Problem:  missing change from patch v9.1.0754
Solution: use correct width for the actual item
          in pum_redraw() (glepnir)

closes: vim/vim#15786

a6d9e3c4e0
2024-10-03 09:58:15 +00:00
zeertzjq
ae0e4071a8 vim-patch:9.1.0755: quickfix list does not handle hardlinks well (#30637)
Problem:  quickfix list does not handle hardlinks well
Solution: store original file name with quickfix entry
          (Austin Chang)

Quickfix list shows entries with duplicate name if the file is opened
with the path of hard links.

The major cause is that qflist assumed that the filename passed into
`qf_add_entry` matches the filename opened with the buffer.

This patch handles this case by introduce a `qf_fname` into `qfline_S`
structure. It stores the filename from `qf_add_entry` for each quickfix
line.

closes: vim/vim#15687

2982299699

Co-authored-by: Austin Chang <austin880625@gmail.com>
2024-10-03 09:44:04 +00:00
fredizzimo
7eba016c86 fix(ui): ensure screen update before waiting for input #30576
Ensure the screen is fully updated before blocking for input. This did
not always happen before, for example when setting `cursorline
scrolloff=9999`, which lead to jerky movement when using some GUI
applications.

Because of the duality of redraw_later, this can't be done in
command-line or when waiting for "Press ENTER". In many of those cases
the redraw is expected AFTER the key press, while normally it should
update the screen immediately. So, those special cases are excluded.
2024-10-03 02:31:17 -07:00
Christian Clason
b973789115 vim-patch:f416a22: runtime(systemd): small fixes to &keywordprg in ftplugin
closes: vim/vim#15784

f416a2220f

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-10-03 10:45:21 +02:00
zeertzjq
4075e613b2 fix(defaults): properly pass count to quickfix commands (#30632) 2024-10-03 10:57:54 +08:00
zeertzjq
184d5e7543 refactor: fix incorrect use of enum (#30631) 2024-10-03 10:34:55 +08:00
zeertzjq
aeea63081c vim-patch:ae62fe5: runtime(doc): 'filetype', 'syntax' and 'keymap' only allow alphanumeric + some characters (#30630)
closes: vim/vim#15783

ae62fe5c28

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-03 06:58:31 +08:00
glepnir
6a2f8958e8 vim-patch:9.1.0754: fixed order of items in insert-mode completion menu (#30619)
Problem:  fixed order of items in insert-mode completion menu
Solution: Introduce the 'completeitemalign' option with default
          value "abbr,kind,menu" (glepnir).

Adding an new option `completeitemalign` abbr is `cia` to custom
the complete-item order in popupmenu.

closes: vim/vim#14006
closes: vim/vim#15760

6a89c94a9e
2024-10-03 06:45:01 +08:00
Justin M. Keyes
d3b4772ddc Merge #30595 from justinmk/fixwatch 2024-10-02 08:05:03 -07:00
Justin M. Keyes
bbf208784c tests: skip watch.watchdirs test on macos 14 CI
Problem:
Strange failure only in macos 14 CI

    FAILED   test/functional/lua/watch_spec.lua @ 82: vim._watch watchdirs() detects file changes
    test/functional/lua/watch_spec.lua:149: Expected objects to be the same.
    Passed in:
    (table: 0x0116023758) {
     *[1] = {
        [change_type] = 3
       *[path] = '/Users/runner/work/neovim/neovim/build/Xtest_tmpdir/nvim_KFMvPbXk9a/nvim_KFMvPbXk9a' }
      [2] = {
        [change_type] = 3
        [path] = '/Users/runner/work/neovim/neovim/build/Xtest_tmpdir/nvim_KFMvPbXk9a/file' } }
    Expected:
    (table: 0x010d9d6548) {
     *[1] = {
        [change_type] = 1
       *[path] = '/Users/runner/work/neovim/neovim/build/Xtest_tmpdir/nvim_KFMvPbXk9a/file' }
      [2] = {
        [change_type] = 3
        [path] = '/Users/runner/work/neovim/neovim/build/Xtest_tmpdir/nvim_KFMvPbXk9a/file' } }

    stack traceback:
            test/functional/lua/watch_spec.lua:149: in function <test/functional/lua/watch_spec.lua:82>

Solution:
Skip test for that exact version.
2024-10-02 16:41:01 +02:00
Justin M. Keyes
9e23b4e185 fix(watch): ignore nonexistent paths (ENOENT)
Problem:
The `_watch.watch()` strategy may fail if the given path does not exist:

    …/vim/_watch.lua:101: ENOENT: no such file or directory
    stack traceback:
        [C]: in function 'assert'
        …/vim/_watch.lua:101: in function <…/vim/_watch.lua:61>
        [string "<nvim>"]:5: in main chunk

- `_watch.watch()` actively asserts any error returned by `handle:start()`.
- whereas `_watch.watchdirs()` just ignores the result of `root_handle:start()`.

Servers may send "client/registerCapability" with "workspace/didChangeWatchedFiles"
item(s) (`baseUri`) which do not actually exist on the filesystem:
https://github.com/neovim/neovim/issues/28058#issuecomment-2189929424

    {
      method = "client/registerCapability",
      params = {
        registrations = { {
            method = "workspace/didChangeWatchedFiles",
            registerOptions = {
              watchers = { {
                  globPattern = {
                    baseUri = "file:///Users/does/not/exist",
                    pattern = "**/*.{ts,js,mts,mjs,cjs,cts,json,svelte}"
                  }
                },
    ...
    }

Solution:
- Remove the assert in `_watch.watch()`.
- Show a once-only message for both cases.
- More detailed logging is blocked until we have `nvim_log` / `vim.log`.

fix #28058
2024-10-02 16:41:01 +02:00
Christian Clason
391c5084d1 build(deps): bump luajit to HEAD - 97813fb92 2024-10-02 14:41:51 +02:00
Christian Clason
9b15f2a0ce build(deps): bump luajit to HEAD - b2915e9ab 2024-10-02 13:02:46 +02:00
Christian Clason
865ba42e04 build(deps): bump tree-sitter to HEAD - c3d45a015 (#30589) 2024-10-02 06:59:23 +02:00
Christian Clason
3d1e6c56f0 build(deps): bump luajit to HEAD - 2240d8446 2024-10-02 06:27:32 +02:00
zeertzjq
2168d772b8 vim-patch:9.1.0752: can set 'cedit' to an invalid value (#30616)
Problem:  can set cedit to an invalid value
Solution: Check that the value is a valid key name
          (Milly)

closes: vim/vim#15778

25732435c5

Co-authored-by: Milly <milly.ca@gmail.com>
2024-10-01 23:39:28 +00:00
zeertzjq
d983599613 vim-patch:baee844: runtime(doc): add usr tag to usr_toc.txt (#30617)
When typing `:h usr` it redirects to usr_01.txt, but I'd argue
usr_toc.txt is more useful as you can see an overview of all manuals.
When I usr `:h usr` I personally always intend to go to `usr_toc`.

closes: vim/vim#15779

baee8448d1

Co-authored-by: dundargoc <gocdundar@gmail.com>
2024-10-01 23:33:25 +00:00
zeertzjq
0e484c2041 vim-patch:9.1.0753: Wrong display when typing in diff mode with 'smoothscroll' (#30614)
Problem:  Wrong display when typing in diff mode with 'smoothscroll'.
Solution: Use adjust_plines_for_skipcol() (zeertzjq).

closes: vim/vim#15776

47f8584a80
2024-10-01 22:55:43 +00:00
Jongwook Choi
5331f87f61 fix(treesitter): indent size for inspect_tree #28727
Problem: For :InspectTree, indent size (`&shiftwidth`) for the tree
viewer may be incorrect.

This is because the tree viewer buffer with the filetype `query` does
not explicitly configures the tab size, which can mismatch with the
default indent size (2) assumed by TSTreeView's implementation.

Solution: Set shiftwidth to be the same as TSTreeViewOpts specifies,
which defaults to 2.
2024-10-01 09:07:30 -07:00
Gregory Anders
bb7604edda feat(defaults): add default unimpaired style mappings (#28525) 2024-10-01 07:24:43 -05:00
zeertzjq
1c30d86c33 fix(tabline): restore behavior of click after last tabpage (#30602)
Also correct the comments about tabpage labels in custom tabline.
2024-10-01 19:46:30 +08:00
Justin M. Keyes
72892aab06 docs(gen_help_html.lua): h4 pseudo-heading layout
Problem:
The <br> hack in a0c64fe816 causes weird layout if a "h4 pseudo-heading"
is not the only tag on the line. For example in the help text below, the
"*'buflisted'*" tag was treated as h4 and followed by <br>, which is
obviously wrong:

                            *'buflisted'* *'bl'* *'nobuflisted'* *'nobl'* *E85*
    'buflisted' 'bl'    boolean (default on)

Solution:
Only treat a tag as "h4 pseudo-heading" if it is the only tag in the
line. This is fragile, but in practice seems to get the right balance.
2024-10-01 12:51:16 +02:00
Justin M. Keyes
a0c64fe816 docs(gen_help_html.lua): h4 pseudo-heading layout #30609
Problem:
The right-aligned tag "pseudo-heading" layout mushes together with the
left-aligned text. This is especially messy in a narrow viewport.

Solution:
Put a `<br>` on it. This is a hack until tree-sitter-vimdoc recognizes
these pseudo-headings.
2024-10-01 02:52:07 -07:00
Christian Clason
2f2f434613 vim-patch:85f054a: runtime(java): Recognise the CommonMark form (///) of Javadoc comments
Complement "g:java_ignore_javadoc" with "g:java_ignore_html"
and "g:java_ignore_markdown" to allow selectively disabling
the recognition of HTML and CommonMark respectively.

(Note that this is not a preview feature.)

======================== LIMITATION ========================

According to the syntactical details of JEP 467:

> Any leading whitespace and the three initial / characters
> are removed from each line.
>
> The lines are shifted left, by removing leading whitespace
> characters, until the non-blank line with the least
> leading whitespace has no remaining leading whitespace.
>
> Additional leading whitespace and any trailing whitespace
> in each line is preserved, because it may be significant.

the following example:
------------------------------------------------------------
///    A summary sentence.
///     A list:
///      - Item A.
///     - Item B.
///
///     Some code span, starting here `
///      1 + 2 ` and ending at the previous \`.
------------------------------------------------------------

should be interpreted as if it were written thus:
------------------------------------------------------------
///A summary sentence.
/// A list:
///  - Item A.
/// - Item B.
///
/// Some code span, starting here `
///  1 + 2 ` and ending at the previous \`.
------------------------------------------------------------

Since automatic line rewriting will not be pursued, parts of
such comments having significant whitespace may be ‘wrongly’
highlighted.  For convenience, a &fex function is defined to
‘correct’ it: g:javaformat#RemoveCommonMarkdownWhitespace()
(:help ft-java-plugin).

References:
https://openjdk.org/jeps/467
https://spec.commonmark.org/0.31.2

closes: vim/vim#15740

85f054aa3f

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
Co-authored-by: Tim Pope <code@tpope.net>
2024-10-01 07:33:24 +02:00
Christian Clason
ea9d61b80d vim-patch:9.1.0749: filetype: http files not recognized
Problem:  filetype: http files not recognized
Solution: detect '*.http' as http filetype, include
          http filetype plugin (Riley Bruins)

Based on the specification found
[here](https://github.com/JetBrains/http-request-in-editor-spec/blob/master/spec.md)

closes: vim/vim#15762

de6c1d1182

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-10-01 07:33:08 +02:00
zeertzjq
e0efbc6e03 refactor: use ERROR_SET() to check for error (#30594)
Replaces the only two places where kErrorTypeNone is checked explicitly.
2024-10-01 06:27:30 +08:00
Christian Clason
888966652d build(deps): bump luajit to HEAD - f5fd22203 2024-09-30 22:47:09 +02:00
Lewis Russell
2c88cfcac4 Merge pull request #30526 from lewis6991/fix/linematchnul 2024-09-30 12:09:36 +01:00
Lewis Russell
0fb5299e53 test: refactor exec_lua in xdiff_spec 2024-09-30 11:51:33 +01:00
Lewis Russell
c65646c247 fix(diff): use mmfile_t in linematch
Problem:

Linematch used to use strchr to navigate a string, however strchr does
not supoprt embedded NULs.

Solution:

Use `mmfile_t` instead of `char *` in linematch and introduce `strnchr()`.

Also remove heap allocations from `matching_char_iwhite()`

Fixes: #30505
2024-09-30 11:51:33 +01:00
Justin M. Keyes
20251be15a docs: graduate editorconfig.txt to "flow layout"
fix #25401
2024-09-30 00:43:44 +02:00
Christian Clason
99e0facf3a feat(treesitter)!: use return values in language.add()
Problem: No clear way to check whether parsers are available for a given
language.

Solution: Make `language.add()` return `true` if a parser was
successfully added and `nil` otherwise. Use explicit `assert` instead of
relying on thrown errors.
2024-09-29 15:27:16 +02:00
Christian Clason
041d98fe8d feat(treesitter)!: add default fallback to ft_to_lang lookups
Problem: Language names are only registered for filetype<->language
lookups when parsers are actually loaded; this means users cannot rely
on `vim.treesitter.language.get_lang()` or `get_filetypes()` to return
the correct value when language and filetype coincide and always need to
add explicit fallbacks.

Solution: Always return the language name as valid filetype in
`get_filetypes()`, and default to the filetype in `get_lang()`. Document
this behavior.
2024-09-29 15:27:16 +02:00
zeertzjq
e40314811e vim-patch:6db3fc5: runtime(doc): reformat gnat example (#30575)
closes: vim/vim#15758

6db3fc5632

Co-authored-by: hokorobi <hokorobi.hokorobi@gmail.com>
2024-09-29 12:35:36 +00:00
zeertzjq
df915f3afc fix(float): properly find last window of tabpage (#30571) 2024-09-29 10:38:17 +00:00
Christian Clason
006323dd70 vim-patch:ee20fc8: runtime(indent): allow matching negative numbers for gnu indent config file
Some gnu indent options take negative numbers (e.g. --indent-label).
Add matching for an optional single '-' before the number.

closes: vim/vim#15754

ee20fc8062

Co-authored-by: John M Devin <john.m.devin@gmail.com>
2024-09-29 12:23:52 +02:00
dundargoc
2c937d723d docs: misc (#30177)
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
Co-authored-by: Riley Bruins <ribru17@hotmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-09-29 09:54:12 +00:00
Christian Clason
1405034ba3 vim-patch:9.1.0745: filetype: bun and deno history files not recognized
Problem:  filetype: bun and deno history files not recognized
Solution: detect '.bun_repl_history' and 'deno_history.txt' as
          javascript filetype (Wu, Zhenyu)

closes: vim/vim#15761

8a2aea8a62

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-09-29 11:13:27 +02:00
zeertzjq
1ff0a1712a vim-patch:9.1.0746: tests: Test_halfpage_longline() fails on large terminals (#30567)
Problem:  Test_halfpage_longline() fails on large terminals
          (lazypingu)
Solution: Use a window with known width (zeertzjq).

fixes: vim/vim#15755
closes: vim/vim#15756

fa117387ee
2024-09-29 17:05:56 +08:00
zeertzjq
8d99a56269 vim-patch:c3989f1: runtime(doc): reformat ada_standard_types section
closes: vim/vim#15759

c3989f184d

Co-authored-by: hokorobi <hokorobi.hokorobi@gmail.com>
2024-09-29 17:05:02 +08:00
zeertzjq
9db304b451 vim-patch:998f018: runtime(doc): include short form for :earlier/:later
fixes: vim/vim#15757

998f018df3

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-09-29 17:05:02 +08:00
bfredl
610e9666af Merge pull request #30401 from bfredl/casefold2
refactor(multibyte): neo-casefolding without allocation
2024-09-29 11:03:36 +02:00
bfredl
2dfa6f6033 refactor(multibyte): neo-casefolding without allocation
fixes #30400
2024-09-29 10:14:16 +02:00
bfredl
69553f7bf5 Merge pull request #30558 from bfredl/noklist
refactor(event): change last use of klist to kvec
2024-09-28 20:59:06 +02:00
bfredl
76163590f0 refactor(event): change last use of klist to kvec
loop->children might have been a linked list because used to be
modified in place while looped over. However the loops that exists
rather schedules events to be processed later, outside of the loop,
so this can not happen anymore.

When a linked list is otherwise useful it is better to use
lib/queue_defs.h which defines an _intrusive_ linked list (i e it
doesn't need to do allocations for list items like klist ).
2024-09-28 20:23:22 +02:00
zeertzjq
d5f6f61879 fix(column): set signcolumn width after splitting window (#30556) 2024-09-28 17:16:22 +08:00
Riley Bruins
4349bdbd0b fix(treesitter): specify success status in edit_query return value 2024-09-28 10:54:45 +02:00
zeertzjq
4f9311b759 fix(window): making float with title/footer non-float leaks memory (#30551) 2024-09-28 10:21:06 +08:00
Riley Bruins
0f067cd34d fix(treesitter): suppress get_parser warnings via opts.error 2024-09-28 00:31:45 +02:00
glepnir
7b71fdbc1e fix(window): respect hide flag of float windows when switching (#30507) 2024-09-28 06:02:14 +08:00
Justin M. Keyes
09d76afe84 feat(defaults): pretty :help headings #30544
Problem:
Headings in :help do not stand out visually.

Solution:
Define a non-standard `@markup.heading.1.delimiter` group and
special-case it in `highlight_group.c`.

FUTURE:
This is a cheap workaround until we have #25718 which will enable:
- fully driven by `vimdoc/highlights.scm` instead of using highlight
  tricks (`guibg=bg guifg=bg guisp=fg`)
- better support of "cterm" ('notermguicolors')
2024-09-27 08:53:30 -07:00
zeertzjq
f55213ce0e fix(api): fix crash/leak with float title/footer on error (#30543) 2024-09-27 14:33:24 +00:00
zeertzjq
eea6b84a87 test(api/window_spec): remove duplicate test (#30538) 2024-09-27 19:10:55 +08:00
zeertzjq
60a7578058 vim-patch:9.1.0744: filetype: notmuch configs are not recognised (#30535)
Problem:  filetype: notmuch configs are not recognised
Solution: Detect more notmuch profile configuration files
          as dosini filetype (Julio B)

Reference:
https://notmuchmail.org/doc/latest/man1/notmuch-config.html#configuration

closes: vim/vim#15744

1a2870b57a

Co-authored-by: Julio B <julio.bacel@gmail.com>
2024-09-27 18:57:01 +08:00
Justin M. Keyes
b63cd8cbae fix(treesitter): EditQuery shows swapfile ATTENTION #30536
Problem:
EditQuery shows swapfile ATTENTION, but this buffer is not intended for
preservation (and the dialog breaks the UX).

Solution:
Set 'noswapfile' on the buffer before renaming it.
2024-09-27 03:27:00 -07:00
zeertzjq
6f2fe8a791 vim-patch:9.1.0743: diff mode does not handle overlapping diffs correctly (#30532)
Problem:  diff mode does not handle overlapping diffs correctly
Solution: correct the logic to handle overlapping blocks
          (Yukihiro Nakadaira)

Vim merges overlapped diff blocks and it doesn't work expectedly
in some situation.

closes: vim/vim#15735

06fe70c183

Co-authored-by: Yukihiro Nakadaira <yukihiro.nakadaira@gmail.com>
2024-09-27 07:14:39 +00:00
zeertzjq
a9287dd882 fix(mbyte): check for utf8proc_map() failure (#30531) 2024-09-26 23:40:46 +00:00
zeertzjq
98d1c0ebef Merge pull request #30530 from zeertzjq/vim-d9af78b
vim-patch: doc updates
2024-09-27 07:22:54 +08:00
zeertzjq
7860fd98ae vim-patch:2c41dad: runtime(doc): Fix typo in :help :command-modifiers
closes: vim/vim#15734

2c41dad387

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-09-27 06:43:29 +08:00
zeertzjq
18bba09491 vim-patch:d9af78b: runtime(docs): update :set? command behavior table
closes: vim/vim#15746

d9af78b945

Co-authored-by: Milly <milly.ca@gmail.com>
2024-09-27 06:43:06 +08:00
Justin M. Keyes
f2fa4ca97e feat(health): highlight headings #30525
Problem:
checkhealth report sections are not visually separated.

Solution:
Highlight with "reverse".

TODO: migrate checkhealth filetype to use treesitter.
TODO: default :help should also highlight headings more boldy!
2024-09-26 07:45:03 -07:00
zeertzjq
efcfcb1efc Merge pull request #30489 from zeertzjq/vim-9.1.0741
vim-patch:9.1.{0741,0742}: No way to get prompt for input()/confirm()
2024-09-26 22:36:12 +08:00
zeertzjq
65b6cd1b3a vim-patch:9.1.0742: getcmdprompt() implementation can be improved
Problem:  getcmdprompt() implementation can be improved
Solution: Improve and simplify it (h-east)

closes: vim/vim#15743

25876a6cdd

Co-authored-by: h-east <h.east.727@gmail.com>
2024-09-26 22:18:19 +08:00
zeertzjq
c2fb1fc700 vim-patch:9.1.0741: No way to get prompt for input()/confirm()
Problem:  No way to get prompt for input()/confirm()
Solution: add getcmdprompt() function (Shougo Matsushita)
          (Shougo Matsushita)

closes: vim/vim#15667

6908428560

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2024-09-26 22:15:28 +08:00
zeertzjq
66197dde70 test(api/buffer_updates_spec): prevent flakiness (#30521)
Use poke_eventloop() to wait for Nvim to finish processing input.
2024-09-26 18:34:35 +08:00
zeertzjq
8070988247 fix(channel): handle writing to file instead of pipe (#30519) 2024-09-26 08:36:50 +00:00
Riley Bruins
64847fbdc9 perf(treesitter): use child_containing_descendant() in is_ancestor()
**Problem:** `is_ancestor()` uses a slow, bottom-up parent lookup which
has performance pitfalls detailed in #28512.

**Solution:** Take `is_ancestor()` from $O(n^2)$ to $O(n)$ by
incorporating the use of the `child_containing_descendant()` function
2024-09-25 23:01:08 +02:00
Nathan Smith
921dc22fc0 fix(diagnostic): correct severity type on setqflist, setloclist (#30506)
fix(diagnostic): correct severity type on setqflist, setloclist
2024-09-25 10:10:50 -05:00
dundargoc
046e0956ee build: fix or silence new clang-tidy warnings 2024-09-25 16:09:08 +02:00
Justin M. Keyes
f3b7444e66 refactor(lua): vim.keymap.set tests, docs #30511 2024-09-25 07:01:27 -07:00
Justin M. Keyes
069451bb21 fix(coverity): size_t overflow #30497
CID 497370: Overflowed constant (INTEGER_OVERFLOW)
    Expression `tsize - ret.has_type_key`, where tsize=0 and
    ret.has_type_key=1, underflows the type that
    receives it, an unsigned integer 64 bits wide.

    CID 509910: Overflowed constant (INTEGER_OVERFLOW)
    Expression stack.size++, which is equal to 0, where stack.size is
    known to be equal to 18446744073709551615, overflows the type that
    receives it, an unsigned integer 64 bits wide
2024-09-25 03:25:49 -07:00
Christian Clason
8ba9f0468d build(deps): bump wasmtime to v25.0.1 2024-09-25 11:39:11 +02:00
Justin M. Keyes
ce7017b850 docs: render @see, @note items in _meta/api.lua #30494 2024-09-25 02:34:13 -07:00
Christian Clason
6c77e840ae build(deps): bump libuv to v1.49.0 2024-09-25 11:24:03 +02:00
zeertzjq
052875b9dc fix(paste): only record a paste when it's from RPC (#30491)
Problem:  When using nvim_paste in a mapping during a macro recording,
          both the mapping and the paste are recorded, causing the paste
          to be performed twice when replaying the macro.
Solution: Only record a paste when it is from RPC.

Unfortunately this means there is no way for a script to make a recorded
paste. A way to enable that can be discussed later if there is need.
2024-09-24 11:48:40 +00:00
Justin M. Keyes
3f6bc34e66 docs: lua error patterns #30240
Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
Co-authored-by: Ananth Bhaskararaman <antsub@gmail.com>
2024-09-24 04:46:50 -07:00
Christian Clason
2276743cb8 vim-patch:a7229c8: runtime(rmd,rrst): 'fex' option not properly restored
Add 'fex' to b:undo_ftplugin variable

closes: vim/vim#15728

a7229c8a99

Co-authored-by: John M Devin <john.m.devin@gmail.com>
2024-09-24 09:55:43 +02:00
zeertzjq
d831392b15 feat(paste): unify cancel and error behavior (#30476)
Before this PR, the behavior of nvim_paste is:
- When vim.paste() returns false, return false to the client, but treat
  following chunks normally (i.e. rely on the client cancelling the
  paste as expected).
- When vim.paste() throws an error, still return true to the client, but
  drain the following chunks in the stream without calling vim.paste().

There are two problems with such behavior:
- When vim.paste() errors, the client is still supposed to send the
  remaining chunks of the stream, even though they do nothing.
- Having different code paths for two uncommon but similar situations
  complicates maintenance.

This PR makes both the cancel case and the error case return false to
the client and drain the remaining chunks of the stream, which, apart
from sharing the same code path, is beneficial whether the client checks
the return value of nvim_paste or not:
- If the client checks the return value, it can avoid sending the
  following chunks needlessly after an error.
- If the client doesn't check the return value, chunks following a
  cancelled chunk won't be pasted on the server regardless, which leads
  to less confusing behavior.
2024-09-24 07:14:14 +08:00
Tristan Knight
032e024f8a fix(filetype): handle .in files with no filename (#30487)
Problem:
fnamemodify with the :r flag will not strip extensions if the filename
starts with a ".". This means that files named ".in" could cause an
infinite loop.

Solution:
Add early return if the filename was not changed
2024-09-24 06:42:16 +08:00
Justin M. Keyes
34a40d3a50 Merge #30435 refactor: rename "Dictionary" => "Dict" 2024-09-23 07:14:10 -07:00
Justin M. Keyes
47e6b2233f fix(vim.fs): dirname() returns "." on mingw/msys2 #30480
Problem:
`vim.fs.dirname([[C:\User\XXX\AppData\Local]])` returns "." on
mingw/msys2.

Solution:
- Check for "mingw" when deciding `iswin`.
- Use `has("win32")` where possible, it works in "fast" contexts since
  b02eeb6a72.
2024-09-23 06:05:58 -07:00
Justin M. Keyes
17027d6472 refactor(api): rename Dictionary => Dict
In the api_info() output:

    :new|put =map(filter(api_info().functions, '!has_key(v:val,''deprecated_since'')'), 'v:val')
    ...

    {'return_type': 'ArrayOf(Integer, 2)', 'name': 'nvim_win_get_position', 'method': v:true, 'parameters': [['Window', 'window']], 'since': 1}

The `ArrayOf(Integer, 2)` return type didn't break clients when we added
it, which is evidence that clients don't use the `return_type` field,
thus renaming Dictionary => Dict in api_info() is not a breaking change.
2024-09-23 14:42:57 +02:00
Justin M. Keyes
737f58e232 refactor(api)!: rename Dictionary => Dict
In the api_info() output:

    :new|put =map(filter(api_info().functions, '!has_key(v:val,''deprecated_since'')'), 'v:val')
    ...

    {'return_type': 'ArrayOf(Integer, 2)', 'name': 'nvim_win_get_position', 'method': v:true, 'parameters': [['Window', 'window']], 'since': 1}

The `ArrayOf(Integer, 2)` return type didn't break clients when we added
it, which is evidence that clients don't use the `return_type` field,
thus renaming Dictionary => Dict in api_info() is not (in practice)
a breaking change.
2024-09-23 14:42:57 +02:00
zeertzjq
5acdc4499e test(tui_spec): prevent another case of race between paste and input (#30481)
Problem:  When input immediately follows end of bracketed paste, the
          nvim_input may be processed before the nvim_paste.
Solution: Ensure some waiting after the end of a bracketed paste.
2024-09-23 11:50:57 +00:00
Justin M. Keyes
cac86e9b4c build: silence "po" noise #30469
Problem:
Noise in stderr from src/nvim/po/CMakeLists.txt during build:

    48 substitutions on 48 lines
    "optwin.js" "optwin.js" 1299L, 57582B written
    385 substitutions on 385 lines
    "nvim.pot" "nvim.pot" 9318L, 180177B written

Solution:
Run with `-c silent source` instead of `-S`.
2024-09-23 02:18:30 -07:00
zeertzjq
5057753431 fix(runtime): treat b:undo_ftplugin consistently in Lua ftplugins (#30473)
- Don't assume b:undo_ftplugin is set when first modifying it.
- Don't assume b:undo_ftplugin already contains some resetting.
2024-09-23 16:49:34 +08:00
Christian Clason
423176db56 vim-patch:be551da: runtime(netrw): remove extraneous closing bracket
fixes: vim/vim#15717
closes: vim/vim#15718

be551dacb8

Co-authored-by: Peter Aronoff <peter@aronoff.org>
2024-09-23 09:30:49 +02:00
zeertzjq
bfe0acaea1 vim-patch:9.1.0740: incorrect internal diff with empty file (#30471)
Problem:  incorrect internal diff with an empty file
Solution: Set pointer to NULL, instead of using an empty line file
          (Yukihiro Nakadaira)

When using internal diff, empty file is read as one empty line file.
So result differs from external diff.

closes: vim/vim#15719

f1694b439b

Co-authored-by: Yukihiro Nakadaira <yukihiro.nakadaira@gmail.com>
2024-09-23 12:04:07 +08:00
dundargoc
e83ce331da build: use treesitter's CMakeLists.txt 2024-09-22 19:58:03 +02:00
dundargoc
327110ff8c build(cmake): remove unnecessary policy code
Policy CMP0092 is by default on for minimum cmake versions above 3.15.
2024-09-22 17:21:10 +02:00
Lewis Russell
511b991e66 feat(fs.lua): add vim.fs.rm()
Analogous to the shell `rm` command.
2024-09-22 15:05:24 +01:00
Evgeni Chasnovski
29bceb4f75 docs(api): nvim_get_runtime_file preserves 'runtimepath' order #30454 2024-09-22 03:51:22 -07:00
zeertzjq
e697c1b43d fix(paste): improve repeating of pasted text (#30438)
- Fixes 'autoindent' being applied during redo.
- Makes redoing a large paste significantly faster.
- Stores pasted text in the register being recorded.

Fix #28561
2024-09-22 06:02:48 +08:00
dundargoc
1d815acd78 build: bump minimum cmake version to 3.16 2024-09-21 23:42:03 +02:00
Christian Clason
4e4b1b6590 test(terminal): unskip wrap tests on windows
These should have been unskipped again when reflow was reenabled.
2024-09-21 19:00:52 +02:00
Lewis Russell
e5c174421d test: support upvalues in exec_lua 2024-09-21 16:04:09 +01:00
zeertzjq
a19e89022d Merge pull request #30452 from zeertzjq/vim-9.1.0738
vim-patch: rapid files are not recognized
2024-09-21 20:50:09 +08:00
zeertzjq
ac65e0f04b vim-patch:a0c14ef: runtime(filetype): tests: Test_filetype_detection() fails
Problem:  tests: Test_filetype_detection() fails (after 9.1.0738)
Solution: Add missing filetype detect patterns for *.SYSx and *.MODx

a0c14ef310

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-09-21 20:25:07 +08:00
zeertzjq
d28be6fe69 vim-patch:9.1.0738: filetype: rapid files are not recognized
Problem:  filetype: rapid files are not recognized
Solution: detect '*.sysx' and '*.modx' as rapid filetype
          (KnoP-01)

closes: vim/vim#15669

fdcb08264d

Co-authored-by: KnoP-01 <knosowski@graeffrobotics.de>
2024-09-21 20:24:06 +08:00
zeertzjq
881a58787d vim-patch:e6b01cf: runtime(dist): do not output a message if executable is not found (#30451)
closes: vim/vim#15705

e6b01cfe01

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-09-21 12:16:28 +00:00
zeertzjq
d8cd15e8d6 vim-patch:9.1.0739: [security]: use-after-free in ex_getln.c (#30448)
Problem:  [security]: use-after-free in ex_getln.c
Solution: free pointer p a bit later (John Marriott)

closes: vim/vim#15712

a6de28755e

Co-authored-by: John Marriott <basilisk@internode.on.net>
2024-09-21 18:26:44 +08:00
Christian Clason
059a9e6254 vim-patch:50423ab: runtime(java): Optionally recognise _module_ import declarations
Define "g:java_syntax_previews" and include number 476 in
its list to enable this recognition:
------------------------------------------------------------
        let g:java_syntax_previews = [476]
------------------------------------------------------------

Reference:
https://openjdk.org/jeps/476

closes: vim/vim#15709

50423ab808

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-09-21 11:25:41 +02:00
Christian Clason
cd230be918 vim-patch:597aadc: runtime(lyrics): support multiple timestamps in syntax script
Problem:  Multiple timestamps in the same line were not highlighted
Solution: Adapt the syntax to support multiple timestamps

fixes: vim/vim#15703
closes: vim/vim#15707

597aadcf21

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2024-09-21 11:25:41 +02:00
Christian Clason
91b7a421ea vim-patch:87b6565: runtime(modconf): remove erroneous :endif in ftplugin
regression introduced in f86568f91848ece0c5da

closes: vim/vim#15704

87b65652e8

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-09-21 11:25:41 +02:00
Christian Clason
b40b22f426 vim-patch:f86568f: runtime(misc): simplify keywordprg in various ftplugins
closes: vim/vim#15696

f86568f918

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-09-21 11:25:41 +02:00
Christian Clason
f5883e0d45 vim-patch:2307945: runtime(java): Optionally recognise all primitive constants in _switch-case_ labels
Define "g:java_syntax_previews" and include number 455 in
its list to enable this recognition:
------------------------------------------------------------
	let g:java_syntax_previews = [455]
------------------------------------------------------------

Reference:
https://openjdk.org/jeps/455

closes: vim/vim#15698

23079450a8

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-09-21 11:25:41 +02:00
Christian Clason
674c1aac11 vim-patch:41c7bba: runtime(zsh,sh): set and unset compiler in ftplugin
closes: vim/vim#15699

41c7bbaf8f

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-09-21 11:25:41 +02:00
Christian Clason
82f329a41d vim-patch:c18a9d5: runtime(netrw): using inefficient highlight pattern for 'mf'
Fixes E872 too many '(' in highlight pattern for `mf` selection

fixup for vim/vim#15551
closes: vim/vim#15700

c18a9d5835

Co-authored-by: yasuda <yasuda@kyoto-sr.co.jp>
2024-09-21 11:25:41 +02:00
dundargoc
e268fcbdaa build: work around bug in make when PATH includes cmake as dir
There appears to be a bug in `make` where if a rule asks `make` to
invoke a command called `foo`, and `foo` exists somewhere in `$PATH` as
a directory (not an executable file), `make` will attempt to `execve`
that directory instead of continuing to search in later parts of the
`$PATH` for `foo` as a true executable.

The cause can be traced back to a bug in Make 4.3 which stems from their
use of the findprog function in Gnulib. This was reported to the Make
maintainers here:

https://savannah.gnu.org/bugs/index.php?57962

and then forwarded to the Gnulib maintainers here:

https://github.com/coreutils/gnulib/commit/7b1de4a

Make 4.4 does not have this bug, and I can confirm that I'm able to run
make in the Neovim repo with no further modifications to my system than
upgrading the version of make I'm using to 4.4 or 4.4.1.

As the change is small enough, and it's unlikely that make version
around the world is going to be updated in a timely manner, it makes
sense to just add a workaround for this. Using `command -v` to resolve
the `cmake` command, similar to what is already being done with
`cmake3`, makes it work correctly in all cases. Continuing to include
`... || echo cmake` at the end means that if neither `cmake3` nor
`cmake` are installed, the user will still see a message about CMake
being missing.

Co-authored-by: Jake Zimmerman <zimmerman.jake@gmail.com>
2024-09-20 22:16:34 +02:00
Justin M. Keyes
100bb15d18 docs: link to discussions instead of stackoverflow 2024-09-20 16:13:17 +02:00
Justin M. Keyes
a60700f3b1 docs: prefix LSP bug report title 2024-09-20 16:08:55 +02:00
Riley Bruins
052e048db6 fix(treesitter): lint top-level anonymous nodes
**Problem:** Top-level anonymous nodes are not being checked by the
query linter

**Solution:** Check them by adding them to the top-level query

This commit also moves a table construction out of the match iterator so
it is run less frequently.
2024-09-20 08:44:43 +02:00
zeertzjq
f01c764cc6 vim-patch:35699f1: runtime(vim): Update base-syntax, improve folding function matches (#30427)
- Allow function command modifiers.
- Match function bodies starting with empty lines.

Command modifiers reported by @Konfekt.

fixes vim/vim#15671
closes: vim/vim#15674

35699f1749

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-09-20 06:59:46 +08:00
Tristan Knight
adbaaa5225 docs(lsp): hover window controls #30347 2024-09-19 08:00:08 -07:00
Justin M. Keyes
84e85aeb10 fix(health): check more "old" files #30421
Problem:

    Node.js provider (optional) ~
    - ERROR Failed to run healthcheck for "provider.node" plugin. Exception:
      …/runtime/lua/provider/node/health.lua:9: attempt to call field 'provider_disabled' (a nil value)

    Perl provider (optional) ~
    - ERROR Failed to run healthcheck for "provider.perl" plugin. Exception:
      …/runtime/lua/provider/perl/health.lua:8: attempt to call field 'provider_disabled' (a nil value)

    Python 3 provider (optional) ~
    - ERROR Failed to run healthcheck for "provider.python" plugin. Exception:
      …/runtime/lua/provider/python/health.lua:226: attempt to call field 'provider_disabled' (a nil value)

    Ruby provider (optional) ~
    - ERROR Failed to run healthcheck for "provider.ruby" plugin. Exception:
      …/runtime/lua/provider/ruby/health.lua:9: attempt to call field 'provider_disabled' (a nil value)

Solution:
Add these files to the runtime sanity check.

fix #29302
2024-09-19 06:34:23 -07:00
zeertzjq
7dbbaaec3f refactor!: rename 'jumpoptions' flag "unload" to "clean" (#30418)
Follow-up to #29347
2024-09-19 18:05:27 +08:00
Devon Gardner
0fe4362e21 fix(coverity/509227/509228): tui driver_ti underflow #30341
Problem:
write() can return -1 but is cast to unsigned type causing coverity
to detect possible overflowed integer

Solution:
Perform check to ensure all negative values are captured rather than
just -1 before casting to unsigned type
2024-09-19 01:33:40 -07:00
Enno
0ba3888474 vim-patch:5036e69: runtime(systemd): allow for overriding systemd ftplugin settings (vim/vim#13373) (#30414)
closes: vim/vim#13357

5036e69852
2024-09-18 19:20:14 +08:00
Justin M. Keyes
ff85e54939 feat(tui): builtin UI (TUI) sets client info #30397
Problem:
The default builtin UI client does not declare its client info. This
reduces discoverability and makes it difficult for plugins to identify
the UI.

Solution:
- Call nvim_set_client_info after attaching, as recommended by `:help dev-ui`.
- Also set the "pid" field.
- Also change `ui_active()` to return a count. Not directly relevant to
  this commit, but will be useful later.
2024-09-18 04:14:06 -07:00
Justin M. Keyes
22553e1f38 docs: graduate tui.txt to "flow layout" #30413 2024-09-18 01:28:00 -07:00
Justin M. Keyes
83a7d97d64 fix(coverity): CID 509571 Uninitialized variables #30395
/src/nvim/os/pty_proc_unix.c: 416 in pty_proc_init()
    410     {
    411       PtyProc rv;
    412       rv.proc = proc_init(loop, kProcTypePty, data);
    413       rv.width = 80;
    414       rv.height = 24;
    415       rv.tty_fd = -1;
    >>>     CID 509571:  Uninitialized variables  (UNINIT)
    >>>     Using uninitialized value "rv". Field "rv.winsize" is uninitialized.
    416       return rv;
2024-09-18 01:26:04 -07:00
Justin M. Keyes
44afd07443 docs(tui): rename term.txt, nvim_terminal_emulator.txt #30398
Problem:
It has long been a convention that references to the builtin terminal UI
should mention "tui", not "term", in order to avoid ambiguity vs the
builtin `:terminal` feature. The final step was to rename term.txt;
let's that step.

Solution:
- rename term.txt => tui.txt
- rename nvim_terminal_emulator.txt => terminal.txt
- `gen_help_html.lua`: generate redirects for renamed pages.
2024-09-18 00:26:01 -07:00
Christian Clason
22479ce563 vim-patch:f21d28a: runtime(zathurarc): add double-click-follow to syntax script
closes: vim/vim#15688

f21d28a5c7

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-09-18 09:05:59 +02:00
Gregory Anders
0ade8fed14 Merge pull request #30411 from gpanders/vim-9.1.0734
vim-patch:9.1.{0734,0735}
2024-09-17 17:20:50 -05:00
Gregory Anders
9a3f74c4c7 vim-patch:9.1.0735: filetype: salt files are not recognized
Problem:  filetype: salt files are not recognized
Solution: Detect '*.sls' files as filetype salt,
          include a syntax script (Gregory Anders)

closes: vim/vim#15689

89b9bb4ac8

Co-authored-by: Gregory Anders <greg@gpanders.com>
2024-09-17 14:18:51 -05:00
Gregory Anders
13d6f6cbb2 vim-patch:9.1.0734: filetype: jinja files are not recognized
Problem:  filetype: jinja files are not recognized
Solution: detect '*.jinja' files a jinja filetype,
          include jinja syntax script (Gregory Anders)

related: vim/vim#15689

202c467bb3

Co-authored-by: Gregory Anders <greg@gpanders.com>
2024-09-17 14:17:33 -05:00
glepnir
a0d8c2b86e docs(eval): update param types of prompt-buffer functions (#30392) 2024-09-16 18:33:35 +08:00
Justin M. Keyes
549c00c791 Merge #29490 feat(vim.ui.open): configurable opener 2024-09-16 03:21:40 -07:00
Justin M. Keyes
23dcd7cd73 test(vim.ui.open): opt.cmd 2024-09-16 11:58:04 +02:00
Matěj Cepl
3f15e57b26 feat(vim.ui): configurable "gx" / vim.ui.open() tool
Problem:
User cannot configure the tool used by `vim.ui.open` (or `gx`). With
netrw this was supported by `g:netrw_browsex_viewer`.

Solution:
Introduce `opts.cmd`. Users that want to set this globally can
monkey-patch `vim.ui.open` in the same way described at `:help vim.paste()`.

Fixes https://github.com/neovim/neovim/issues/29488

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2024-09-16 11:58:02 +02:00
Christian Clason
a9031cc4a6 vim-patch:5e95c8f: runtime(java): Highlight javaConceptKind modifiers with StorageClass
Stop assigning by default the NonText highlighting group for
javaConceptKind modifiers since its colour is hardly
distinguishable from a background colour for a range of
colour schemes.

fixes vim/vim#15237
related vim/vim#15238
closes: vim/vim#15664

5e95c8f637

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
Co-authored-by: Dexter Gaon-Shatford <dexter@gaonshatford.ca>
2024-09-16 08:16:32 +02:00
Christian Clason
5e7933693b vim-patch:0f5effb: runtime(netrw): delete confirmation not strict enough
fixes: vim/vim#15680

0f5effbd1f

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-09-16 08:16:20 +02:00
Christian Clason
f408603f4f vim-patch:9.1.0731: inconsistent case sensitive extension matching
Problem:  inconsistent case sensitive extension matching
Solution: unify case sensitive extension matching (Evgeni Chasnovski).

There are different approaches of how extensions are matched with
respect to case sensitivity. In particular, '\c' flag is used in pattern
whereas in most places case sensitive matching is guarded behind
`has("fname_case")` condition.

Replace all instances of '\c' with an explicit case sensitive pattern
variants guarded by `has("fname_case")`. Strictly speaking, this is a
breaking change because only two (most common and prevailingly tested)
variants are now matched: upper first letter and upper all letters.

closes: vim/vim#15672

59b089c9df

Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
2024-09-16 08:16:07 +02:00
zeertzjq
78b8510933 vim-patch:4d427d4: runtime(vim): Update base-syntax, match Vim9 bool/null literal args to :if/:while/:return (#30391)
Match Vim9 boolean and null literals in expression arguments of :if,
:elseif, :while and :return.

closes: vim/vim#15684

4d427d4cab

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-09-15 22:57:16 +00:00
Justin M. Keyes
057d27a9d6 refactor: rename "process" => "proc" #30387
Problem:
- "process" is often used as a verb (`multiqueue_process_events`), which
  is ambiguous for cases where it's used as a topic.
- The documented naming convention for processes is "proc".
  - `:help dev-name-common`
- Shorter is better, when it doesn't harm readability or
  discoverability.

Solution:
Rename "process" => "proc" in all C symbols and module names.
2024-09-15 12:20:58 -07:00
Justin M. Keyes
5792546777 refactor(tests): rename terminal/testutil.lua => testterm.lua #30372
This module is generally used by any tests that need the full Nvim TUI
instead of `screen.lua`. Thus it should live in `functional/` instead of
in `functional/terminal/`.
2024-09-15 03:28:14 -07:00
zeertzjq
3b54adc6c6 Merge pull request #30378 from zeertzjq/vim-9.1.0729
vim-patch:9.1.{0729,0730}
2024-09-14 19:51:11 +08:00
zeertzjq
325d349f9d vim-patch:9.1.0728: [security]: heap-use-after-free in garbage collection with location list user data (#30377)
Problem:  heap-use-after-free in garbage collection with location list
          user data.
Solution: Mark user data as in use when no other window is referencing
          the location list (zeertzjq)

fixes: neovim/neovim#30371
closes: vim/vim#15683

be4bd189d2
2024-09-14 19:38:33 +08:00
zeertzjq
5191a11d66 vim-patch:9.1.0730: Crash with cursor-screenline and narrow window
Problem:  Crash with cursor-screenline and narrow window
          (elig0n)
Solution: Don't set right_col when width2 is 0 (zeertzjq).

fixes: vim/vim#15677
closes: vim/vim#15678

59149f0269
2024-09-14 19:29:40 +08:00
zeertzjq
90585e47fe vim-patch:9.1.0729: Wrong cursor-screenline when resizing window
Problem:  Wrong cursor-screenline when resizing window
Solution: Invalidate saved left_col and right_col when width1 or width2
          change.

closes: vim/vim#15679

86dc4f8b43
2024-09-14 19:29:37 +08:00
Jaehwang Jung
f2173b1aa2 fix(defaults): cannot remove "How-to disable mouse" menu item #30375 2024-09-14 02:18:38 -07:00
dundargoc
67d6b6f27e ci: skip automerge step if backport failed 2024-09-14 01:55:36 +02:00
Mathias Fussenegger
8512f669f0 fix(lsp): handle nil bytes in strings
Problem:

The LSP omnifunc can insert nil bytes, which when read in other places
(like semantic token) could cause an error:

    semantic_tokens.lua:304: Vim:E976: Using a Blob as a String

Solution:

Use `#line` instead of `vim.fn.strlen(line)`. Both return UTF-8 bytes
but the latter can't handle nil bytes.

Completion candidates can currently insert nil bytes, if other parts of
Alternative fix to https://github.com/neovim/neovim/pull/30359

Note that https://github.com/neovim/neovim/pull/30315 will avoid the
insertion of nil bytes from the LSP omnifunc, but the change of this PR
can more easily be backported.
2024-09-13 22:34:49 +02:00
dundargoc
755512ed60 ci: don't add reviewers for PRs created by a bot
This will ensure automatic backports created by the backport action does
not request reviewers (since the commit in question has already been
vetted and merged), but manual backports created by users does request
reviewers as these commits has not been vetted previously.
2024-09-13 16:58:15 +02:00
dundargoc
4c23b83456 ci: add needs:backport label on backport PRs with conflict
This makes it easy to keep track of which backport PRs have failed and
need manual intervention to fix.
2024-09-13 16:49:35 +02:00
dundargoc
5284a2a793 build: bump unibilium to v2.1.2
There is no real practical difference from previous commit except that
this is a tagged release.
2024-09-13 15:56:37 +02:00
Riley Bruins
b9b408a56c feat(treesitter): start moving get_parser to return nil #30313
**Problem:** `vim.treesitter.get_parser` will throw an error if no parser
can be found.

- This means the caller is responsible for wrapping it in a `pcall`,
  which is easy to forget
- It also makes it slightly harder to potentially memoize `get_parser`
  in the future
- It's a bit unintuitive since many other `get_*` style functions
  conventionally return `nil` if no object is found (e.g. `get_node`,
  `get_lang`, `query.get`, etc.)

**Solution:** Return `nil` if no parser can be found or created

- This requires a function signature change, and some new assertions in
  places where the parser will always (or should always) be found.
- This commit starts by making this change internally, since it is
  breaking. Eventually it will be rolled out to the public API.
2024-09-13 05:09:11 -07:00
James Trew
8654a97006 fix(lsp): handle empty call hierarchy items #30349
Ensure that the function `pick_call_hierarchy_item` correctly handles
the case where `call_hierarchy_items` is nil or an empty table. This
prevents potential errors when the function is called with no items.
2024-09-13 04:59:49 -07:00
dundargoc
057314345a ci: enable automerge by default when backporting
This will automatically merge backported PRs without human intervention
if the tests pass.
2024-09-13 12:31:33 +02:00
Justin M. Keyes
deac7df80a refactor(stream.c): unused params in stream_close #30356 2024-09-12 09:16:57 -07:00
Christian Clason
ae917dbd06 fix(treesitter): sync queries from upstream 2024-09-12 13:41:15 +02:00
Christian Clason
c65153893a build(deps): bump tree-sitter-c to v0.23.0 2024-09-12 13:41:15 +02:00
Christian Clason
f6cc0394ae build(deps): bump tree-sitter-markdown to v0.3.2 2024-09-12 13:41:15 +02:00
Christian Clason
f347c292d1 build(deps): bump tree-sitter-lua to v0.2.0 2024-09-12 13:41:15 +02:00
zeertzjq
48c14d3544 vim-patch:9.1.0725: filetype: swiftinterface files are not recognized (#30350)
Problem:  filetype: swiftinterface files are not recognized
Solution: Detect '*.swiftinterface' files as swift filetype
          (LosFarmosCTL)

closes: vim/vim#15658

03cac4b70d

Co-authored-by: LosFarmosCTL <80157503+LosFarmosCTL@users.noreply.github.com>
2024-09-12 15:16:58 +08:00
Justin M. Keyes
5931f780e0 feat(log): use "ui" as default name for TUI client #30345
The default "session name" for the builtin TUI is "ui".

before:

    INF 2024-09-10T14:57:35.385 hello.sock os_exit:692: Nvim exit: 1
    INF 2024-09-10T14:57:35.388 ?.4543     os_exit:692: Nvim exit: 1

after:

    INF 2024-09-10T14:59:19.919 hello.sock os_exit:692: Nvim exit: 1
    INF 2024-09-10T14:59:19.922 ui.5684    os_exit:692: Nvim exit: 1
2024-09-11 17:25:00 -07:00
Gregory Anders
98ba65b8be fix: replace NVIM with Nvim in default titlestring (#30348) 2024-09-11 20:32:08 +00:00
glepnir
f9bf64d746 fix(lsp): check buffer is loaded and valid #30330
Problem: buffer mabye not valid when callback handler invoke.

Soliton: check buffer is valid and loaded in handler.
2024-09-11 08:11:09 -07:00
Justin M. Keyes
a30afeeb85 Merge #30342 :checkhealth completion 2024-09-11 03:01:48 -07:00
Justin M. Keyes
7b680e0ca9 test(health): "test_plug/health/init.lua" completes as "test_plug" 2024-09-11 11:40:56 +02:00
Christian Clason
8501fe621a build(deps): bump unibilium to HEAD - ab28a2ddb 2024-09-11 11:10:40 +02:00
Christian Clason
a5bd6665b0 fix(scripts): update bundled dependencies in bump_deps 2024-09-11 11:10:40 +02:00
Christian Clason
4ac733f6ef vim-patch:fc72a2f: runtime(idlang): update syntax script
closes: vim/vim#15419

fc72a2fa48

Co-authored-by: Joe Sapp <992873+sappjw@users.noreply.github.com>
2024-09-11 09:47:30 +02:00
Christian Clason
c1a4b8680b vim-patch:e401576: runtime(spec): Recognize epoch when making spec changelog in ftplugin
closes: vim/vim#15537

e40157641c

Co-authored-by: fundawang <fundawang@yeah.net>
2024-09-11 09:47:30 +02:00
Christian Clason
f6579a4db1 vim-patch:2241f08: runtime(spec): add file triggers to syntax script
closes: vim/vim#15569

2241f0845f

Co-authored-by: fundawang <fundawang@yeah.net>
2024-09-11 09:47:30 +02:00
Christian Clason
608ef83fc6 vim-patch:077d1d2: runtime(make): add compiler/make.vim to reset compiler plugin settings
closes: vim/vim#15645

077d1d2cff

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
Co-authored-by: K.Takata <kentkt@csc.jp>
2024-09-11 09:47:30 +02:00
Christian Clason
57db94235c vim-patch:a9ae38d: runtime(java): Recognise all available standard doclet tags
* Complement the tag set with @spec, {@systemProperty},
  {@summary}, @provides, @uses, @hidden, and {@index}.
* Do not hoard all tags under a single highlighting group.
* Skip over nested balanced braces in inline tags.
* Observe that tag names are case sensitive: both {@docRoot}
  and {@inheritDoc} are valid, whereas {@inheritdoc} and
  {@docroot} are not.
* In the @see tag arguments, allow for:
  - module name prefixes (e.g. java.base/java.lang.String);
  - references to arbitrary URI fragments (e.g. ##foo);
  - matching any tag variation arguments on the next line.
* Test directives and tags for Java module declarations.
* Enforce the word end for "module-info" candidates.

References:
https://bugs.openjdk.org/browse/JDK-8226279 (@spec)
https://bugs.openjdk.org/browse/JDK-8214559 ({@systemProperty})
https://bugs.openjdk.org/browse/JDK-8173425 ({@summary})
https://bugs.openjdk.org/browse/JDK-8160196 (@provides & @uses)
https://bugs.openjdk.org/browse/JDK-8073100 (@hidden)
https://bugs.openjdk.org/browse/JDK-8044243 ({@index})
https://docs.oracle.com/en/java/javase/21/docs/specs/javadoc/doc-comment-spec.html
https://github.com/openjdk/jdk/blob/jdk-21-ga/src/jdk.compiler/share/classes/com/sun/source/doctree/DocTree.java

closes: vim/vim#15652

a9ae38dc3f

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-09-11 09:47:30 +02:00
Christian Clason
cdab8c8ebb vim-patch:c0982f9: runtime(dosini): Update syntax script, spellcheck comments only
By default spell checking is enabled for all text, but adding
`contains=@Spell` to syntax rules restricts spell checking to those
syntax rules.  See `:help spell-syntax` for full details.

Variable names and headers are far more likely than comments to contain
spelling errors, so only enable spell checking in comments.

Introduced in https://github.com/xuhdev/syntax-dosini.vim/pull/8

cc @tobinjt

closes: vim/vim#15655

c0982f9f79

Co-authored-by: John Tobin <johntobin@johntobin.ie>
2024-09-11 09:47:30 +02:00
Christian Clason
830cf054bc vim-patch:d30ffdc: runtime(pandoc): Update compiler plugin to use actual 'spelllang'
Previously these would be cached in buffer-local variables and
would not change on :compiler pandoc

closes: vim/vim#15642

d30ffdca49

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-09-11 09:47:30 +02:00
Christian Clason
def6111118 vim-patch:7cc0e91: runtime(groff): Add compiler plugin for groff
Groff MOM (Macros for Manuscripts) is a macro package for the GNU
troff (groff) typesetting system, a light-weight alternative
to LaTeX for professional-quality documents.

closes: vim/vim#15646

7cc0e9145d

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-09-11 09:47:30 +02:00
monkoose
237d2aef4d fix(health): return correct name from 'path2name()'
`path2name()` function doesn't process `'pluginname/health/init.lua'` correctly. Instead of retruning `'pluginname'` it returns `'pluginname.health'`
2024-09-11 07:55:37 +03:00
zeertzjq
15bfdf73ea vim-patch:9.1.0727: too many strlen() calls in option.c (#30338)
Problem:  too many strlen() calls in option.c
Solution: refactor the code to reduce the number of strlen() calls
          (John Marriott)

closes: vim/vim#15604

95dacbb5fd

Co-authored-by: John Marriott <basilisk@internode.on.net>
2024-09-10 23:31:07 +00:00
dundargoc
f289161c3c test: add termkey unit tests
Skipped importing the following unit tests from libtermkey as they'd
require introducing a lot of unused code or require more effort to port
than is probably worth:

- 05read
- 12strpkey
- 20canon
- 40ti-override
2024-09-11 00:36:14 +02:00
zeertzjq
4b98d38870 vim-patch:d657d3d: runtime(doc): clarify the effect of the timeout for search()-functions (#30337)
related: vim/vim#15657
related: vim/vim#15404

d657d3d8fd

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-09-11 06:09:58 +08:00
bfredl
4c5bce9cb4 Merge pull request #30295 from glepnir/nfloat
fix(highlight): floating windows inherit NormalFloat from global-ns
2024-09-10 11:11:07 +02:00
Justin M. Keyes
5d7853f229 refactor(os/input.c): rename os_inchar => input_get #30327
Problem:
The name `os_inchar` (from Vim's old `mch_inchar`) is ambiguous:
"inchar" sounds like it could be reading or enqueuing (setting) input.
Its docstring is also ambiguous.

Solution:
- Rename `os_inchar` to `input_get`.
- Write some mf'ing docstrings.
- Add assert() in TRY_READ().
2024-09-10 01:14:18 -07:00
tris203
f279d1ae33 fix(lsp): handle encoding bounds in str_utfindex_enc
Problem:
str_utfindex_enc could return an error if the index was longer than the
line length. This was handled in each of the calls to it individually

Solution:
* Fix the call at the source level so that if the index is higher than
  the line length, utf length is returned
2024-09-10 09:25:04 +02:00
LosFarmosCTL
9ddfcb64bf fix(runtime): add remaining missing commentstrings (#30252) 2024-09-10 15:01:25 +08:00
glepnir
8e81212e15 fix(highlight): floating windows inherit NormalFloat from global-ns
Problem:
floating windows did not correctly inherit the NormalFloat highlight
group from the global namespace when it was not defined in the window-specific
namespace. This led to floating windows losing their background highlight when
switching between namespaces.

Solution:
Updated the window highlight logic in update_window_hl() to handle the fallback.

This fix resolves issues with floating window backgrounds not displaying as expected
in certain namespace configurations.
2024-09-10 13:31:42 +08:00
Justin M. Keyes
648d6426c8 fix(server): CID 509282: DEADCODE #30316
listen_addr cannot be NULL at this point.
2024-09-09 05:14:47 -07:00
Justin M. Keyes
f0334c2c71 Merge #30312 from justinmk/testslashes 2024-09-09 04:00:35 -07:00
Justin M. Keyes
c8e3618e0e fix(test): "tempdir not a directory" in CI logs
$NVIM_LOG_FILE: /Users/runner/work/neovim/neovim/build/.nvimlog
    WRN 2024-09-08T21:48:13.279 ?.21134    vim_mktempdir:3281: $TMPDIR tempdir not a directory (or does not exist): TMPDIR-should-be-ignored
    WRN 2024-09-08T21:48:13.312 ?.21137    vim_mktempdir:3281: $TMPDIR tempdir not a directory (or does not exist): TMPDIR-should-be-ignored
2024-09-09 12:23:54 +02:00
Justin M. Keyes
ed832b9ddf refactor(test): rename alter_slashes, invert its behavior
- `alter_slashes` belongs in `testutil.lua`, not `testnvim.lua`.
- `alter_slashes` is an unusual name. Rename it to `fix_slashes`.
- invert its behavior, to emphasize that `/` slashes are the preferred,
  pervasive convention, not `\` slashes.
2024-09-09 12:23:54 +02:00
Justin M. Keyes
8a2aec9974 fix(startup): server fails if $NVIM_APPNAME is relative dir #30310
Problem:
If $NVIM_APPNAME is a relative dir path, Nvim fails to start its
primary/default server, and `v:servername` is empty.
Root cause is d34c64e342, but this wasn't
noticed until 96128a5076 started reporting the error more loudly.

Solution:
- `server_address_new`: replace slashes "/" in the appname before using
  it as a servername.
- `vim_mktempdir`: always prefer the system-wide top-level "nvim.user/"
  directory. That isn't intended to be specific to NVIM_APPNAME; rather,
  each *subdirectory* ("nvim.user/xxx") is owned by each Nvim instance.
  Nvim "apps" can be identified by the server socket(s) stored in those
  per-Nvim subdirs.

fix #30256
2024-09-08 12:48:32 -07:00
Christian Clason
3a88113246 fix(lua): revert vim.tbl_extend behavior change and document it
Problem: vim.tbl_deep_extend had an undocumented feature where arrays
(integer-indexed tables) were not merged but compared literally (used
for merging default and user config, where one list should overwrite the
other completely). Turns out this behavior was relied on in quite a
number of plugins (even though it wasn't a robust solution even for that
use case, since lists of tables (e.g., plugin specs) can be array-like
as well).

Solution: Revert the removal of this special feature. Check for
list-like (contiguous integer indices) instead, as this is closer to the
intent. Document this behavior.
2024-09-08 21:06:13 +02:00
Justin M. Keyes
08153ddd1c fix(startup): ignore broken $XDG_RUNTIME_DIR #30285
Problem:
$XDG_RUNTIME_DIR may be broken on WSL, which prevents starting (and even
building) Nvim. #30282

Solution:
- When startup fails, mention the servername in the error message.
- If an autogenerated server address fails, log an error and continue
  with an empty `v:servername`. It's only fatal if a user provides a bad
  `--listen` or `$NVIM_LISTEN_ADDRESS` address.

Before:

    $ nvim --headless --listen ./hello.sock
    nvim: Failed to --listen: "address already in use"
    $ NVIM_LISTEN_ADDRESS='./hello.sock' ./build/bin/nvim --headless
    nvim: Failed to --listen: "address already in use"

After:

    $ nvim --headless --listen ./hello.sock
    nvim: Failed to --listen: address already in use: "./hello.sock"
    $ NVIM_LISTEN_ADDRESS='./hello.sock' ./build/bin/nvim --headless
    nvim: Failed $NVIM_LISTEN_ADDRESS: address already in use: "./hello.sock"
2024-09-08 07:07:19 -07:00
Tristan Knight
003b8a251d fix(lsp): handle out-of-bounds character positions #30288
Problem:
str_byteindex_enc could return an error if the index was longer than the
lline length. This was handled in each of the calls to it individually

Solution:
* Fix the call at the source level so that if the index is higher than
  the line length, line length is returned as per LSP specification
* Remove pcalls on str_byteindex_enc calls. No longer needed now that
  str_byteindex_enc has a bounds check.
2024-09-08 03:44:46 -07:00
Justin M. Keyes
0cfbc6eaff Merge #30105 fix(tohtml): quote font-family names 2024-09-08 03:32:33 -07:00
Justin M. Keyes
95b65a7554 test(tohtml): simplify font test 2024-09-08 12:17:42 +02:00
yayoyuyu
e37404f7fe fix(tohtml): enclose font-family names in quotation marks
Font-family names must be enclosed in quotation marks to ensure that
fonts are applied correctly when there are spaces in the name.

Fix an issue where multiple fonts specified in `vim.o.guifont` are
inserted as a single element, treating them as a single font.

Support for escaping commas with backslash and ignoring spaces
after a comma.

ref `:help 'guifont'`
2024-09-08 12:15:50 +02:00
zeertzjq
b40ec083ae vim-patch:b584117: runtime(doc): buffers can be re-used (#30300)
while at it, also move the note about :wincmd
directly to :h :wincmd, it doesn't seem to belong to the buffer section.

closes: vim/vim#15636

b584117b05

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-09-08 05:41:44 +08:00
Yi Ming
d338ec9cb2 fix(vim.ui.open): prefer xdg-open on WSL #30302
xdg-open is usually not installed in WSL. But if the user deliberately
installs it, presumably they want to prioritize it.
2024-09-07 14:14:37 -07:00
Justin M. Keyes
5ddf2ab768 test(lua): tbl_deep_extend "after second argument" #30297 2024-09-07 09:41:02 -07:00
zeertzjq
3d1110674e vim-patch:9.1.0720: Wrong breakindentopt=list:-1 with multibyte or TABs (#30293)
Problem:  Wrong breakindentopt=list:-1 with multibyte chars or TABs in
          text matched by 'formatlistpat' (John M Devin)
Solution: Use the width of the match text (zeertzjq)

fixes: vim/vim#15634
closes: vim/vim#15635

61a6ac4d00
2024-09-07 10:50:52 +00:00
zeertzjq
738a84de09 vim-patch:9.1.0719: Resetting cell widths can make 'listchars' or 'fillchars' invalid (#30289)
Problem:  Resetting cell widths can make 'listchars' or 'fillchars'
          invalid.
Solution: Check for conflicts when resetting cell widths (zeertzjq).

closes: vim/vim#15629

66f65a46c5
2024-09-06 23:36:51 +00:00
bfredl
439d031742 Merge pull request #30236 from luukvbaal/invalid
fix(decor): revise marktree metadata for invalid marks
2024-09-06 13:13:51 +02:00
bfredl
c81cb02dd6 Merge pull request #30272 from bfredl/replace_emoji
fix(multibyte): handle backspace of wide clusters in replace mode
2024-09-06 12:08:26 +02:00
bfredl
fa99afe35e fix(multibyte): handle backspace of wide clusters in replace mode
Make utf_head_off more robust against invalid sequences
and embedded NUL chars
2024-09-06 10:22:29 +02:00
zeertzjq
9570ad24f5 vim-patch:9.1.0717: Unnecessary nextcmd NULL checks in parse_command_modifiers() (#30275)
Problem:  Unnecessary nextcmd NULL checks in parse_command_modifiers().
Solution: Remove them (zeertzjq)

Every place parse_command_modifiers() is called, nextcmd is NULL, and
after it's set to non-NULL the function returns very soon.
Even if one day nextcmd may be non-NULL, the NULL checks may still be
wrong as the correct behavior may be overriding nextcmd.

closes: vim/vim#15620

f7b8609446
2024-09-06 07:23:31 +08:00
zeertzjq
d60c753cff vim-patch:9.1.0716: resetting setcellwidth() doesn't update the screen (#30274)
Problem:  resetting setcellwidth() doesn't update the screen
Solution: Redraw after clearing the cellwidth table (Ken Takata)

closes: vim/vim#15628

539e9b571a

Co-authored-by: Ken Takata <kentkt@csc.jp>
2024-09-06 06:52:13 +08:00
Christian Clason
e36e68d35c build(deps): bump libuv to HEAD - 0a00e80c3 2024-09-05 16:23:58 +02:00
Paul "LeoNerd" Evans
f4d823b123 refactor(vterm): inline REFLOW macro
cherry-picked from dfc4c5e5b3
2024-09-05 15:38:58 +02:00
Justin M. Keyes
76aa3e52be feat(defaults): popupmenu "Open in browser", "Go to definition" #30261
- Use the popup to expose more features such as LSP and gx.
- Move the copy/paste items lower in the menu, they are lower priority.
2024-09-05 05:56:00 -07:00
dundargoc
f9108378b7 refactor: adopt termkey and eliminate duplicate code
Termkey is abandoned and it's now our code, so there's no reason not to
treat it as such. An alternative approach could be to have a proper repo
that we maintain such as with unibilium, although with this approach we
can make a few assumptions that will allow us to remove more code.

Also eliminate duplicate code from both termkey and libvterm.
2024-09-05 14:28:12 +02:00
Justin M. Keyes
975aeee537 test: avoid noise in CI logs #30264
Problem:
Since 96128a5076 the test logs have noise from tests that *expect*
failures:

    $NVIM_LOG_FILE: /tmp/cirrus-ci-build/build/.nvimlog
    (last 100 lines)
    ERR 2024-09-04T13:38:45.181 T949.28335.0/c terminfo_start:486: uv_pipe_open failed: no such device or address
    ERR 2024-09-04T13:38:45.181 T949.28335.0/c flush_buf:2527: uv_write failed: bad file descriptor
    ERR 2024-09-04T13:38:45.181 T949.28335.0/c flush_buf:2527: uv_write failed: bad file descriptor
    WRN 2024-09-04T13:43:43.294 ?.35904    server_start:173: Failed to start server: address already in use: /…/Xtest_tmpdir/…/T7159.35895.0
    WRN 2024-09-04T13:43:43.314 ?.35907    server_start:173: Failed to start server: illegal operation on a directory: /
    ERR 2024-09-04T13:43:43.332 ?.35909    socket_watcher_init:60: Host lookup failed: https://example.com

Solution:
Rewrite the test to use `vim.system()`. Set NVIM_LOG_FILE in the child
process to a "throwaway" logfile.
2024-09-05 02:39:58 -07:00
Tristan Knight
882a450a29 fix(lsp): handle locations exceeding line length #30253
Problem:
LSP spec [states](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position)
that "if the character value is greater than the line length it defaults
back to the line length", but `locations_to_items` fails in that case.

Solution:
Adjust locations_to_items to follow the spec.

closes #28281
2024-09-05 00:23:11 -07:00
Gregory Anders
220b8aa6fe vim-patch:315b6f7: runtime(tmux): Update syntax script (#30265)
closes: ericpruitt/tmux.vim#25
closes: vim/vim#15622

315b6f7b73

Co-authored-by: Eric Pruitt <eric.pruitt@gmail.com>
2024-09-04 19:33:07 -05:00
Gregory Anders
51088b67cb vim-patch:150b507: runtime(hcl,terraform): Add runtime files for HCL and Terraform (#30266)
closes: vim/vim#15618

150b5078ac
2024-09-04 19:32:52 -05:00
Luuk van Baal
34ded4d97b fix(decor): exclude invalid marks from meta total
Problem:  Marktree meta count still includes invalidated marks, making
          guards that check the meta total ineffective.
Solution: Revise marktree metadata when in/revalidating a mark.
2024-09-04 15:13:12 +02:00
Lewis Russell
b6e350a6b4 fix(lua): allows tables with integer keys to be merged in tbl_deep_extend
- The exclusion of lists was never justified in the commit history and is
  the wrong thing to do for a function that deals with tables.

- Move the error checks out of the recursive path.

Fixes #23654
2024-09-04 11:34:19 +01:00
zeertzjq
7b7c95dac9 vim-patch:9.1.0713: Newline causes E749 in Ex mode (#30254)
Problem:  Newline causes E749 in Ex mode (after 9.1.0573).
Solution: Don't execute empty command followed by a newline.

closes: vim/vim#15614

2432b4a753

Cherry-pick code change from patch 8.2.3405.
2024-09-04 06:35:26 +08:00
Tristan Knight
45e76acaa0 feat(lsp): support hostname in rpc.connect #30238
Updated the `rpc.connect` function to support connecting to LSP servers
using hostnames, not just IP addresses. This change includes updates to
the documentation and additional test cases to verify the new
functionality.

- Modified `connect` function to resolve hostnames.
- Updated documentation to reflect the change.
- Added test case for connecting using hostname.

Added a TCP echo server utility function to the LSP test suite. This
server echoes the first message it receives and is used in tests to
verify LSP server connections via both IP address and hostname.
Refactored existing tests to use the new utility function.
2024-09-03 08:10:39 -07:00
こけっち
fdd3a9cdf7 docs: use "nvim" in swapfile message #30250
Problem:
The message E325 displays “vim -r” to recover the file.

Solution:
Change the message to display “nvim -r” instead of “vim -r”.
2024-09-03 14:11:26 +00:00
vanaigr
d1d7d54680 fix(api): nvim_buf_get_text() crashes with large negative column #28740
Problem:
crash when calling nvim_buf_get_text() with a large negative start_col:

    call nvim_buf_get_text(0, 0, -123456789, 0, 0, {})

Solution:
clamp start_col after subtracting it from the line length.
2024-09-03 06:01:42 -07:00
bfredl
ceddaedfad Merge pull request #30232 from bfredl/emoji2
fix(mbyte): mark any 0xFE0F sequence as a TUI ambiguous width char
2024-09-03 12:04:42 +02:00
Justin M. Keyes
ea2d949351 test: tmpname(create:boolean) #30242
Problem:
137f98cf64 added the `create` parameter to `tmpname()` but didn't
fully implement it.

Solution:
- Update impl for the `os.tmpname()` codepath.
- Inspect all usages of `tmpname()`, update various tests.
2024-09-03 02:18:17 -07:00
Justin M. Keyes
ae9674704a Merge #30237 validate --listen address 2024-09-02 15:52:18 -07:00
Justin M. Keyes
96128a5076 feat(startup): validate --listen address
Problem:
`nvim --listen` does not error on EADDRINUSE. #30123

Solution:
Now that `$NVIM_LISTEN_ADDRESS` is deprecated and input *only* (instead
of the old, ambiguous situation where it was both an input *and* an
output), we can be fail fast instead of trying to "recover". This
reverts the "recovery" behavior of
704ba4151e, but that was basically
a workaround for the fragility of `$NVIM_LISTEN_ADDRESS`.
2024-09-02 22:41:41 +02:00
Justin M. Keyes
137f98cf64 test: tmpname() can skip file creation 2024-09-02 20:19:50 +02:00
dundargoc
ef8067a19d build: add quotes around CMAKE_GENERATOR variable
This will fix the following error when using generators that have a
space in them, e.g. "Unix Makefiles":

"CMake Error: Could not create named generator Unix".

Closes https://github.com/neovim/neovim/issues/30218.
2024-09-02 17:37:15 +02:00
wzy
60ea046741 feat(clipboard): try cygutils, clip on Windows #30215 2024-09-02 05:43:23 -07:00
bfredl
50a576ba57 fix(mbyte): mark any 0xFE0F sequence as a TUI ambiguous width char
Some sequences beginning with ASCII might be rendered as emoji, as for
instance emoji 1️⃣  which is encoded as ascii 0x31 + U+FE0F + U+20E3.

While it is tricky to make the width of such sequences configurable,
we can make TUI be careful with such sequences and reset the cursor,
just like for Extended_Pictogram based sequences.
2024-09-02 12:49:02 +02:00
zeertzjq
a8fc799e8b vim-patch:3c07eb0: runtime(vim): Update syntax, improve user-command matching (#30231)
- Match -addr and -keepscript attributes and generate -addr values.
- Match attribute errors where = is specified.
- Highlight attributes with Special like other Ex command options.
- Don't highlight user-specified completion function args.
- Match :delcommand -buffer attribute.

closes: vim/vim#15586

3c07eb0c67

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-09-02 17:38:19 +08:00
Christian Clason
13c739a664 vim-patch:bd69b39: runtime(sudoers): improve recognized Runas_Spec and Tag_Spec items
Recognize colon-delimited second part of Runas_Spec that specifies
permitted groups, e.g.:

    alan ALL = (root, bin : operator, system) ALL

This implementation is sloppy because it accepts any amount of colons
delimiting further Runas_Lists, but for now that's better than bailing
out completely as soon as a colon is encountered (esp. given that the
default sudoers uses these colons, breaking highlighting OOTB).

Also, while at it, make Vim recognize all Tag_Spec items, not just
{,NO}PASSWD

closes: vim/vim#15607

bd69b39514

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-09-02 11:15:42 +02:00
Tristan Knight
bcae8be91f docs: vim.lsp.rpc.connect() TCP requires IP address #30219
"localhost" would work if we used
[tcp_connect](ae0387742b/examples/echo-server-client.lua (L42)),
but that will require changes to
[vim.lsp.rpc.connect](318c0415d5/runtime/lua/vim/lsp/rpc.lua (L638)).
2024-09-01 15:46:01 -07:00
Justin M. Keyes
61e9137394 docs: misc #28970 2024-09-01 13:01:24 -07:00
Gregory Anders
6913c5e1d9 feat(treesitter)!: default to correct behavior for quantified captures (#30193)
For context, see https://github.com/neovim/neovim/pull/24738. Before
that PR, Nvim did not correctly handle captures with quantifiers. That
PR made the correct behavior opt-in to minimize breaking changes, with
the intention that the correct behavior would eventually become the
default. Users can still opt-in to the old (incorrect) behavior for now,
but this option will eventually be removed completely.

BREAKING CHANGE: Any plugin which uses `Query:iter_matches()` must
update their call sites to expect an array of nodes in the `match`
table, rather than a single node.
2024-09-01 18:01:53 +00:00
Gregory Anders
318c0415d5 fix(ui): correctly pass metadata to get_node_text #30222
Fixes: #30220
2024-09-01 10:15:02 -07:00
luukvbaal
97f8d1de1c vim-patch:9.1.0708: Recursive window update does not account for reset skipcol (#30217)
Problem:  Window is updated with potentially invalid skipcol in recursive
          window update path. I.e. cursor outside of visible range in
          large line that does not fit.
Solution: Make sure it is valid (Luuk van Baal).

3d5065fc75
2024-09-01 20:19:19 +08:00
Yi Ming
9b983e5f6c docs(treesitter): annotate some tables as TSMetadata 2024-09-01 10:45:24 +01:00
Christian Clason
195eca94d4 vim-patch:9abd02d: runtime(nu): include filetype plugin
This is used to set the commentstring option.

closes: vim/vim#15601

9abd02d16a

Co-authored-by: Marc Jakobi <marc.jakobi@tiko.energy>
2024-09-01 11:35:34 +02:00
Gregory Anders
9762c5e340 feat(ui): gx: use url extmark attribute and tree-sitter directive (#30192)
Use the "url" extmark attribute as well as the "url" tree-sitter
metadata key to determine if the cursor is over something Nvim considers
a URL.
2024-08-31 19:56:20 -05:00
zeertzjq
808d73b5df vim-patch:d817609: runtime(vim): Update base-syntax, match bracket mark ranges (#30208)
Match '(,'),'[,'],'{, and '} marks in Ex command ranges.

Thanks to Maxim Kim.

Fixes vim/vim#15332.
Closes vim/vim#15337.

d817609b87

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-09-01 08:26:59 +08:00
zeertzjq
bfa365a872 fix(completion): don't include <Lua function> in -complete= (#30209) 2024-09-01 07:57:09 +08:00
zeertzjq
f046c3eca6 Merge pull request #30207 from zeertzjq/vim-7c8bbc6
vim-patch: doc updates
2024-09-01 06:53:13 +08:00
zeertzjq
751ab0e4ca vim-patch:e2c4e07: runtime(doc): Update :help :command-complete list
closes: vim/vim#15602

e2c4e07795

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-09-01 06:30:33 +08:00
zeertzjq
5f81c36934 vim-patch:7c8bbc6: runtime(doc): use mkdir -p to save a command
closes: vim/vim#15599

7c8bbc6d28

Co-authored-by: Ughur Alakbarov <58857108+ugur-a@users.noreply.github.com>
2024-09-01 06:28:46 +08:00
zeertzjq
ea2998fec9 vim-patch:9.1.0704: inserting with a count is inefficient (#30206)
Problem:  inserting with a count is inefficient
Solution: Disable calculation of the cursor position and topline, if a
          count has been used (Ken Takata)

Optimize insertion when using :normal 10000ix.

This patch optimizes the insertion with a large count (e.g. `:normal
10000ix`).

It seems that calculation of the cursor position for a long line is slow
and it takes O(n^2). Disable the calculation if not needed.

Before:
```
$ time ./vim --clean -c 'normal 10000ix' -cq!
real    0m1.879s
user    0m1.328s
sys     0m0.139s

$ time ./vim --clean -c 'normal 20000ix' -cq!
real    0m5.574s
user    0m5.421s
sys     0m0.093s

$ time ./vim --clean -c 'normal 40000ix' -cq!
real    0m23.588s
user    0m23.187s
sys     0m0.140s
```

After:
```
$ time ./vim --clean -c 'normal 10000ix' -cq!
real    0m0.187s
user    0m0.046s
sys     0m0.093s

$ time ./vim --clean -c 'normal 20000ix' -cq!
real    0m0.217s
user    0m0.046s
sys     0m0.108s

$ time ./vim --clean -c 'normal 40000ix' -cq!
real    0m0.278s
user    0m0.093s
sys     0m0.140s

$ time ./vim --clean -c 'normal 80000ix' -cq!
real    0m0.494s
user    0m0.311s
sys     0m0.140s

$ time ./vim --clean -c 'normal 160000ix' -cq!
real    0m1.302s
user    0m1.140s
sys     0m0.094s
```

closes: vim/vim#15588

09b80d23cf

Co-authored-by: Ken Takata <kentkt@csc.jp>
2024-09-01 06:21:36 +08:00
zeertzjq
6f167fcae9 vim-patch:9.1.0707: [security]: invalid cursor position may cause a crash (#30204)
Problem:  [security]: invalid cursor position may cause a crash
          (after v9.1.0038)
Solution: Set cursor to the last character in a line, if it would
          otherwise point to beyond the line; no tests added, as it
          is unclear how to reproduce this.

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-4ghr-c62x-cqfh

396fd1ec29

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-09-01 05:07:17 +08:00
dundargoc
4ee65484b1 build: make makefile work on windows
Using powershell as the default windows shell as using cmd alters $PATH
in a way that makes building neovim fail (powershell prioritizes visual
studio tools which is arguably more correct).

This was tested with gnu make for windows, which can be installed with
e.g. scoop. It does not work with nmake and it is extremely unlikely we
want to add nmake support as the makefile is merely supposed to be
syntactic sugar for the most common case. For similar reasons, the only
supported generator is ninja.
2024-08-31 23:05:36 +02:00
bfredl
e1937286f0 Merge pull request #30042 from bfredl/bobbytables
refactor(multibyte): replace generated unicode tables with utf8proc
2024-08-31 18:55:09 +02:00
bfredl
26be6446e5 refactor(multibyte): replace generated unicode tables with utf8proc
This commit intentionally aims at preserving existing behavior as much
as possible while replacing our build step to convert unicode data
files into binary tables, which corresponding lookups in utf8proc.
Actual improvements in behavior will be a followup.

The only change in behavior is that 'emoji' option will turn some
more codepoints into double with. Nvim used the "Emoji" and
"Emoji_Presentation" properties to define emojis, while utf8proc
only exposes the Extended_Pictographic property from the emoji table.
This is a superset of the previous emoji properties. As only
codepoints above 0x1f000 are affected by the 'emoji' option, this means
that the following chars are now treated as double-width, instead of
single-width like in previous nvim versions:

🀀 🀁 🀂 🀃 🀅 🀆 🀇 🀈 🀉 🀊 🀋 🀌 🀍 🀎 🀏 🀐 🀑 🀒 🀓 🀔 🀕 🀖 🀗 🀘 🀙 🀚 🀛 🀜 🀝 🀞 🀟 🀠 🀡 🀢 🀣 🀤
🀥 🀦 🀧 🀨 🀩 🀪 🀫 🀰 🀱 🀲 🀳 🀴 🀵 🀶 🀷 🀸 🀹 🀺 🀻 🀼 🀽 🀾 🀿 🁀 🁁 🁂 🁃 🁄 🁅 🁆 🁇 🁈 🁉 🁊 🁋 🁌
🁍 🁎 🁏 🁐 🁑 🁒 🁓 🁔 🁕 🁖 🁗 🁘 🁙 🁚 🁛 🁜 🁝 🁞 🁟 🁠 🁡 🁢 🁣 🁤 🁥 🁦 🁧 🁨 🁩 🁪 🁫 🁬 🁭 🁮 🁯 🁰
🁱 🁲 🁳 🁴 🁵 🁶 🁷 🁸 🁹 🁺 🁻 🁼 🁽 🁾 🁿 🂀 🂁 🂂 🂃 🂄 🂅 🂆 🂇 🂈 🂉 🂊 🂋 🂌 🂍 🂎 🂏 🂐 🂑 🂒 🂓 🂠
🂡 🂢 🂣 🂤 🂥 🂦 🂧 🂨 🂩 🂪 🂫 🂬 🂭 🂮 🂱 🂲 🂳 🂴 🂵 🂶 🂷 🂸 🂹 🂺 🂻 🂼 🂽 🂾 🂿 🃁 🃂 🃃 🃄 🃅 🃆 🃇
🃈 🃉 🃊 🃋 🃌 🃍 🃎 🃑 🃒 🃓 🃔 🃕 🃖 🃗 🃘 🃙 🃚 🃛 🃜 🃝 🃞 🃟 🃠 🃡 🃢 🃣 🃤 🃥 🃦 🃧 🃨 🃩 🃪 🃫 🃬 🃭
🃮 🃯 🃰 🃱 🃲 🃳 🃴 🃵 🄍 🄎 🄏 🄯 🅬 🅭 🅮 🅯 🆭 🌢 🌣 🎔 🎕 🎘 🎜 🎝 🏱 🏲 🏶 📾 🕆 🕇 🕈 🕏 🕨 🕩 🕪 🕫
🕬 🕭 🕮 🕱 🕲 🕻 🕼 🕽 🕾 🕿 🖀 🖁 🖂 🖃 🖄 🖅 🖆 🖈 🖉 🖎 🖏 🖑 🖒 🖓 🖔 🖗 🖘 🖙 🖚 🖛 🖜 🖝 🖞 🖟 🖠 🖡
🖢 🖣 🖦 🖧 🖩 🖪 🖫 🖬 🖭 🖮 🖯 🖰 🖳 🖴 🖵 🖶 🖷 🖸 🖹 🖺 🖻 🖽 🖾 🖿 🗀 🗁 🗅 🗆 🗇 🗈 🗉 🗊 🗋 🗌 🗍 🗎
🗏 🗐 🗔 🗕 🗖 🗗 🗘 🗙 🗚 🗛 🗟 🗠 🗢 🗤 🗥 🗦 🗧 🗩 🗪 🗫 🗬 🗭 🗮 🗰 🗱 🗲 🗴 🗵 🗶 🗷 🗸 🗹 🛆 🛇 🛈 🛉
🛊 🛓 🛔 🛦 🛧 🛨 🛪 🛱 🛲 🝴 🝵 🝶 🝻 🝼 🝽 🝾 🝿 🟕 🟖 🟗 🟘 🟙 🢰 🢱 🨀 🨁 🨂 🨃 🨄 🨅 🨆 🨇 🨈 🨉 🨊 🨋
🨌 🨍 🨎 🨏 🨐 🨑 🨒 🨓 🨔 🨕 🨖 🨗 🨘 🨙 🨚 🨛 🨜 🨝 🨞 🨟 🨠 🨡 🨢 🨣 🨤 🨥 🨦 🨧 🨨 🨩 🨪 🨫 🨬 🨭 🨮 🨯
🨰 🨱 🨲 🨳 🨴 🨵 🨶 🨷 🨸 🨹 🨺 🨻 🨼 🨽 🨾 🨿 🩀 🩁 🩂 🩃 🩄 🩅 🩆 🩇 🩈 🩉 🩊 🩋 🩌 🩍 🩎 🩏 🩐 🩑 🩒 🩓
🩠 🩡 🩢 🩣 🩤 🩥 🩦 🩧 🩨 🩩 🩪 🩫 🩬 🩭
2024-08-31 18:09:38 +02:00
glepnir
a6c4487e8b vim-patch:9.1.0684: completion is inserted on Enter with "noselect" (#30111)
Problem:  completion is inserted on Enter with "noselect"
          (Carman Fu)
Solution: check noselect before update compl_shown_match
          (glepnir)

fixes: vim/vim#15526
closes: vim/vim#15530

753794bae8
2024-08-31 17:10:05 +08:00
zeertzjq
53af02adba refactor(plines): correct double-width condition (#30200)
To check for a non-ASCII character, the condition should be >= 0x80, not
> 0x80.  In this case it doesn't really matter as the 0x80 character is
unprintable and occupies 4 cells, but still make it consistent.
2024-08-31 01:06:34 +00:00
zeertzjq
55dc482e75 fix(completion): fix inconsistent Enter behavior (#30196)
Problem:  Behavior of Enter in completion depends on typing speed.
Solution: Don't make whether Enter selects original text depend on
          whether completion has been interrupted, which can happen
          interactively with a slow completion function.
2024-08-31 04:03:30 +08:00
glepnir
42ed0ffad9 fix(lsp): when prefix is non word add all result into matches (#30044)
Problem: prefix can be a symbol like period, the fuzzy matching can't
handle it correctly.

Solution: when prefix is empty or a symbol add all lsp completion
result into matches.
2024-08-30 20:23:49 +02:00
bfredl
5f95f1249f Merge pull request #30014 from bfredl/neoemoji
support emojis with ZWJ and variant selectors
2024-08-30 12:58:48 +02:00
bfredl
cfdf68a7ac feat(mbyte): support extended grapheme clusters including more emoji
Use the grapheme break algorithm from utf8proc to support grapheme
clusters from recent unicode versions.

Handle variant selector VS16 turning some codepoints into double-width
emoji. This means we need to use ptr2cells rather than char2cells when
possible.
2024-08-30 11:49:09 +02:00
Christian Clason
4353996d0f vim-patch:87c01d9: runtime(hollywood): update syn highlight for If-Then statements and For-In-Loops
Improving syntax highlighting by allowing numbers, - and a $ as suffix
in user constants and by allowing hwConstants in If-Then statements

closes: vim/vim#15059

87c01d9561

Co-authored-by: Tom Crecelius <holly@net-eclipse.net>
2024-08-30 00:35:05 +02:00
Evgeni Chasnovski
862679c70f fix(highlight): update PmenuSel for colored completion items #30183
Problem: completion items can now have dedicated highlighting (through
  `hl_group` and `kind_hlgroup` fields). Both of the fields combine
  their highlight attributes with the underlying `PmenuXxx` group.

  As default color scheme `Pmenu` and `PmenuSel` are intentionally
  almost inverted versions of one another, the added highlighting will
  be unreadable in one of them if done only through foreground (which is
  the most convenient way for users and being able to do so is arguably
  the biggest benefit of actually combining added highlighting).

Solution: adjust `PmenuSel` to utilize `attr=reverse`. This works
  because `fg`/`bg` are first combined and only then reversed. This
  results in a colored background for items with `hl_group` and
  `kind_hlgroup` using text highlighting.

  This also results in the same background for regular selected item,
  while intentionally changing foreground from `Nvim{Light,Dark}Grey3`
  to (essentially) `Nvim{Light,Dark}Grey2`. This both provides better
  contrast ratio and does not need realigning of the whole block.
2024-08-29 12:08:30 -07:00
bfredl
9a3c8f64a7 Merge pull request #26950 from bfredl/s390x_fix
fix issues with s390x CI on master (xdiff and others)
2024-08-29 18:52:23 +02:00
Riley Bruins
59baa5e8a1 fix(tohtml): apply sp color if present #30110
Problem:
Things like underlines are always given a default foreground highlight
regardless of the value of `sp`.

Solution:
Check for `sp` first, and apply that color to the text decoration color if it
exists.

Limitations:
If there is no value of `sp`, vim applies a text decoration color that matches
the foreground of the text. This is still not implemented (and seems like a much
more complex problem): in TOhtml, the underline will still be given a default
foreground highlight.
2024-08-29 09:36:33 -07:00
bfredl
176bfea135 fix(build): issues with s390x CI
Does not fix everything, but at least let's test run to finish before
timeout
2024-08-29 15:15:50 +02:00
zeertzjq
7588ff2d89 fix(man): check if buffer is valid before restoring 'tagfunc' (#30180) 2024-08-29 11:53:48 +00:00
glepnir
6c2186a998 docs(eval): fix wrong return type of getcharsearch() (#30176) 2024-08-29 18:02:23 +08:00
zeertzjq
0346666f71 vim-patch:9.1.0699: "dvgo" is not always an inclusive motion (#30173)
Problem:  "dvgo" is not always an inclusive motion
          (Iain King-Speir)
Solution: initialize the inclusive flag to false

fixes: vim/vim#15580
closes: vim/vim#15582

f8702aeb8f

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-29 06:24:40 +08:00
dundargoc
cd05a72fec docs: misc (#29719)
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: Lauri Heiskanen <lauri.heiskanen@nimble.fi>
Co-authored-by: Piotr Doroszewski <5605596+Doroszewski@users.noreply.github.com>
Co-authored-by: Tobiasz Laskowski <tobil4sk@outlook.com>
Co-authored-by: ariel-lindemann <41641978+ariel-lindemann@users.noreply.github.com>
Co-authored-by: glepnir <glephunter@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-08-29 06:11:32 +08:00
dundargoc
3085c9d9da revert: "Makefile: use pattern rules for build/.deps (#10366)"
This reverts commit 7f6ff829aa.

The given reasoning and usecase is unsatisfactory. While it is true that
it allows to run `make build/bin/nvim`, it can easily be recreated with
`ninja -C build bin/nvim` which does the exact same thing. This minor
convenience is not worth adding the extra code given how rare this
usecase should be.
2024-08-28 12:37:29 +02:00
Christian Clason
3a61f05dd2 vim-patch:8556e23: runtime(java): Provide support for syntax preview features
Introduce a new API variable "g:java_syntax_previews" whose
value must be a list of syntax preview feature numbers.

Enumerate the currently supported numbers in a table at the
end of the documentation entry for "ft-java-syntax".

Also, disable the recognition of String Templates.  Despite
the withdrawal of this preview feature in its proposed form
from the upcoming JDK 23 release and the fact that the JDK
22 release is coming to EOL this September, an earlier
iteration of this preview feature was included in JDK 21
(LTS) whose EOL is projected to fall due in late 2028 and,
therefore, retain the current implementation.

Define "g:java_syntax_previews" and include number 430 in
its list to enable the recognition of String Templates:
------------------------------------------------------------
	let g:java_syntax_previews = [430]
------------------------------------------------------------

References:
https://openjdk.org/jeps/430 (Preview)
https://openjdk.org/jeps/459 (Second Preview)
https://openjdk.org/jeps/465 (Third Preview)
https://mail.openjdk.org/pipermail/amber-spec-experts/2024-April/004106.html

closes: vim/vim#15579

8556e23ee9

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-08-28 11:22:23 +02:00
Eisuke Kawashima
3bcd5624be fix(regexp): fix typo in E888 error message (#30161)
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2024-08-28 10:37:27 +08:00
Maria José Solano
dad55f5e76 feat(lsp): export diagnostic conversion functions (#30064) 2024-08-27 13:16:33 -05:00
Riley Bruins
f8e1ebd6f6 fix(treesitter): escape things like " in omnifunc results 2024-08-27 09:27:47 +02:00
Maria José Solano
d9ccd828b0 fix(lsp): return call hierarchy item, not the index (#30145) 2024-08-26 17:37:36 +02:00
Maria José Solano
0e394f136f fix(lsp): log when receiving markup messages (#30065) 2024-08-26 17:35:43 +02:00
Mathias Fußenegger
983953858e fix(lsp): fix isIncomplete condition in completion trigger (#30130)
Follow up to https://github.com/neovim/neovim/pull/30028#discussion_r1726539370
2024-08-26 17:34:54 +02:00
Lewis Russell
688b961d13 feat(treesitter): add support for wasm parsers
Problem: Installing treesitter parser is hard (harder than
climbing to heaven).

Solution: Add optional support for wasm parsers with `wasmtime`.

Notes:

* Needs to be enabled by setting `ENABLE_WASMTIME` for tree-sitter and
  Neovim. Build with
  `make CMAKE_EXTRA_FLAGS=-DENABLE_WASMTIME=ON
  DEPS_CMAKE_FLAGS=-DENABLE_WASMTIME=ON`
* Adds optional Rust (obviously) and C11 dependencies.
* Wasmtime comes with a lot of features that can negatively affect
  Neovim performance due to library and symbol table size. Make sure to
  build with minimal features and full LTO.
* To reduce re-compilation times, install `sccache` and build with
  `RUSTC_WRAPPER=<path/to/sccache> make ...`
2024-08-26 16:44:03 +02:00
Christian Clason
664de5ea97 build(deps): bump tree-sitter to v0.23.0 2024-08-26 16:14:36 +02:00
zeertzjq
c0a8abf18e vim-patch:88a6dd0: runtime(doc): fix typo (#30140)
closes: vim/vim#15572

88a6dd036a

Co-authored-by: glepnir <glephunter@gmail.com>
2024-08-26 08:10:29 +08:00
JonnyKong
b8135a76b7 fix(docs): wrong return value annotation for nvim_buf_get_extmarks 2024-08-25 08:36:00 +01:00
zeertzjq
cf44121f7f vim-patch:9.1.0694: matchparen is slow on a long line (#30134)
Problem:  The matchparen plugin is slow on a long line.
Solution: Don't use a regexp to get char at and before cursor.
          (zeertzjq)

Example:

```vim
  call setline(1, repeat(' foobar', 100000))
  runtime plugin/matchparen.vim
  normal! $hhhhhhhh
```

closes: vim/vim#15568

81e7513c86
2024-08-25 06:07:43 +08:00
Christian Clason
84f1c5e072 build(deps): bump luajit to HEAD - f725e44cd 2024-08-24 17:58:20 +02:00
zeertzjq
91ce0c3ddd vim-patch:9.1.0692: Wrong patlen value in ex_substitute() (#30131)
Problem:  Wrong patlen value in ex_substitute() (after 9.1.0426).
Solution: Compute patlen after finding end separator.
          (zeertzjq)

Add a more explicit test.  The test already passes as the only case
where a overlarge patlen value matters was fixed by patch 9.1.0689.

closes: vim/vim#15565

d1c8d2de4b
2024-08-24 10:19:24 +00:00
zeertzjq
bb4b6b427c vim-patch:9.1.0690: cannot set special highlight kind in popupmenu (#30128)
Problem:  cannot set special highlight kind in popupmenu
Solution: add kind_hlgroup item to complete function
          (glepnir)

closes: vim/vim#15561

38f99a1f0d

Co-authored-by: glepnir <glephunter@gmail.com>
2024-08-24 08:38:05 +08:00
zeertzjq
2c6222c56b Merge pull request #30127 from zeertzjq/vim-7884cc7
vim-patch: update Vim syntax
2024-08-24 08:12:51 +08:00
zeertzjq
8010d1c0ed vim-patch:7866d54: runtime(vim): Update base-syntax, match :loadkeymap after colon and bar
Match :loadkeymap after Ex colons and bars.

Don't generate :loadkeymap as it is matched with a custom syntax group.

closes: vim/vim#15554

7866d54ecc

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-08-24 07:41:28 +08:00
zeertzjq
8f9669a27c vim-patch:7884cc7: runtime(vim): Update base-syntax, improve :let-heredoc highlighting
The end marker is not required to match the indent of :let when "trim"
is specified, it may also appear without leading whitespace as normal.

closes: vim/vim#15564

7884cc7418

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-08-24 07:39:56 +08:00
zeertzjq
6af9ca4926 vim-patch:95e9078: runtime(vim): Improve heredoc handling for all embedded scripts (#30121)
* Improve heredoc handling
  - Support "trim" for all the embedded scripts.
  - Check the indent of "trim" for "let" and all the embedded scripts.
* Update missing part of vim.vim.base in the commit
  d164f2a521f8e52e587727657fb1c19e9a25f32a.
* Update gen_syntax_vim.vim to catch up with 9.1.0685's source code.

closes: vim/vim#15542

95e90781a4

Co-authored-by: Ken Takata <kentkt@csc.jp>
2024-08-23 09:56:29 +08:00
Christian Clason
3b32869ced vim-patch:2750b83: runtime(java): Make the bundled &foldtext function optional
- Obtain and pass through translated messages with this
  function.
- If "g:java_foldtext_show_first_or_second_line" is defined,
  assign this function to &foldtext.

closes: vim/vim#15549

2750b83fa1

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-08-22 23:45:48 +02:00
Christian Clason
8db8793503 vim-patch:c75dad0: runtime(netrw): Change line on mx if command output exists
closes: vim/vim#15550

c75dad0177

Co-authored-by: yasuda <yasuda@kyoto-sr.co.jp>
2024-08-22 23:45:48 +02:00
Christian Clason
916237d9b5 vim-patch:38cfa2b: runtime(netrw): Fix mf-selected entry highlighting
closes: vim/vim#15551

38cfa2b662

Co-authored-by: yasuda <yasuda@kyoto-sr.co.jp>
2024-08-22 23:45:48 +02:00
Christian Clason
8c405d9b34 vim-patch:0e9fd77: runtime(htmlangular): add html syntax highlighting
fixes: vim/vim#15459
closes: vim/vim#15552

0e9fd7755d

Co-authored-by: Dennis van den Berg <dennis.vandenberg@nedap.com>
2024-08-22 23:45:48 +02:00
glepnir
1f5bcc7c4e feat(lsp): completion opts support custom item conversion (#30060)
Problem: Some items of completion results include function signatures that can
cause the pum to be very long when a function has many params, because pum
scales with the longest word/abbr.

Solution: add custom covert function that can customise abbr to remove params.
2024-08-22 21:42:27 +02:00
glepnir
e48179f31e fix(lsp): suppress completion request if completion is active (#30028)
Problem: the autotrigger mechanism could fire completion requests despite
completion already being active from another completion mechanism or manual
trigger

Solution: add a condition to avoid an additional request.
2024-08-22 09:51:44 +02:00
zeertzjq
3bd7492a69 vim-patch:bc29ea6: runtime(zip): simplify condition to detect MS-Windows (#30115)
related: vim/vim#15519

bc29ea6286

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-22 05:58:22 +08:00
zeertzjq
362389eb15 vim-patch:9.1.0683: mode() returns wrong value with <Cmd> mapping (#30109)
Problem:  mode() returns wrong value with <Cmd> mapping
Solution: Change decision priority of VIsual_active and move
          visual mode a bit further down (kuuote)

closes: vim/vim#15533

0fd1cb1b1f

Co-authored-by: kuuote <znmxodq1@gmail.com>
2024-08-22 05:30:21 +08:00
Christian Clason
4e5607eb37 build(deps): bump luajit to HEAD - c68711cc8 2024-08-21 12:57:18 +02:00
Christian Clason
a691858326 vim-patch:5f5f283: runtime(pandoc): escape quotes in &errorformat for pandoc
closes: vim/vim#15535

5f5f2832f5

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-08-21 09:14:17 +02:00
Christian Clason
78e48cd9b5 vim-patch:d55e698: runtime(pandoc): refine pandoc compiler settings
closes: vim/vim#15529

d55e698fa0

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-08-21 09:14:17 +02:00
zeertzjq
6f7bb02e7f vim-patch:9.1.0686: zip-plugin has problems with special characters (#30108)
Problem:  zip-plugin has problems with special characters
          (user202729)
Solution: escape '*?[\' on Unix and handle those chars
          a bit differently on MS-Windows, add a test, check
          before overwriting files

runtime(zip): small fixes for zip plugin

This does the following:
- verify the unzip plugin is executable when loading the autoload plugin
- handle extracting file names with '[*?\' in its name correctly by
  escaping those characters for the unzip command (and handle those
  characters a bit differently on MS-Windows, since the quoting is different)
- verify, that the extract plugin is not overwriting a file (could cause
  a hang, because unzip asking for confirmation)
- add a test zip file which contains those special file names

fixes: vim/vim#15505
closes: vim/vim#15519

7790ea0c68

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-20 23:35:27 +00:00
zeertzjq
a9e11168f5 Merge pull request #30095 from zeertzjq/vim-175a87c
vim-patch: update :keeppatterns doc
2024-08-21 07:20:59 +08:00
zeertzjq
9f49529627 vim-patch:e44e644: runtime(doc): fix grammar in :h :keeppatterns
- It's clear that :s and :& are Ex commands, so remove "command" along
  with the duplicate "the".
- Use "or" instead of "and" following "without".

closes: vim/vim#15527

e44e64492c
2024-08-21 07:03:55 +08:00
zeertzjq
9639552572 vim-patch:3840d2f: runtime(doc): remove trailing whitespace in cmdline.txt
3840d2feaf

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-21 07:02:23 +08:00
zeertzjq
abd1b1ff42 vim-patch:175a87c: runtime(doc): more clarification for the :keeppatterns needed
175a87c7f1

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-21 07:02:23 +08:00
Christian Clason
41859c2d8c build(deps): bump luajit to HEAD - 304da39cc 2024-08-20 19:53:35 +02:00
atusy
fe5ae88b20 fix(lsp): update request name to capability map #30098
Add items based on specifications (<https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocumentClientCapabilities>)

- textDocument/documentColor
- textDocument/inlineValue
- textDocument/linkedEditingRange
- textDocument/moniker
- textDocument/onTypeFormatting
- textDocument/selectionRange
2024-08-20 06:37:03 -07:00
Rosen Stoyanov
8faa369791 docs(gen_help_html): wrap headings for narrow viewport #29903
Problem:
The headings and help tags overlap when browsing the docs in neovim.io/doc/user/ from a mobile phone.

Solution:
Apply the correct CSS rules so that the headings and help tags wrap
nicely below one another.
2024-08-20 05:56:37 -07:00
Ricardo Casía
766d503627 docs(lsp): annotate with vim.lsp.protocol.Methods enum #29521
Added the enum type annotation `vim.lsp.protocol.Methods` to provide some intellisense support.
2024-08-20 05:52:14 -07:00
Christian Clason
ac53996ebb build(deps): bump luajit to HEAD - fb22d0f80 2024-08-20 10:56:28 +02:00
zeertzjq
a8fbe1d409 fix(decor): don't use separate DecorSignHighlight for url (#30096) 2024-08-20 08:20:19 +08:00
ibhagwan
1d11808bfd fix(terminal): interrupt/got_int hangs terminal (#30056)
Upon `terminal_enter`, `mapped_ctrl_c` is set in order to avoid `CTRL-C`
interrupts (which is proxied to the terminal process instead), `os_inchar`
will then test `mapped_ctrl_c` against `State` and set `ctrl_c_interrupts=false`
which prevents `process_ctrl_c` from setting `got_int=true` in a terminal
state.

However, if `got_int` is set outside of `process_ctrl_c`, e.g. via
`interrupt()`, this will hang the neovim process as `terminal_execute` will
enter an endless loop as `got_int` will never be cleared causing `safe_vgetc`
to always return `Ctrl_C`.

A minimal example reproducing this bug:
```vim
:autocmd TermEnter * call timer_start(500, {-> interrupt()})
:terminal
:startinsert
```

To fix, we make sure `got_int` is cleared inside `terminal_execute` when
it detects `Ctrl_C`.

Closes #20726

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-08-20 06:23:56 +08:00
Christian Clason
169f37b94f build(deps): bump luajit to HEAD - fb5e1c9f0 2024-08-19 19:33:02 +02:00
Gregory Anders
6d997f8068 fix(terminal): handle C0 characters in OSC terminator (#30090)
When a C0 character is present in an OSC terminator (i.e. after the ESC
but before a \ (0x5c) or printable character), vterm executes the
control character and resets the current string fragment. If the C0
character is the final byte in the sequence, the string fragment has a
zero length. However, because the VT parser is still in the "escape"
state, vterm attempts to subtract 1 from the string length (to account
for the escape character). When the string fragment is empty, this
causes an underflow in the unsigned size variable, resulting in a buffer
overflow.

The fix is simple: explicitly check if the string length is non-zero
before subtracting.
2024-08-19 06:43:06 -05:00
Gregory Anders
33464189bc fix(vim.text): handle very long strings (#30075)
Lua's string.byte has a maximum (undocumented) allowable length, so
vim.text.hencode fails on large strings with the error "string slice too
long".

Instead of converting the string to an array of bytes up front, convert
each character to a byte one at a time.
2024-08-17 22:28:03 -05:00
Christian Clason
d1bdeacb00 vim-patch:8e25d91: runtime(dist): verify that executable is in $PATH
Otherwise, if the executable to be verified does not exist,
this would cause a false-positive in the 'IsSafeExecutable()' check,
because 'exepath(executable)' returns an empty string and
'fnamemodify('', ':p:h')' returns the current directory and as a result
the 'IsSafeExecutable()' returns false (for the wrong reason).

8e25d91cb7

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-18 01:19:01 +02:00
zeertzjq
cce1eb0806 fix(api): error properly with invalid field in nvim_open_win (#30078) 2024-08-17 23:10:27 +00:00
Christian Clason
b0a042e877 vim-patch:6908db4: runtime(colors): update colorschemes
- all: PMenuMatch and PMenuMatchSel for 8c/16c
- habamax:
    - revert VertSplit to solid background color
    - remove gitCommitSummary link to Title
    - make TabLineFill same as StatuslineNC

closes: vim/vim#15506

6908db4756

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-08-17 13:03:13 +02:00
Christian Clason
77380e1601 vim-patch:c6ed816: runtime(yaml): do not re-indent when commenting out lines
It's a personal annoyance for me. I have to edit yaml files on a lot of
customer environments and whenever you type '#' at the start of the
line, the commented line will be indented by whatever indent the
previous line had.

I hate this seriously, because it makes un-commenting painful. So let's
fix this. But instead of messing with the indent function, let's just
remove the '0#' from cinkeys, so that Vim won't perform re-indenting
when commenting out such a yaml file.

closes: vim/vim#15494

c6ed816761

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-17 13:03:13 +02:00
Christian Clason
550ddef366 vim-patch:1fbccc1: runtime(netrw): Drop committed trace lines
closes: vim/vim#15501

1fbccc1e96

Co-authored-by: Damien <141588647+xrandomname@users.noreply.github.com>
2024-08-17 13:03:13 +02:00
Christian Clason
68eceb8058 vim-patch:b4d1164: runtime(netrw): Error popup not always used
Problem:  g:netrw_use_errorwindow=2 does not work
          without +balloon_eval.
Solution: Check for popup_atcursor().

related: vim/vim#15501

b4d1164425

Co-authored-by: Damien <141588647+xrandomname@users.noreply.github.com>
2024-08-17 13:03:13 +02:00
Christian Clason
de68077545 vim-patch:7c75411: runtime(netrw): ErrorMsg() may throw E121
Move variables declaration

related: vim/vim#15501

7c754110ff

Co-authored-by: Damien <141588647+xrandomname@users.noreply.github.com>
2024-08-17 13:03:13 +02:00
Christian Clason
0c3bdb80bd vim-patch:a1dc649: runtime(dosbatch): Show %%i as an argument in syntax file
Inside batch files, for-variables must be written as %%i, not %i.

closes: vim/vim#15453

a1dc64956f

Co-authored-by: Ken Takata <kentkt@csc.jp>
2024-08-17 13:03:13 +02:00
Christian Clason
78fb387f87 vim-patch:11c92be: runtime(dosbatch): Add syn-sync to syntax file
Closing parentheses were often highlighted as errors.
Add a syntax sync command to reduce the error.

Also fix that `defined` was not highlighted as an operator inside
parentheses.  E.g.:
```
if defined foo (
    if defined bar (
        ...
    )
)
```
The first `defined` was highlighted but the second one was not.

related: vim/vim#15453

11c92be897

Co-authored-by: Ken Takata <kentkt@csc.jp>
2024-08-17 13:03:13 +02:00
Christian Clason
89df96b5cf vim-patch:dd36d6c: runtime(mediawiki): fix typo in doc, test for b:did_ftplugin var
closes: vim/vim#15479

dd36d6cc7c

Co-authored-by: Stanislav Asunkin <1353637+stasjok@users.noreply.github.com>
2024-08-17 13:03:13 +02:00
zeertzjq
172cc23d88 vim-patch:d164f2a: runtime(vim): Update base-syntax, improve :let-heredoc highlighting (#30069)
The end marker must appear on line of its own without any trailing
whitespace.

Whitespace is incorrectly allowed before all end markers.  Limiting this
only to heredocs where "trim" was specified, and with the correct
indent, is currently an intractable problem given that contained syntax
groups (in this case :let) cannot be limited to start patterns.

Highlight interpolated expressions when "eval" is specified.

cloess: vim/vim#15511

d164f2a521

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-08-16 23:09:39 +00:00
zeertzjq
d698b3acca Merge pull request #30066 from zeertzjq/vim-9.1.0677
vim-patch: :keepp does not retain last substitute string
2024-08-17 07:04:10 +08:00
zeertzjq
a837f10d17 vim-patch:cba93ca: runtime(doc): clarify the effect of :keeppatterns after v9.1.0677
cba93cab53
2024-08-17 06:35:42 +08:00
zeertzjq
a25dbeee10 vim-patch:9.1.0677: :keepp does not retain the substitute pattern
Problem:  :keeppatterns does not retain the substitute pattern
          for a :s command
Solution: preserve the last substitute pattern when used with the
          :keeppatterns command modifier (Gregory Anders)

closes: vim/vim#15497

3b59be4ed8

Co-authored-by: Gregory Anders <greg@gpanders.com>
2024-08-17 06:34:59 +08:00
zeertzjq
4afd4061a2 Merge pull request #30068 from zeertzjq/vim-9.1.0678
vim-patch:9.1.{0678,0679}
2024-08-17 06:33:13 +08:00
zeertzjq
7df6fbb096 vim-patch:9.1.0679: Rename from w_closing to w_locked is incomplete
Problem:  Rename from w_closing to w_locked is incomplete
          (after 9.1.0678).
Solution: Rename remaining occurrences of w_closing to w_locked and
          update comments (zeertzjq).

closes: vim/vim#15504

bc11f6d9d4
2024-08-17 06:04:52 +08:00
zeertzjq
b3d291c565 vim-patch:9.1.0678: [security]: use-after-free in alist_add()
Problem:  [security]: use-after-free in alist_add()
          (SuyueGuo)
Solution: Lock the current window, so that the reference to
          the argument list remains valid.

This fixes CVE-2024-43374

0a6e57b09b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-17 06:04:52 +08:00
Eduardo Rittner Coelho
8b8096500d fix(tutor): incorrect lines marked as correct #29833
Problem: In line 308 the poem appears as

1)  Roses are red,
2)  Mud is fun,
3)  Violets are blue,
4)  I have a car,
5)  Clocks tell time,
6)  Sugar is sweet
7)  And so are you.

where the wrong lines (2, 4, 5) are all marked as correct.

Solution: Change the tutor.json file so that initially the poem appears
as

1)  Roses are red,
2)  Mud is fun,
3)  Violets are blue,
4)  I have a car,
5)  Clocks tell time,
6)  Sugar is sweet
7)  And so are you.

The method for checking whether a line is correct or not is really
simple, so I couldn't find a way to display the 6th line as initially
correct, however upon deleting lines 2, 4 and 5 the final result shows
line 6 as correct.
2024-08-16 10:35:13 -07:00
Maria José Solano
a901fb875f fix(docs): add missing properties to hl_info #30032 2024-08-16 08:36:23 -07:00
Lewis Russell
fd65422b99 feat(diff): do not try external when out of memory
- Also merge diff_buf_idx_tp into diff_buf_idx.
2024-08-15 19:46:52 +01:00
zeertzjq
ee5aaba215 fix(man): avoid setting v:errmsg (#30052) 2024-08-15 22:02:20 +08:00
Gregory Anders
4199671047 feat(term): support OSC 8 hyperlinks in :terminal (#30050) 2024-08-15 06:09:14 -05:00
Yinzuo Jiang
f3677c71f0 vim-patch:fc762df: runtime(sql, mysql): fix E169: Command too recursive with sql_type_default = "mysql"
Problem: When setting "let g:sql_type_default = "mysql", editing .sql
file reports "E169: Command too recursive" error

Solution:

- Add 'let b:did_ftplugin = 1' at the top of ftplugin/sql.vim
- Add 'if exists("b:did_ftplugin") | finish | endif' in ftplugin/mysql.vim
- Add missing header information in ftplugin/mysql.vim
- Remove redundant code in ftplugin/sql.vim

fixes: vim/vim#15474
closes: vim/vim#15475

fc762dfc9f

Signed-off-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-15 10:28:01 +00:00
Christian Clason
40bc48479d build(deps): bump luajit to HEAD - ae4735f62 2024-08-15 09:03:57 +02:00
tobil4sk
615f7bbff0 vim-patch:ea76096: runtime(javascript): fix a few issues with syntax higlighting (#30049)
It addresses the following issues:

- Fix highlight of let and var javascript keywords

  According to runtime/doc/syntax.txt, Identifier is for variable names.
  let/var are not variable names, they are keywords

- Add highlighting for "from" keyword in javascript

- Fix highlight of function keyword in javascript

  According to docs, Function is for function names, so the function
  keyword should just be Keyword.

- Fix highlight of static keyword in javascript

  According to vim docs: StorageClass static, register, volatile, etc.

closes: vim/vim#15480

ea76096fa9
2024-08-14 22:43:34 +00:00
bfredl
32d17cb6d2 Merge pull request #30045 from bfredl/nodefault5
refactor(tests): again yet more global highlight definitions
2024-08-14 19:38:49 +02:00
William Wong
6bcefad5a6 fix(highlight): fix the seg fault caused by the invalid linked hl ids 2024-08-14 15:42:55 +01:00
bfredl
ef4c9b136e refactor(tests): again yet more global highlight definitions 2024-08-14 14:03:34 +02:00
zeertzjq
9d74dc3ac5 vim-patch:dc831db: runtime(doc): add help tags for json + markdown global variables (#30037)
I added help tags for them in the syntax.txt file since this is the only
place they are mentioned.

closes: vim/vim#15486

dc831db6ea

Co-authored-by: JJCUBER <34446698+JJCUBER@users.noreply.github.com>
2024-08-13 22:42:07 +00:00
futsuuu
ab561302a3 test: remove internal assertions and simplify 2024-08-13 14:05:10 +01:00
futsuuu
b621921074 test: add a test to check the indentation 2024-08-13 14:05:10 +01:00
futsuuu
67bb0cfa79 fix(loader): follow the style of the error message for built-in loaders
start the error message with '\n\t' instead of '\n'
surround the module name by single quotes
2024-08-13 14:05:10 +01:00
zeertzjq
9768e88f38 refactor(fileio): use os_copy() to copy file (#30030)
It uses sendfile(), which is faster than combining read() and write(),
and it also copies permissions.
2024-08-13 07:09:55 +08:00
Alexander Mnich
88f07d6ca4 fix(win-msi): set installer scope to machine #29895
Problem:
The windows installer did not have the AllUsers property which leads to
the installer being misidentified as per user installer.
Currently the installer already requires administrative privileges and
installs into the system-wide ProgramFiles directory, but the start menu
entry and uninstaller registration are created only for the current user.
Issue: #29885

https://cmake.org/cmake/help/latest/cpack_gen/wix.html#variable:CPACK_WIX_INSTALL_SCOPE

Solution:
With setting CPACK_WIX_INSTALL_SCOPE to "perMachine" the generated msi
installer includes the Property ALLUSERS=1.
Additionally the start menu entries and uninstaller registration will be
created for all users.
2024-08-12 12:11:40 -07:00
Aaron
65a703e060 fix(lua): ignore stdout and stderr for xdg-open
Ref #19724
Fix #29932
2024-08-12 07:03:48 +00:00
zeertzjq
37d97e771e vim-patch:9.1.0672: marker folds may get corrupted on undo (#30026)
Problem:  marker folds may get corrupted on undo (Yousef Mohammed)
Solution: when adjusting folds, make sure that line1 is the lower limit
          and line2 is the upper line limit. In particular, line2 should
          not be able to get smaller than line1.

fixes: vim/vim#15455
closes: vim/vim#15466

8d02e5cf96

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-11 22:52:31 +00:00
Lewis Russell
9b5ab66678 test(lsp): refactor and tidy
- Merge all the top level 'LSP' describe blocks
- Refactor text edit tests
- Fix typing errors
- Add linebreaks between tests
2024-08-11 15:14:14 +01:00
Christian Clason
8df6736ca1 feat(term): enable reflow by default (#21124)
Problem: Contents of terminal buffer are not reflown when Nvim is
resized.

Solution: Enable reflow in libvterm by default. Now that libvterm is
vendored, also fix "TUI rapid resize" test failures there.

Note: Neovim's scrollback buffer does not support reflow (yet), so lines
vanishing into the buffer due to a too small window will be restored
without reflow.
2024-08-10 10:26:07 +02:00
Christian Clason
fa79a8ad6d build(deps): vendor libvterm at v0.3.3
Problem: Adding support for modern Nvim features (reflow, OSC 8, full
utf8/emoji support) requires coupling libvterm to Nvim internals
(e.g., utf8proc).

Solution: Vendor libvterm at v0.3.3.
2024-08-10 10:26:07 +02:00
zeertzjq
0ec43cb4b5 vim-patch:9.1.0667: Some other options reset curswant unnecessarily when set (#30020)
Problem:  Some other options reset curswant unnecessarily when set.
          (Andrew Haust)
Solution: Don't reset curswant when setting 'comments', 'commentstring'
          or 'define' (zeertzjq)

fixes: vim/vim#15462
closes: vim/vim#15467

b026a293b1
2024-08-10 08:05:30 +00:00
zeertzjq
4e8efe002e vim-patch:9.1.0666: assert_equal() doesn't show multibyte string correctly (#30018)
Problem:  assert_equal() doesn't show multibyte string correctly
Solution: Properly advance over a multibyte char.
          (zeertzjq)

closes: vim/vim#15456

9c4b2462bb
2024-08-10 06:35:51 +08:00
github-actions[bot]
0d3f2c4904 docs: update version.c (#30016)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2024-08-09 11:36:03 +08:00
zeertzjq
b9913191be Merge pull request #30015 from zeertzjq/vim-8.2.4860
vim-patch: Check NoDefaultCurrentDirectoryInExePath
2024-08-09 07:45:21 +08:00
zeertzjq
e01ccda1be vim-patch:0cc5dce: runtime(doc): clarify directory of Vim's executable vs CWD
According to :h win32-PATH, "the same directory as Vim" means the same
directory as the Vim executable, not Vim's current directory.  In patch
8.2.4860 these two concepts were mixed up.

closes: vim/vim#15451

0cc5dce578
2024-08-09 07:21:59 +08:00
zeertzjq
336ab2682e vim-patch:8.2.4860: MS-Windows: always uses current directory for executables
Problem:    MS-Windows: always uses current directory for executables.
Solution:   Check the NoDefaultCurrentDirectoryInExePath environment variable.
            (Yasuhiro Matsumoto, closes vim/vim#10341)

05cf63e9bd

Omit doc change: override in later doc update.

Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
2024-08-09 07:21:59 +08:00
zeertzjq
a89088b7a0 vim-patch:8.1.1413: error when the drive of the swap file was disconnected (#30009)
Problem:    Error when the drive of the swap file was disconnected.
Solution:   Try closing and re-opening the swap file. (closes vim/vim#4378)

b58a4b938c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-08-08 08:11:53 +00:00
zeertzjq
2f1ea1133a Merge pull request #30008 from zeertzjq/vim-8.2.3476
vim-patch:8.2.{3476,3477}
2024-08-08 15:33:23 +08:00
zeertzjq
94cc293927 vim-patch:8.2.3477: startup test fails on MS-Windows
Problem:    Startup test fails on MS-Windows.
Solution:   Skip the test if not on Unix.

6d19798774

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-08-08 14:55:16 +08:00
zeertzjq
92186be428 vim-patch:8.2.3476: renaming a buffer on startup may cause using freed memory
Problem:    Renaming a buffer on startup may cause using freed memory.
Solution:   Check if the buffer is used in a window. (closes vim/vim#8955)

d3710cf01e

Cherry-pick Test_echo_true_in_cmd() from Vim.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-08-08 14:54:14 +08:00
Christian Clason
f35d5afbf1 vim-patch:39eff4c: runtime(proto): Add indent script for protobuf filetype
closes: vim/vim#15446

39eff4cdc0

Co-authored-by: David Pedersen <limero@me.com>
2024-08-08 00:17:11 +02:00
Grzegorz Rozdzialik
7031949be0 fix(lsp): avoid reusing diagnostics from different servers in actions (#30002)
Problem: When preparing the parameters for a code actions LSP request,
the code set `context.diagnostics` when processing the first LSP client,
and then reused those `context.diagnostics` for subsequent LSP clients.

This meant that the second and next LSP clients got diagnostics that
did not originate from them, and they did not get the diagnostics that
they sent.

Solution: Avoid setting `context.diagnostics` (which is referenced by
all clients). Instead, set `params.context.diagnostics` directly, which
is specific to a single client.

Fixes #30001
Caused by #29501
2024-08-07 17:28:01 +02:00
dundargoc
328ea02eb7 refactor!: use utf8proc full casefolding
According to `CaseFolding-15.1.0.txt`, full casefolding should be
preferred over simple casefolding as it's considered to be more correct.
Since utf8proc already provides full casefolding it makes sense to
switch to it. This will also remove a lot of unnecessary build code.

Temporary exceptions are made for two sets characters:

- `ß` will still be considered `ß` (instead of `ss`) as using a full
  casefolding requires interfering with upstream spell files in some
  form.
- `İ` will still be considered `İ` (instead of `i̇`) as using full
  casefolding requires making a value judgement on the "correct"
  behavior. There are two, equally valid case-insensetive comparison for
  this character according to unicode. It is essentially up to the
  implementor to decide which conversion is correct. For this reason it
  might make sense to allow users to decide which conversion should be
  done as an added option to `casemap` in a future PR.
2024-08-07 15:31:18 +02:00
zeertzjq
11a6f3c930 vim-patch:partial:8.1.0914: code related to findfile() is spread out (#30000)
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

Keep functions related to wildcard expansion in path.c, as in Vim they
are now spread out among multiple files, which isn't really ideal.
2024-08-07 01:12:33 +00:00
zeertzjq
0c99ce0e89 Merge pull request #29999 from zeertzjq/vim-a63f66e
vim-patch: zip plugin updates
2024-08-07 07:34:27 +08:00
zeertzjq
1937870114 vim-patch:9.1.0663: tests: zip test still resets 'shellslash' option
Problem:  tests: zip test still resets 'shellslash' option
Solution: Remove resetting the 'shellslash' option, the zip
          plugin should now be able to handle this options

closes: vim/vim#15434

91efcd115e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-07 07:16:26 +08:00
zeertzjq
450d49660f vim-patch:afea6b9: runtime(zip): use defer to restore old settings
Problem:  RestoreOpts() plugin called too often
Solution: use :defer to have the RestoreOpts() function
          called when the function returns automatically

afea6b9468

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-07 07:16:26 +08:00
zeertzjq
221c489edd vim-patch:8d52926: runtime(zip): add a generic Message function
Problem:  the zip plugin duplicates a lot of code for displaying
          warnings/errors
Solution: refactor common code into a generic Mess() function

8d52926857

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-07 07:16:26 +08:00
zeertzjq
025920b330 vim-patch:a336d8f: runtime(zip): increment base version of zip plugin
Problem:  the zip plugin version is still v33
Solution: increment the version to v34

a336d8f21e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-07 07:16:26 +08:00
zeertzjq
92981c8e0b vim-patch:19636be: runtime(zip): refactor save and restore of options
Problem:  zip plugin has no way to set/restore option values
Solution: Add the SetSaneOpts() and RestoreOpts() functions,
          so options that cause issues are set to sane values
          and restored back to their initial values later on.
          (this affects the 'shellslash' option on windows, which also
          changes how the shellescape() function works)

19636be55e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-07 07:07:34 +08:00
zeertzjq
11c57c25ef vim-patch:33836d3: runtime(zip): remove test for fnameescape
Problem:  zip plugin tests for fnameescape() function
Solution: Remove the check, fnameescape() has been available since
          7.1.299, it should nowadays always be available

33836d38b8

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-07 07:07:07 +08:00
zeertzjq
303b3e153d vim-patch:120c0dd: runtime(zip): use :echomsg instead of :echo
Problem:  zip plugin uses :echo which does not store messages
Solution: use :echomsg instead of :echo so that messages are stored in
          the message history

120c0dd815

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-07 07:06:35 +08:00
zeertzjq
0bf9a574b5 vim-patch:a63f66e: runtime(zip): clean up and remove comments
Problem:  zip plugin contains a lot of comments from the decho plugin
Solution: Clean up and remove un-used comments

a63f66e953

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-07 07:06:03 +08:00
zeertzjq
9307a53c7b vim-patch:9.1.0661: the zip plugin is not tested. (#29993)
Problem:  the zip plugin is not tested.
Solution: include tests (Damien)

closes: vim/vim#15411

d7af21e746

Co-authored-by: Damien <141588647+xrandomname@users.noreply.github.com>
2024-08-06 22:53:05 +00:00
zeertzjq
4ddc4a11ca vim-patch:9.1.0662: filecopy() may return wrong value when readlink() fails (#29998)
Problem:  filecopy() may return wrong value when readlink() fails.
Solution: Set ret to -1 so that 0 is returned when readlink() fails.
          (zeertzjq)

closes: vim/vim#15438

da090f95df
2024-08-07 06:14:05 +08:00
Yi Ming
0a1212ef94 docs(treesitter): generate inline docs for Ranges
docs(treesitter): in-place parameter description

docs(treesitter): remove internal type names

docs(treesitter): add missing private annotation
2024-08-06 18:18:34 +02:00
Yi Ming
cc26cf0400 fix(docs): do not treat indexes as short_link 2024-08-06 18:18:34 +02:00
zeertzjq
93347a67bf fix(filetype): fix :filetype detect error with -u NONE (#29991)
:filetype detect should enable filetype detection when it hasn't been
enabled before.
2024-08-06 22:20:26 +08:00
zeertzjq
37952bf7b4 vim-patch:8.2.4838: checking for absolute path is not trivial (#29990)
Problem:    Checking for absolute path is not trivial.
Solution:   Add isabsolutepath(). (closes vim/vim#10303)

dca1d40cd0

vim-patch:8a3b805c6c9c

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-08-06 21:19:12 +08:00
zeertzjq
28fbba2092 vim-patch:9.1.0465: missing filecopy() function (#29989)
Problem:  missing filecopy() function
Solution: implement filecopy() Vim script function
          (Shougo Matsushita)

closes: vim/vim#12346

60c8743ab6

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2024-08-06 12:49:59 +00:00
zeertzjq
b5f92c4e5c refactor: extract eval/fs.c from eval/funcs.c (#29985)
In Vim a lot of filesystem functions have been moved to filepath.c.
However, some of these functions actually deal with file contents, and
Nvim's filesystem-related functions are spread out in a different way.
Therefore, it's better to use a different file for these functions.
2024-08-06 20:13:07 +08:00
zeertzjq
b04b263e1f Merge pull request #29984 from zeertzjq/vim-217d3c1
vim-patch: runtime file updates
2024-08-06 07:22:03 +08:00
zeertzjq
6f5b904fb2 vim-patch:f0e9b72: runtime(zip): Fix for FreeBSD's unzip command
Problem:  Cannot browse zipfiles with the unzip program found
	  on FreeBSD.
Solution: Adjust command arguments.

Unzip found on FreeBSD complain about missing argument with the
zipinfo modifier '-Z -1'. Joining arguments seems to work
for both implementations.

Also change `:sil!` to `:sil` so that error messages are properly
reported (per review of Christian Brabandt).

related: vim/vim#15411

f0e9b72c8f

Co-authored-by: Damien <141588647+xrandomname@users.noreply.github.com>
2024-08-06 06:47:53 +08:00
zeertzjq
9a30abb292 vim-patch:217d3c1: runtime(doc): capitalize correctly
* do not capitalize after a double colon when introducing a list
* Capitalize a header line

closes: vim/vim#15433

217d3c17c6

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-06 06:47:30 +08:00
Gregory Anders
b3641b8008 build(deps): remove libtermkey dependency
It's been vendored since https://github.com/neovim/neovim/pull/25870.
2024-08-05 19:04:09 +02:00
bfredl
fd1d84c705 Merge pull request #29540 from bfredl/neoshada
refactor(shada): rework msgpack decoding without msgpack-c
2024-08-05 14:08:28 +02:00
bfredl
c7b100630a Merge pull request #29982 from bfredl/gccwarn
fix(build): surpress spurious warnings from gcc in -E preprocessor mode
2024-08-05 12:43:02 +02:00
bfredl
1247684ae1 build(deps): remove msgpack-c dependency 2024-08-05 12:22:12 +02:00
bfredl
217e26cb64 fix(build): surpress spurious warnings from gcc in -E preprocessor mode
Since #29315 we are also preprocessing header files in order to find
functions which need prototype declarations. gcc emits a spurious
"warning: #pragma once in main file" even when when you are just
using `gcc -E` which causes a bit of noise in compiler output.

As a workaround, surpress all warnings for this step, this should be pretty
much harmless as we will still get preprocessor warnings when doing
actual compilation `gcc -c` later.

reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89808
2024-08-05 12:02:47 +02:00
bfredl
f926cc32c9 refactor(shada): rework msgpack decoding without msgpack-c
This also makes shada reading slightly faster due to avoiding
some copying and allocation.

Use keysets to drive decoding of msgpack maps for shada entries.
2024-08-05 11:12:44 +02:00
zeertzjq
0c2860d9e5 Merge pull request #29979 from clason/vim-c5bdd66
vim-patch: update runtime files

N/A patches for version.c:
vim-patch:9.1.0658: Coverity warns about dereferencing NULL pointer.
2024-08-05 06:31:20 +08:00
Christian Clason
28e2e8aa04 vim-patch:c0f7505: runtime(lua): add/subtract a 'shiftwidth' after '('/')' in indentexpr
Problem:

- Current lua indentexpr does not indent for '(' ')'.
- Missing indent test for lua.

Solution:

- Match '(', ')' in `function GetLuaIndentIntern`.
- Add an indent test for lua.

closes: vim/vim#15364

c0f7505ede

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-08-04 19:00:10 +02:00
Christian Clason
be9eaac7e8 vim-patch:c5bdd66: runtime(zip): escape '[' on Unix as well
Problem:  After 6f1cbfc9ab fnameescape()
          is no longer called on the name of the file to be extracted.
          However, while spaces indeed don't need to be escaped, unzip
          treats '[' as a wildcard character, so it need to be escaped.
Solution: Escape '[' on both MS-Windows and Unix.

From the docs it seems '*' and '?' also need escaping, but they seem to
actually work without escaping.

fixes: neovim/neovim#29977
closes: vim/vim#15427

c5bdd66558

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-08-04 18:59:38 +02:00
zeertzjq
58406ab9f0 vim-patch:947f752: runtime(doc): fix typo in syntax.txt (#29974)
closes: vim/vim#15425

947f752a47

Co-authored-by: Jon Parise <jon@indelible.org>
2024-08-04 06:09:54 +08:00
Christian Clason
ac24b907f0 vim-patch:6228481: runtime(colors): update Todo highlight in habamax colorscheme
Magenta background Todo is too bright and might interfere with DiffText.
Make it less strong, without background, bold.

closes: vim/vim#15423

6228481b8e

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-08-03 15:22:11 +02:00
Christian Clason
3b58d93aae docs(filetype): consolidate comments in dev_vimpatch.txt 2024-08-03 14:14:42 +02:00
Evgeni Chasnovski
37910f2703 docs(filetype): add note about prefering explicit lists over pattern 2024-08-03 14:14:42 +02:00
Evgeni Chasnovski
95e0289cb2 refactor(filetype): use extension match instead of pattern if possible
Problem: some patterns are used as a replacement for several explicit
  extension matches (like '%.[Ss][Yy][Ss]$', '%.php%d$', etc.).
  They usually correspond to Vim's "ignore case" regexes (like
  '*.sys\c') and "convenience" patterns to not define many of them (like
  '*.php\d').
  As matching extension directly is faster and more explicit, it should
  be preferred.
Solution: move all such patterns to direct extension match.
2024-08-03 14:14:42 +02:00
Evgeni Chasnovski
66a74535d4 refactor(filetype): use file name match instead of pattern if possible
Problem: some patterns are used as a replacement for one-two explicit
  file matches (like '^[mM]akefile$'). As matching file name directly is
  faster and more explicit, it should be preferred.
Solution: move those patterns to direct file name match.
  NOTE: this is not strictly backwards compatible, because exact file
  name matching is done *before* pattern matching. If user has
  conflicting `vim.filetype.add()` call with high priority (like with
  `pattern='file$'` and `priority=100`), after this change it will be
  ignored (i.e. 'makefile' will match exactly).
  Judging by converted cases, it seems reasonable to prefer exact
  matches there.
2024-08-03 14:14:42 +02:00
Jaehwang Jung
eb629cce91 fix(lsp): redundant spaces in lsp log (#29970) 2024-08-03 11:14:34 +02:00
Mathias Fußenegger
6072153796 feat(lsp): announce codeLens resolveSupport (#29956)
The codelens implementation can resolve command via `codeLens/resolve`.

The spec added client capabilities for that:

https://github.com/microsoft/language-server-protocol/pull/1979
2024-08-03 11:14:12 +02:00
zeertzjq
4f3801c925 Merge pull request #29967 from zeertzjq/vim-9.1.0648
vim-patch:9.1.{0648,0653}
2024-08-03 08:45:55 +08:00
zeertzjq
4c886d0e73 vim-patch:9.1.0653: Patch v9.1.0648 not completely right
Problem:  Patch v9.1.0648 not completely right
          (zeertzjq)
Solution: Remove always true condition

closes: vim/vim#15415

a0b5bc1285

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-03 08:25:43 +08:00
zeertzjq
6967c08840 vim-patch:9.1.0648: [security] double-free in dialog_changed()
Problem:  [security] double-free in dialog_changed()
          (SuyueGuo)
Solution: Only clear pointer b_sfname pointer, if it is different
          than the b_ffname pointer.  Don't try to free b_fname,
          set it to NULL instead.

fixes: vim/vim#15403

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-46pw-v7qw-xc2f

b29f4abcd4

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-03 08:25:43 +08:00
zeertzjq
383f693472 refactor: move some functions out of eval.c (#29964)
- common_function() has always been in evalfunc.c in Vim
- return_register() has always been in evalfunc.c in Vim
- get_user_input() was moved to ex_getln.c in Vim 8.1.1957
- tv_get_lnum_buf() was moved to typval.c in Vim 8.2.0847
2024-08-02 23:42:52 +00:00
Christian Clason
e7f8349a2e vim-patch:9.1.0655: filetype: goaccess config file not recognized
Problem:  filetype: goaccess config file not recognized
Solution: detect 'goaccess.conf' as goaccess filetype, also
          include a basic syntax and ftplugin (Adam Monsen)

Add syntax highlighting for GoAccess configuration file.

GoAccess is a real-time web log analyzer and interactive viewer that
runs in a terminal in *nix systems or through your browser.

GoAccess home page: https://goaccess.io

closes: vim/vim#15414

0aa65b48fb

Co-authored-by: Adam Monsen <haircut@gmail.com>
2024-08-03 00:16:22 +02:00
Christian Clason
a90b1b7c6f vim-patch:c527d90: runtime(netrw): honor g:netrw_alt{o,v} for :{S,H,V}explore
Make `:Sexplore` / `:Hexplore` / `:Vexplore` commands honor the user
`&split{right,below}` settings (or netrw-specific `g:netrw_alt{o,v}`)
instead of hardcoding a split direction. Similarly, update banged
variants of the two latter commands to follow the inverted preference.

closes: vim/vim#15417

c527d90fae

Co-authored-by: Ivan Shapovalov <intelfx@intelfx.name>
2024-08-03 00:16:09 +02:00
Lewis Russell
7d24c4d6b0 test: allow exec_lua to handle functions
Problem:

Tests have lots of exec_lua calls which input blocks of code
provided as unformatted strings.

Solution:

Teach exec_lua how to handle functions.
2024-08-02 19:04:37 +01:00
Gregory Anders
f32557ca67 fix(tui): reset active attr ID when OSC 8 sequence is terminated (#29960)
When the cursor is moved we terminate any active OSC 8 sequences to
prevent the sequence from inadvertently spanning regions it is not meant
to span. However, if we do not also reset the TUI's active attr id
(print_attr_id) then the TUI does not "know" that it's current attribute
set has changed. When cursor_goto is called to wrap a line, the TUI does
not recompute the attributes so the OSC 8 sequence is not restarted
again.

When we terminate an OSC 8 sequence before moving the cursor, also reset
the active attr id so that the attributes are recomputed for URLs.
2024-08-02 13:00:04 -05:00
Mathias Fußenegger
0a0962a2e8 refactor(lsp): remove freeze() from gen_lsp (#29955)
To match the change in https://github.com/neovim/neovim/pull/29283
2024-08-02 13:00:11 +02:00
Mathias Fussenegger
5de2ae2bce refactor(lsp): add test case for default diagnostic severity
See https://github.com/microsoft/language-server-protocol/pull/1978
If the severity is not specified by the server, error should be used.

This was already the case because it matches the vim.diagnostic default.
This only adds a test case for it.
2024-08-02 11:20:37 +02:00
zeertzjq
2a3561819e fix(eval): handle wrong v:lua in expr option properly (#29953) 2024-08-02 08:00:27 +00:00
zeertzjq
76dea5feaa Merge pull request #29951 from zeertzjq/vim-9.0.0632
vim-patch:9.0.{0632,0634,0635},9.1.0649
2024-08-02 13:15:16 +08:00
zeertzjq
99bb0a10d3 refactor(eval): treat v:lua call as simple function 2024-08-02 12:56:57 +08:00
zeertzjq
6d722f3309 vim-patch:9.1.0649: Wrong comment for "len" argument of call_simple_func()
Problem:  Wrong comment for "len" argument of call_simple_func().
Solution: Remove the "or -1 to use strlen()".  Also change its type to
          size_t to remove one cast. (zeertzjq)

closes: vim/vim#15410

c1ed788c1b
2024-08-02 12:16:19 +08:00
zeertzjq
582bf4f1e1 vim-patch:9.0.0634: evaluating "expr" options has more overhead than needed
Problem:    Evaluating "expr" options has more overhead than needed.
Solution:   Use call_simple_func() for 'foldtext', 'includeexpr', 'printexpr',
            "expr" of 'spellsuggest', 'diffexpr', 'patchexpr', 'balloonexpr',
            'formatexpr', 'indentexpr' and 'charconvert'.

a4e0b9785e

vim-patch:9.0.0635: build error and compiler warnings

Problem:    Build error and compiler warnings.
Solution:   Add missing change.  Add type casts.

3292a22940

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-08-02 11:56:51 +08:00
zeertzjq
f7fde0173a vim-patch:9.0.0632: calling a function from an "expr" option has overhead
Problem:    Calling a function from an "expr" option has too much overhead.
Solution:   Add call_simple_func() and use it for 'foldexpr'

87b4e5c5db

Cherry-pick a call_func() change from patch 8.2.1343.
Add expr-option-function docs to options.txt.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-08-02 11:56:51 +08:00
zeertzjq
48e4589ead vim-patch:8.2.4416: Vim9: using a script-local function requires using "s:" (#29950)
Problem:    Vim9: using a script-local function requires using "s:" when
            setting 'completefunc'.
Solution:   Do not require "s:" in Vim9 script. (closes vim/vim#9796)

1fca5f3e86

vim-patch:8.2.4417: using NULL pointer

Problem:    Using NULL pointer.
Solution:   Set offset after checking for NULL pointer.

e89bfd212b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-08-02 02:58:10 +00:00
zeertzjq
3bc864e773 vim-patch:9.1.0652: too many strlen() calls in syntax.c (#29949)
Problem:  too many strlen() calls in syntax.c
Solution: refactor code to reduce the number or strlen() calls,
          get rid of un-used SYN_NAMELEN macro
          (John Marriott)

closes: vim/vim#15368

b4ea77185c

Co-authored-by: John Marriott <basilisk@internode.on.net>
2024-08-02 01:12:38 +00:00
zeertzjq
b782a37cf5 vim-patch:9.1.0651: ex: trailing dot is optional for :g and :insert/:append (#29946)
Problem:  ex: trailing dot is optional for :g and :insert/:append
Solution: don't break out early, when the next command is empty.
          (Mohamed Akram)

The terminating period is optional for the last command in a global
command list.

closes: vim/vim#15407

0214680a8e

Co-authored-by: Mohamed Akram <mohd.akram@outlook.com>
2024-08-02 07:52:09 +08:00
zeertzjq
ac15db4b9c Merge pull request #29945 from zeertzjq/vim-9.1.0647
vim-patch:9.0.{2149,2158},9.1.0647
2024-08-02 07:33:52 +08:00
zeertzjq
6af359ef4c vim-patch:9.1.0647: [security] use-after-free in tagstack_clear_entry
Problem:  [security] use-after-free in tagstack_clear_entry
          (Suyue Guo )
Solution: Instead of manually calling vim_free() on each of the tagstack
          entries, let's use tagstack_clear_entry(), which will
          also free the stack, but using the VIM_CLEAR macro,
          which prevents a use-after-free by setting those pointers
          to NULL

This addresses CVE-2024-41957

Github advisory:
https://github.com/vim/vim/security/advisories/GHSA-f9cr-gv85-hcr4

8a0bbe7b8a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-02 07:14:42 +08:00
zeertzjq
a4bec30b7b vim-patch:9.0.2158: [security]: use-after-free in check_argument_type
Problem:  [security]: use-after-free in check_argument_type
Solution: Reset function type pointer when freeing the function type
          list

function pointer fp->uf_func_type may point to the same memory, that was
allocated for fp->uf_type_list. However, when cleaning up a function
definition (e.g. because it was invalid), fp->uf_type_list will be
freed, but fp->uf_func_type may still point to the same (now) invalid
memory address.

So when freeing the fp->uf_type_list, check if fp->func_type points to
any of those types and if it does, reset the fp->uf_func_type pointer to
the t_func_any (default) type pointer

closes: vim/vim#13652

0f28791b21

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-02 06:11:58 +08:00
zeertzjq
9f2d793068 vim-patch:9.0.2149: [security]: use-after-free in exec_instructions()
Problem:  [security]: use-after-free in exec_instructions()
Solution: get tv pointer again

[security]: use-after-free in exec_instructions()

exec_instructions may access freed memory, if the GA_GROWS_FAILS()
re-allocates memory. When this happens, the typval tv may still point to
now already freed memory. So let's get that pointer again and compare it
with tv. If those two pointers differ, tv is now invalid and we have to
refresh the tv pointer.

closes: vim/vim#13621

5dd41d4b63

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-02 06:11:58 +08:00
zeertzjq
d65788052f vim-patch:9.1.0650: Coverity warning in cstrncmp() (#29944)
Problem:  Coverity warning in cstrncmp()
          (after v9.1.0645)
Solution: Change the type of n2 to int.
          (zeertzjq)

________________________________________________________________________________________________________
*** CID 1615684:  Integer handling issues  (INTEGER_OVERFLOW)
/src/regexp.c: 1757 in cstrncmp()
1751                 n1 -= mb_ptr2len(s1);
1752                 MB_PTR_ADV(p);
1753                 n2++;
1754             }
1755             // count the number of bytes to advance the same number of chars for s2
1756             p = s2;
>>>     CID 1615684:  Integer handling issues  (INTEGER_OVERFLOW)
>>>     Expression "n2--", which is equal to 18446744073709551615, where "n2" is known to be equal to 0, underflows the type that receives it, an unsigned integer 64 bits wide.
1757             while (n2-- > 0 && *p != NUL)
1758                 MB_PTR_ADV(p);
1759
1760             n2 = p - s2;
1761
1762             result = MB_STRNICMP2(s1, s2, *n, n2);

closes: vim/vim#15409

e8feaa354e
2024-08-01 22:09:23 +00:00
Mathias Fußenegger
720b309c78 fix(lsp): don't send foreign diagnostics to servers in buf.code_action (#29501)
`buf.code_action` always included diagnostics on a given line from all
clients. Servers should only receive diagnostics they published, and in
the exact same format they sent it.

Should fix https://github.com/neovim/neovim/issues/29500
2024-08-01 16:01:15 +02:00
Manuel
32e128f209 fix(watch): exclude .git when using inotifywait (#29914)
inotifywait man page specifies:
The file must be specified with a relative or absolute path according to whether a relative or absolute path is given for watched directories.

So it would only work this way in case the path is relative (which at least for gopls it is not)
2024-08-01 16:00:48 +02:00
zeertzjq
3146433190 build(vim-patch.sh): use 7 hex digits for runtime patch file name (#29940)
7 digits are used in commit message, so also using this in patch file
name allows its proper deletion on PR creation.
2024-08-01 20:37:43 +08:00
Christian Clason
d3019419e7 vim-patch:30a8ad6: runtime(java): Document "g:java_space_errors" and "g:java_comment_strings"
closes: vim/vim#15399

30a8ad675d

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-08-01 10:14:10 +02:00
Christian Clason
2339bd894b vim-patch:77b87c3: runtime(java): Cluster optional group definitions and their group links
And keep non-optional group links at the end of the file.

related: vim/vim#15399

77b87c30d9

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-08-01 10:14:10 +02:00
Christian Clason
13a4e61231 vim-patch:9aabcef: runtime(java): Tidy up the syntax file
- Prefix all global variables with "g:".
- Add spaces around each variable assignment operator.
- Remove extraneous whitespace characters.
- Remove a spurious _serializable_ Java keyword (since v1.1,
  java.io.Serializable and java.io.Externalizable interfaces
  provide an API for object serialization; see vim-6-0j).
- Normalise the syntax definition argument order by making
  _contained_ the first argument of each such definition.
- Normalise the argument tabulation for highlighting group
  definitions.

Reference:
https://web.archive.org/web/20010821025330/java.sun.com/docs/books/jls/first_edition/html/1.1Update.html

related: vim/vim#15399

9aabcef1c8

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-08-01 10:14:10 +02:00
Christian Clason
a70371ff00 vim-patch:3749dff: runtime(java): Tidy up the documentation for "ft-java-syntax"
- Reword a few sentences and reformat a few paragraphs.
- Supply absent capitalisation and punctuation.
- Make listed highlighting groups and code stand out.
- Prefix all Java-related global variables with "g:".
- Add spaces around each variable assignment operator.
- Acknowledge that some Javadoc variables are maintained in
  the HTML syntax file.

Also, move the overridable _default_ HTML group links before
the HTML syntax file inclusion in order to implement the
documented diverged settings.

related: vim/vim#15399

3749dff093

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-08-01 10:14:10 +02:00
zeertzjq
b7dec93e68 vim-patch:5b07213: runtime(doc): re-format tag example lines, mention ctags --list-kinds (#29938)
5b07213c0b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-01 08:00:41 +00:00
zeertzjq
db928f0dd3 vim-patch:8.2.4275: cannot use an autoload function from a package under start (#29937)
Problem:    Cannot use an autoload function from a package under start.
Solution:   Also look in the "start" package directory. (Bjorn Linse,
            closes vim/vim#7193)

223a950a85

Nvim already does this in do_in_cached_path(), and this change has no
effect in Nvim as Nvim removes DIP_START after do_in_cached_path().

Accidentally failed to mark as ported:
vim-patch:8.2.1731: Vim9: cannot use += to append to empty NULL list

Co-authored-by: bfredl <bjorn.linse@gmail.com>
2024-08-01 14:45:57 +08:00
zeertzjq
2b4049719a vim-patch:partial:f10911e: Update runtime files (#29936)
f10911e5db

Also cherry-pick E1142 and E1156 tags from Vim.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-08-01 03:50:38 +00:00
zeertzjq
02eaf7c4c1 Merge pull request #29935 from zeertzjq/vim-9.1.0450
vim-patch:partial:9.1.{0450,0462}
2024-08-01 09:46:32 +08:00
zeertzjq
7f1ba04421 vim-patch:partial:9.1.0462: eval5() and eval7 are too complex
Problem:  eval5() and eval7 are too complex
Solution: Refactor eval5() and eval7() in eval.c
          (Yegappan Lakshmanan)

closes: vim/vim#14900

734286e4c6

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-08-01 09:28:21 +08:00
zeertzjq
8f47a95add vim-patch:partial:9.1.0450: evalc. code too complex
Problem:  eval.c code too complex
Solution: refactor eval6() and eval9() functions into several smaller
          functions (Yegappan Lakshmanan)

closes: vim/vim#14875

51c45e89b5

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-08-01 09:28:19 +08:00
Christian Clason
e820474cde vim-patch:d88ebcb: runtime(colors): update habamax scheme - tweak diff/search/todo colors
- Make diff colors more accessible, Green for added, Red for deleted, Blue for Changed
- Change Search to blue to be visible with Diff colors
- Change Todo to bright magenta

closes: vim/vim#15400

d88ebcbd9f

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-08-01 00:07:31 +02:00
Christian Clason
9e5381d1ad vim-patch:fcc5346: runtime(colors): update included colorschemes
- Add PmenuMatch and PmenuMatchSel to all colorschemes
- Add contrast to habamax Type, String, Constant and PreProc
- Change habamax PmenuSel to neutral gray to make PmenuMatchSel more visible
- Change habamax Tabline and VertSplit
- Make Conceal less visible for zellner, torte, shine, ron, peachpuff,
  pablo, morning, koehler, evening, delek, blue, darkblue, lunaperche,
  retrobox
- Add Added/Changed/Removed highlights
- Fix retrobox Terminal background
- Other minor fixes and improvements

closes: vim/vim#15267

fcc53461d4

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-08-01 00:07:31 +02:00
Christian Clason
e1d48d5cf2 vim-patch:5753d99: runtime(nohlsearch): add missing loaded_hlsearch guard
related: vim/vim#15039
closes: vim/vim#15402

5753d99ff6

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-07-31 23:06:28 +02:00
Christian Clason
479af3b006 vim-patch:56e8ed6: runtime(kivy): Updated maintainer info for syntax script
closes: vim/vim#15405

56e8ed6162

Co-authored-by: Corey Prophitt <git@prophitt.me>
2024-07-31 23:06:28 +02:00
Jaehwang Jung
6bb40f3dbf fix(lsp): prevent desync due to empty buffer (#29904)
Problem:
Some language servers (e.g., rust-analyzer, texlab) are desynced when
the user deletes the entire contents of the buffer. This is due to the
discrepancy between how nvim computes diff and how nvim treats empty
buffer.
* diff: If the buffer became empty, then the diff includes the last
  line's eol.
* empty buffer: Even if the buffer is empty, nvim regards it as having
  a single empty line with eol.

Solution:
Add special case for diff computation when the buffer becomes empty so
that it does not include the eol of the last line.
2024-07-31 16:18:24 +02:00
glepnir
4e90bc3023 feat(lsp): lsp.completion support set deprecated (#29882)
Problem: CompletionItem in lsp spec mentioned the deprecated attribute

Solution: when item has deprecated attribute set hl_group to DiagnosticDeprecated
          in complete function
2024-07-31 16:15:34 +02:00
Lewis Russell
573a71469d fix(scrollbind): properly take filler/virtual lines into account
Problem:

`'scrollbind'` does not work properly if the window being scrolled
automatically contains any filler/virtual lines (except for diff filler
lines).

This is because when the scrollbind check is done, the logic only
considers changes to topline which are represented as line numbers.

Solution:

Write the logic for determine the scroll amount to take into account
filler/virtual lines.

Fixes #29751
2024-07-31 11:33:32 +01:00
zeertzjq
c9b129a02a vim-patch:9.1.0411: too long functions in eval.c (#29925)
Problem:  too long functions in eval.c
Solution: refactor functions (Yegappan Lakshmanan)

closes: vim/vim#14755

4ceb4dc825

The remaining eval_expr_typval() changes.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-07-31 03:59:57 +00:00
zeertzjq
410be968d5 Merge pull request #29924 from zeertzjq/vim-9.1.0411
vim-patch:8.2.{1731,3264,4115},9.1.{partial:0411,0415,0419,partial:0445}
2024-07-31 11:07:18 +08:00
zeertzjq
706a0a4b04 vim-patch:partial:9.1.0445: Coverity warning after 9.1.0440
Problem:  Coverity warning after 9.1.0440
Solution: Fix Coverity warning, add a test and
          reduce the calls to clear_tv()
          (Yegappan Lakshmanan).

closes: vim/vim#14845

dbac0da631

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-07-31 10:49:57 +08:00
zeertzjq
30f85fcb7f vim-patch:9.1.0419: eval.c not sufficiently tested
Problem:  eval.c not sufficiently tested
Solution: Add a few more additional tests for eval.c,
          (Yegappan Lakshmanan)

closes: vim/vim#14799

4776e64e72

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-07-31 10:49:57 +08:00
zeertzjq
619cb143f9 vim-patch:9.1.0415: Some functions are not tested
Problem:  Some functions are not tested
Solution: Add a few more tests, fix a few minor problems
          (Yegappan Lakshmanan)

closes: vim/vim#14789

fe424d13ef

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-07-31 10:49:57 +08:00
zeertzjq
a1561cbbea vim-patch:partial:9.1.0411: too long functions in eval.c
Problem:  too long functions in eval.c
Solution: refactor functions (Yegappan Lakshmanan)

closes: vim/vim#14755

4ceb4dc825

Skip the eval_expr_typval() changes.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-07-31 10:49:57 +08:00
zeertzjq
5463b5c9e1 vim-patch:8.2.4115: cannot use a method with a complex expression
Problem:    Cannot use a method with a complex expression.
Solution:   Evaluate the expression after "->" and use the result.

c665dabdf4

Cherry-pick a "verbose" check from patch 8.2.4123.

N/A patches for version.c:
vim-patch:8.2.4102: Vim9: import cannot be used after method
vim-patch:8.2.4110: Coverity warns for using NULL pointer

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-31 10:49:57 +08:00
zeertzjq
98d05a2dee vim-patch:8.2.3264: Vim9: assign test fails
Problem:    Vim9: assign test fails.
Solution:   Add missing change.

f24f51d030

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-31 10:49:57 +08:00
zeertzjq
43c137c3d8 vim-patch:9.2.1731: Vim9: cannot use += to append to empty NULL list
Problem:    Vim9: cannot use += to append to empty NULL list.
Solution:   Copy the list instead of extending it. (closes vim/vim#6998)

81ed496048

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-31 10:49:55 +08:00
zeertzjq
403de7ffc7 Merge pull request #29923 from zeertzjq/vim-9.1.0645
vim-patch:9.0.{0105,1771,1777},9.1.0645
2024-07-31 08:23:02 +08:00
zeertzjq
e57598fbef vim-patch:9.1.0645: regex: wrong match when searching multi-byte char case-insensitive
Problem:  regex: wrong match when searching multi-byte char
          case-insensitive (diffsetter)
Solution: Apply proper case-folding for characters and search-string

This patch does the following 4 things:

1) When the regexp engine compares two utf-8 codepoints case
   insensitive it may match an adjacent character, because it assumes
   it can step over as many bytes as the pattern contains.

   This however is not necessarily true because of case-folding, a
   multi-byte UTF-8 character can be considered equal to some
   single-byte value.

   Let's consider the pattern 'ſ' and the string 's'. When comparing and
   ignoring case, the single character 's' matches, and since it matches
   Vim will try to step over the match (by the amount of bytes of the
   pattern), assuming that since it matches, the length of both strings is
   the same.

   However in that case, it should only step over the single byte value
   's' by 1 byte and try to start matching after it again. So for the
   backtracking engine we need to ensure:
   * we try to match the correct length for the pattern and the text
   * in case of a match, we step over it correctly

   There is one tricky thing for the backtracing engine. We also need to
   calculate correctly the number of bytes to compare the 2 different
   utf-8 strings s1 and s2. So we will count the number of characters in
   s1 that the byte len specified. Then we count the number of bytes to
   step over the same number of characters in string s2 and then we can
   correctly compare the 2 utf-8 strings.

2) A similar thing can happen for the NFA engine, when skipping to the
   next character to test for a match. We are skipping over the regstart
   pointer, however we do not consider the case that because of
   case-folding we may need to adjust the number of bytes to skip over.
   So this needs to be adjusted in find_match_text() as well.

3) A related issue turned out, when prog->match_text is actually empty.
   In that case we should try to find the next match and skip this
   condition.

4) When comparing characters using collections, we must also apply case
   folding to each character in the collection and not just to the
   current character from the search string.  This doesn't apply to the
   NFA engine, because internally it converts collections to branches
   [abc] -> a\|b\|c

fixes: vim/vim#14294
closes: vim/vim#14756

22e8e12d9f

N/A patches:
vim-patch:9.0.1771: regex: combining chars in collections not handled
vim-patch:9.0.1777: patch 9.0.1771 causes problems

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-31 08:03:31 +08:00
zeertzjq
17f95fe79b vim-patch:9.0.0105: illegal memory access when pattern starts with illegal byte
Problem:    Illegal memory access when pattern starts with illegal byte.
Solution:   Do not match a character with an illegal byte.

f50940531d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-31 08:03:30 +08:00
zeertzjq
63cd2adf3d vim-patch:9.1.0644: Unnecessary STRLEN() when applying mapping (#29921)
Problem:  Unnecessary STRLEN() when applying mapping.
          (after v9.1.0642)
Solution: Use m_keylen and vim_strnsave().
          (zeertzjq)

closes: vim/vim#15394

74011dc1fa
2024-07-31 06:21:55 +08:00
Christian Clason
617810d72d vim-patch:e34d0e3: runtime(netrw): removing trailing slash when copying files in same directory
closes: vim/vim#14756

e34d0e37e3

Co-authored-by: Travis Shelton <tshelton.mail@gmail.com>
2024-07-31 00:19:03 +02:00
Christian Clason
bd6bef60ba vim-patch:e6471b4: runtime(cuda): source c and cpp ftplugins
closes: vim/vim#15383

e6471b415b

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-07-31 00:18:52 +02:00
Christian Clason
34fa34e720 vim-patch:c4be066: runtime(zip): Opening a remote zipfile don't work
Problem:  Opening a zipfile from HTTP gives an empty buffer.
Solution: Ensure that the magic bytes check does not
          skip protocol processing.

Also use readblob() and remove commented out lines.

closes: vim/vim#15396

c4be066817

Co-authored-by: Damien <141588647+xrandomname@users.noreply.github.com>
2024-07-31 00:18:43 +02:00
Christian Clason
1dd2bf926d vim-patch:df9f67e: runtime(html): update syntax script to sync by 250 minlines by default
closes: vim/vim#14071

df9f67e10d

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-31 00:18:32 +02:00
Lewis Russell
d1bd3d643e refactor: collapse statements in single assignments
Problem:

Variables are often assigned multiple places in common patterns.

Solution:

Replace these common patterns with different patterns that reduce the
number of assignments.

Use `MAX` and `MIN`:
```c
if (x < y) {
  x = y;
}

// -->

x = MAX(x, y);
```

```c
if (x > y) {
  x = y;
}

// -->

x = MIN(x, y);
```

Use ternary:
```c
int a;
if (cond) {
  a = b;
} els {
  a = c;
}

// -->

int a = cond ? b : c;

```
2024-07-30 22:43:29 +01:00
Christian Clason
1b5a394ffd vim-patch:011f222: runtime(thrift): add ftplugin, indent and syntax scripts
Problem: Apache Thrift files misses ftplugin, indent and syntax scripts

Solution:
- add ftplugin and indent scripts
- add thrift indent test
- port the syntax script from apache/thrift (Apache License 2)

Reference:
https://diwakergupta.github.io/thrift-missing-guide/#_language_reference

closes: vim/vim#15387

011f2223e5

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-07-30 10:39:43 +02:00
zeertzjq
619d005ac3 Merge pull request #29912 from zeertzjq/vim-9.0.0327
vim-patch:9.0.{partial:0327,0330,0331,0333}
2024-07-30 12:39:19 +08:00
zeertzjq
0af056ebce vim-patch:49cdd62: runtime(doc): list of new/changed features in version9.txt
closes: vim/vim#13753

49cdd629a3

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-07-30 12:18:44 +08:00
zeertzjq
520d94cc23 vim-patch:9.0.0333: method test fails
Problem:    Method test fails.
Solution:   Adjust test for items() now working on string.

171a1607f4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-30 12:18:44 +08:00
zeertzjq
8ca3c1515c vim-patch:9.0.0331: cannot use items() on a string
Problem:    Cannot use items() on a string.
Solution:   Make items() work on a string. (closes vim/vim#11016)

3e518a8ec7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-30 12:18:44 +08:00
zeertzjq
2dd0a90f21 vim-patch:9.0.0330: method tests fail
Problem:    Method tests fail.
Solution:   Adjust for change of items().

f92cfb1acc

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-30 12:18:44 +08:00
zeertzjq
96b358e9f1 vim-patch:partial:9.0.0327: items() does not work on a list
Problem:    items() does not work on a list. (Sergey Vlasov)
Solution:   Make items() work on a list. (closes vim/vim#11013)

976f859763

Skip CHECK_LIST_MATERIALIZE.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-30 12:18:38 +08:00
zeertzjq
cd46383667 refactor(mappings): elide description copy (#29910) 2024-07-30 00:11:21 +00:00
zeertzjq
4b852bc555 vim-patch:9.1.0642: Check that mapping rhs starts with lhs fails if not simplified (#29909)
Problem:  Check that mapping rhs starts with lhs doesn't work if lhs is
          not simplified.
Solution: Keep track of the mapblock containing the alternative lhs and
          also compare with it (zeertzjq).

fixes: vim/vim#15376
closes: vim/vim#15384

9d997addc7

Cherry-pick removal of save_m_str from patch 8.2.4059.
2024-07-30 07:35:25 +08:00
zeertzjq
d131c48c82 vim-patch:9.1.0638: E1510 may happen when formatting a message for smsg() (#29907)
Problem:  E1510 may happen when formatting a message
          (after 9.1.0181).
Solution: Only give E1510 when using typval. (zeertzjq)

closes: vim/vim#15391

0dff31576a
2024-07-29 22:26:09 +00:00
Riley Bruins
94d42a3e72 fix(treesitter): highlight anonymous nodes in inspect_tree
**Problem:** With anonymous nodes toggled in the inspect tree, only
named nodes will be highlighted when moving the cursor in the source
code buffer.

**Solution:** Retrieve the anonymous node at the cursor (when toggled on
in the inspect tree) and highlight them when appropriate, for better
clarity/specificity.
2024-07-29 17:15:46 +02:00
Riley Bruins
1af55bfcf2 feat(treesitter): allow get_node to return anonymous nodes
Adds a new field `include_anonymous` to the `get_node` options to allow
anonymous nodes to be returned.
2024-07-29 17:15:46 +02:00
Riley Bruins
bd3b6ec836 feat(treesitter): add node_for_range function
This is identical to `named_node_for_range` except that it includes
anonymous nodes. This maintains consistency in the API because we
already have `descendant_for_range` and `named_descendant_for_range`.
2024-07-29 17:15:46 +02:00
Christian Clason
01a56a056c vim-patch:9.1.0636: filetype: ziggy files are not recognized
Problem:  filetype: ziggy files are not recognized
Solution: detect '*.ziggy' files as ziggy filetype,
          detect '*.ziggy-schema' files as ziggy-schema filetype
          (EliSauder)

References: https://ziggy-lang.io/

fixes: vim/vim#15355
closes: vim/vim#15367

f4572cee35

Co-authored-by: EliSauder <24995216+EliSauder@users.noreply.github.com>
2024-07-29 09:12:14 +02:00
Christian Clason
e596b6a18d vim-patch:9.1.0635: filetype: SuperHTML template files not recognized
Problem:  filetype: SuperHTML template files not recognized
Solution: Update the filetype detection code to detect '*.shtml' either
          as HTML (Server Side Includes) or SuperHTML (template files)
          (EliSauder)

related: vim/vim#15355
related: vim/vim#15367

e57c9a19ed

Co-authored-by: EliSauder <24995216+EliSauder@users.noreply.github.com>
2024-07-29 09:12:14 +02:00
Christian Clason
8168b228e0 vim-patch:4c45425: runtime(debcopyright): Add support for Files-Included in syntax script
Full support (including for components) was finished with this commit:
ee90dad771

closes: vim/vim#15374

4c45425c10

Co-authored-by: josch <josch@debian.org>
2024-07-29 09:12:03 +02:00
zeertzjq
fe5030c05e vim-patch:partial:52e7cc2: runtime(doc): tweak documentation style a bit (#29897)
closes: vim/vim#15371

52e7cc26d8

Co-authored-by: h-east <h.east.727@gmail.com>
2024-07-29 00:02:31 +00:00
Christian Clason
5aa1a9532c docs(treesitter): don't quote metadata 2024-07-28 16:13:11 +02:00
Christian Clason
9e80738f30 fix(runtime): sync bundled treesitter queries 2024-07-28 16:13:11 +02:00
Mathias Fußenegger
bdff50dee5 fix(lsp): revert text edit application order change (#29877)
Reverts https://github.com/neovim/neovim/pull/29212 and adds a few
additional test cases

From the spec

> All text edits ranges refer to positions in the document they are
> computed on. They therefore move a document from state S1 to S2 without
> describing any intermediate state. Text edits ranges must never overlap,
> that means no part of the original document must be manipulated by more
> than one edit. However, it is possible that multiple edits have the same
> start position: multiple inserts, or any number of inserts followed by a
> single remove or replace edit. If multiple inserts have the same
> position, the order in the array defines the order in which the inserted
> strings appear in the resulting text.

The previous fix seems wrong. The important part:

> If multiple inserts have the same position, the order in the array
> defines the order in which the inserted strings appear in the
> resulting text.

Emphasis on _appear in the resulting text_

Which means that in:

    local edits1 = {
      make_edit(0, 3, 0, 3, { 'World' }),
      make_edit(0, 3, 0, 3, { 'Hello' }),
    }

`World` must appear before `Hello` in the final text. That means the old
logic was correct, and the fix was wrong.
2024-07-27 22:30:14 +02:00
zeertzjq
aee4254b76 Merge pull request #29876 from glepnir/vim-patch
vim-patch:9.1.{0618,0619,0629}: cannot mark deprecated attributes in completion menu
2024-07-27 22:12:30 +08:00
zeertzjq
b8b0e9db3f vim-patch:9.1.0629: Rename of pum hl_group is incomplete
Problem:  Rename of pum hl_group is incomplete in source.
Solution: Also rename the test function.  Rename to user_hlattr in code
          to avoid confusion with pum_extra.  Add test with matched text
          highlighting (zeertzjq).

closes: vim/vim#15348

4100852e09
2024-07-27 21:56:44 +08:00
glepnir
985c636aa6 test(ui/popupmenu_spec): add case of hl_group field in complete items
Problem:  Missing test case for hl_group field in complete items.
Solution: Add a test case for hl_group field.
2024-07-27 21:43:38 +08:00
zeertzjq
5be5928771 test(ui/popupmenu_spec): make highlights more consistent 2024-07-27 21:42:31 +08:00
Lewis Russell
6162c937ab refactor(decor): decor_virt_lines()
Reduce calls to hasFolding() and remove the has_fold argument.

For lines that don't have virtual lines this should be more efficient as
it should avoid any calls to hasFolding(), whereas before it was called
at least once for any buffer containing at least one virtual line.

This will be slightly less efficient for lines with multiple virtual
lines marks as hasFolding() is called once for each mark. This could be
optimized, but having multiple virtual lines marks on a single line is
very rare.
2024-07-27 14:10:30 +01:00
Maria José Solano
8bdfc2ab2b fix(version): return nil with empty string 2024-07-27 14:06:31 +01:00
glepnir
bc8a776ef8 vim-patch:9.1.0619: tests: test_popup fails
Problem:  tests: test_popup fails
          (after v9.1.0618)
Solution: Correct test, move combining extra attributes to
          pum_compute_text_attrs() (glepnir)

closes: vim/vim#15353

8754efe437

Co-authored-by: glepnir <glephunter@gmail.com>
2024-07-27 18:10:33 +08:00
glepnir
f132f8e9d4 vim-patch:9.1.0618: cannot mark deprecated attributes in completion menu
Problem:  cannot mark deprecated attributes in completion menu
Solution: add hl_group to the Dictionary of supported completion fields
          (glepnir)

closes: vim/vim#15314

508e7856ec

Co-authored-by: glepnir <glephunter@gmail.com>
2024-07-27 18:05:37 +08:00
zeertzjq
60967cd9aa vim-patch:9.1.0616: filetype: Make syntax highlighting off for MS Makefiles (#29874)
Problem:  filetype: Make syntax highlighting off for MS Makefiles
Solution: Try to detect MS Makefiles and adjust syntax rules to it.
          (Ken Takata)

Highlighting of variable expansion in Microsoft Makefile can be broken.
E.g.:
2979cfc262/src/Make_mvc.mak (L1331)

Don't use backslash as escape characters if `make_microsoft` is set.
Also fix that `make_no_comments` was not considered if `make_microsoft`
was set.

Also add description for `make_microsoft` and `make_no_comments` to the
documentation and include a very simple filetype test

closes: vim/vim#15341

eb4b903c9b

Co-authored-by: Ken Takata <kentkt@csc.jp>
2024-07-27 16:48:29 +08:00
Christian Clason
aa853f362a vim-patch:a7295ae: runtime(autohotkey): include initial filetype plugin
closes: vim/vim#15345

a7295ae7f5

Co-authored-by: Peter Aronoff <peter@aronoff.org>
2024-07-27 01:12:09 +02:00
Christian Clason
bb185d63ab vim-patch:4d68054: runtime(progress): Add single-line comment syntax
Progress OpenEdge 11.6 added a new C-like single-line comment syntax; such
comments begin with `//` and proceed to the end of the line.

Add a new syntax group `ProgressLineComment` to implement highlighting for this
syntax. Rename the existing group from `ProgressComment` to
`ProgressBlockComment`, and introduce a cluster named `ProgressComment` to
encapsulate both.

closes: vim/vim#15339

4d68054c1e

Co-authored-by: Daniel Smith <daniel@rdnlsmith.com>
2024-07-26 08:45:06 +02:00
Christian Clason
a2840d0117 vim-patch:d5cc8ee: runtime(progress): Update maintainer info
The Progress syntax file was last updated eight years ago, and the header
information twelve years ago. Attempts to contact the last known maintainer at
the email address listed in the file header (with the spam-prevention characters
removed) produced a delivery failure notification stating that the address did
not exist.

I intend to submit some minor improvements to this file. Per [1], I will assume
maintainership of it for the time being.

related: vim/vim#15339

[1]: https://groups.google.com/g/vim_dev/c/I3pOKIOgM4A/m/pekGQB_lBwAJ

d5cc8ee0fa

Co-authored-by: Daniel Smith <daniel@rdnlsmith.com>
2024-07-26 08:45:06 +02:00
zeertzjq
0dfcf3fe12 fix(plines): don't count invalidated virt text in char size (#29863)
Also:
- Remove mt_end() and MT_FLAG_DECOR_VIRT_TEXT_INLINE checks, as they are
  already checked by marktree_itr_check_filter().
- Move ns_in_win() to the last check in decor_redraw_col().
2024-07-26 02:01:12 +00:00
luukvbaal
5af9c065ad fix(decor): don't draw invalidated virtual lines (#29858) 2024-07-26 09:04:17 +08:00
Carman Fu
41b70a0dea fix(runtime): set 'keywordprg' only once in vim ftplugin 2024-07-26 08:45:51 +08:00
zeertzjq
41106168a2 vim-patch:8.2.3543: swapname has double slash when 'directory' ends in it (#29862)
Problem:    Swapname has double slash when 'directory' ends in double slash.
            (Shane Smith)
Solution:   Remove the superfluous slash. (closes vim/vim#8876)

8b0e62c93b

The test got lost in #29758...

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-26 00:09:47 +00:00
zeertzjq
cd1550818b Merge pull request #29758 from zeertzjq/vim-8.2.3543
vim-patch:{8.2.3543,9.1.0615}
2024-07-26 07:45:02 +08:00
zeertzjq
114d1e7b43 vim-patch:9.1.0615: Unnecessary STRLEN() in make_percent_swname()
Problem:  Unnecessary STRLEN() in make_percent_swname()
Solution: Pass the end of "dir" to make_percent_swname()
          (zeertzjq)

closes: vim/vim#15340

242667ae14
2024-07-26 07:23:56 +08:00
zeertzjq
4bb6cd4c2d vim-patch:8.2.3543: swapname has double slash when 'directory' ends in it
Problem:    Swapname has double slash when 'directory' ends in double slash.
            (Shane Smith)
Solution:   Remove the superfluous slash. (closes vim/vim#8876)

8b0e62c93b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-26 07:18:30 +08:00
luukvbaal
dd61be59af vim-patch:9.1.0617: Cursor moves beyond first line of folded end of buffer (#29859)
Problem:  Cursor moves beyond start of a folded range at the end of a buffer.
Solution: Move cursor to start of fold when going beyond end of buffer.
          Check that cursor moved to detect FAIL in outer cursor function.
          (Luuk van Baal)

dc373d456b
2024-07-26 06:32:54 +08:00
Christian Clason
807eb4434c vim-patch:9.1.0612: filetype: deno.lock file not recognized
Problem:  filetype: deno.lock file not recognized
Solution: detect 'deno.lock' as json filetype
          (カワリミ人形)

Reference:
https://docs.deno.com/runtime/manual/basics/modules/integrity_checking/#caching-and-lock-files

closes: vim/vim#15333

df77c8ad39

Co-authored-by: カワリミ人形 <kawarimidoll+git@gmail.com>
2024-07-25 10:01:46 +02:00
Christian Clason
108d2bf74b vim-patch:e73e5b8: runtime(java): Optionally highlight the :: token for method references
This token will be highlighted, similar to the arrow of
lambda expressions, whenever "g:java_highlight_functions" is
defined.

Also:

- Improve the recognition of _switch-case_ labels
  (D-Cysteine).
- Remove insignificant empty statements in syntax test
  files.

closes: vim/vim#15322

References:
https://docs.oracle.com/javase/specs/jls/se21/html/jls-15.html#jls-15.13
https://github.com/fleiner/vim/pull/1

e73e5b889b

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
Co-authored-by: D-Cysteine <54219287+D-Cysteine@users.noreply.github.com>
2024-07-25 10:01:35 +02:00
Christian Clason
90d40c68dc vim-patch:2cad941: runtime(zip): Use delete() for deleting directory
This is safer because we don't invoke the shell.

closes: vim/vim#15335

2cad941dc0

Co-authored-by: Damien <141588647+xrandomname@users.noreply.github.com>
2024-07-25 10:01:35 +02:00
zeertzjq
0cdeb06db0 vim-patch:ddbb6fe: runtime(vim): Update base-syntax, improve :set highlighting (#29850)
- Match bang, "all" and "termcap" options, and trailing command
  separator "|".
- Highlight set assignment operators.
- Match multiline :set and multiline option values.
- Mention the newer "0o" octal prefix at :help :set=.

closes: vim/vim#15329

ddbb6fe2d0

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-07-25 09:55:59 +08:00
Abao Zhang
b4b4cf46a7 fix(health): fix pyenv root and python exepath detect issue
Fix the following two issues:

- pyenv root detection issue

When `PYENV_ROOT` environment variable is not set, neovim will detect
pyenv's root via `pyenv root` command, but which will be always fail
because `vim.fn.system()` returns result with additional `\n`. Using
`vim.system` instead prevents this problem. to trim it before check
whether it is exists

- python executable path detection issue

Filter unrelated `python-config` in cases where multiple python versions
are installed, e.g. `python-config`, `python3.10-config`,
`python3.11-config` etc.
2024-07-24 16:21:46 +02:00
Gregory Anders
b02c839414 fix(tui): set id parameter in OSC 8 sequences (#29840)
The id parameter is used to communicate to the terminal that two URLs
are the same. Without an id, the terminal must rely on heuristics to
determine which cells belong together to make a single hyperlink.

See the relevant section in the spec [1] for more details.

[1]: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda#hover-underlining-and-the-id-parameter
2024-07-24 09:04:09 -05:00
Christian Clason
862338255d fix(runtime): sync bundled treesitter queries 2024-07-24 16:02:53 +02:00
Christian Clason
64727ac012 vim-patch:38ce71c: runtime(zip): correctly extract file from zip browser
Problem:  Enter 'x' in zip browser fail with E121
Solution: Fix typo in zip#Extract()

closes: vim/vim#15321

38ce71c1c3

Co-authored-by: Damien <141588647+xrandomname@users.noreply.github.com>
2024-07-24 09:14:26 +02:00
Nikita Rudakov
c025c049a4 vim-patch:581d4a7: runtime(netrw): escape filename before trying to delete it (#29838)
fixes: vim/vim#15330

581d4a7b35

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-24 07:33:44 +08:00
github-actions[bot]
9793a97778 docs: update version.c (#29760)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2024-07-23 03:40:37 +00:00
Christian Clason
9322b7e059 vim-patch:9d57ea5: runtime(netrw): Fix endless recursion in netrw#Explore()
Problem:  ':E /etc BOOM' give E132 error.
Solution: Avoid recursion call with same arguments.

fixes: vim/vim#5723
closes: vim/vim#15318

9d57ea5cd3

Co-authored-by: Damien <141588647+xrandomname@users.noreply.github.com>
2024-07-23 00:30:30 +02:00
Gregory Anders
79d492a421 vim-patch:9.1.0610: filetype: OpenGL Shading Language files are not detected (#29831)
Problem:  filetype: OpenGL Shading Language files are not detected
Solution: detect various file extensions as GLSL filetype, include
          indent and syntax script, do no longer recognize '*.comp'
          as Mason filetype (Gregory Anders)

closes: vim/vim#15317

e4b991ed36
2024-07-23 06:28:05 +08:00
Gregory Anders
f93ecd2760 feat(tui): parse CSI subparams in termkey (#29805)
libtermkey does not know how to parse CSI subparameters (parameters
separated by ':', ASCII 0x3A) and currently just ignores them. However,
many important CSI sequences sent by the terminal make use of
subparameters, most notably key events when using the kitty keyboard
protocol [1]. Enabling subparameters is a prerequisite for expanding
kitty keyboard protocol support in Neovim.

Concretely, we do this by returning pointers into the internal termkey
buffer for each CSI parameter rather than parsing them into integers
directly. When a caller wants to actually use the parameter as an
integer, they must call termkey_interpret_csi_param, which parses the
full parameter string into an integer parameter and zero or more
subparameters.

The pointers into the internal buffer will become invalidated when new
input arrives from the terminal so it is important that the individual
params are used and parsed right away. All of our code (and libtermkey's
code) does this, so this is fine for now, but is something to keep in
mind moving forward.

[1]: https://sw.kovidgoyal.net/kitty/keyboard-protocol/
2024-07-21 21:47:37 -05:00
bfredl
7381f0a1d5 Merge pull request #29650 from ruuzia/fix_expression_parser_crash
fix: assert failure in VimL expression parser
2024-07-21 16:29:16 +02:00
Christian Clason
80eda9726f docs(lua): clarify assumptions on luajit vs. puc lua
Problem: Plugin authors and distribution packagers are confused about
the role of LuaJIT vs. PUC Lua.

Solution: Clarify that LuaJIT is preferred but not required (extensions
should not be assumed but checked for) and that vanilla Lua 5.1 should
be used without language extensions such as `goto`.
2024-07-21 16:11:28 +02:00
bfredl
cbb46ac4fa Merge pull request #28873 from luukvbaal/redraw
fix(api): alloc and draw cursor window in nvim__redraw
2024-07-21 16:04:59 +02:00
bfredl
5c2f8ccc00 Merge pull request #29523 from luukvbaal/invalid
fix(marks): revalidate marks whose position did not change
2024-07-21 15:59:12 +02:00
dundargoc
4c788b1757 ci: always add target:release label when backporting
Previously the label was not added if the backport PR was created
manually. The new code is also easier to maintain as it's close to other
label-related code.
2024-07-21 15:39:47 +02:00
Christian Clason
e1b7fa2a3a vim-patch:6e37575: runtime(mysql): update syntax script
Problem:

- `syn region ...`s in syntax/mysql.vim match function names inaccurately.
- no syntax rules for mysql window function.
- coarse highlight definition in syntax/mysql.vim.

Solution:

- add `\<` before the function name for accuracy.
- add syntax rules for mysql window function.
- enhance the highlight definition.

closes: vim/vim#15311

6e37575760

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-07-21 14:14:53 +02:00
Christian Clason
a5d5b9f36b vim-patch:aa49512: runtime(yaml): Fix flow mapping key detection
fixes: vim/vim#15196
closes: vim/vim#15313

aa495124f8

Co-authored-by: itchyny <itchyny@cybozu.co.jp>
2024-07-21 14:14:53 +02:00
Luuk van Baal
89f9f168a5 fix(api): alloc and draw cursor window in nvim__redraw
Problem:  Unable to move cursor to recently opened window.
Solution: Make sure uninitialized window is drawn before trying to move
          the cursor to it.
2024-07-20 14:53:42 +02:00
Luuk van Baal
012db2b0f5 fix(marks): revalidate marks whose position did not change
Problem:  Marks whose position did not change with the action that
          invalidated them (right_gravity = false) are not revalidated
          upon undo.
Solution: Remove early return when restoring a marks saved position so
          that it is still revalidated. Add "move" guards instead.
2024-07-20 14:52:39 +02:00
Christian Clason
5fc25ecc7a vim-patch:4aa6b52: runtime(kconfig): Update syntax script and remove syn sync
fixes: vim/vim#15306

4aa6b52e82

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-20 12:59:07 +02:00
Christian Clason
2a24d0a435 vim-patch:9.1.0603: filetype: use correct extension for Dracula
Problem:  pattern detection for Dracula language uses "*lvs" and "*lpe".
          as there is no dot, those are not treated as extensions which
          they should (judging by 'runtime/syntax/dracula.vim' and
          common sense).
Solution: use "*.lvs" and "*.lpe" patterns (Evgeni Chasnovski)

closes: vim/vim#15303

5fb801a74f

Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
2024-07-19 17:28:48 +02:00
Gregory Anders
e41368f3bc feat(tui): support in-band resize events (#29791)
DEC mode 2048 is a newly proposed private mode for sending resize events
in band to applications from the terminal emulator, instead of relying
on SIGWINCH.

Full text of the specification is here:

  https://gist.github.com/rockorager/e695fb2924d36b2bcf1fff4a3704bd83
2024-07-19 13:29:29 +00:00
zeertzjq
d8aee77a4e Merge pull request #29798 from zeertzjq/vim-9.1.0558
vim-patch:9.1.{0558,0602}
2024-07-19 15:08:53 +08:00
zeertzjq
f67a7365af vim-patch:9.1.0602: filetype: Prolog detection can be improved
Problem:  filetype: Prolog detection can be improved
Solution: update the prolog detection regex
          (igna_martinoli)

related: vim/vim#10835
related: vim/vim#15206
closes: vim/vim#15253

37853b7de3

N/A patch:

vim-patch:7347642: runtime(filetype): Fix Prolog file detection regex

Problem: filetype: .pro file detection for Prolog is broken
Solution: fixed the regex to only match on the tested
          cases (igna_martinoli)

fixes: vim/vim#10835
closes: vim/vim#15206

7347642633

Co-authored-by: igna_martinoli <ignamartinoli@protonmail.com>
Co-authored-by: clason <c.clason@uni-graz.at>
2024-07-19 14:42:02 +08:00
zeertzjq
44f871a3cb vim-patch:9.1.0558: filetype: prolog detection can be improved
Problem:  filetype: prolog detection can be improved
Solution: Improved the Prolog file detection regex and added tests for
          all cases. (igna_martinoli)

fixes: vim/vim#10835
closes: vim/vim#15206

50dc83cf92

Only include the tests, as code changes are superseded by later patches.

Co-authored-by: igna_martinoli <ignamartinoli@protonmail.com>
2024-07-19 14:42:02 +08:00
Christian Clason
e54f503c44 vim-patch:4266daa: runtime(mermaid): correct wrong comment options
fixes: vim/vim#15279

4266daae17

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-19 08:17:47 +02:00
zeertzjq
adef830f83 vim-patch:99984fc: runtime(vim): Update base-syntax, improve :map highlighting (#29795)
Match :map ( RHS properly.

Only match ! after :map, :noremap, :unmap and :mapclear.

closes: vim/vim#15297

99984fc58a

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-07-19 04:16:20 +00:00
zeertzjq
f73904f9d6 vim-patch:eb6d733: runtime(doc): fix more inconsistencies in assert function docs (#29796)
related: https://github.com/vim/vim/pull/15280#issuecomment-2233771449

closes: vim/vim#15285

eb6d733bef
2024-07-19 04:12:13 +00:00
zeertzjq
35b35cb93c vim-patch:9.1.0601: Wrong cursor position with 'breakindent' when wide char doesn't fit (#29793)
Problem:  Wrong cursor position with 'breakindent' when a double-width
          character doesn't fit in a screen line (mikoto2000)
Solution: Include the width of the 'breakindent' properly.
          (zeertzjq)

fixes: vim/vim#15289
closes: vim/vim#15290

b5d6b5caac
2024-07-19 03:54:42 +00:00
zeertzjq
0b710c8e55 vim-patch:9.1.0599: Termdebug: still get E1023 when specifying arguments (#29794)
Problem:  Termdebug: still get E1023 when specifying arguments and using
          a prompt buffer.
Solution: Use empty() instead of len().  Add a test.  Fix wrong order of
          arguments to assert_equal() in Test_termdebug_basic().
          (zeertzjq)

closes: vim/vim#15288

aef6179bcf
2024-07-19 03:48:13 +00:00
Evgeni Chasnovski
f61efe3fe7 perf(filetype): implement parent pattern pre-matching (#29660)
Problem: calling `vim.filetype.match()` has performance bottleneck in
  that it has to match a lot of Lua patterns against several versions of
  input file name. This might be the problem if users need to call it
  synchronously a lot of times.

Solution: add "parent pattern pre-matching" which can be used to quickly
  reject several potential pattern matches at (usually rare) cost of
  adding time for one extra Lua pattern match.

  "Parent pattern" is a manually added/tracked grouping of filetype
  patterns which should have two properties:
    - Match at least the same set of strings as its filetype patterns.
      But not too much more.
    - Be fast to match.

  For them to be effective, group should consist from at least three
  filetype patterns.

  Example: for a filetpye pattern ".*/etc/a2ps/.*%.cfg", both "/etc/"
  and "%.cfg" are good parent patterns (prefer the one which can group
  more filetype patterns).

  After this commit, `vim.filetype.match()` on most inputs runs ~3.4
  times faster (while some inputs may see less impact if they match
  many parent patterns).
2024-07-18 10:26:27 -05:00
Christian Clason
c69ea53c9d vim-patch:9.1.0596: filetype: devscripts config files are not recognized (#29773)
Problem:  filetype: Debian devscripts config files are not recognized
Solution: detect devscripts.conf and .devscripts files as sh filetype
          (sourced by /bin/sh)

closes: vim/vim#15227

76c19028ff

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-07-18 07:13:16 +00:00
Christian Clason
f69cfc6712 vim-patch:1724ddb: runtime(sdc): update syntax to SDC-standard 2.1
Looking into the current standard for Synopsis Design Constraints (SDC)
from their [Technology Access
Program](https://www.synopsys.com/community/interoperability-programs/tap-in.html),
one can see that the current state of the sdc-syntax file is very
outdated as well as short in coverage of keywords.

This commit pursues to add all the missing keywords from the current
standard (Rev. 2.1).

closes: vim/vim#15281

1724ddbe3a

Co-authored-by: daniel-s-w <59746710+daniel-s-w@users.noreply.github.com>
2024-07-18 08:48:24 +02:00
zeertzjq
410cf29ee6 Merge pull request #29784 from zeertzjq/vim-83d002802644
vim-patch:{83d0028,c3837a4,27f5334}
2024-07-18 14:23:51 +08:00
zeertzjq
be7b577453 vim-patch:27f5334: runtime(termdebug): quote filename arguments using double quotes
closes: vim/vim#15270

27f53346a3

Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
2024-07-18 13:28:12 +08:00
zeertzjq
8ce85d5fc7 vim-patch:c3837a4: runtime(termdebug): fix a few issues
Fix a few minor issues:
1. filename with whitespaces issue should be fixed now, fixes: vim/vim#12357
2. ":Termdebug args" should work now, fixes: vim/vim#15254

closes: vim/vim#15261

c3837a46ff

Omit the DeleteCommands() change as it isn't really an improvement.

Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
2024-07-18 13:21:22 +08:00
zeertzjq
c909efb96f vim-patch:83d0028: runtime(termdebug): Use string interpolation instead of string concat
closes: vim/vim#14972

83d0028026

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-07-18 11:50:32 +08:00
Rustum Zia
6720bd440f fix: assert failure in VimL expression parser 2024-07-17 23:37:59 -04:00
zeertzjq
167d0e5a6c vim-patch:d65e58f: runtime(vim): Update base-syntax, match types in Vim9 variable declarations (#29780)
Match types in Vim9 variable declarations.

Match Vim9 boolean and null literals. These are not matched in all
contexts yet.

related: vim/vim#15277

d65e58f6f9

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-07-18 01:08:47 +00:00
zeertzjq
18f1a3aaa5 vim-patch:c1b3984: runtime(doc): minor updates. (#29778)
closes: vim/vim#15280

c1b3984a7b

Co-authored-by: Shane Harper <shane@shaneharper.net>
2024-07-18 08:08:56 +08:00
zeertzjq
185b22720d vim-patch:9.0.0003: functions are global while they could be local (#29777)
Problem:    Functions are global while they could be local.
Solution:   Add "static".  Add a few tests. (Yegappan Lakshmanan,
            closes vim/vim#10612)

ee47eaceaa

Omit script_name_after_autoload(), untrans_function_name(): Vim9 script
only.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-07-17 23:47:20 +00:00
zeertzjq
ca6710c83e Merge pull request #29776 from zeertzjq/vim-8.2.1432
vim-patch:partial:8.2.{1432,2571}
2024-07-18 07:21:09 +08:00
zeertzjq
286f7ef8a8 vim-patch:partial: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

This only includes test_quickfix.vim changes.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-18 07:00:07 +08:00
zeertzjq
005f6e1076 vim-patch:partial:8.2.1432: various inconsistencies in test files
Problem:    Various inconsistencies in test files.
Solution:   Add modelines where they were missing.  Use Check commands instead
            of silently skipping over tests.  Adjust indents and comments.
            (Ken Takata, closes vim/vim#6695)

6d91bcb4d2

This only includes test_quickfix.vim changes.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-18 07:00:04 +08:00
zeertzjq
bbe51ef016 vim-patch:9.1.0594: Unnecessary redraw when setting 'winfixbuf' (#29775)
Problem:  Unnecessary redraw when setting 'winfixbuf'.
Solution: Remove P_RWIN flag. (zeertzjq)

closes: vim/vim#15283

ac4ce9e15b
2024-07-18 06:45:26 +08:00
zeertzjq
8634ec3827 Merge pull request #29774 from zeertzjq/vim-9.0.1257
vim-patch:9.0.{partial:0719,1257}
2024-07-18 06:35:56 +08:00
zeertzjq
457ab65ff3 vim-patch:9.0.1257: code style is not check in test scripts
Problem:    Code style is not check in test scripts.
Solution:   Add basic code style check for test files.

94722c5107

Use Test_test_files() from latest Vim.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-18 06:18:03 +08:00
zeertzjq
f17d819330 vim-patch:partial:9.0.0719: too many delete() calls in tests
Problem:    Too many delete() calls in tests.
Solution:   Use deferred delete where possible.

56564964e6

This includes all changes expect changes in test_startup.vim.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-18 06:18:02 +08:00
Amit Singh
e29f245a10 fix(lsp): inlay hints are rendered in the correct order (#29707)
Problem:
When there are multiple inlay hints present at the same position, they
should be rendered in the order they are received in the response from
LSP as per the LSP spec. Currently, this is not respected.

Solution:
Gather all hints for a given position, and then set it in a single
extmark call instead of multiple set_extmark calls. This leads to fewer
extmark calls and correct inlay hints being rendered.
2024-07-17 16:44:53 +02:00
dundargoc
0500804df5 ci: skip lintcommit workflow on release branches
Since lintcommit is a required check, it will always need to be run.
However, the lintcommit script is not designed to work on PRs that
doesn't target master branch (and it's not clear whether it's even
desirable).

To circumvent this we create a "dummy" lintcommit check that is run on
release branches that always passes, thus fulfilling the condition of
the required check.
2024-07-17 16:40:59 +02:00
zeertzjq
bc2bd25f8e test: fix reporting "no flush received" too early (#29735) 2024-07-17 22:39:25 +08:00
dundargoc
dafd944a46 ci: remove "skip ci" tag
We can't skip CI runs as there are required checks that needs to always
be run.
2024-07-17 14:54:16 +02:00
glepnir
8ddcf9d939 fix(float): handle error in win_float_create() (#29742)
Problem: Missing error handling in win_float_create() function.
Solution: Add an inline function for error handling.
2024-07-17 12:22:59 +00:00
zeertzjq
5d7fd74397 vim-patch:8.1.1588: in :let-heredoc line continuation is recognized (#29767)
Problem:    In :let-heredoc line continuation is recognized.
Solution:   Do not consume line continuation. (Ozaki Kiichi, closes vim/vim#4580)

e96a2498f9

Nvim already sets may_garbage_collect to false in nv_event(), so the
timer change isn't needed.
Other changes have already been ported.
Also fix incorrect port of test in patch 8.1.1356.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-17 12:06:59 +00:00
Riley Bruins
05dcda8f9b fix(treesitter): recognize aliased parsers in omnifunc, query linter
**Problem:** A query file for something like `html_tags` will not be
given html node completion

**Solution:** Check for parser aliases before offering completions

Co-authored-by: Lewis Russell <me@lewisr.dev>
2024-07-17 12:13:53 +02:00
Christian Clason
c7b0334cea vim-patch:3698fbb: runtime(tsv): include simple syntax plugin
fixes: vim/vim#15271

3698fbbd7c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-17 11:11:58 +02:00
Christian Clason
8e590cae83 vim-patch:9.1.0593: filetype: Asymptote files are not recognized
Problem:  filetype: Asymptote files are not recognized
Solution: detect '*.asy' files as asy filetype, include
          ftplugin and syntax plugin (AvidSeeker).

Reference: https://asymptote.sourceforge.io/

closes: vim/vim#15252

3088ef094d

Co-authored-by: AvidSeeker <avidseeker7@protonmail.com>
2024-07-17 11:11:58 +02:00
Christian Clason
498d9beed9 vim-patch:babea52: runtime(gomod): add recommended indent options to ftplugin
closes: vim/vim#15264

babea52f4d

Co-authored-by: markmacode <code@mamo.aleeas.com>
2024-07-17 11:11:58 +02:00
Christian Clason
5d8220bda0 vim-patch:3e07d5a: runtime(go): add recommended indent options to ftplugin
related: vim/vim#15264

3e07d5aef1

Co-authored-by: markmacode <code@mamo.aleeas.com>
2024-07-17 11:11:58 +02:00
Christian Clason
c146580e9d vim-patch:6a54dcb: runtime(gdscript): add recommended indent options to ftplugin
related: vim/vim#15264

6a54dcbbd6

Co-authored-by: markmacode <code@mamo.aleeas.com>
2024-07-17 11:11:58 +02:00
Christian Clason
61ea466591 vim-patch:9.1.0592: runtime: filetype: Mediawiki files are not recognized
Problem:  filetype: Mediawiki files are not recognized
Solution: detect "*.mw" and "*.wiki" as mediawiki filetype,
          include basic syntax and filetype plugins.
          (AvidSeeker)

closes: vim/vim#15266

b5844104ab

Co-authored-by: AvidSeeker <avidseeker7@protonmail.com>
2024-07-17 11:11:58 +02:00
Christian Clason
4a7371c714 vim-patch:9.1.0591: filetype: *.wl files are not recognized
Problem:  filetype: *.wl files are not recognized
Solution: Detect '*.wl' files as Mathematica package files
          (Jonas Dujava)

closes: vim/vim#15269

c6d7dc0393

Co-authored-by: Jonas Dujava <jonas.dujava@gmail.com>
2024-07-17 11:11:58 +02:00
zeertzjq
79002cf438 vim-patch:8.2.2656: some command line arguments and regexp errors not tested (#29761)
Problem:    Some command line arguments and regexp errors not tested.
Solution:   Add a few test cases. (Dominique Pellé, closes vim/vim#8013)

a2b3e7dc92

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-17 03:33:45 +00:00
zeertzjq
620f4bd9b7 Merge pull request #29759 from zeertzjq/vim-9.0.0228
vim-patch:9.0.{0228,0407,0414}
2024-07-17 11:23:54 +08:00
zeertzjq
e83949f96c vim-patch:9.0.0414: matchstr() still does not match column offset
Problem:    matchstr() still does not match column offset when done after a
            text search.
Solution:   Only use the line number for a multi-line search.  Fix the test.
            (closes vim/vim#10938)

753aead960

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-17 11:04:55 +08:00
zeertzjq
ccdbab7810 vim-patch:9.0.0407: matchstr() does match column offset
Problem:    matchstr() does match column offset. (Yasuhiro Matsumoto)
Solution:   Accept line number zero. (closes vim/vim#10938)

75a115e8d6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-17 11:04:55 +08:00
zeertzjq
dce615bc42 vim-patch:9.0.0228: crash when pattern looks below the last line
Problem:    Crash when pattern looks below the last line.
Solution:   Consider invalid lines to be empty. (closes vim/vim#10938)

13ed494bb5

Comment out the test as it uses Vim9 script and text properties.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-17 11:04:50 +08:00
zeertzjq
8f890f74b6 test(old): reorder test_regexp_latin.vim to match upstream 2024-07-17 10:50:19 +08:00
zeertzjq
4025c2aa5f vim-patch:8.2.0281: two placed signs in the same line are not combined (#29757)
Problem:    Two placed signs in the same line are not combined.  E.g. in the
            terminal debugger a breakpoint and the PC cannot be both be
            displayed.
Solution:   Combine the sign column and line highlight attributes.

a2f6e42ded

Nvim already does this in decor_redraw_signs().

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-17 01:20:41 +00:00
luukvbaal
f9a49fab0c fix(column): modifying a sign should update placed signs (#29750)
Problem:  Modifying a sign no longer updates already placed signs.
Solution: Loop over (newly-exposed) placed decorations when modifying a
          sign definition. Update placed decor if it belongs to the sign
          that is modified.
2024-07-17 08:53:10 +08:00
Riley Bruins
1f2f460b4a fix(lsp): don't show codelens for buffers that don't support it (#29690) 2024-07-16 19:48:54 +02:00
Maria José Solano
5fe4ce6678 fix(snippet): modify base indentation when there's actually whitespace (#29670) 2024-07-16 19:30:22 +02:00
altermo
118ae7e5ed fix(tohtml): support ranges again 2024-07-16 15:07:40 +02:00
dundargoc
a5d4e3467d ci: run workflows on release branches
Github doesn't allow workflows to be run from the `github-actions`
account, which is the default account. This caused the CI on backport
PRs to not be run. The way to circumvent this is to use a token that
essentially "pretends" to be another user, which in turn triggers the CI
as desired.

Also run lintcommit on release branches as that is now a required check,
meaning it must always be run.
2024-07-16 14:15:50 +02:00
Christian Clason
a0fd51c1e2 vim-patch:1cc4cae: runtime(typst): Add typst runtime files
closes: vim/vim#15234

1cc4cae961

Co-authored-by: Gregory Anders <greg@gpanders.com>
2024-07-16 09:43:57 +02:00
zeertzjq
08abb64680 Merge pull request #29741 from zeertzjq/vim-8.2.1651
vim-patch:8.2.{1651,1659}
2024-07-16 15:43:25 +08:00
zeertzjq
7e5c5b4d85 vim-patch:8.2.1659: spellfile code not completely tested
Problem:    Spellfile code not completely tested.
Solution:   Add a few more test cases. (Yegappan Lakshmanan, closes vim/vim#6929)

96fdf4348a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-16 15:25:10 +08:00
zeertzjq
10fa9c8039 vim-patch:8.2.1651: spellfile code not completely tested
Problem:    Spellfile code not completely tested.
Solution:   Add a few more test cases. (Yegappan Lakshmanan, closes vim/vim#6918)

64e2db6dc6

Fix incorrect spellfile message.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-16 15:25:10 +08:00
zeertzjq
0bbccf7c5f vim-patch:8.2.3381: crash when using NULL list with sign functions (#29740)
Problem:    Crash when using NULL list with sign functions.
Solution:   Handle a NULL list like an empty list. (issue vim/vim#8260)

5c56da4de8

Nvim's TV_LIST_ITER_MOD() already checks for NULL.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-16 15:24:32 +08:00
zeertzjq
3adf9d4ec8 Merge pull request #29739 from zeertzjq/vim-8.2.5158
vim-patch:8.2.{2276,5158},9.0.0393
2024-07-16 15:24:15 +08:00
altermo
25db0a1385 fix(tohtml): extmark text may be out of bounds 2024-07-16 08:11:26 +01:00
zeertzjq
e84a4c5a98 vim-patch:9.0.0393: signals test often fails on FreeBSD
Problem:    Signals test often fails on FreeBSD.
Solution:   Use separate files for Suspend and Resume. (Ken Takata,
            closes vim/vim#11065)

a9480dbc8c

Co-authored-by: K.Takata <kentkt@csc.jp>
2024-07-16 14:41:02 +08:00
zeertzjq
a35eda36c3 vim-patch:8.2.5158: TSTP and INT signal tests are not run with valgrind
Problem:    TSTP and INT signal tests are not run with valgrind.
Solution:   Sleep a bit longer. (closes vim/vim#10614)

61e3784819

Cherry-pick Test_signal_TSTP() from patch 8.2.3941.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-16 14:40:14 +08:00
zeertzjq
76aede1162 vim-patch:8.2.2276: list of distributed files is outdated
Problem:    List of distributed files is outdated.
Solution:   Update the file list.  Minor comment updates.

a72514945b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-16 14:38:04 +08:00
zeertzjq
598fd77d95 vim-patch:8.2.0183: tests fail when the float feature is disabled (#29738)
Problem:    Tests fail when the float feature is disabled.
Solution:   Skip tests that don't work without float support.

5feabe00c4

Cherry-pick Test_ruby_Vim_blob() from patch 8.1.0977 and skip it.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-16 06:25:35 +00:00
zeertzjq
37c7c7547a vim-patch:8.1.1106: no test for 'writedelay' (#29736)
Problem:    No test for 'writedelay'.
Solution:   Add a test.

449ac47f93

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-16 05:39:20 +00:00
zeertzjq
a553b36876 vim-patch:7.4.1565 (#29734)
Problem:    Crash when assert_equal() runs into a NULL string.
Solution:   Check for NULL. (Dominique) Add a test.

f155196444

Use the latest version of the test from Vim.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-16 03:44:17 +00:00
zeertzjq
42829bf5d7 Merge pull request #29732 from zeertzjq/vim-8.2.3579
vim-patch:8.2.{3311,3579}
2024-07-16 11:14:16 +08:00
zeertzjq
24bd7a4a9c vim-patch:8.2.3579: CI sometimes fails for MinGW
Problem:    CI sometimes fails for MinGW.
Solution:   Use backslashes in HandleSwapExists(). (Christian Brabandt,
            closes vim/vim#9078)

4b2c804767

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-16 10:56:37 +08:00
zeertzjq
1bf9a7ce95 vim-patch:8.2.3311: Vim9: check for DO_NOT_FREE_CNT is very slow
Problem:    Vim9: check for DO_NOT_FREE_CNT is very slow.
Solution:   Move to a separate function so it can be skipped by setting
            $TEST_SKIP_PAT.

dae453f339

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-16 10:56:37 +08:00
zeertzjq
c2b51e6c41 vim-patch:df62c62: runtime(doc): grammar fixes in options.txt (#29729)
closes: vim/vim#15265

df62c62177

Co-authored-by: Dominique Pellé <dominique.pelle@gmail.com>
2024-07-15 22:24:02 +00:00
zeertzjq
b213f5169c build: allow comment after #include for required header (#29722)
And also check in .c files, as the attributes may be silently missing
there as well.
2024-07-16 06:08:16 +08:00
Maria José Solano
8703e7bd12 docs(lpeg): merge upstream changes 2024-07-15 21:16:29 +01:00
dundargoc
3c803483ac ci: adjust workflows to enable required checks
Auto-merging is a useful feature by github, but it requires required
checks which requires a few adjustments. The primary change is that
required checks can't use `paths` or `paths-ignore` as that risks not
running the job, and required checks must always be run.

A workaround for this is to introduce a dummy workflow which is used for
every path not used in the real workflow. That way the required job is
"always" run as far as github is concerned. The workaround is unweildly
so it's only useful to do it for costly workflows where the potential
benefits are big. If not it's better to simply remove any `paths` or
`paths-ignore` from a workflow instead.
2024-07-15 13:02:09 +02:00
zeertzjq
594c7f3d77 fix(ui): avoid ambiguity about last chunk when flushing halfway (#29718) 2024-07-15 18:35:20 +08:00
dundargoc
04c158fbec docs: misc (#29622)
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-07-15 06:54:45 +08:00
zeertzjq
da9e938793 Merge pull request #29713 from zeertzjq/vim-9.1.0585
vim-patch:partial:9.0.0418,9.1.0585
2024-07-15 06:34:26 +08:00
zeertzjq
15a0977ffc vim-patch:9.1.0585: tests: test_cpoptions leaves swapfiles around
Problem:  tests: test_cpoptions leaves swapfiles around
Solution: Use :bw! instead of :close!

bb5d27dc79

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-15 06:16:31 +08:00
zeertzjq
7214fd8f55 vim-patch:partial:9.0.0418: manually deleting temp test files
Problem:    Manually deleting temp test files.
Solution:   Use the 'D' flag of writefile() and mkdir().

45bbaef038

This only includes test_cpoptions.vim changes.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-15 06:03:58 +08:00
Christian Clason
79130c0fd3 vim-patch:9.1.0586: ocaml runtime files are outdated
Problem:  ocaml runtime files are outdated
Solution: sync those files with the upstream repo,
          detect a few more ocaml files
          (Yinzuo Jiang)

closes: vim/vim#15260

700cf8cfa1

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-07-14 23:55:57 +02:00
Christian Clason
60734dc761 vim-patch:9.1.0583: filetype: *.pdf_tex files are not recognized
Problem:  filetype: *.pdf_tex files are not recognized
Solution: Detect '*.pdf_tex' files as tex filetype
          (Jonas Dujava)

Those files are generated by inkscape, when exporting, see e.g.
https://inkscape.org/doc/inkscape-man.html

closes: vim/vim#15250

28145e005d

Co-authored-by: Jonas Dujava <jonas.dujava@gmail.com>
2024-07-14 12:21:11 +02:00
zeertzjq
8b7c8a0994 vim-patch:27c5598: runtime(doc): Add hint how to load termdebug from vimrc (#29704)
fixes: vim/vim#15256

27c55984de

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-14 18:15:50 +08:00
zeertzjq
f0eb855607 Merge pull request #29696 from zeertzjq/vim-9.1.0573
vim-patch:9.1.{0573,0574,0582}
2024-07-14 16:49:03 +08:00
zeertzjq
c8401515cd vim-patch:9.1.0582: Printed line doesn't overwrite colon when pressing Enter in Ex mode
Problem:  Printed line no longer overwrites colon when pressing Enter in
          Ex mode (after 9.1.0573).
Solution: Restore the behavior of pressing Enter in Ex mode.
          (zeertzjq)

closes: vim/vim#15258

7d664bf0eb
2024-07-14 16:33:07 +08:00
zeertzjq
ba36742211 vim-patch:9.1.0574: ex: wrong handling of commands after bar
Problem:  ex: wrong handling of commands after bar
Solution: for :append, :insert and :change use the text after the bar
          as input for those commands. This is what POSIX requests.
          (Mohamed Akram)

See the POSIX Spec:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ex.html#tag_20_40_13_03
Section 12.c

closes: vim/vim#15229

8c446da349

Co-authored-by: Mohamed Akram <mohd.akram@outlook.com>
2024-07-14 13:39:40 +08:00
zeertzjq
9093fbdd02 vim-patch:9.1.0573: ex: no implicit print for single addresses
Problem:  ex: no implicit print for single addresses
Solution: explicitly print even during single addresses,
          as requested by POSIX (Mohamed Akram)

See the POSIX behaviour here:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ex.html#tag_20_40_13_03
Section 6b

closes: vim/vim#15230

c25a7084e9

Co-authored-by: Mohamed Akram <mohd.akram@outlook.com>
2024-07-14 13:39:40 +08:00
zeertzjq
49ba36becd vim-patch:9.1.0580: :lmap mapping for keypad key not applied when typed in Select mode (#29693)
Problem:  An :lmap mapping for a printable keypad key is not applied
          when typing it in Select mode.
Solution: Change keypad key to ASCII after setting vgetc_char.
          (zeertzjq)

closes: vim/vim#15245

90a800274d
2024-07-14 06:50:36 +08:00
zeertzjq
1f748d46c3 vim-patch:9.1.0575: Wrong comments in alt_tabpage() (#29692)
Problem:  Wrong comments in alt_tabpage()
          (after v9.1.0572)
Solution: Correct the comments (zeertzjq).

closes: vim/vim#15235

1a3dd7dc78
2024-07-14 06:50:17 +08:00
zeertzjq
c2ed8ce102 Merge pull request #29691 from zeertzjq/vim-9.1.0577
vim-patch:8.2.{3716,4065},9.1.{0577,0579}
2024-07-14 06:37:15 +08:00
zeertzjq
88c698083a vim-patch:8.2.3716: Vim9: range without a command is not compiled
Problem:    Vim9: range without a command is not compiled.
Solution:   Add the ISN_EXECRANGE byte code.

e4eed8c6db

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-14 06:12:42 +08:00
zeertzjq
3700d94c6f vim-patch:9.1.0579: Ex command is still executed after giving E1247
Problem:  Ex command is still executed after giving E1247.
Solution: Indicate the error properly and set cmd to NULL.
          (zeertzjq)

closes: vim/vim#15241

d1b5ea984d
2024-07-14 06:12:42 +08:00
zeertzjq
5531c95101 vim-patch:8.2.4065: computation overflow with large cound for :yank
Problem:    Computation overflow with large cound for :yank.
Solution:   Avoid an overflow.

3cf21b3051

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-14 06:12:42 +08:00
zeertzjq
6276fce11e test(old): enable Test_address_line_overflow()
Nvim doesn't use atol() in getdigits() and doesn't need to check for
size of long.
2024-07-14 06:12:42 +08:00
zeertzjq
c31f64dd4d vim-patch:9.1.0577: Unnecessary checks for v:sizeoflong in test_put.vim
Problem:  Unnecessary checks for v:sizeoflong in test_put.vim.  They are
          no longer necessary as patch 8.2.3661 has changed the count to
          be within 32-bit integer limit.
Solution: Remove the checks (zeertzjq).

closes: vim/vim#15239

69a28f6c08
2024-07-14 06:12:41 +08:00
bfredl
eab535e10e Merge pull request #29315 from bfredl/staticinline
refactor(declarations): also generate prototypes for functions in headers
2024-07-13 17:22:59 +02:00
bfredl
2ad8428637 Merge pull request #29659 from amitds1997/fix/empty-dict-encoding
fix(lua)!: do not use typed table for empty dict
2024-07-13 14:55:35 +02:00
Amit Singh
970a27927e fix(lua)!: do not use typed table for empty dict
Problem:
Empty dictionaries are converted into typed tables of the form `{ [true]
= 6}` instead of an empty dictionary representation `{}`. This leads to
incorrect table representation, along with failure in JSON encoding of
such tables as currently tables with only string and number type keys
can be encoded.

Solution:
The typed table logic has been removed from `nlua_push_Dictionary`. The
typed table logic is required only for float value conversions which is
already handled in `nlua_push_Float`. So, it is(was) no longer required
here.

Fixes neovim/neovim#29218
2024-07-13 16:42:28 +05:30
bfredl
7dffc36e61 refactor(declarations): also generate prototypes for functions in headers
Before this change, "static inline" functions in headers needed to have
their function attributes specified in a completely different way. The
prototype had to be duplicated, and REAL_FATTR_ had to be used instead
of the public FUNC_ATTR_ names.

TODO: need a check that a "header.h.inline.generated.h" file is not
forgotten when the first "static inline" function with attributes
is added to a header (they would just be silently missing).
2024-07-13 12:30:49 +02:00
Lewis Russell
b0f39f3ef5 Merge pull request #29632 from echasnovski/filetype-refactor
refactor(filetype): extract some functions, use more cache
2024-07-13 08:27:47 +01:00
zeertzjq
b1aa8f5eb8 vim-patch:9.1.0572: cannot specify tab page closing behaviour (#29682)
Problem:  cannot specify tab page closing behaviour
          (Gianluca Pacchiella)
Solution: Add the 'tabclose' option (LemonBoy).

fixes: vim/vim#5967
closes: vim/vim#15204

5247b0b92e

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-07-13 08:56:58 +08:00
zeertzjq
10256bb760 vim-patch:74703f1: runtime(doc): remove obsolete Ex insert behavior (#29678)
related: vim/vim#15120
closes: vim/vim#15228

74703f1086

Nvim only supports Vim Ex mode, so this is long obsolete in Nvim.

Co-authored-by: Mohamed Akram <mohd.akram@outlook.com>
2024-07-13 04:38:37 +08:00
zeertzjq
16f63b964f fix(input): handle vim.on_key() properly with ALT and K_SPECIAL (#29677) 2024-07-13 04:14:29 +08:00
Evgeni Chasnovski
708b5f86ba refactor(filetype): use Lua patterns without implicit anchoring 2024-07-12 21:16:09 +03:00
Evgeni Chasnovski
9d14b76089 refactor(filetype): extract expanding env. vars in separate function 2024-07-12 21:16:09 +03:00
Evgeni Chasnovski
abf4b65a51 perf(filetype): cache (more) pattern data during "add" time 2024-07-12 21:16:09 +03:00
Evgeni Chasnovski
c7e8fc6302 refactor(filetype): unify matching patterns with pos/neg priority
Problem: due to single list of sorted patterns, their matching inside
  `vim.filetype.match()` was done very similarly but with extra checks
  to stop processing negative priority patterns before extensions.

Solution: create separated sorted lists for patterns with non-negative
  and negative priorities. This allows to process them in a single
  extracted function making the main codeflow a bit nicer and more
  easily expandable.
2024-07-12 21:16:09 +03:00
Christian Clason
8d8b8af2d2 vim-patch:57f7d75: runtime(logindefs): update syntax with new keywords
* add keywords
* enforce octal format for permissions

closes: vim/vim#15222

57f7d75591

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2024-07-12 11:41:51 +02:00
Christian Clason
26d5253805 vim-patch:fc533c9: runtime(mojo): include mojo ftplugin and indent script
Taken from excerpts of the Python ftplugin and adapted,
indent script simply sources the python indent script.

closes: vim/vim#15171

fc533c9f06

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-12 11:34:11 +02:00
Christian Clason
f4beab7ad8 vim-patch:7a22cb8: runtime(fstab): Add missing keywords to fstab syntax
Added overlay, tracefs and fixed the "none" keyword in the fstab syntax definition.

closes: vim/vim#15217

7a22cb8141

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-12 11:34:00 +02:00
zeertzjq
028dd3c5c4 vim-patch:9.1.0569: fnamemodify() treats ".." and "../" differently (#29673)
Problem:  fnamemodify() treats ".." and "../" differently.
Solution: Expand ".." properly like how "/.." is treated in 8.2.3388.
          (zeertzjq)

closes: vim/vim#15218

1ee7420460
2024-07-12 14:30:49 +08:00
zeertzjq
bcb17689da Merge pull request #29669 from zeertzjq/vim-9.1.0568
vim-patch:partial:9.0.{0323,0418},9.1.0568
2024-07-12 08:05:22 +08:00
zeertzjq
83f42aa450 vim-patch:9.1.0568: Cannot expand paths from 'cdpath' setting
Problem:  Cannot expand paths from 'cdpath' setting
          (Daniel Hahler)
Solution: Implement 'cdpath' completion, add the new 'dir_in_path'
          completion type (LemonBoy)

fixes vim/vim#374
closes: vim/vim#15205

a20bf69a3b

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-07-12 07:39:36 +08:00
zeertzjq
f1827d877d vim-patch:partial:9.0.0418: manually deleting temp test files
Problem:    Manually deleting temp test files.
Solution:   Use the 'D' flag of writefile() and mkdir().

45bbaef038

This only includes test_cd.vim changes.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-12 07:30:21 +08:00
zeertzjq
a61666293d 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 only includes test_cd.vim changes.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-12 07:30:21 +08:00
zeertzjq
a5de650f0e Merge pull request #29668 from zeertzjq/vim-9.1.0562
vim-patch:9.1.{0562,0565,0566,0567}: file search fixes
2024-07-12 07:10:31 +08:00
zeertzjq
80818641f3 vim-patch:9.1.0567: Cannot use relative paths as findfile() stop directories
Problem:  Cannot use relative paths as findfile() stop directories.
Solution: Change a relative path to an absolute path.
          (zeertzjq)

related: vim/vim#15200
closes: vim/vim#15202

764526e279
2024-07-12 06:49:43 +08:00
zeertzjq
091a130804 vim-patch:9.1.0566: Stop dir in findfile() doesn't work properly w/o trailing slash
Problem:  Stop directory in findfile() doesn't work properly without a
          trailing slash.
Solution: Always use fnamencmp(), not fnamecmp().

related: vim/vim#15200
related: vim/vim#15202

e6ab23bd4a
2024-07-12 06:49:38 +08:00
zeertzjq
50feb85b0c vim-patch:9.1.0565: Stop directory doesn't work properly in 'tags'
Problem:  Stop directory doesn't work properly in 'tags'.
          (Jesse Pavel)
Solution: Also move the stop directory forward by one byte.
          (zeertzjq)

This doesn't support relative stop directories yet, as they are not
supported in other places like findfile() either.

fixes: vim/vim#15200
related: vim/vim#15202

68819afb2c
2024-07-12 06:49:35 +08:00
zeertzjq
2c9e82e193 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 only includes test_findfile.vim changes.

vim-patch:9.1.0562: tests: inconsistency in test_findfile.vim

Problem:  tests: inconsistency in test_findfile.vim, it saves and
          restores 'shellslash', but doesn't actually set it
Solution: Set shellslash explicitly (zeertzjq)

closes: vim/vim#15217

e7b98ab96e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-12 06:49:33 +08:00
zeertzjq
31d53cbb0f vim-patch:8.2.3388: fnamemodify('path/..', ':p') differs from using 'path/../' (#29667)
Problem:    fnamemodify('path/..', ':p') differs from using 'path/../'.
Solution:   Include the "/.." in the directory name. (closes vim/vim#8808)

4eaef9979f

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-12 06:33:54 +08:00
zeertzjq
45b7a2c503 vim-patch:9.1.0557: moving in the buffer list doesn't work as documented (#29653)
Problem:  moving in the buffer list doesn't work as documented
          (SenileFelineS)
Solution: Skip non-help buffers, when run from normal buffers, else
          only move from help buffers to the next help buffer (LemonBoy)

As explained in the help section for :bnext and :bprev the commands
should jump from help buffers to help buffers (and from regular ones to
regular ones).

fixes: vim/vim#4478
closes: vim/vim#15198

893eeeb445

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-07-11 08:02:59 +08:00
Christian Clason
afbe7736a4 vim-patch:9.1.0555: filetype: angular ft detection is still problematic
Problem:  filetype: angular ft detection is still problematic
          (after 9.1.0551)
Solution: detect htmlangular filetype only by inspecting the content,
          do not try to determine it from a generic name like
          '*.component.html'

For the reasons mentioned here:

https://github.com/vim/vim/pull/13594#issuecomment-1834465890

related: vim/vim#15190
related: vim/vim#13594
related: vim/vim#13604

c03f631b7b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-11 00:41:40 +02:00
Christian Clason
f24dd5481b vim-patch:a3a14d5: runtime(htmlangular): correct comment
related: vim/vim#15190

a3a14d5469

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-11 00:41:40 +02:00
zeertzjq
15f6cf0c8f vim-patch:7a85e34: runtime(doc): fix inconsistencies in :h file-searching (#29652)
closes: vim/vim#15201

7a85e343d2
2024-07-11 06:27:40 +08:00
zeertzjq
07c1996c8a vim-patch:9.1.0556: :bwipe doesn't remove file from jumplist of other tabpages (#29651)
Problem:  :bwipe doesn't remove file from jumplist and tagstack of other
          tabpages. Time complexity of mark_forget_file() is O(n^2) when
          removing all entries (after v9.1.0554)
Solution: Use FOR_ALL_TAB_WINDOWS().  Start the loops over the arrays
          from the end instead of the start (zeertzjq)

closes: vim/vim#15199

2e7d89b398
2024-07-11 06:26:22 +08:00
dundargoc
3c5abf01bf refactor: remove CH_FOLD macro
It should not be needed as utf_fold should already work on its own.
2024-07-10 10:44:03 +02:00
zeertzjq
4208223175 vim-patch:9.1.{0503,0549} (#29643)
vim-patch:9.1.0503: cannot use fuzzy keyword completion

Problem:  cannot use fuzzy keyword completion
          (Maxim Kim)
Solution: add the "fuzzycollect" value for the 'completeopt'
          setting, to gather matches using fuzzy logic (glepnir)

fixes: vim/vim#14912
closes: vim/vim#14976

43eef882ff

vim-patch:9.1.0549: fuzzycollect regex based completion not working as expected

Problem:  fuzzycollect regex based completion not working as expected
Solution: Revert Patch v9.1.0503 (glepnir)

closes: vim/vim#15192

600a12d08e

Co-authored-by: glepnir <glephunter@gmail.com>
2024-07-10 16:04:33 +08:00
Christian Clason
17bc5af01b vim-patch:9.1.0553: filetype: *.mcmeta files are not recognized
Problem:  filetype: *.mcmeta files are not recognized
Solution: Detect '*.mcmeta' files as json filetype
          (Tomodachi94)

"pack.mcmeta" was added to the JSON tests because that is the most common
filename with that extension.

There are currently 34,000 instances of this file extension on GitHub:
https://github.com/search?q=path%3A*.mcmeta&type=code&p=2

.zip files with this extension have downloads in the millions on sites
like CurseForge:
https://www.curseforge.com/minecraft/search?page=1&pageSize=20&sortBy=relevancy&class=texture-packs

Further reading about the file extension:
https://minecraft.wiki/w/Tutorials/Creating_a_resource_pack#Creating_a_.MCMETA_file

closes: vim/vim#15189

d33a518025

Co-authored-by: Tomodachi94 <tomodachi94@protonmail.com>
2024-07-10 09:31:48 +02:00
Christian Clason
7fa089f463 vim-patch:9.1.0551: filetype: htmlangular files are not properly detected
Problem:  filetype: htmlangular files are not properly detected
Solution: Use the new htmlangular filetype for angular files, because
          since angular v17, those are no longer valid HTML files.
          (Dennis van den Berg)

Since Angular 17, the new Control Flow Syntax is not valid HTML. This PR
adds a new filetype detection for the HTML templates of Angular.

It first checks the filename. The Angular convention is to use
*.component.html for the template. However, this is not mandatory.

If the filename does not match, it will check the contents of the file
if it contains:

  - One of the Control-Flow blocks: @if, @for, @switch, @defer
  - A structural directive: *ngIf, *ngFor, *ngSwitch, *ngTemplateOutlet
  - Builtin Angular elements: ng-template or ng-content
  - String interpolation: {{ something }}

This enables the Angular LSP to attach only to htmlangular filetypes, as
well as language parsers, such as tree-sitter.

closes: vim/vim#15190

1ad194c0df

Co-authored-by: Dennis van den Berg <dennis.vandenberg@nedap.com>
2024-07-10 09:31:48 +02:00
Christian Clason
80530d07e7 vim-patch:9.1.0552: No test for antlr4 filetype
Problem:  No test for antlr4 filetype
          (after 9.1.0550)
Solution: Add a simple filename test

related: vim/vim#15191

8fc23bb8a4

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-10 09:31:48 +02:00
Christian Clason
136c11ca22 vim-patch:9.1.0550: filetype: antlr4 files are not recognized
Problem:  filetype: antlr4 files are not recognized
Solution: Detect '*.g4' as antlr4 filetype, include a simple antlr4
          syntax and filetype plugin (Yinzuo Jiang)

closes: vim/vim#15191

4a7a4a3675

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-07-10 09:31:48 +02:00
zeertzjq
158ffd646d vim-patch:9.1.0554: :bw leaves jumplist and tagstack data around (#29639)
Problem:  :bw leaves jumplist and tagstack data around
          (Paul "Joey" Clark)
Solution: Wipe jumplist and tagstack references to the wiped buffer
          (LemonBoy)

As documented the :bwipeout command brutally deletes all the references
to the buffer, so let's make it delete all the entries in the jump list
and tag stack referring to the wiped-out buffer.

fixes: vim/vim#8201
closes: vim/vim#15185

4ff3a9b1e3

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-07-10 10:35:12 +08:00
zeertzjq
545aafbeb8 vim-patch:9.1.0547: No way to get the arity of a Vim function (#29638)
Problem:  No way to get the arity of a Vim function
          (Austin Ziegler)
Solution: Enhance get() Vim script function to return the function
          argument info using get(func, "arity") (LemonBoy)

fixes: vim/vim#15097
closes: vim/vim#15109

48b7d05a4f

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-07-10 08:07:16 +08:00
Christian Clason
f3c7fb9db1 vim-patch:73a8108: runtime(tmux): Update syntax script
closes: vim/vim#15195
related: vim/vim#15188

73a810817b

Co-authored-by: Eric Pruitt <eric.pruitt@gmail.com>
Co-authored-by: Contsantine Bulany <61948252+lostl1ght@users.noreply.github.com>
2024-07-09 22:05:45 +02:00
Max Coplan
d918ebe3b8 fix(diagnostic): fix backwards compatibility for goto_next and goto_prev (#29593) 2024-07-09 14:08:12 -05:00
Christian Clason
51d85f7ea5 build(deps): drop unused bundled bash, python parsers and queries
Problem: Neovim bundles treesitter parsers for bash and python but does
not use them by default. This dilutes the messaging about the bundled
parsers being required for functionality or reasonable out-of-the-box
experience. It also increases the risk of query incompatibilities for no
gain.

Solution: Stop bundling bash and python parser and queries.
2024-07-09 15:26:48 +02:00
zeertzjq
487f44a6c1 fix(lua): change some vim.fn.expand() to vim.fs.normalize() (#29583)
Unlike vim.fn.expand(), vim.fs.normalize() doesn't expand wildcards.
2024-07-09 19:17:50 +08:00
zeertzjq
fb6c059dc5 vim-patch:d1c3698: runtime(doc): fix typo in :h ft-csv-syntax (#29619)
closes: vim/vim#15179

d1c369892d
2024-07-09 06:41:26 +08:00
Christian Clason
9ebf3454ad vim-patch:ab03dd2: runtime(hlsplaylist): include hlsplaylist ftplugin file
fixes: vim/vim#15156
closes: vim/vim#15162

ab03dd2085

Co-authored-by: AvidSeeker <avidseeker7@protonmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-07-09 00:34:34 +02:00
Evgeni Chasnovski
dc04ef2a20 perf(filetype): skip contents check in match() if there is no contents (#29596)
Problem: `vim.filetype.match()` tries to match on contents even if there
  is no contents (empty buffer or `{''}` explicit contents).
  This results in extra avoidable execution duration for cases.
  It matters, for example, when trying to match filetype based solely
  on file name (which still needs `contents` or `buf` to properly match
  earlier in the code path).

Solution: skip matching based solely on contents if it is `{''}`. This
  works because:
    - Matching solely on content is done after any user-configured
      `vim.filetype.add()` hooks.
    - All default matching on content might depend on supplied path
      *only* if there is non-empty content (like in
      `require('vim.filetype.detect').match_from_hashbang()`).
2024-07-08 11:20:32 -05:00
Christian Clason
b3d94b1087 vim-patch:f77a0e9: runtime(cmakecache): include cmakecache ftplugin file
closes: vim/vim#15175

f77a0e9f41

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 12:14:44 +02:00
Christian Clason
3b4481d3a5 vim-patch:380f980: runtime(lex): include lex ftplugin file
Spec found [here](https://docs.oracle.com/cd/E19504-01/802-5880/lex-6/index.html)

closes: vim/vim#15174

380f98002d

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 12:14:44 +02:00
Christian Clason
f7274fde06 vim-patch:7d60dc2: runtime(yacc): include yacc ftplugin file
closes: vim/vim#15173

7d60dc2069

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 12:14:44 +02:00
Christian Clason
e271110e37 vim-patch:08b0c12: runtime(squirrel): include squirrel ftplugin file
Comment spec found [here](https://squirrel-lang.org/squirreldoc/reference/language/lexical_structure.html#comments)

closes: vim/vim#15172

08b0c12716

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 12:14:44 +02:00
Christian Clason
79c63b5561 vim-patch:2c9ef3a: runtime(objcpp): include objcpp ftplugin file
This one just sources the objc.vim ftplugin.

closes: vim/vim#15170

2c9ef3a671

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 12:14:44 +02:00
Christian Clason
8aab46da5e vim-patch:94c1c66: runtime(tf): include tf ftplugin file
Adds ftplugin support for tf (TinyFugue). Comment support taken from
[here](1e8ac0bb01/src/command.c (L568))

closes: vim/vim#15168

94c1c6638a

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 12:14:44 +02:00
Christian Clason
97704a6694 vim-patch:01e2090: runtime(mysql): include mysql ftplugin file
This one just sources from the SQL ftplugin. Without this, *.mysql
files don't inherit the common SQL settings.

closes: vim/vim#15166

01e20902f4

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 12:14:44 +02:00
Christian Clason
d70c224131 vim-patch:a264bb9: runtime(javacc): include javacc ftplugin file
closes: vim/vim#15167

a264bb931e

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 12:14:44 +02:00
Christian Clason
bc3051e7a7 vim-patch:2525608: runtime(cabal): include cabal ftplugin file
closes: vim/vim#15158

2525608d73

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 12:14:44 +02:00
Christian Clason
60b74f27d0 vim-patch:f5398c8: runtime(cuda): include CUDA ftplugin file
closes: vim/vim#15159

f5398c8975

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 12:14:44 +02:00
Christian Clason
4315657a36 vim-patch:2c299eb: runtime(editorconfig): include editorconfig ftplugin file
closes: vim/vim#15160

2c299eb258

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 12:14:44 +02:00
Christian Clason
27cd2aa38d vim-patch:8906e22: runtime(kivy): update kivy syntax, include ftplugin
Kivy uses "#:" for preprocessing commands (like "#:import ...") which
were overridden by the comment syntax. This has been changed, and a
commentstring has been added.

closes: vim/vim#15163

8906e22df5

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 12:14:44 +02:00
Jaehwang Jung
8474f52978 fix(treesitter.foldexpr): robustness against ctrl-c
Problem:
Exiting the insert mode with ctrl-c does not trigger InsertLeave
autocmd. This may lead to nil error in treesitter foldexpr.

Solution:
Check nil. Folds still can be stale after exiting the insert mode with
ctrl-c, but it will be eventually updated correctly.

An alternative solution would be to ensure that exiting the insert mode
always triggers do_foldupdate. This can be done either by "fixing"
ctrl-c or with on_key callback that checks ctrl-c (nvim-cmp does this).
2024-07-08 11:06:26 +01:00
Christian Clason
bf92d423a9 vim-patch:9.1.0544: filetype: ldapconf files are not recognized
Problem:  filetype: ldapconf files are not recognized
Solution: Detect '.ldaprc', 'ldap.conf' and 'ldaprc' files as ldapconf
          filetype, include a simple ldapconf ftplugin file
          (Riley Bruins)

[Specification](https://www.openldap.org/software//man.cgi?query=ldap.conf&sektion=5&apropos=0&manpath=OpenLDAP+2.4-Release)

closes: vim/vim#15176

62f31e9499

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 11:03:51 +02:00
zeertzjq
73ae7d44a2 fix(quickfix): make shortmess+=O work with cmdheight=0 (#29609) 2024-07-08 10:36:41 +08:00
zeertzjq
76b91106fc vim-patch:9.1.0543: Behavior of CursorMovedC is strange (#29608)
Problem:  Behavior of CursorMovedC is strange.
Solution: Also trigger when the cmdline has changed.
          (zeertzjq)

fixes: vim/vim#15069
closes: vim/vim#15071

8145620a95
2024-07-08 06:55:21 +08:00
zeertzjq
055a222797 vim-patch:e85fdc7: runtime(vim): Update base-syntax, improve :match command highlighting (#29607)
Match group and pattern arguments to :match commands.

closes: vim/vim#15096

e85fdc730e

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-07-08 06:51:23 +08:00
zeertzjq
51ef445c15 Merge pull request #29606 from zeertzjq/vim-b9bbf1f04439
vim-patch: documentation updates
2024-07-08 06:45:32 +08:00
zeertzjq
435ce99213 vim-patch:9.1.0540: Unused assignment in sign_define_cmd()
Problem:  Unused assignment in sign_define_cmd()
Solution: Remove the assignment.  Also document the "priority" flag of
          sign_define(). (zeertzjq)

closes: vim/vim#15169

fc3f5dba52
2024-07-08 06:20:22 +08:00
zeertzjq
7b5364166c vim-patch:fbbabbc: runtime(doc): add page-scrolling keys to index.txt
Also add the newly documented keys from commit 6a4afb1efca1bac5fbc0281804591cf0a52b2d81
to index.txt which was forgotten.

related: vim/vim#15107

fbbabbca33

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-08 06:19:05 +08:00
zeertzjq
7195d331af vim-patch:b9bbf1f: runtime(doc): clarify how to re-init csv syntax file
fixes: vim/vim#15161

b9bbf1f044

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-08 06:17:51 +08:00
Lewis Russell
e5ff302033 build: remove -O2 from gen_cflags
Problem:
zig cc implicitly defines NDEBUG with -O2. This breaks debug builds
which does not include -O2 or NDEBUG.

Solution:
Do not add -O2 when generating header files.
2024-07-07 19:46:32 +01:00
Stanislav Asunkin
5b778a64ec fix(health): fix fetching url with python in provider health (#29594) 2024-07-07 16:37:39 +08:00
zeertzjq
6a886a2511 vim-patch:9.1.0538: not possible to assign priority when defining a sign (#29592)
Problem:  not possible to assign priority when defining a sign
          (Mathias Fußenegger)
Solution: Add the priority argument for the :sign-define ex command and
          the sign_define() function (LemonBoy)

Use the specified value instead of the default one (SIGN_DEF_PRIO) when
no priority is explicitly specified in sign_place or :sign place.

fixes: vim/vim#8334
closes: vim/vim#15124

b975ddfdf9

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-07-07 07:21:14 +08:00
Christian Clason
472b5b9b20 vim-patch:9.1.0536: filetype: zone files are not recognized
Problem:  filetype: zone files are not recognized
          (rpdprd)
Solution: Detect '*.zone' files as bindzone filetype

fixes: vim/vim#14222

f095539b39

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-07 00:36:40 +02:00
zeertzjq
5da9b49b19 vim-patch:9.1.0537: signed number detection for CTRL-X/A can be improved (#29590)
Problem:  signed number detection for CTRL-X/A can be improved
          (Chris Patuzzo)
Solution: Add the new "blank" value for the 'nrformat' setting. This
          will make Vim assume a signed number only if there is a blank
          in front of the sign.
          (distobs)

fixes: vim/vim#15033
closes: vim/vim#15110

25ac6d67d9

Co-authored-by: distobs <cuppotatocake@gmail.com>
2024-07-07 06:32:54 +08:00
zeertzjq
7a54d707fa vim-patch:9.1.0534: completion wrong with fuzzy when cycling back to original (#29588)
Problem:  completion wrong with fuzzy when cycling back to original
          (Quan Nguyen)
Solution: reset show_match_ok when cp_score is zero (glepnir)

fixes: vim/vim#15095
closes: vim/vim#15105

65407ce1d2

Co-authored-by: glepnir <glephunter@gmail.com>
2024-07-06 22:44:37 +08:00
zeertzjq
bdc6e38781 fix(lua): don't include text after cursor in completion pattern (#29587) 2024-07-06 22:25:35 +08:00
zeertzjq
34fa54355a Merge pull request #29584 from zeertzjq/vim-6a4afb1efca1
vim-patch:6a4afb1,aaaa21b
2024-07-06 17:52:28 +08:00
Andreas Schneider
55e4301036 feat(lsp): drop fswatch, use inotifywait (#29374)
This patch replaces fswatch with inotifywait from inotify-toools:

https://github.com/inotify-tools/inotify-tools

fswatch takes ~1min to set up recursively for the Samba source code
directory. inotifywait needs less than a second to do the same thing.

https://github.com/emcrisostomo/fswatch/issues/321

Also it fswatch seems to be unmaintained in the meantime.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2024-07-06 11:44:19 +02:00
Gregory Anders
91e5dcae3d docs(lsp): add examples to lsp-quickstart for completion and autoformatting (#29497)
Auto-completion and auto-formatting are common (though certainly not
universal) features that many users want. We can document how to
accomplish this in lsp-quickstart so that users that do want these
features can easily find examples of how to configure them.
2024-07-06 11:41:55 +02:00
Zoltán Nyikos
b109b1abce fix(glob): avoid subcapture nesting too deep error (#29520)
Use Cmt to evaluate Cond and Elem during match to avoid building the
nested capture structure later.
2024-07-06 11:40:08 +02:00
zeertzjq
285543b6aa vim-patch:aaaa21b: runtime(doc): Remove wrong help tag CTRL-SHIFT-CR
aaaa21b58f

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-06 17:32:38 +08:00
zeertzjq
9a63ab5e3b vim-patch:6a4afb1: runtime(doc): document further keys that scroll page up/down
fixes: vim/vim#15107

6a4afb1efc

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-06 17:32:22 +08:00
Christian Clason
0abaccb2a7 vim-patch:9.1.0532: filetype: Cedar files not recognized
Problem:  filetype: Cedar files not recognized
Solution: Detect '*.cedar' files as cedar filetype
          (Riley Bruins)

References: https://github.com/cedar-policy

closes: vim/vim#15148

15addb24dd

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-06 11:05:19 +02:00
zeertzjq
3c53e8f785 refactor(eval): use uv_random() for init_srand() (#29575)
N/A patches for version.c:
vim-patch:9.1.0518: initialize the random buffer can be improved
vim-patch:9.1.0531: resource leak in mch_get_random()
2024-07-05 18:39:06 +08:00
Riley Bruins
9217e0d671 fix(treesitter): display fields for anonymous nodes in :InspectTree 2024-07-05 10:11:48 +02:00
zeertzjq
2a883d9c59 vim-patch:9.1.0524: the recursive parameter in the *_equal functions can be removed (#29572)
Problem:  the recursive parameter in the *_equal functions can be removed
Solution: Remove the recursive parameter in dict_equal(), list_equal()
          object_equal and tv_equal(). Use a comparison of the static
          var recursive_cnt == 0 to determine whether or not tv_equal()
          has been called recursively (Yinzuo Jiang).

closes: vim/vim#15070

7ccd1a2e85

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-07-05 15:20:02 +08:00
luukvbaal
3e6cec0bef vim-patch:9.1.0526: Unwanted cursor movement with pagescroll at start of buffer (#29569)
Problem:  Cursor is moved to bottom of window trying to pagescroll when
          already at the start of the buffer (Asheq Imran, after v9.1.0357)
Solution: Don't move cursor when buffer content did not move.
          (Luuk van Baal)

8ccb89016e
2024-07-05 07:51:34 +08:00
zeertzjq
842725eedc vim-patch:9.1.0525: Right release selects immediately when pum is truncated. (#29568)
Problem:  Right release selects immediately when pum is truncated.
Solution: Use pum_height instead of pum_size when checking click row.
          Don't place it above mouse row when there is more space below.
          (zeertzjq)

fixes: vim/vim#15101
closes: vim/vim#15102

761a420c66
2024-07-05 07:46:01 +08:00
zeertzjq
81d4e96bc8 fix(mouse): don't treat click on hsep as click on statusline (#29565)
This allows showing popup menu when right-clicking on hsep or cmdline.
2024-07-05 07:24:45 +08:00
zeertzjq
6cbba2b48d vim-patch:9.1.0529: silent! causes following try/catch to not work (#29567)
Problem:  silent! causes following try/catch to not work
          (Malcolm Rowe)
Solution: consider emsg_silent in handle_did_throw() and do not abort
          evaluation flow for :silent! (LemonBoy)

The silent! flag causes the evaluation not to be aborted in case of
uncaught exceptions, adjust handle_did_throw to take this detail into
account.

Fixes the long-standing todo.txt item:
```
Problem that a previous silent ":throw" causes a following try/catch not
to work. (ZyX, 2013 Sep 28) With examples: (Malcolm Rowe, 2015 Dec 24)
Also see vim/vim#8487 for an example.
```

fixes: vim/vim#538
closes: vim/vim#15128

749ba0f6d9

Cherry-pick Test_deeply_nested_source() from patch 8.2.5169.

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-07-05 07:10:30 +08:00
zeertzjq
6f42396cdc vim-patch:9.1.0528: spell completion message still wrong in translations (#29566)
Problem:  spell completion message still wrong in translations
          (after 9.1.0512)
Solution: Update translation files with the new message
          (Kyle Kovacs)

closes: vim/vim#15113

68f5ceddca

Co-authored-by: Kyle Kovacs <kkovacs@diconfiberoptics.com>
2024-07-05 07:09:40 +08:00
dundargoc
25c59d08c4 docs: misc (#29410)
Co-authored-by: Michael Härtl <haertl.mike@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-07-05 05:20:45 +08:00
Christian Clason
71c50edceb vim-patch:3146d63: runtime(netrw): fix remaining case of register clobber
complements 62f7b55c1a4564f8744af9446bc7af47fe16a245

closes: vim/vim#15114

3146d63267

Co-authored-by: Enno <Konfekt@users.noreply.github.com>
2024-07-04 23:01:35 +02:00
Christian Clason
c49bcde927 vim-patch:11d5992: runtime(rust): use shiftwidth() in indent script
closes: vim/vim#15138

11d5992573

Co-authored-by: novenary <novenary@kwak.zip>
2024-07-04 23:01:35 +02:00
Peter Aronoff
4b3be56a03 fix(diagnostic): make docs agree with code (#29561)
Problem: the code and docs for vim.diagnostic.JumpOpts.float send mixed
signals about what the default should be. When the option is first set,
in the global_diagnostic_options table, the comment clearly says that
the default is false. Later in the code, in goto_diagnostic, there's
a line that sets the default to true if no default is present. Finally,
the docs say that the default is true.

Solution: Change the docs to reflect the new default of false and fix
the goto_diagnostic function.
2024-07-04 12:15:35 -05:00
Christian Clason
7e099cf3eb build(macos): disable deduplication in link step
Problem: Apple Clang 16 comes with a new deduplication algorithm that is
enabled by default in release builds (https://developer.apple.com/documentation/xcode-release-notes/xcode-16-release-notes#New-Features-in-Xcode-16-Beta) which breaks the built
nvim binary (locks and spins at 100% CPU).

Solution: Disable deduplication on macOS. Tested on Clang 15 as well and
seems to make no difference to binary size anyway.
2024-07-04 15:11:39 +02:00
Christian Clason
8a338c0ccc vim-patch:2fbcc15: runtime(terraform): Add filetype plugin for terraform
- Adds commentstring property for terraform
- Adds comments property for terraform

closes: vim/vim#15144

2fbcc15cf9

Co-authored-by: Janno Tjarks <janno.tjarks@mailbox.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-07-04 14:06:41 +02:00
Christian Clason
0803ac7b08 vim-patch:3d2a996: runtime(dockerfile): enable spellchecking of comments in syntax script
closes: vim/vim#15147

3d2a996267

Co-authored-by: Kafva <36083692+Kafva@users.noreply.github.com>
2024-07-04 14:06:41 +02:00
Christian Clason
7f8cd91ac0 vim-patch:2606e77: runtime(doc): rename variable for pandoc markdown support
fixes: vim/vim#15141

2606e7718c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-04 11:54:02 +02:00
Christian Clason
81d2e4446e build(deps): bump luajit to HEAD - 04dca7911 2024-07-04 10:37:28 +02:00
zeertzjq
033ea63b2f refactor: add assertion for v_blob in tv_ptr() (#29554)
Also add test for using printf() and id() with a Blob.
2024-07-04 09:54:51 +08:00
Tyler Miller
7f33c1967b fix(lua): use rawget() to get __call in vim.is_callable() (#29536)
Lua 5.1 uses a "raw get" to retrieve `__call` from a metatable to
determine if a table is callable. Mirror this behavior in
`vim.is_callable()`.
2024-07-04 06:36:00 +08:00
zeertzjq
12c9791e0f fix(runtime): stop treesitter highlight in b:undo_ftplugin (#29533)
It seems that nvim-treesitter stops treesitter highlight when changing
filetype, so it makes sense for builtin ftplugins to do this as well.

Use :call and v:lua here to allow separation with '|'.
2024-07-03 15:24:12 +08:00
zeertzjq
599fc7cee4 test: starting and stopping treesitter highlight (#29546) 2024-07-03 08:40:55 +08:00
zeertzjq
d413038b4f fix(treesitter): ensure syntaxset augroup exists (#29542)
Problem:
Error when calling vim.treesitter.start() and vim.treesitter.stop() in
init.lua.

Solution:
Ensure syntaxset augroup exists after loading synload.vim.
2024-07-03 07:40:42 +08:00
Sebastian Lyng Johansen
aec7f1979a fix(lsp): fallback to label for completion items if all others are missing (#29522) 2024-07-02 18:27:51 +02:00
alex-tdrn
cb84cd5d9f feat(win32): embed executable icon
Problem: on windows, the neovim executable (and thus the filetypes
associated to open with neovim) has no embedded icon

Solution: create a windows resource file pointing to the icon, and
add it to the nvim binary target
2024-07-02 13:05:16 +02:00
dundargoc
9216bc927c build(deps): fix formatc target on MSVC
Set CMAKE_RUNTIME_OUTPUT_DIRECTORY for CMAKE_ARGS for the uncrustify
ExternalProject to point to DEPS_BIN_DIR because the uncrustify cmake
sources do not install to DESTDIR/bin under MSVC but to DESTDIR.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-07-02 12:16:23 +02:00
zeertzjq
8f5e908110 fix(runtime): update b:undo_ftplugin in Lua runtime files (#29529)
Related to #29506, but adding vim.treesitter.stop() to b:undo_ftplugin
doesn't solve the problem yet.
2024-07-01 17:48:09 +08:00
zeertzjq
e7020306a1 feat(jumplist): allow opting out of removing unloaded buffers (#29347)
Problem:  Cannot opt out of removing unloaded buffers from the jumplist.
Solution: Only enable that with "unload" flag in 'jumpoptions'.
2024-06-30 06:40:31 +08:00
dundargoc
435d0182d2 refactor: remove special handling for lowercase German sharp s
utf8proc already defines LATIN CAPITAL LETTER SHARP S (ẞ) to be the
uppercase variant of LATIN SMALL LETTER SHARP S (ß), so this special
workaround when using `gU` is no longer needed on the neovim side.
2024-06-29 17:57:56 +02:00
bfredl
ace0d5306b Merge pull request #29467 from bfredl/shadapack2
refactor(shada): don't use msgpack_packer for shada
2024-06-29 11:57:37 +02:00
dundargoc
c33f670da2 refactor: remove special-case conversion for german sharp s
The comment "German sharp s is lower case but has no upper case
equivalent." is no longer true and is therefore not needed anymore.
2024-06-29 11:41:05 +02:00
dundargoc
aa6b9c677d refactor: use vim._with where possible
This mostly means replacing `nvim_buf_call` and `nvim_win_call` with
`vim._with`.
2024-06-28 19:58:31 +02:00
dundargoc
496091b632 refactor: replace utf_convert with utf8proc conversion functions 2024-06-28 19:47:39 +02:00
dundargoc
32e16cb0b6 build: add utf8proc as dependency
utf8proc contains all the data which is currently in
unicode_tables.generated.h internally, but in quite a different format.
Ideally unicode_tables.generated.h should be removed as well so we rely
solely on utf8proc. We want to avoid a situation where the possibility
of unicode mismatch occurs, e.g a distro using both unicode 12 and
unicode 13.
2024-06-28 19:47:39 +02:00
bfredl
782b3024ef refactor(shada): don't use msgpack_packer for shada
Now msgpack-c is never used for packing. The real fun part will be
replacing it for unpacking.
2024-06-27 18:46:27 +02:00
bfredl
46187117c9 Merge pull request #29483 from bfredl/nonbinary
refactor(typval)!: remove binary distinction of binary and nonbinary strings
2024-06-27 18:45:18 +02:00
Mathias Fußenegger
724d1110b1 fix(lsp): pre-filter matches on label if filterText is missing (#29491)
Although the built-in pum completion mechanism will filter anyway on the
next input it is odd if the initial popup shows entries which don't
match the current prefix.

Using fuzzy match on the label/prefix is compatible with
`completeopt+=fuzzy` and also doesn't seem to break postfix snippet
cases

Closes https://github.com/neovim/neovim/issues/29287
2024-06-27 12:20:00 +02:00
bfredl
bda63d5b97 refactor(typval)!: remove distinction of binary and nonbinary strings
This is a breaking change which will make refactor of typval and shada
code a lot easier. In particular, code that would use or check for
v:msgpack_types.binary in the wild would be broken. This appears to be
rarely used in existing plugins.

Also some cases where v:msgpack_type.string would be used to represent a
binary string of "string" type, we use a BLOB instead, which is
vimscripts native type for binary blobs, and already was used for BIN
formats when necessary.

msgpackdump(msgpackparse(data)) no longer preserves the distinction
of BIN and STR strings. This is very common behavior for
language-specific msgpack bindings. Nvim uses msgpack as a tool to
serialize its data. Nvim is not a tool to bit-perfectly manipulate
arbitrary msgpack data out in the wild.

The changed tests should indicate how behavior changes in various edge
cases.
2024-06-27 11:04:04 +02:00
Matt Fellenz
fc9b70826e fix(lsp): avoid vim.keymap.del error when stopping a client (#29478) 2024-06-26 17:03:46 +02:00
dundargoc
76dd07e572 Merge pull request #29280 from echasnovski/with-owobogo
Add several updates to `vim._with` (tests, granular option contexts, `env` context)
2024-06-26 12:23:34 +02:00
zeertzjq
9dc09a4cdd ci(lintcommit): allow capitalized letter after colon in description (#29480) 2024-06-26 05:08:15 +08:00
Yinzuo Jiang
9e436251de vim-patch:9.1.0516: need more tests for nested dicts and list comparison (#29481)
Problem:  need more tests for nested dicts and list comparison
Solution: Add tests for comparing deeply nested List/Dict values
          (Yegappan Lakshmanan)

closes: vim/vim#15081

88bbdb04c2

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-06-25 11:34:37 +08:00
zeertzjq
295e223a28 vim-patch:62f7b55: runtime(netrw): save and restore register 0-9, a and unnamed (#29479)
fixes: vim/vim#15077

62f7b55c1a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-25 09:38:50 +08:00
zeertzjq
1922f7e32b vim-patch:ecd642a: runtime(doc): clarify, that register 1-9 will always be shifted (#29476)
related: vim/vim#15077

ecd642af43

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-25 06:18:57 +08:00
Evgeni Chasnovski
cd53db2157 feat(lua): add context.env (environment variables) to vim._with() 2024-06-24 20:23:11 +03:00
Evgeni Chasnovski
07cc559cdf feat(lua): update vim._with to allow more granular option contexts
Problem: with a single `context.options` there is no way for user to
  force which scope (local, global, both) is being temporarily set and
  later restored.

Solution: replace single `options` context with `bo`, `go`, `wo`, and
  `o`. Naming and implementation follows how options can be set directly
  with `vim.*` (like `vim.bo`, etc.).
  Options are set for possible target `win` or `buf` context.
2024-06-24 20:23:11 +03:00
Evgeni Chasnovski
f8795365de test(lua): cover vim._with() with tests
Problem: `vim._with()` has many different use cases which are not
  covered with tests.

Solution: cover with tests. Some (many) test cases are intentionally
  marked as "pending" because they cover cases which don't work as
  expected at the moment (and fixing them requires specific knowledge of
  C codebase). Use them as a reference for future fixes.
  Also some of "can be nested" tests currently might pass only because
  the tested context doesn't work.
2024-06-24 20:23:11 +03:00
Tom Praschan
5581a95534 feat(lsp): vim.lsp.buf.format() supports textDocument/rangesFormatting #27323
While this relies on a proposed LSP 3.18 feature, it's fully backwards
compatible, so IMO there's no harm in adding this already.

Looks like some servers already support for this e.g.
- gopls: https://go-review.googlesource.com/c/tools/+/510235
- clangd: https://github.com/llvm/llvm-project/pull/80180

Fixes #27293
2024-06-24 07:54:56 -07:00
zeertzjq
b0e5990907 refactor(filetype): change some patterns to extensions (#29472)
Ref #29468
2024-06-24 22:12:15 +08:00
Riley Bruins
c57a85e0ed perf(treesitter): remove unnecessary foldexpr loop
Instead of looping over all captured nodes, just take the end range from
the last node in the list. This uses the fact that nodes returned by
iter_matches are ordered by their range (earlier to later).
2024-06-24 14:10:25 +02:00
bfredl
0a789a8182 Merge pull request #29358 from bfredl/typvalpack
refactor(typval): don't use msgpack_packer for msgpackdump()
2024-06-24 11:30:31 +02:00
bfredl
2bb1a18631 refactor(typval): don't use msgpack_packer for msgpackdump()
Step towords completely eliminating msgpack_packer.
2024-06-24 10:38:36 +02:00
Luuk van Baal
da4e8dc5b0 fix(treesitter): do not modify highlight state for _on_spell_nav
Problem:  Treesitter highlighter clears the already populated highlight
          state when performing spell checking while drawing a
          smoothscrolled topline.
Solution: Save and restore the highlight state in the highlighter's
          _on_spell_nav callback.
2024-06-24 09:22:27 +01:00
Christian Clason
be999e6a0e vim-patch:01a4fb1: runtime(java): Compose "g:java_highlight_signature" and "g:java_highlight_functions"
With the variables defined, distinctly highlight parts of
a method declaration header: its name and parameter list
parens, from its type parameters, return type, and formal
parameters; and distinctly highlight parts of a lambda
expression: its parameter list parens and the arrow, from
its formal parameters and identifiers.

closes: vim/vim#15083

01a4fb104d

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-06-23 12:20:08 +02:00
TheLeoP
6c3f7e7e27 fix(gen_vimdoc): correctly generate function fields 2024-06-22 20:00:13 +01:00
zeertzjq
5a8a34dafa fix(filetype): source ftdetect/* after creating scripts.vim autocmds (#29445) 2024-06-22 21:17:36 +08:00
zeertzjq
6796f7cf61 vim-patch:fc64ac0: runtime(vim): Update base-syntax, fix function tail comments (#29450)
Match Vim9-script comments after :def and :enddef and legacy-script
comments after :func and :endfunc, in any definition context.

Highlight incorrect comment types after these commands as errors.

fixes: vim/vim#15062
closes: vim/vim#15072

fc64ac0be2

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-06-22 19:46:13 +08:00
Christian Clason
d82efeccc7 vim-patch:9.1.0506: filetype: .envrc & .prettierignore not recognized
Problem:  filetype: .envrc & .prettierignore not recognized
Solution: Detect '.envrc' as shell and '.prettierignore' as gitignore
          filetype (Tyler Miller)

Support ft detection for `.envrc` files used by direnv, and
`.prettierignore` files used by prettier.

closes: vim/vim#15053
resolves: neovim/neovim#29405

49012cd8c2

Co-authored-by: Tyler Miller <tmillr@proton.me>
2024-06-21 11:17:33 +02:00
Christian Clason
5eb604c642 vim-patch:17e0a19: runtime(scheme): update runtime files
Add TODO highlighting, disable text-wrapping, add "define-library" to
lispwords on CHICKEN. Update MAINTAINERS.

closes: vim/vim#15063

17e0a1969d

Co-authored-by: Evan Hanson <evhan@foldling.org>
2024-06-21 11:03:47 +02:00
Christian Clason
7306adaebc vim-patch:beb02ed: runtime(java): Optionally highlight parameterised types
In the presence of parameterised types whose names begin
with a capital letter and end with a less-than sign "<" that
introduces a type argument or a list of comma-separated type
arguments, followed by a greater-than sign ">", a variable
"g:java_highlight_generics" can be defined to have some
components of such types uniformly coloured (by picking
highlight groups for javaGenericsC{1,2}, javaWildcardBound).

For example,
------------------------------------------------------------
java.io.InputStream stream = java.io.InputStream.nullInputStream();
java.util.function.Function<String,
    java.util.function.BiFunction<String, String, String>> updater =
	property -> (oldValue, newValue) -> oldValue;
java.util.logging.LogManager.getLogManager()
    .updateConfiguration(stream, updater);
------------------------------------------------------------

Note that the diamond form and explicit type arguments do
not qualify for this kind of recognition.

For example,
------------------------------------------------------------
new java.util.HashSet<>().<String>toArray(new String[0]);
------------------------------------------------------------

References:
https://docs.oracle.com/javase/specs/jls/se21/html/jls-4.html#jls-4.5
https://docs.oracle.com/javase/specs/jls/se21/html/jls-15.html#jls-15.9
https://docs.oracle.com/javase/specs/jls/se21/html/jls-15.html#jls-15.12.2.1

closes: vim/vim#15050

beb02ed674

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-06-21 11:03:47 +02:00
zeertzjq
1db1476fd9 vim-patch:9.1.0512: Mode message for spell completion doesn't match allowed keys (#29437)
Problem:  Mode message for spell completion doesn't match allowed keys
          (Kyle Kovacs)
Solution: Show "^S" instead of "s".
          (zeertzjq)

This matches the code in vim_is_ctrl_x_key():

	case CTRL_X_SPELL:
	    return (c == Ctrl_S || c == Ctrl_P || c == Ctrl_N);

fixes: neovim/neovim#29431
closes: vim/vim#15065

7002c055d5
2024-06-21 14:40:28 +08:00
zeertzjq
a5d8e5336a Merge pull request #29436 from zeertzjq/vim-9.1.0507
vim-patch:9.1.{0507,0511}: CursorMovedC autocommand
2024-06-21 14:35:24 +08:00
zeertzjq
f45403db19 vim-patch:9.1.0511: CursorMovedC triggered wrongly with setcmdpos()
Problem:  CursorMovedC triggered wrongly with setcmdpos()
          (after v9.1.0507)
Solution: Remove the premature triggering.  Also don't trigger when
          cursor didn't move. (zeertzjq)

closes: vim/vim#15064

bc6f96708e
2024-06-21 14:13:33 +08:00
zeertzjq
86ea42ce26 vim-patch:9.1.0507: hard to detect cursor movement in the command line
Problem:  hard to detect cursor movement in the command line
Solution: Add the CursorMovedC autocommand
          (Shougo Matsushita)

closes: vim/vim#15040

d09521476f

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2024-06-21 14:10:30 +08:00
yuyk
26c2a56d99 vim-patch:6ccf6da: runtime(gomod): add gomod filetype plugin (#29433)
closes: vim/vim#15060

6ccf6da7a2
2024-06-21 12:36:57 +08:00
Jaehwang Jung
0e3e1e6b6d fix(treesitter): don't open fold when o/O adds a line below #28709
Problem:
`o`-ing on a folded line opens the fold, because the new line gets the
fold level from the above line (level '='), which extends the fold to
the new line. `O` has a similar problem when run on the line below a
fold.

Solution:
Use -1 for the added line to get the lower level from the above/below
line.
2024-06-20 06:37:09 -07:00
zeertzjq
b923fcbaf0 build(vim-patch.sh): don't ignore changes to version*.txt (#29425)
Suggest adding them to news.txt instead.

Also don't ignore changes to intro.txt and sponsor.txt, as they don't
change much these days, and it's necessary to consider whether to
include their changes in Nvim's intro.txt.
2024-06-20 20:16:53 +08:00
zeertzjq
af0021f990 vim-patch:9.1.0505: filetype: Faust files are not recognized (#29426)
Problem:  filetype: Faust files are not recognized
Solution: Detect '*.lib' files as Faust filetype, add detection for
          '*.dsp' files (Faust or Make), remove '*.lib' from Cobol
          filetype (PowerUser64)

closes: vim/vim#14894

aa61b8a908

Co-authored-by: PowerUser64 <blake@blakenorth.net>
2024-06-20 17:45:41 +08:00
Christian Clason
ac6f0c02cf vim-patch:94c5d8a: runtime(java): Remove the group exclusion list from @javaTop
Instances of anonymous classes can be passed as method
arguments and should be subject to line folding as well.

closes: vim/vim#15048

94c5d8a5e2

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-06-20 09:28:01 +02:00
zeertzjq
978b0263f8 Merge pull request #29413 from jiangyinzuo/vim-patch-9.1.0497
vim-patch:partial:9.1.{0497,0501}: termdebug can be further improved
2024-06-20 12:29:47 +08:00
Yinzuo Jiang
99373c8792 vim-patch:partial:9.1.0501: too complicated mapping restore in termdebug
Problem:  too complicated mapping restore in termdebug
Solution: simplify unmapping logic, add a few more tests
          (Ubaldo Tiberi)

closes: vim/vim#15046

46f2823807

Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
2024-06-20 10:49:24 +08:00
zeertzjq
3317aa2f37 vim-patch:9.1.0504: inner-tag textobject confused about ">" in attributes (#29420)
Problem:  inner-tag textobject confused about ">" in attributes
Solution: Skip over quoted '>' when determining the start position

fixes: vim/vim#15043
closes: vim/vim#15049

ca7f93e6f3

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-20 09:57:00 +08:00
Christian Clason
38a1d41ac0 vim-patch:aeca717: runtime(nohlsearch): simplify mapping
Use <cmd> instead of <expr> with execute(...)[-1]

closes: vim/vim#15047

aeca7176f3

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-06-19 22:50:54 +02:00
Justin M. Keyes
ceea6898a8 fix(gen_help_html): handle delimiter, heading #29415
Problem:
vimdoc grammar added new forms that are not handled in our HTML
generator. https://github.com/neovim/tree-sitter-vimdoc/pull/134

Solution:
Update `gen_help_html.lua`.

Fixes #29277
2024-06-19 09:45:40 -07:00
Riley Bruins
e5e81262af fix(diagnostics): don't apply extmarks to invalid lines #29321
Problem:
If there are errors in the last line of a buffer, something like `Gdk` or
`G2k3J` will produce an error (at least with `lua_ls`):

    Error executing vim.schedule lua callback:
    .../neovim/share/nvim/runtime/lua/vim/diagnostic.lua:1446: Invalid 'line': out of range

Solution:
Only set extmarks if the target buffer line still exists
2024-06-19 09:28:44 -07:00
Yinzuo Jiang
b48192af37 vim-patch:partial:9.1.0497: termdebug can be further improved
Problem:  termdebug can be further improved
Solution: refactor save/restore, update docs,
          add a new save/restore test (Ubaldo Tiberi)

closes: vim/vim#15032

a48637c105

Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
2024-06-19 21:23:21 +08:00
Christian Clason
fe5d1279a4 vim-patch:1ce65e3: runtime(csv): include a simple csv filetype and syntax plugin (#29395)
* vim-patch:1ce65e3: runtime(csv): include a simple csv filetype and syntax plugin

fixes: vim/vim#15038

1ce65e35ac

Co-authored-by: Maxim Kim <habamax@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-06-19 09:41:03 +02:00
zeertzjq
b1c439cef6 fix(drawline): don't draw beyond end of window with 'rnu' (#29406) 2024-06-19 09:20:24 +08:00
zeertzjq
b381b2d529 Merge pull request #29404 from zeertzjq/vim-8.2.4724
vim-patch:8.2.{4724,5047}: make CurSearch behavior match Vim
2024-06-19 08:24:29 +08:00
zeertzjq
a2a3e8412e vim-patch:8.2.5047: CurSearch highlight is often wrong
Problem:    CurSearch highlight is often wrong.
Solution:   Remember the last highlighted position and redraw when needed.

368137aa52

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-06-19 08:02:29 +08:00
zeertzjq
14aba67967 vim-patch:8.2.4724: current instance of last search pattern not easily spotted
Problem:    Current instance of last search pattern not easily spotted.
Solution:   Add CurSearch highlighting. (closes vim/vim#10133)

a43993897a

Some code is superseded by later patches that are already ported.

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-06-19 08:02:02 +08:00
zeertzjq
a2d510e101 vim-patch:9.1.0499: MS-Windows: doesn't handle symlinks properly (#29400)
Problem:  MS-Windows: doesn't handle symlinks properly
          (Timothy Madden)
Solution: Implement lstat() on MS-Windows
          (author)

lstat() differs from stat() in how it handles symbolic links, the former
doesn't resolve the symlink while the latter does so.

Implement a simple yet effective fallback using Win32 APIs.

fixes vim/vim#14933
closes: vim/vim#15014

23c5ebeb95

Co-authored-by: LemonBoy <thatlemon@gmail.com>
Co-authored-by: K.Takata <kentkt@csc.jp>
2024-06-19 06:32:02 +08:00
Christian Clason
6012f79557 vim-patch:9718ed7: runtime(filetype): update htmldjango detection
- update tags to detect djangohtml based on
  https://docs.djangoproject.com/en/5.0/ref/templates/builtins/#built-in-tag-reference

- increase the lines to inspect to 40 lines

  10 lines is too few and might result in high false negative.
  Increasing it to 40 lines should reduce the false negative.

closes: vim/vim#15037

9718ed7ab9

Co-authored-by: Afiq Nazrie <afnazrie@gmail.com>
2024-06-19 00:22:58 +02:00
luukvbaal
102971a396 fix(mouse): early return when clicking in padded 'statuscolumn' (#29394)
Problem:  Hit assert when clicking inside a padded 'statuscolumn' that
          is padded beyond the length of the allocated click_defs.
Solution: Still consider this a "in_statuscol" click, but return early
          when about to execute the click func.
2024-06-19 06:00:39 +08:00
Christian Clason
2791fd4e17 vim-patch:26de90c: runtime(nohlsearch): include the the simple nohlsearch package
fixes: vim/vim#15039
closes: vim/vim#15042

26de90c631

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-06-18 23:59:39 +02:00
zeertzjq
4e8ec4900e vim-patch:9.1.0498: getcmdcompltype() interferes with cmdline completion (#29397)
Problem:  getcmdcompltype() interferes with cmdline completion.
Solution: Don't set expand context when it's already set.
          (zeertzjq)

closes: vim/vim#15036

a821b609f9
2024-06-19 05:47:25 +08:00
zeertzjq
b0c336eaf8 refactor(lua): remove unnecessary strlen() in nlua_expand_pat() (#29388)
Also change the initial value of `status` to `FAIL`, as that'll avoid
unnecessary assignments.
2024-06-18 12:02:31 +08:00
Rafael Kitover
1a1c766049 refactor: Windows tilde expansion followup (#29380)
Followup to #28515:

Rename the static os_homedir() to os_uv_homedir() to emphasize that it
is a wrapper around a libuv function.

Add the function os_get_homedir() to os/env.c to return the cached
homedir value as a const. Must be called after homedir is initialized or
it fails.

The difference between this function and the static os_uv_homedir() is
that the latter gets the homedir from libuv and is used to initialize
homedir in init_homedir(), while os_get_homedir() just returns homedir
as a const if it's initialized and is public.

Use the os_get_homedir() accessor for ~/ expansion on Windows to make
the code more concise.

Add a Windows section to main_spec.lua with tests for expanding ~/ and
~\ prefixes for files passed in on the command-line.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-06-18 11:23:52 +08:00
zeertzjq
948f2beed4 fix(lua): find length of completion prefix earlier (#29384)
Do the expansion right after setting the expand context, so that the
length of the completion prefix can be set, but don't do that directly
in set_one_cmd_context(), as that's also called by getcmdcompltype().
2024-06-18 09:47:10 +08:00
zeertzjq
9d200c78a5 vim-patch:ca47114: runtime(doc): improve the vim-shebang example (#29382)
ca47114532

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-18 07:11:17 +08:00
Yi Ming
7ce261c064 docs(lsp): format the handwritten part #29295 2024-06-17 16:04:40 -07:00
zeertzjq
a46991e1c6 docs(news): fix inconsistencies (#29381) 2024-06-18 07:00:32 +08:00
zeertzjq
7363b695de Merge pull request #29379 from zeertzjq/vim-9.1.0495
vim-patch:9.1.{0495,0496}
2024-06-18 06:45:28 +08:00
zeertzjq
c2491fbab4 vim-patch:9.1.0496: matched text is highlighted case-sensitively
Problem:  matched text is highlighted case-sensitively
Solution: use MB_STRNICMP, update highlighting when the base changes
          (glepnir)

fixes: vim/vim#15021
closes: vim/vim#15023

f189138b39

Co-authored-by: glepnir <glephunter@gmail.com>
2024-06-18 06:18:58 +08:00
zeertzjq
c429c5f86f vim-patch:9.1.0495: Matched text isn't highlighted in cmdline pum
Problem:  Matched text isn't highlighted in cmdline pum.
Solution: Use cmdline completion pattern in cmdline mode.
          (zeertzjq)

closes: vim/vim#15029

d8c9340fc6

Cherry-pick syntax.txt change from runtime update.
2024-06-18 06:18:34 +08:00
Justin M. Keyes
b60030b7bf Merge #28775 fix(man.vim): signcolumn causes broken wrap 2024-06-17 15:09:30 -07:00
zeertzjq
20a7eebec0 vim-patch:9.1.0494: Wrong matched text highlighted in pum with 'rightleft' (#29371)
Problem:  Wrong matched text highlighted in pum with 'rightleft'.
Solution: Match using the original text instead of the reversed text.
          (zeertzjq)

closes: vim/vim#15020

63901e8963
2024-06-17 06:42:11 +08:00
zeertzjq
7746c54e10 Merge pull request #29357 from luukvbaal/statuscol
feat(column)!: rework 'statuscolumn' %r/l items
2024-06-17 06:33:15 +08:00
Christian Clason
c3cb56d8ec vim-patch:0ddab58: runtime(java): Add a config variable for commonly used compiler options
The value of g:javac_makeprg_params, if set, is added to the value of
'makeprg' as an option string.

closes: vim/vim#14999

0ddab582fa

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-06-16 23:24:55 +02:00
Christian Clason
72ddf213a1 vim-patch:917ff8a: runtime(html): bump length of character references in syntax script (vim/vim#15022)
This allows handling longer references such as
`&CounterClockwiseContourIntegral;`.

917ff8a19d

Co-authored-by: Mohamed Akram <mohd.akram@outlook.com>
2024-06-16 23:24:55 +02:00
Luuk van Baal
ad70c9892d feat(column)!: rework 'statuscolumn' %r/l items
Problem:  A custom 'statuscolumn' needs to check a bunch of options and
          placed signs to replicate the default number column.
Solution: Rework %l item to include the necessary logic to mimic the
          default number column. Remove now redundant %r item.
2024-06-16 19:04:34 +02:00
Luuk van Baal
114197517f refactor: remove redundant copy in statuscolumn items
Immediately write to buf_tmp instead of to another temporary buffer that
is later copied to buf_tmp. Misc cleanup.
2024-06-16 13:24:25 +02:00
Christian Clason
615e859a0e vim-patch:79da22d: runtime(kdl): fix KdlIndent and kdlComment in indent script (vim/vim#15019)
79da22de75

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-06-16 12:00:58 +02:00
Christian Clason
2f87d363c1 vim-patch:371bab0: runtime(java): Fold multi-line comments with the syntax kind of &fdm (vim/vim#15016)
Also:

- Restore the capability to mark as an error braces nested
  in parens with g:javaInParen.
- Try not to fold top-level-type bodies.  (Defining multiple
  package-private top level types in a single source file is
  not recommended as it can impose order among compilation
  units; so it is assumed that only one such top level type
  is usually defined.)
- Compose ‘method header’ highlighting and block braces
  folding.
- Do not highlight block braces whenever ‘method header’
  highlighting is requested.

This bundling of ‘method headers’ and block braces for
highlighting can be traced back to Vim v5.0; however, no
comment or documentation entry conveys any justification.
For example, it is hard to discover the connection between
block braces for "while", "if", etc., statements and method
body block braces.  The former behaviour can be attained in,
e.g. ~/.vim/after/syntax/java.vim:

------------------------------------------------------------
if exists("g:java_highlight_functions")
    syn clear javaBlock javaInParen
    syn match javaBlockOther "[{}]"
    syn region javaBlock transparent matchgroup=javaBlockStart
	\ start="\%(^\|^\S[^:]\+\)\@120<!{" end="}" fold
    hi def link javaBlockStart javaFuncDef
    hi def link javaBlockOther javaBlockStart

    if exists("g:java_mark_braces_in_parens_as_errors")
	syn match javaInParen contained "[{}]"
    endif
endif
------------------------------------------------------------

Note: Read ‘a method header omitting a _throws_ clause’ for
every ‘method header’ appellation used above.

371bab0594

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-06-16 12:00:58 +02:00
Christian Clason
191a70f9dd vim-patch:9.1.0492: filetype: Vim-script files not detected by shebang line
Problem:  Vim-script files may not be recognised
Solution: Add shebang line detection (Doug Kearns)

closes: vim/vim#15012

0d4d23dac0

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-06-16 11:45:44 +02:00
zeertzjq
57c377dfb2 vim-patch:9.1.0493: Test for patch 9.1.0489 doesn't fail without the fix (#29366)
Problem:  Test for patch 9.1.0489 doesn't fail without the fix.
Solution: Use "!" flag of feedkeys() so that ex_normal_busy is not set
          and ins_compl_check_keys() is not skipped (zeertzjq).

closes: vim/vim#15018

acc8746941
2024-06-16 17:30:15 +08:00
zeertzjq
aa319da402 vim-patch:9.1.0489: default completion may break with fuzzy (#29364)
Problem:  default completion may break with fuzzy
Solution: check that completion_match_array is not null
          (glepnir)

closes: vim/vim#15010

aced8c2f4f

Co-authored-by: glepnir <glephunter@gmail.com>
2024-06-16 07:07:06 +08:00
zeertzjq
7e65f3757b docs: document 'list' behavior when 'listchars' excludes "tab" (#29360) 2024-06-16 06:08:36 +08:00
zeertzjq
db7332d687 Merge pull request #29361 from zeertzjq/vim-1c6734291295
vim-patch:1c67342,52f2ff0
2024-06-16 06:08:23 +08:00
zeertzjq
c1d463fcaf vim-patch:52f2ff0: runtime(zip): revert unintended change to zip#Write()
This was wrongly included as of patch 1c6734291295bf8aa39577840b40bb
because apparently I messed up the use of git apply :/

52f2ff0363

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-16 05:52:13 +08:00
zeertzjq
6f1cbfc9ab vim-patch:1c67342: runtime(zip): MS-Windows: handle files with spaces properly
This change does the following 3 things:

1) non need to quote the file to be extracted

The zipfile plugin used to quote and fnameescape() the path to the
file to be extracted. However testing with unzip showed, that while this
works on Linux on Windows you shall not escape the blanks in filenames.

As long as the pathname is properly quoted, this words on Linux and
Windows.

2) reset shellslash (MS-Windows only)

When shellslash is set, filenames to the zip archive will be forward
quoted. However since the filename is eventually handed over to the
unzip command, we need to make sure to use native paths so that the
command will understand what file to open. Therefore, if shellslash is
set (and the shell is cmd.exe), replace any forward slashes by the
expected backslashes

3) style:
Use tabs for the Header, remove a few comments in the s:Escape() and
zip#read() functions

fixes: vim/vim#14998

1c67342912

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-16 05:51:53 +08:00
zeertzjq
203540926d vim-patch:9.1.0491: Cmdline pum doesn't work properly with 'rightleft' (#29355)
Problem:  Cmdline pum doesn't work properly with 'rightleft'.
Solution: Don't use curwin->w_p_rl in cmdline mode in pum_redraw().  Use
          a static variable since pum_may_redraw() may be called in any
          mode.  Also correct position of other popups with 'rightleft'.
          (zeertzjq)

closes: vim/vim#15005

883018feff
2024-06-15 22:37:48 +08:00
zeertzjq
c5e3321aa1 vim-patch:f4bc59c: runtime(doc): add another tag for vim-shebang feature (#29356)
related: vim/vim#15011

f4bc59c4f6

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-15 22:26:36 +08:00
zeertzjq
fc6477002c vim-patch:9.1.0490: minor style problems with patch 9.1.0487 (#29354)
Problem:  minor style problems with patch 9.1.0487
Solution: use shown_compl instead of after_first_compl variable
          (glepnir)

closes: vim/vim#15008

fix(completion): use exist shown_compl instead after_first_compl

105f741fac

Co-authored-by: glepnir <glephunter@gmail.com>
2024-06-15 22:06:29 +08:00
zeertzjq
fd2ef4edf9 vim-patch:9.1.0488: Wrong padding for pum "kind" with 'rightleft' (#29352)
Problem:  Wrong padding for pum "kind" with 'rightleft'.
Solution: Fix off-by-one error (zeertzjq).

The screen_fill() above is end-exclusive, and
- With 'rightleft' it fills `pum_col - pum_base_width - n + 1` to `col`,
  so the next `col` should be `pum_col - pum_base_width - n`.
- With 'norightleft' it fills `col` to `pum_col - pum_base_width + n - 1`,
  so the next `col` should be `pum_col - pum_base_width + n`.

closes: vim/vim#15004

a2324373eb
2024-06-15 21:39:56 +08:00
zeertzjq
bb487ea12e vim-patch:ae321b5: runtime(vim): Update base-syntax, match shebang lines (vim/vim#15011) (#29351)
Match shebang lines in Vim9 and legacy script.

Mark these as an error if they appear anywhere other than the first line
of a legacy-script file.  In Vim9 script these match as normal line
comments rather than an error.

ae321b51f7

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-06-15 21:28:23 +08:00
Christian Clason
4faad4a950 vim-patch:9.1.0486: filetype: Snakemake files are not recognized
Problem:  filetype: Snakemake files are not recognized
Solution: Detect '*.smk' and Snakefile files as snakemake filetype
          (Riley Bruins)

See:
https://snakemake.readthedocs.io/en/stable/snakefiles/deployment.html#distribution-and-reproducibility

closes: vim/vim#14992

82a579e15a

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-06-15 10:27:59 +02:00
Jerry
61aabe0730 fix(defaults): default @/Q broken when 'ignorecase' is set (#29343)
Problem:
When 'ignorecase' is set, the default keymap Q and Q would exit visual
mode.

This issue was raised in #28287 and a fix was applied in #28289.

However, `==` operator is subject to user `ignorecase` setting.

Solution:
Switching to `==#` operator would guarantee case sensitive comparison
between visual mode and linewise visual mode.

Co-authored-by: Kuanju Chen <kuanju.chen@mksinst.com>
2024-06-15 10:21:16 +08:00
zeertzjq
199d852d9f vim-patch:9.1.0487: completed item not update on fuzzy completion (#29341)
Problem:  completed item not update on fuzzy completion
Solution: reset compl_shown_match when at original match position
          (glepnir)

closes: vim/vim#14955

f94c9c482a

Co-authored-by: glepnir <glephunter@gmail.com>
2024-06-15 07:20:38 +08:00
dundargoc
6e28589e00 docs: misc (#29229)
Co-authored-by: Ilia Choly <ilia.choly@gmail.com>
Co-authored-by: Jose Pedro Oliveira <jose.p.oliveira.oss@gmail.com>
Co-authored-by: Maria José Solano <majosolano99@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-06-15 07:04:27 +08:00
zeertzjq
bcca597e17 Merge pull request #29339 from zeertzjq/vim-a3bddb759e77
vim-patch:a3bddb7,d6d4e13,262e25e,c509c00
2024-06-15 06:30:55 +08:00
zeertzjq
b969e3e0b9 vim-patch:c509c00: runtime(doc): fix wrong helptag for :defer
c509c009bb

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-15 06:09:11 +08:00
zeertzjq
a6e01d191a vim-patch:262e25e: runtime(vim): Update base-syntax, match :sleep arg
Match :sleep arg properly including a lone "m" with a leading count.

closes: vim/vim#15003

262e25e5a1

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-06-15 06:06:53 +08:00
zeertzjq
f557a985ef vim-patch:d6d4e13: runtime(doc): rewrite mkdir() doc and simplify {flags} meaning
related: vim/vim#14991

d6d4e13336

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-15 06:05:33 +08:00
zeertzjq
0600754d8d vim-patch:a3bddb7: runtime(vim): Update base-syntax, match :catch and :throw args (vim/vim#14989)
Match :catch /{pattern}/ and :throw {expr1}.

a3bddb759e

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-06-15 06:01:50 +08:00
Christian Clason
79ed11f257 vim-patch:79a14c0: runtime(keymap): include Georgian keymap
closes: vim/vim#15002

79a14c061b

Co-authored-by: Misho <nnamper@gmail.com>
2024-06-14 23:58:27 +02:00
zeertzjq
4b36a7e601 Merge pull request #29311 from zeertzjq/vim-9.1.0476
vim-patch:9.1.{0476,0478,0479,0480,0485}
2024-06-15 05:56:15 +08:00
zeertzjq
aacd6c440d vim-patch:9.1.0485: Matched text shouldn't be highlighted in "kind" and "menu"
Problem:  Matched text shouldn't be highlighted in "kind" and "menu".
Solution: Pass hlf_T instead of the attribute.  Fix indent.
          (zeertzjq)

closes: vim/vim#14996

afbe5359e9
2024-06-15 04:58:11 +08:00
zeertzjq
53b2817fd3 vim-patch:9.1.0480: fuzzy string matching executed when not needed
Problem:  fuzzy string matching executed when not needed
Solution: when no leader is available, can skip fuzzy logic, so return
          early (glepnir)

closes: vim/vim#14986

1c29602662

Co-authored-by: glepnir <glephunter@gmail.com>
2024-06-15 04:47:23 +08:00
zeertzjq
e2ef533025 vim-patch:9.1.0479: fuzzy_match_str_with_pos() does unnecessary list operations
Problem:  fuzzy_match_str_with_pos() does unnecessary list operations.
Solution: Use fuzzy_match() directly (zeertzjq).

closes: vim/vim#14987

2f95ca9fce

N/A patch:

vim-patch:9.1.0478: potential deref of NULL pointer in fuzzy_match_str_with_pos
2024-06-15 04:47:23 +08:00
zeertzjq
dc4037f612 vim-patch:9.1.0476: Cannot see matched text in popup menu
Problem:  Cannot see matched text in popup menu
Solution: Introduce 2 new highlighting groups: PmenuMatch and
          PmenuMatchSel (glepnir)

closes: vim/vim#14694

40c1c3317d

Co-authored-by: glepnir <glephunter@gmail.com>
2024-06-15 04:47:23 +08:00
zeertzjq
fd950d4998 vim-patch:9.1.0484: Sorting of completeopt+=fuzzy is not stable (#29338)
Problem:  Sorting of completeopt+=fuzzy is not stable.
Solution: Compare original indexes when scores are the same.
          (zeertzjq)

closes: vim/vim#14988

8e56747fd2
2024-06-15 04:33:19 +08:00
Mathias Fußenegger
aa47af7e69 fix(lsp): tune completion word extraction for decorated labels (#29331)
Problem:

For snippets lsp.completion prefers the label if it is shorter than the
insertText or textEdit to support postfix completion cases but clangd
adds decoration characters to labels. E.g.: `•INT16_C(c)`

Solution:

Use parse_snippet on insertText/textEdit before checking if it is
shorter than the label.

Fixes https://github.com/neovim/neovim/issues/29301
2024-06-14 19:32:34 +02:00
bfredl
ba70404c55 Merge pull request #29241 from bfredl/shadapack
refactor(shada): use msgpack_sbuffer less
2024-06-14 11:33:27 +02:00
Evgeni Chasnovski
458473acb8 fix(highlight): add StatusLineTerm/StatusLineTermNC to :color vim (#29313)
Problem: both `StatusLineTerm`/`StatusLineTermNC` are now explicitly
  used, but `:color vim` does not set them to the values used in Vim.
  This might be fine if `:color vim` is treated as "the state of default
  color scheme prior the big update", but it seems to be better treated
  as "Vim's default color scheme" (how it is documented in its header).

Solution: add `StatusLineTerm`/`StatusLineTermNC` definitions to
  'runtime/colors/vim.lua'.
  Use explicit foreground colors ('Whte'/'Black') instead of `guifg=bg`
  used in source, as the latter caused some problems in the past (if
  `Normal` is not defined, `nvim_set_hl()` can't recognize `'bg'` as the
  foreground value).
  Also realign the rest of the background conditional highlight groups.
2024-06-14 17:28:49 +08:00
Ilia Choly
0a9c81d709 refactor(lsp): use metatable for buf_versions (#29304)
This reduces the number of nil checks around buf_versions usage
Test changes were lifted from 5c33815

Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2024-06-14 11:03:58 +02:00
Tama McGlinn
81b372fecd fix(lsp): check for nil response from server (#29196)
this only changes the error message, so that it is clear that
the error is with the LSP server, rather than being a crash inside
nvim runtime scripts. We are already doing a lot of validation,
it's just that nil was being overlooked here.

This fixes issue #27395
2024-06-14 11:02:36 +02:00
Yinzuo Jiang
29e05cfb7e vim-patch:partial:9.1.0482: termdebug plugin needs more love (#29329)
Problem:  termdebug plugin needs more love
Solution: start with some more Vim9 refactoring
          to improve maintenance and readability
          (Ubaldo Tiberi)

List of Changes and the Reasoning Behind Them:

1) Introduction of InitScriptVariables() Function:

Reasoning: This function has been introduced to ensure that when you open and
close Termdebug, and then open it again, there are no leftover script variable
values from the previous session. Leftover values could potentially cause
issues. The goal is for each Termdebug session to be independent of previous
sessions. At startup, all script variables are initialized. The only exception
is g:termdebug_loaded located at the very beginning of the script to prevent
sourcing the script twice. The variables are declared at script level and
defined in InitScriptVariables().

2) More Descriptive Variable Names:

Reasoning: The names of variables have been made more comprehensive. Almost
every Termdebug buffer now has a variable to indicate its name and another
variable to indicate its number, improving code readability and
maintainability. Due to the latest discussion around the &mousemodel option
save/restore mechanism, perhaps some other variables shall be prepended with
saved_.

3) Consistent Naming for GDB Terminal Buffers:

Reasoning: The name of the GDB terminal buffer now matches the name of the GDB
program being used, e.g., 'gdb', 'mygdb', 'arm-eabi-none-gdb', etc. This
ensures clarity and consistency in identifying buffers.

4) Other minor improvements:
Moved EchoErr() on top, added another test, some refactoring, mainly changed
several 0 and 1 to true and false

closes: vim/vim#14980

ef8eab86e2

Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@volvo.com>
2024-06-14 16:37:38 +08:00
zeertzjq
874869321a vim-patch:4407461: runtime(netrw): correctly test for windows in NetrwGlob() (#29330)
use has("win32") instead of has("win64") otherwise it
won't work on x86 systems.

440746158c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-14 16:28:55 +08:00
zeertzjq
5def8714ad fix(terminal): set local values of window options (#29326) 2024-06-14 06:20:42 +08:00
zeertzjq
4a24940980 vim-patch:1487947: runtime(netrw): glob() on windows fails with [] in directory name (#29324)
fixes: vim/vim#14952
closes: vim/vim#14991

1487947fb6

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-14 05:48:37 +08:00
zeertzjq
6b022f9d8b vim-patch:9.1.0483: glob() not sufficiently tested (#29323)
Problem:  glob() not sufficiently tested
Solution: Add more tests for directory containing [] chars

related: vim/vim#14991

8b34aea1b0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-14 05:48:23 +08:00
Lewis Russell
43d8435cf8 revert: "refactor: use S_LEN macro" (#29319)
revert: "refactor: use S_LEN(s) instead of s, n (#29219)"

This reverts commit c37695a5d5.
2024-06-14 05:20:06 +08:00
zeertzjq
6589d05894 Merge pull request #29322 from zeertzjq/vim-02f3ebacfbfa
vim-patch:02f3eba,d353d27
2024-06-14 05:10:38 +08:00
zeertzjq
6ba1521687 vim-patch:d353d27: runtime(doc): restore description of "$" in col() and virtcol() (vim/vim#14981)
These are different from line() and getpos().

d353d27820
2024-06-14 04:49:21 +08:00
zeertzjq
fab3d4721f vim-patch:02f3eba: runtime(doc): deduplicate getpos(), line(), col(), virtcol()
Move the main description to getpos() and link to that from the other
functions.

closes: vim/vim#14970

02f3ebacfb
2024-06-14 04:49:18 +08:00
Christian Clason
f75053a00a vim-patch:902b766: runtime(java): Include element values in non-marker annotations (vim/vim#14979)
Make a formal definition for normal and single-element kinds
of annotations that otherwise require for their containment
to repeat each time all syntax groups that describe element
values.

Reference:
https://docs.oracle.com/javase/specs/jls/se21/html/jls-9.html#jls-9.7

902b766858

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-06-13 22:26:54 +02:00
Gregory Anders
0231265c8c fix(tui): skip TUI in ui_rgb_attached (#29096)
The ui_rgb_attached function determines if any UI is attached which
supports RGB (truecolor). We determine if the TUI supports RGB via the
'termguicolors' option which is checked at the beginning of this
function. If the TUI does not support RGB ('termguicolors' is unset), we
check to see if any _other_ UI is attached which supports RGB.

Normally, the TUI's "rgb" flag and the 'termguicolors' option are the
same. However, they may differ during startup when the "rgb" flag is set
by tui/tui.c to indicate to the core that the terminal emulator supports
truecolor. The 'termguicolors' option is not actually set until
_defaults.lua runs.
2024-06-12 19:55:28 -05:00
Gregory Anders
6311a7fe4b Merge pull request #29103 from gpanders/test-no-tgc
test: do not set termguicolors in test runner
2024-06-12 19:31:15 -05:00
Lewis Russell
53afdf360c Merge pull request #29303 from lewis6991/fix/wobuf
fix(vim.wo): never allow non-zero bufnr
2024-06-12 17:30:11 +01:00
Gregory Anders
9cac40ba1e Merge pull request #29290 from gpanders/push-wuqlkrkuypzz
Add StatusLineTerm highlight group and move terminal buffer defaults
2024-06-12 11:17:53 -05:00
Gregory Anders
d38912b59f refactor(terminal): move :terminal defaults to _defaults.lua 2024-06-12 10:43:57 -05:00
Gregory Anders
3e09fbdf82 feat(highlight): add StatusLineTerm and StatusLineTermNC groups
These highlight groups are used for the statusline in :terminal windows.
By default they link to StatusLine and StatusLineNC (respectively), so
there is no visual difference unless a colorscheme defines these groups
separately.
2024-06-12 10:43:57 -05:00
Lewis Russell
2ca678f57d test: fix vim.deprecate tests 2024-06-12 16:41:26 +01:00
Lewis Russell
8bf79bd13c fix(vim.wo): never allow non-zero bufnr 2024-06-12 15:42:56 +01:00
zeertzjq
7215512100 vim-patch:210b39c: runtime(doc): clarify documentation for "v" position at line() (#29296)
Problem: the previous documentation falsely states that "v" always
refers to the start of a visual area.  In fact, the reference of "v" and
"." complement each other.  If the cursor is at the start of
a (characterwise) visual area, then "v" refers to the end of the area.

Solution: be more verbose and explicit about the connection between "."
and "v" and also refer to |v_o| which many vim users will be familiar
with for visual areas.

210b39c2d6

Co-authored-by: Peter Aronoff <peter@aronoff.org>
2024-06-12 11:44:38 +08:00
zeertzjq
033810ba23 vim-patch:9.1.0477: block_editing errors out when using <enter> (#29294)
Problem:  block_editing errors out when using <enter>
          (Ali Rizvi-Santiago, after v9.1.0274)
Solution: Change ins_len from size_t to int so that the test
          if ins_len is negative actually works properly

Add a test, so that this doesn't regress.

fixes: vim/vim#14960

1fb9eae579

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-12 11:07:36 +08:00
zeertzjq
d73910d7f6 vim-patch:b4e648a: runtime(doc): fix typos in syntax.txt (#29293)
b4e648a006

Co-authored-by: Ken Takata <kentkt@csc.jp>
2024-06-12 11:07:22 +08:00
zeertzjq
af8001d100 Merge pull request #29292 from zeertzjq/vim-059cbe893355
vim-patch:059cbe8,959c3c8
2024-06-12 11:06:57 +08:00
zeertzjq
bbe69b4022 vim-patch:959c3c8: runtime(vim): Update base-syntax, configurable comment string highlighting (vim/vim#14931)
Allow highlighting of strings within comments to be disabled by setting
g:vimsyn_comment_strings to false.

959c3c887b

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-06-12 10:29:19 +08:00
zeertzjq
c7799b1a23 vim-patch:059cbe8: runtime(vim): Update base-syntax, match multiline continued comments (vim/vim#13936)
Match multiline (continued) line comments.

Continued tail comments are not supported yet.

059cbe8933

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-06-12 10:22:50 +08:00
Christian Clason
66a1e028e6 vim-patch:2e3b2a8: runtime(kdl): use shiftwidth() instead of &tabstop in indent script
closes: vim/vim#14962

2e3b2a8d89

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-06-12 00:02:39 +02:00
Gregory Anders
3ad977f01d feat(terminal): add support for copying with OSC 52 in embedded terminal (#29117)
When libvterm receives the OSC 52 escape sequence it ignores it because
Nvim does not set any selection callbacks. Install selection callbacks
that forward to the clipboard provider, so that setting the clipboard
with OSC 52 in the embedded terminal writes to the system clipboard
using the configured clipboard provider.
2024-06-11 13:18:06 -05:00
bfredl
39d8651283 Merge pull request #29278 from bfredl/strcat
refactor(memory): use builtin strcat() instead of STRCAT()
2024-06-11 19:21:50 +02:00
James
c37695a5d5 refactor: use S_LEN(s) instead of s, n (#29219) 2024-06-11 16:40:24 +01:00
notomo
44410d063a fix(types): add some vim.fn type annotations
Problem: Some vim.fn have no type annotations.

Solution: Add type annotations.
2024-06-11 16:37:15 +01:00
Will Hopkins
e947f226be fix(types): use vararg return type annotation
build(types): allow vararg returns in function types
2024-06-11 16:36:29 +01:00
bfredl
bbd2f340a2 refactor(memory): use builtin strcat() instead of STRCAT()
The latter was mostly relevant with the past char_u madness.

NOTE: STRCAT also functioned as a counterfeit "NOLINT" for clint
apparently. But NOLINT-ing every usecase is just the same as disabling
the check entirely.
2024-06-11 14:53:52 +02:00
Christian Clason
c06f3dbe3e vim-patch:2d88210: runtime(kdl): include syntax, indent and ftplugin files
closes: vim/vim#14956

2d88210b3c

Co-authored-by: inzuo Jiang <jiangyinzuo@foxmail.com>
Co-authored-by: Aram Drevekenin <aram@poor.dev>
2024-06-11 14:00:11 +02:00
Christian Clason
04d3ad1ded vim-patch:b8076f9: runtime(deb822sources): add missing Enabled field in syntax script
closes: vim/vim#14898

It lacks the support of Enabled: boolean option field [1]:

e.g.

  Types: deb
  Uris: https://paulcarroty.gitlab.io/vscodium-deb-rpm-repo/debs/
  Components: main
  Suites: vscodium
  Architectures: amd64 i386 arm64 armhf
  Enabled: yes
  Signed-By: /var/lib/extrepo/keys/vscodium.asc

This patch was also forwarded to upstream. [2]

[1] https://manpages.debian.org/unstable/apt/sources.list.5.en.html#DEB822-STYLE_FORMAT
[2] https://salsa.debian.org/vim-team/vim-debian/-/merge_requests/16

b8076f92a1

Co-authored-by: Kentaro Hayashi <kenhys@gmail.com>
2024-06-11 14:00:11 +02:00
Christian Clason
34b7e00eed vim-patch:7e9a1a7: runtime(svelte): basic svelte ftplugin file
closes: vim/vim#14949

7e9a1a75b8

Co-authored-by: Igor <igorlfs@ufmg.br>
2024-06-11 14:00:11 +02:00
Lewis Russell
5e49ef0af3 refactor(lua): improve type annotations 2024-06-11 12:45:43 +01:00
bfredl
19052e0a06 refactor(shada): use msgpack_sbuffer less
Work towards getting rid of libmsgpack depedency eventually.

msgpack_sbuffer is just a string buffer, we can use our own
String type.
2024-06-11 11:11:38 +02:00
bfredl
d8e384b7bf Merge pull request #29272 from luukvbaal/signcol
fix(column): clamp line number for legacy signs
2024-06-11 09:52:10 +02:00
belkka
2c160f39d3 fix(ftplugin/man.vim): hide signcolumn (auto)
Problem:
It's a common practice to set 'signcolumn=yes' (always show) instead of default 'signcolumn=auto' in order to prevent annoying horizontal shifting in editable buffers when using some popular plugins that add/remove signs on the fly. This makes signcolumn always visible and breaks the text flow of pre-formatted man pages, even when no signs are actually defined. Some other options are already tweaked in man.vim to address the issue (e.g. 'nonumber'), but not signcolumn.

Solution:
set 'signcolumn=auto' in ftplugin/man.vim.
By default there is no |signs| in man pages anyway (and I am not aware of any plugins that could define them in man pages), so 'signcolumn=auto' should behave like 'signcolumn=no', i.e. hide the empty column in order to keep buffer width same as terminal width.
In a (rare?) case when user does define some signs in man pages, signcolumn will appear (breaking the text flow).
2024-06-11 04:58:18 +03:00
belkka
3cf1c70c70 refactor(ftplugin/man.vim): rearrange setlocal commands
Problem:
1. multiple `setlocal` commands are spread across the script.
2. several options, apparently, serve the same purpose (hide UI columns) which may not be immediately clear. more options may be required to fullfill the same purpose or they could be removed all together as a group if better solution is found later
3. `setlocal nofoldenable` may be overriden by conditional block later in the script.

Solution:
1. move 'colorcolumn' and 'nolist' to the group of other options at the beginning
2. add an explanatory comment about options that disable UI columns
3. move 'nofoldenable' to the if-else block to keep relevant commands coupled
2024-06-11 04:09:50 +03:00
Luuk van Baal
1dcda86559 fix(column): clamp line number for legacy signs
Problem:  Legacy :sign API still allows placing signs beyond the end of
          the buffer. This is unaccounted for by the signcolumn tracking
          logic and is disallowed in general for the extmark API which
          implements it now.
Solution: Clamp legacy sign line number to the length of the buffer.
2024-06-10 20:00:59 +02:00
Ilia Choly
37bf4c572a fix(lsp): do not reset buf version when detaching client (#29242) 2024-06-10 18:53:08 +02:00
Justin M. Keyes
d9af8c2431 Merge #29238 from clason/feat/help-toc 2024-06-10 05:22:27 -07:00
Jon Huhn
4bd86120d4 fix(glob): handle overlapping {} condition elements #29236
This change fixes an issue where glob patterns like `{a,ab}` would not
match `ab` because the first option `a` matches, then the end of the
string is expected but `b` is found, and LPeg does not backtrack to try
the next option `ab` which would match. The fix here is to also append
the rest of the pattern to the generated LPeg pattern for each option.
This changes a glob `{a,ab}` from being parsed as

    ("a" or "ab") "end of string"

to

    ("a" "end of string" or "ab" "end of string")

Here, matching against `ab` would try the first option, fail to match,
then proceed to the next option, and match.

The sacrifice this change makes is dropping support for nested `{}`
conditions, which VSCode doesn't seem to support or test AFAICT.

Fixes #28931

Co-authored-by: Sergey Slipchenko <faergeek@gmail.com>
2024-06-10 04:23:03 -07:00
dundargoc
743c5808b6 fix(api): allow scope = 'local' with buf when using nvim_get_option_value
`nvim_get_option_value` throws a warning if both `scope` and `buf`
options are used at the same time. This is because using `buf` always
implies `scope` is local, and is therefore not needed. There's however
no need to error if `scope` is already set "local" as it's the correct
value.
2024-06-10 11:50:39 +02:00
Tom Praschan
20f22f75ee feat(lsp): include end_col, end_lnum in vim.lsp.buf.locations_to_items #29164 2024-06-09 18:14:55 -07:00
zeertzjq
40329f32d8 vim-patch:9c4389a: runtime(doc): Fix small style issues (#29263)
closes: vim/vim#14942

9c4389acc3

Co-authored-by: h-east <h.east.727@gmail.com>
2024-06-10 06:47:30 +08:00
zeertzjq
a056cc1300 vim-patch:9.1.0472: Inconsistencies between functions for option flags (#29262)
Problem:  Inconsistencies between functions for option flags.
Solution: Consistently use "unsigned int" as return type and rename
          get_bkc_value() to get_bkc_flags() (zeertzjq).

closes: vim/vim#14925

aa925eeb97
2024-06-10 06:37:56 +08:00
Christian Clason
2f752d6ad4 vim-patch:d6b4afb: runtime(java): Exclude lambda expressions from _when_ _switch-case_ label clauses (vim/vim#14945)
These guard clauses are always boolean expressions, whereas
lambda expressions can only appear in either an assignment,
a casting, or an invocation context.

References:
https://docs.oracle.com/javase/specs/jls/se21/html/jls-14.html#jls-14.11.1
https://docs.oracle.com/javase/specs/jls/se21/html/jls-15.html#jls-15.27

d6b4afb636

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-06-10 00:23:18 +02:00
Samuel Born
b6c1ce8a95 fix(runtime): add commentstring for glsl ftplugin 2024-06-09 14:51:22 +02:00
bfredl
fd52b63f1d Merge pull request #29248 from bfredl/dynamic_kvec
refactor(os/shell): we have DynamicBuffer at home
2024-06-09 14:24:48 +02:00
Christian Clason
a156038d70 docs: fix more treesitter parsing errors 2024-06-09 13:54:34 +02:00
Christian Clason
6592873f77 feat(help): use treesitter for table of contents
Problem: Creating the table of contents for `gO` is complicated.

Solution: Use treesitter instead.
2024-06-09 13:54:34 +02:00
bfredl
caa2e842a1 refactor(os/shell): we have DynamicBuffer at home
DynamicBuffer at home: KVÄCK
2024-06-09 11:53:56 +02:00
bfredl
2b2dd6accf Merge pull request #29141 from bfredl/rstream2
refactor(io): make rstream use a linear buffer
2024-06-09 11:33:00 +02:00
dundargoc
9afa1fd355 feat(lua): add vim._with
It's a function to perform operations in their own sealed context,
similar to pythons `with`. This helps ease operations where you need to
perform an operation in a specific context, and then restore the
context.

Marked as private for now as it's not ready for public use. The current
plan is to start using this internally so we can discover and fix any
problems. Once this is ready to be exposed it will be renamed to
`vim.with`.

Usage:

```lua
local ret = vim._with({context = val}, function()
  return "hello"
end)
```

, where `context` is any combination of:

- `buf`
- `emsg_silent`
- `hide`
- `horizontal`
- `keepalt`
- `keepjumps`
- `keepmarks`
- `keeppatterns`
- `lockmarks`
- `noautocmd`
- `options`
- `sandbox`
- `silent`
- `unsilent`
- `win`

(except for `win` and `buf` which can't be used at the same time). This
list will most likely be expanded in the future.

Work on https://github.com/neovim/neovim/issues/19832.

Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2024-06-08 21:38:06 +02:00
bfredl
78d21593a3 refactor(io): make rstream use a linear buffer
If you like it you shouldn't put a ring on it.

This is what _every_ consumer of RStream used anyway, either by calling
rbuffer_reset, or rbuffer_consumed_compact (same as rbuffer_reset
without needing a scratch buffer), or by consuming everything in
each stream_read_cb call directly.
2024-06-08 12:50:17 +02:00
Christian Clason
105a9e3dcf build(deps): bump tree-sitter-vimdoc to v3.0.0 2024-06-08 10:19:28 +02:00
James
4881211097 refactor: quadratic behavior in vim_findfile_stopdir (#29232)
Copies characters in-places instead. Related #27827
2024-06-08 10:12:39 +08:00
Lennard Hofmann
da6f68ee69 fix(man): filter OSC 8 hyperlink markup #29171
Problem: `man cmake` shows "8;;https://cmake.orghttps://cmake.org8;;"
Solution: Remove noise so that it shows as "https://cmake.org".
See also: https://en.wikipedia.org/wiki/ANSI_escape_code#OSC
2024-06-07 12:43:17 -07:00
altermo
f3632e14e3 feat: get/set namespace properties #28728
ref https://github.com/neovim/neovim/pull/28432
ref https://github.com/neovim/neovim/issues/28469
2024-06-07 08:33:40 -07:00
Al Colmenar
2ce4a4d91e fix(lsp): fix reverse sorting of same position text edits (#29212)
Problem:
Text edits with the same position (both line and character) were being
reverse sorted prior to being applied which differs from the lsp spec

Solution:
Change the sort order for just the same position edits
2024-06-07 11:54:43 +02:00
Mathias Fußenegger
6e45cd7f00 fix(lsp): revert buf_versions deprecation/replacement (#29217)
* Revert "fix(lsp): account for changedtick version gap on modified reset (#29170)"

This reverts commit 2e6d295f79.

* Revert "refactor(lsp): replace util.buf_versions with changedtick (#28943)"

This reverts commit 5c33815448.
2024-06-07 11:36:46 +02:00
dundargoc
6c7677e5d2 revert(commitlint): stop ignoring "fixup" commits (#29184)
This reverts 2875d45e79.

Allowing lintcommit to ignore "fixup" makes it too easy to fixup commits
to be merged on master as the CI won't give any indications that
something is wrong. Contributors can always squash their pull requests
if it annoys them too much.
2024-06-07 11:36:14 +08:00
dundargoc
8c5af0eb85 docs: misc (#28837)
Co-authored-by: Danymat <d.danymat@gmail.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Jakub Okoński <jakub@okonski.org>
Co-authored-by: John L. Villalovos <john@sodarock.com>
Co-authored-by: Maria José Solano <majosolano99@gmail.com>
Co-authored-by: Michaili K <git@michaili.dev>
Co-authored-by: TheLeoP <eugenio2305@hotmail.com>
Co-authored-by: Tobias Schmitz <tobiasschmitz2001@gmail.com>
Co-authored-by: W20MC <157727813+W20MC@users.noreply.github.com>
Co-authored-by: Will Hopkins <willothyh@gmail.com>
Co-authored-by: Yifan Hu <141280278+b0ae989c@users.noreply.github.com>
Co-authored-by: glepnir <glephunter@gmail.com>
Co-authored-by: prljav <74116121+prljav@users.noreply.github.com>
2024-06-07 10:55:14 +08:00
Christian Clason
d490a7bc5b vim-patch:ce47d32: runtime(cpp): Change 'cms' for C++ to '// %s'
fixes: vim/vim#14911
closes: vim/vim#14926

ce47d32b03

Co-authored-by: Luc Hermitte <luc.hermitte@csgroup.eu>
2024-06-07 00:17:56 +02:00
sus-domesticus
cb6c0fda71 feat(editorconfig): add support for spelling_language (#28638) 2024-06-06 09:16:43 -05:00
bfredl
972374f4e9 Merge pull request #29221 from bfredl/filebuffix
fix(fileio): copy to correct buffer position when reading
2024-06-06 15:11:04 +02:00
bfredl
84ad95fdc9 fix(fileio): copy to correct buffer position when reading
fixes #29186 (likely)

fixup for #29093 064483a2b
2024-06-06 13:48:05 +02:00
zeertzjq
78d3f47428 vim-patch:92f4e91: runtime(vim): Update base-syntax, allow whitespace before :substitute pattern (#29210)
Allow whitespace between the :substitute command and its pattern
argument.  Although unusual, it is supported and there are examples in
the wild.

Match Vi compatible :substitute commands like :s\/{string}/.  See :help
E1270.

fixes: vim/vim#14920
closes: vim/vim#14923

92f4e91590

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-06-06 06:40:11 +08:00
zeertzjq
12b43919a1 Merge pull request #29209 from zeertzjq/vim-9.1.0467
vim-patch:9.1.{0467,0469}
2024-06-06 06:27:39 +08:00
zeertzjq
1d4e894403 vim-patch:9.1.0469: Cannot have buffer-local value for 'completeopt'
Problem:  Cannot have buffer-local value for 'completeopt'
          (Nick Jensen).
Solution: Make 'completeopt' global-local (zeertzjq).

Also for some reason test Test_ColonEight_MultiByte seems to be failing
sporadically now. Let's mark it as flaky.

fixes: vim/vim#5487
closes: vim/vim#14922

529b9ad62a
2024-06-06 06:07:31 +08:00
zeertzjq
c235a063d6 vim-patch:9.1.0467: typos in some comments
Problem:  typos in some comments
          (after v9.1.0466)
Solution: fix comments
          (zeertzjq)

closes: vim/vim#14919

551d8c372e
2024-06-06 05:50:12 +08:00
Gregory Anders
d7651b27d5 fix(tui): move $COLORTERM check to _defaults.lua (#29197)
We currently check $COLORTERM in the TUI process to determine if the
terminal supports 24 bit color (truecolor). If $COLORTERM is "truecolor"
or "24bit" then we automatically assume that the terminal supports
truecolor, but if $COLORTERM is set to any other value we still query
the terminal.

The `rgb` flag of the UI struct is a boolean which only indicates
whether the UI supports truecolor, but does not have a 3rd state that we
can use to represent "we don't know if the UI supports truecolor". We
currently use `rgb=false` to represent this "we don't know" state, and
we use XTGETTCAP and DECRQSS queries to determine at runtime if the
terminal supports truecolor. However, if $COLORTERM is set to a value
besides "truecolor" or "24bit" (e.g. "256" or "16) that is a clear
indication that the terminal _does not_ support truecolor, so it is
incorrect to treat `rgb=false` as "we don't know" in that case.

Instead, in the TUI process we only check for the terminfo capabilities.
This must be done in the TUI process because we do not have access to
this information in the core Neovim process when `_defaults.lua` runs.
If the TUI cannot determine truecolor support from terminfo alone, we
set `rgb=false` to indicate "we don't know if the terminal supports
truecolor yet, keep checking". When we get to `_defaults.lua`, we can
then check $COLORTERM and only query the terminal if it is unset.

This means that users can explicitly opt out of truecolor determination
by setting `COLORTERM=256` (or similar) in their environment.
2024-06-05 08:27:56 -05:00
zeertzjq
43bd9c9c1c fix(lua): don't clamp -1 or v:maxcol in vim.highlight.range() (#29203) 2024-06-05 16:47:43 +08:00
zeertzjq
e41597c510 Merge pull request #29200 from zeertzjq/vim-9.1.0463
vim-patch:9.1.{0463,0466}
2024-06-05 15:26:24 +08:00
zeertzjq
818cb27e48 vim-patch:9.1.0466: Missing comments for fuzzy completion
Problem:  Missing comments for fuzzy completion (after 9.1.0463)
Solution: Add more comments, adjust indentation slightly
          (glepnir)

closes: vim/vim#14910

dca57fb542

Co-authored-by: glepnir <glephunter@gmail.com>
2024-06-05 15:08:31 +08:00
zeertzjq
c2e836c41c vim-patch:2a2c4ff: runtime(doc): clarify how fuzzy 'completeopt' should work
related: vim/vim#14912

2a2c4fffd7

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-05 15:08:31 +08:00
zeertzjq
164338330b vim-patch:9.1.0463: no fuzzy-matching support for insert-completion
Problem:  no fuzzy-matching support for insert-completion
Solution: enable insert-mode completion with fuzzy-matching
          using :set completopt+=fuzzy (glepnir).

closes: vim/vim#14878

a218cc6cda

Co-authored-by: glepnir <glephunter@gmail.com>
2024-06-05 15:08:31 +08:00
Andre Toerien
f69937fdbd fix(diagnostic): fix float scope filtering (#29134) 2024-06-04 16:35:44 -05:00
Christian Clason
946a839aa9 vim-patch:98b73eb: runtime(netrw): prevent accidental data loss
fixes: vim/vim#14915

98b73eb645

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-04 23:15:50 +02:00
Saltaformajo
230bc34ca5 fix(lsp): check if buffer is valid before LspDetach autocmd (#29162) 2024-06-04 17:23:57 +02:00
jdrouhard
43581011e4 fix(lsp): remove superfluous on_detach callback from semantic tokens module (#29174)
LspDetach is now triggered by the main on_detach callback that is added
when an LSP client is attached to a buffer. The semantic_tokens module
already includes a LspDetach handler that does the right thing. When the
LspDetach trigger was added to the main LSP on_detach, it created a race
condition in semantic tokens when a buffer was deleted that would
trigger both its own on_detach and the LspDetach handlers. If the former
came last, an error was thrown trying to delete a non-existent augroup
(destroy() was being called twice).
2024-06-04 17:22:02 +02:00
Mathias Fußenegger
2e6d295f79 fix(lsp): account for changedtick version gap on modified reset (#29170)
Follow up to https://github.com/neovim/neovim/pull/28943
Fixes https://github.com/neovim/neovim/issues/29163
2024-06-04 17:21:37 +02:00
luukvbaal
b66106a46c fix(ui): superfluous showmode / excessive grid_cursor_goto #29089
Problem:  Unsetting global variables earlier in #28578 to avoid
          recursiveness, caused superfluous or even unlimited
          showmode().
Solution: Partly revert #28578 so that the globals are unset at the end
          of showmode(), and avoid recursiveness for ext UI by adding a
          recursive function guard to each generated UI call that may
          call a Lua callback.
2024-06-04 06:09:12 -07:00
Ilia Choly
8cbb1f20e5 refactor(lua): use tuple syntax everywhere #29111 2024-06-04 06:06:02 -07:00
Luis Calle
61025c9e7a feat(install): mention standard paths, XDG vars in Windows installer #29101
fix #25207

The `.wxs` files were copied from
- cmake repo (BSD 3-Clause License)
  https://github.com/Kitware/CMake/blob/master/Utilities/Release/WiX/install_dir.wxs
- wix repo [Microsoft Reciprocal License](b40e9a32c2/LICENSE.TXT))
  b40e9a32c2/src/ext/UIExtension/wixlib/WixUI_InstallDir.wxs
2024-06-04 05:51:35 -07:00
Christian Clason
8369590eb2 fix(runtime): remove obsolete ftplugin/calender.lua 2024-06-04 12:54:34 +02:00
Lewis Russell
ae0d562644 refactor(spell.c): reduce scope of locals 2024-06-04 11:07:01 +01:00
Evgeni Chasnovski
aa9f21ee95 fix(filetype): fix typos in filetype detection 2024-06-04 11:26:27 +02:00
James Tirta Halim
46b69aaf14 fixup: include nvim/ascii_defs.h 2024-06-04 09:42:19 +01:00
James Tirta Halim
200e7ad157 fixup: apply the change on more files 2024-06-04 09:42:19 +01:00
James Tirta Halim
4b3845be2e fixup: LNUL 2024-06-04 09:42:19 +01:00
James Tirta Halim
a18982cb83 refactor: replace '\0' with NUL 2024-06-04 09:42:19 +01:00
Christian Clason
2f5b8a0092 vim-patch:9.1.0464: no whitespace padding in commentstring option in ftplugins
Problem:  no whitespace padding in commentstring option in ftplugins
Solution: Change default to include whitespace padding, update
          existing filetype plugins with the new default value
          (Riley Bruins)

closes: vim/vim#14843

0a0830624a

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-06-04 10:38:55 +02:00
zeertzjq
e20c5fba2c vim-patch:partial:8.2.3637: typos in test files (#29172)
Problem:    Typos in test files.
Solution:   Correct the typos. (Dominique Pellé, closes vim/vim#9175)

923dce2b07

Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
2024-06-04 06:07:20 +08:00
ippachi
5aa9906676 fix(lsp): use client.id instead of pairs index (#29143)
Problem: Completion side effects not working randomly.

Solution: When creating the table of LSP responses, the table index
was used, but this is not the same as the actual client_id, so it was changed
to use the client_id directly.
2024-06-03 18:07:09 +02:00
dundargoc
a9c89bcbf6 fix(gx): allow @ in url
This will make `gx` work for links for the form
https://hachyderm.io/@neovim.
2024-06-03 15:33:10 +02:00
Soham Shanbhag
054a287dbe feat(ftplugin): change 'commentstring' to // %s for C/C++ (#29085)
Problem: The default commentstring for C/C++ can lead to invalid code 
when commenting and does not match the Nvim codebase.

Solution: Change commentstring to `// %s` as used by Neovim. Also
set all commentstrings that derive from the default C string explicitly
(and correctly).
2024-06-03 09:48:43 +02:00
zeertzjq
3a1515bfee vim-patch:partial:9.1.0461: too many strlen() calls in drawline.c (#29150)
Problem:  too many strlen() calls in drawline.c
Solution: Refactor code to avoid strlen()
          (John Marriott)

closes: vim/vim#14890

f51ff96532

Co-authored-by: John Marriott <basilisk@internode.on.net>
2024-06-03 05:38:06 +08:00
zeertzjq
0c9f7f5f96 vim-patch:9.1.0458: Coverity complains about division by zero (#29149)
Problem:  Coverity complains about division by zero
Solution: Check explicitly for sw_val being zero

Shouldn't happen, since tabstop value should always be larger than zero.
So just add this as a safety measure.

7737ce519b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-03 05:35:02 +08:00
Christian Clason
659d3dcd2e vim-patch:9.1.0460: filetype: lintstagedrc files are not recognized
Problem:  filetype: lintstagedrc files are not recognized
Solution: recognize '.lintstagedrc' files as json filetype
          (İlyas Akın)

see: https://github.com/lint-staged/lint-staged

closes: vim/vim#14897

7577afd5ef

Co-authored-by: İlyas Akın <ilyas.akin@kuika.com>
2024-06-02 23:01:20 +02:00
bfredl
89dc8f8f4e Merge pull request #29124 from bfredl/inputring
refactor(input): don't use a ring for input
2024-06-02 10:19:55 +02:00
Mathias Fußenegger
19be3d2683 fix(lsp): trim trailing whitespace from completion words (#29122)
the `complete()` mechanism doesn't play nicely with trailing newlines or
tabs. A newline causes it to insert a null character, showing up as
`^@`.
2024-06-02 09:54:15 +02:00
zeertzjq
24cb9ba6d3 Merge pull request #29136 from zeertzjq/vim-8.2.0083
vim-patch:8.2.{0083,0109}
2024-06-02 15:37:11 +08:00
zeertzjq
56337310ef test: add a test for #29119 2024-06-02 15:18:30 +08:00
zeertzjq
97d9d71bf3 vim-patch:8.2.0109: corrupted text properties when expanding spaces
Problem:    Corrupted text properties when expanding spaces.
Solution:   Reallocate the line. (Nobuhiro Takasaki, closes vim/vim#5457)

ac15fd8c67

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-06-02 15:03:53 +08:00
zeertzjq
4374ec83cd vim-patch:8.2.0083: text properties wrong when tabs and spaces are exchanged
Problem:    Text properties wrong when tabs and spaces are exchanged.
Solution:   Take text properties into account. (Nobuhiro Takasaki,
            closes vim/vim#5427)

5cb0b93d52

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-06-02 15:00:05 +08:00
zeertzjq
05435a915a Merge pull request #29132 from zeertzjq/vim-9.1.0456
vim-patch:8.2.{4436,4437,4452},9.1.0456
2024-06-02 06:29:18 +08:00
zeertzjq
0e49c3ad1a vim-patch:9.1.0456: Left shift is incorrect with vartabstop and shiftwidth=0
Problem:  Left shift is incorrect with vartabstop and shiftwidth=0
Solution: make tabstop_at() function aware of shift direction
          (Gary Johnson)

The problem was that with 'vartabstop' set and 'shiftwidth' equal 0,
left shifts using << were shifting the line to the wrong column.  The
tabstop to the right of the first character in the line was being used
as the shift amount instead of the tabstop to the left of that first
character.

The reason was that the tabstop_at() function always returned the value
of the tabstop to the right of the given column and was not accounting
for the direction of the shift.

The solution was to make tabstop_at() aware of the direction of the
shift and to choose the tabtop accordingly.

A test was added to check this behavior and make sure it doesn't
regress.

While at it, also fix a few indentation/alignment issues.

fixes: vim/vim#14864
closes: vim/vim#14887

88d4f255b7

Co-authored-by: Gary Johnson <garyjohn@spocom.com>
2024-06-02 06:06:34 +08:00
zeertzjq
6f87779857 vim-patch:8.2.4452: test for what 8.2.4436 fixes does not check for regression
Problem:    Test for what 8.2.4436 fixes does not check for regression.
Solution:   Set several options. (Ken Takata, closes vim/vim#9830)

2dada73a4e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-06-02 06:06:34 +08:00
zeertzjq
7cbfbd3ae1 vim-patch:8.2.4437: vartabs test fails on MS-Windows
Problem:    Vartabs test fails on MS-Windows.
Solution:   Use iso8859-1 'encoding'. (Ken Takata, closes vim/vim#9818)

0f113e4f7b

Co-authored-by: K.Takata <kentkt@csc.jp>
2024-06-02 06:06:34 +08:00
zeertzjq
c81ad884c7 vim-patch:8.2.4436: crash with weird 'vartabstop' value
Problem:    Crash with weird 'vartabstop' value.
Solution:   Check for running into the end of the line.

4e889f98e9

Code change is N/A as it's superseded by virtual text changes.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-06-02 06:06:34 +08:00
zeertzjq
7a8f42dc03 vim-patch:e299591: runtime(doc): clarify 'shortmess' flag "S" (#29131)
fixes: vim/vim#14893

e299591498

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-02 06:06:12 +08:00
Justin M. Keyes
bb6190bec5 refactor: move shared messages to errors.h #26214 2024-06-01 08:19:41 -07:00
Ilia Choly
9eb0426002 fix(luacats): allow all types inside tuples 2024-06-01 12:56:43 +01:00
luukvbaal
f2083bd55c fix(column): crash with 'signcolumn' set to "number" (#29003)
Problem:  Numberwidth may depend on number of signs with text in the
          buffer and is not handled correctly for extmark signs.
Solution: Move legacy sign code for changed numberwidth so that it is
          handled properly for legacy and extmark signs alike.
2024-06-01 18:10:35 +08:00
bfredl
6d6974eae6 refactor(input): don't use a ring for input
Since paste data is handled via a separate channel, the data processed via `input_buffer` is typically just explicit keys as typed in by the user. Therefore it should be fine to use `memmove()` to always put the remaining data in front when refilling the buffer.
2024-06-01 10:52:43 +02:00
Mathias Fussenegger
138a93a057 perf(lsp): avoid repeated table lookup in completion.enable 2024-06-01 10:23:01 +02:00
Mathias Fussenegger
4c938f6d72 refactor(lsp): share completion request logic between omnifunc & trigger 2024-06-01 10:23:01 +02:00
Mathias Fussenegger
cc1f2d2ca6 perf(lsp): don't copy completion items in filter pass 2024-06-01 10:23:01 +02:00
bfredl
1d091e52f0 Merge pull request #29114 from bfredl/key_buffer
refactor(tui): use a linear buffer for buffered keys
2024-06-01 10:18:44 +02:00
bfredl
0ba087df5e refactor(tui): use a linear buffer for buffered keys
This buffer is completely emptied every time it is read from.
Thus there is no point in using a ring buffer.
2024-06-01 09:55:43 +02:00
bfredl
2008fe7b85 Merge pull request #29106 from bfredl/rwstream
refactor(io): separate types for read and write streams
2024-06-01 09:53:45 +02:00
zeertzjq
50f6d364c6 vim-patch:0bdc5d8: runtime(doc): Add ft_hare.txt to Reference Manual TOC (#29120)
while at it, also re-align ft_context.txt with the rest of the
list.

closes: vim/vim#14863

0bdc5d8241

Co-authored-by: h-east <h.east.727@gmail.com>
2024-06-01 14:47:18 +08:00
Gregory Anders
5493fcd52f test: remove checks for failed tests on Windows 2024-05-31 10:04:01 -05:00
Ilia Choly
d62d181ce0 refactor(lsp): use tuple syntax in generated protocol types (#29110) 2024-05-31 16:48:05 +02:00
Ilia Choly
217828b20c fixup! docs(luacats): add tuple support 2024-05-31 15:00:17 +01:00
Ilia Choly
d87ecfc8bc docs(luacats): add tuple support 2024-05-31 15:00:17 +01:00
Gregory Anders
4cff418564 fix(vim.text): remove assert from vim.text.hexdecode
Instead, return nil plus an error message if the input is invalid.
2024-05-31 08:25:35 -05:00
Gregory Anders
d24f3d055a test: do not set termguicolors in test runner
It's not clear why this is needed and it has adverse side effects on
other tests.
2024-05-31 08:25:35 -05:00
bfredl
c13c50b752 refactor(io): separate types for read and write streams
This is a structural refactor with no logical changes, yet. Done in
preparation for simplifying rstream/rbuffer which will require more
state inline in RStream.

The initial idea was to have RStream and WStream as sub-types
symetrically but that doesn't work, as sockets are both reading and
writing. Also there is very little write-specific state to start with,
so the benefit of a separate WStream struct is a lot smaller. Just
document what fields in `Stream` are write specific.
2024-05-31 15:01:13 +02:00
Ilia Choly
6566a59b3a refactor(lsp): use predefined types in util function signatures (#29095) 2024-05-31 14:41:10 +02:00
Christian Clason
9b3dfa3ac0 vim-patch:9.1.0454: minor issues in test_filetype with rasi test
Problem:  minor issues in test_filetype with rasi test
          (after 9.1.0453)
Solution: re-sort test_filetype, fix wrong syntax.txt help tags

f3dd6f617c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-05-31 14:11:20 +02:00
Christian Clason
07af492f63 vim-patch:9.1.0453: filetype: rasi files are not recognized
Problem:  filetype: rasi files are not recognized
Solution: regonize '*.rasi' files as rasi filetype,
          include a filetype and syntax plugin
          (Pierrick Guillaume)

ported from: https://github.com/Fymyte/rasi.vim

closes: vim/vim#14821

280e5b13ca

Co-authored-by: Pierrick Guillaume <pierguill@gmail.com>
2024-05-31 14:11:20 +02:00
Christian Clason
7c48cedf30 vim-patch:7129f2a: runtime(java): Improve the matching of lambda expressions (vim/vim#14880)
- Distinguish some formal parameters.
- Support multi-line definitions.

7129f2ad2f

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-05-31 14:11:10 +02:00
bfredl
7e44ab696a Merge pull request #29093 from bfredl/noring
refactor(fileio): use a linear buffer for FileDescriptor
2024-05-31 10:13:56 +02:00
Luis Calle
a18652ed61 fix(win-msi): add bin to PATH per-machine after installation (#29099)
#22856 made it possible for the msi installer to perform per-user
installations, which caused problems for users that already had
per-machine installations trying to update (the Windows Installer does
not support major upgrades across installation context, see #22933 and
https://stackoverflow.com/a/15498911). It was then reverted in #22949,
but the scope of the modification to the PATH environment variable was
not reverted.
2024-05-31 12:45:30 +08:00
zeertzjq
88fe467b19 Merge pull request #29102 from zeertzjq/vim-9.1.0449
vim-patch:9.1.{0449,0451}
2024-05-31 06:10:30 +08:00
zeertzjq
2de12e9bd7 vim-patch:9.1.0451: No test for escaping '<' with shellescape()
Problem:  No test for escaping '<' with shellescape()
Solution: Add a test.  Use memcpy() in code to make it easier to
          understand.  Fix a typo (zeertzjq).

closes: vim/vim#14876

88c8c547d5
2024-05-31 05:52:53 +08:00
zeertzjq
df2c3b204b vim-patch:9.1.0449: MS-Windows: Compiler warnings
Problem:  MS-Windows: Compiler warnings
Solution: Resolve size_t to int warnings

closes: vim/vim#14874

A couple of warnings in ex_docmd.c have been resolved by modifying their
function argument types, followed by some changes in various function
call sites.  This also allowed removal of some casts to cope with
size_t/int conversion.

51024bbc1a

Co-authored-by: Mike Williams <mrmrdubya@gmail.com>
2024-05-31 05:50:41 +08:00
dundargoc
783f6079b8 ci: update labeler configuration and add reviewers 2024-05-30 20:57:14 +02:00
bfredl
064483a2b4 refactor(fileio): use a linear buffer for FileDescriptor
Using a ring buffer for buffered synchronous fileio is just unnecessary
complexity.

- when reading, we always consume the _entire_ buffer before getting
  into syscalls. Thus we reset the buffer to its initial position before
  when we actually read.
- when writing and buffer is full, we always flush the entire buffer
  before starting to buffer again. So we can reset the buffer to its
  initial state.

Also no static buffers are needed for writing and skipping. Needing an
extra copy for each write completely defeated the purpose of
a ring buffer (if there had been one)
2024-05-30 11:40:02 +02:00
Mathias Fußenegger
5c33815448 refactor(lsp): replace util.buf_versions with changedtick (#28943)
`lsp.util.buf_versions` was already derived from changedtick (`on_lines`
from `buf_attach` synced the version)

As far as I can tell there is no need to keep track of the state in a
separate table.
2024-05-30 10:46:26 +02:00
Mathias Fussenegger
b2bad0ac91 feat(lsp): support postfix snippets in completion 2024-05-30 09:24:24 +02:00
Mathias Fussenegger
0df2c6b5d0 feat(lsp): use fuzzy match on filterText instead of prefix match
The `complete()` mechanism matches completion candidates against
the typed text, so strict pre-filtering isn't necessary.

This is a first step towards supporting postfix snippets (like
`items@insert` in luals)
2024-05-30 09:24:24 +02:00
crwebb85
025c874415 fix(lsp): clear lsp client diagnostics (#29050)
Problem: When an lsp client is stopped, the client will
only clear the diagnostics for the attached buffers but
not the unattached buffers.
Solution: Reset the diagnostics for the whole namespace rather than
for only the attached buffers.
2024-05-30 08:59:23 +02:00
zeertzjq
40679c764a vim-patch:8.2.3061: testing the shell option is incomplete and spread out (#29090)
Problem:    Testing the shell option is incomplete and spread out.
Solution:   Move shell tests to one file and increase coverage. (Yegappan
            Lakshmanan, closes vim/vim#8464)

054794c20f

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-05-30 14:39:48 +08:00
bfredl
f55767afe2 Merge pull request #29016 from bfredl/shadareader
refactor(shada): remove ShaDaReadDef secondary wrapper
2024-05-29 13:23:14 +02:00
Gregory Anders
efa45832ea feat: add "jump" options to vim.diagnostic.config() (#29067)
Problem: There is no easy way to configure the behavior of the default
diagnostic "jump" mappings. For example, some users way want to show the
floating window, and some may not (likewise, some way want to only move
between warnings/errors, or disable the "wrap" parameter).

Solution: Add a "jump" table to vim.diagnostic.config() that sets
default values for vim.diagnostic.jump().

Alternatives: Users can override the default mappings to use the exact
options to vim.diagnostic.jump() that they want, but this has a couple
issues:

  - While the default mappings are not complicated, they are also not
    trivial, so overriding them requires users to understand
    implementation details (specifically things like setting "count"
    properly).
  - If plugins want to change the default mappings, or configure the
    behavior in any way (e.g. floating window display), it becomes even
    harder for users to tweak specific behavior.

vim.diagnostic.config() already works quite well as the "entry point"
for tuning knobs with diagnostic UI elements, so this fits in nicely and
composes well with existing mental models and idioms.
2024-05-28 14:54:50 -05:00
dundargoc
f09f5c45fa build: reuse code for deps.txt for both deps and main build 2024-05-28 20:58:07 +02:00
Gregory Anders
1c6d920052 feat(defaults): use vim.diagnostic.jump() for default mappings (#29066)
This allows the mappings to work with a count and also enables new ]D
and [D mappings to go to the last/first diagnostic in the buffer.
2024-05-28 13:24:16 -05:00
bfredl
fc2429962a Merge pull request #29063 from bfredl/noapifile
refactor(fileio): remove useless use of FileDescriptor
2024-05-28 19:42:00 +02:00
Gregory Anders
0bdd602bf9 Merge pull request #27339 from MariaSolOs/completion
feat(lsp): completion side effects
2024-05-28 12:39:30 -05:00
Maria José Solano
e6cfcaed18 feat(snippet): add default keymaps during snippet session 2024-05-28 08:49:39 -07:00
Gregory Anders
8ba73f0e4c feat(diagnostic): add vim.diagnostic.jump() (#26745)
Deprecate vim.diagnostic.goto_prev() and vim.diagnostic.goto_next() in
favor of a unified vim.diagnostic.jump() interface.

We cannot name the function "goto()" because some of our tooling
(luacheck and stylua) fail to parse it, presumably because "goto" is a
keyword in newer versions of Lua.

vim.diagnostic.jump() also allows moving to a specific diagnostic and
moving by multiple diagnostics at a time (useful for creating mappings
that use v:count).
2024-05-28 08:51:44 -05:00
bfredl
b386334cdb refactor(shada): remove ShaDaReadDef secondary wrapper
`FileDescriptor` is already a wrapper around an fd and a buffer.
By allowing to just use the buffer without an fd, it can
already handle in-memory reads.
2024-05-28 13:36:54 +02:00
bfredl
ff7f22c28b refactor(fileio): remove useless use of FileDescriptor
FileDescriptor is used to buffer togheter many small writes to fewer
syscalls. if the data to write already is in a single buffer, it is
perfectly fine to just use os_write directly (which will take care of
the reverse problem: splitting a too big write into many syscalls)
2024-05-28 13:06:35 +02:00
Justin M. Keyes
90a4b1a59c refactor: deprecate vim.region() #28416
Problem:
`vim.region()` is redundant with `getregionpos()`.

Solution:
Deprecate `vim.region()`.
2024-05-28 03:07:13 -07:00
luukvbaal
5b6477be45 fix(ui): flush ext_cmdline events before doing cmdpreview #27950
Problem:  Unable to update the screen for external cmdline during cmdpreview.
Solution: Flush the cmdline UI before cmdpreview state.
2024-05-28 02:43:56 -07:00
zeertzjq
c272f30b1f Merge pull request #29057 from zeertzjq/vim-0b74eeceb856
vim-patch:0b74eec: runtime(stylus): remove remaining css code (vim/vim#14866)
2024-05-28 14:59:48 +08:00
zeertzjq
4e2c8dc374 vim-patch:0b74eec: runtime(stylus): remove remaining css code (vim/vim#14866)
This seems to be a forgotten fixup in 2d919d2744 (r141568461)

0b74eeceb8
2024-05-28 14:40:26 +08:00
zeertzjq
7b16c1fa84 fix(runtime): source c ftplugin properly for cpp on Windows (#29053)
On Windows, '{' is currently not treated as a wildcard char, so another
wildcard char is needed for the pattern to be treated as a wildcard.

It may be worth trying to make '{' always a wildcard char in the future,
but that'll be a bit harder as it'll be necessary to make sure '{' is
escaped at various places.
2024-05-28 06:39:07 +08:00
Maria José Solano
490c2109e6 test(lsp): add completion tests 2024-05-27 14:53:28 -07:00
Maria José Solano
ff097f2091 feat(lsp): completion side effects 2024-05-27 14:53:28 -07:00
dundargoc
6e8a728e3d refactor: fix luals type warnings 2024-05-27 20:48:46 +02:00
dundargoc
f70af5c3ca ci: bump backport action to version 3 2024-05-27 19:47:49 +02:00
Maria José Solano
608543f8a9 fix(snippet): cancel snippet session when leaving the buffer (#29031) 2024-05-27 17:18:10 +02:00
Ilia Choly
292365fa1b fix(lsp): do not detach from buffer if there are uninitialized clients (#29029)
Problem: if on_lines is called before the LSP is initialized, the buffer
is detached.
Solution: check for uninitialized clients before detaching.
2024-05-27 17:06:03 +02:00
zeertzjq
8893b7b340 vim-patch:393708c: runtime(vim): re-generate vim syntax from generator (#29041)
related: vim/vim#14861

393708cff6

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-05-27 22:38:10 +08:00
glepnir
dbc2678f46 vim-patch:9.1.0447: completion may be wrong when deleting all chars (#29040)
Problem:  completion may be wrong when deleting all chars.
Solution: reset compl_shown_match (glepnir).

closes: https://github.com/vim/vim/pull/14854

53387c55a1
2024-05-27 22:02:24 +08:00
Gregory Anders
48251134ee perf: add fast path to vim.validate (#28977)
For many small/simple functions (like those found in shared.lua), the
runtime of vim.validate can far exceed the runtime of the function
itself. Add an "overload" to vim.validate that uses a simple assertion
pattern, rather than parsing a full "validation spec".
2024-05-27 08:08:23 -05:00
Guilherme Soares
c4eb0b64bd fix(treesitter): find buffer in multiple windows #28922
Problem:
1. When interacting with multiple :InspectTree and the source buffer
   windows there is a high chance of errors due to the window ids not
   being updated and validated.
2. Not all InspectTree windows were closed when the source buffer was
   closed.

Solution:
1. Update InspectTree window id on `CursorMoved` event and validate
   source buffer window id before trying to navigate to it.
2. Close all InspectTree windows
2024-05-27 04:20:03 -07:00
Malte Dehling
104800ce2e build: "popcount" name conflict on NetBSD #28983
Problem:
    NetBSD's libc already has a function by the same name.

Solution:
    Rename popcount to xpopcount and add #if defined(__NetBSD__) to
prefer NetBSD's own implementation.  This fixes #28983.
2024-05-27 04:14:57 -07:00
zeertzjq
9a0239fdc8 fix(drawline): don't draw beyond end of window (#29035) 2024-05-27 14:37:22 +08:00
Christian Clason
ffbd09ef6a vim-patch:8607192: runtime(typescriptreact): fix highlighting nested and escaped quotes in string props (vim/vim#14852)
86071925ed

Co-authored-by: Linda_pp <rhysd@users.noreply.github.com>
2024-05-27 06:59:01 +02:00
Christian Clason
14a7644181 vim-patch:76174e7: runtime(asm): remove the indent plugin since it has too many issues
fixes: vim/vim#14791

76174e7110

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-05-27 06:59:01 +02:00
zeertzjq
22fe04452e vim-patch:9.1.0446: getregionpos() inconsistent for partly-selected multibyte char (#29032)
Problem:  getregionpos() behaves inconsistently for a partly-selected
          multibyte char.
Solution: Always use column of the first byte for a partly-selected
          multibyte char (zeertzjq).

closes: vim/vim#14851

ef73374dc3
2024-05-27 05:50:49 +08:00
luukvbaal
43a2019f09 fix(extmarks): issues with revalidating marks #28961
Problem:  Invalid marks appear to be revalidated multiple times, and
          decor is added at the old position for unpaired marks.
Solution: Avoid revalidating already valid marks, and don't use old
          position to add to decor for unpaired marks.
2024-05-26 10:55:57 -07:00
luukvbaal
bc63ffcf39 fix(tui): reset clear_region attributes during startup #28713
Problem:  Fix added in #28676 worked accidentally(used variables were
          themselves uninitialized at this point during startup) and
          does not always work.
Solution: Reset attributes when clearing regions during startup.
2024-05-26 10:54:08 -07:00
Riley Bruins
eb37241d38 fix(tohtml): properly handle multiple hl groups #29012
Problem: :TOhtml doesn't properly handle virtual text when it has
multiple highlight groups. It also improperly calculates position offset
for multi-byte virt_text characters.

Solution: Apply the `vim.api.nvim_strwidth` broadly to properly
calculate character offset, and handle the cases where the `hl` argument
can be a table of multiple hl groups.
2024-05-26 10:27:12 -07:00
Justin M. Keyes
dd54e81551 Merge #29021 TOhtml fixes 2024-05-26 10:20:59 -07:00
altermo
88c7997503 fix(tohtml): show how many warnings are hidden 2024-05-26 13:57:30 +02:00
bfredl
4f24e1b1d7 Merge pull request #29014 from bfredl/editortest
refactor(tests): more global highlight definitions
2024-05-26 13:32:51 +02:00
altermo
8cd9feb501 fix(tohtml): ignore lsp inlay hints 2024-05-26 13:14:40 +02:00
altermo
2ed6423c7e fix(tohtml): replace ipairs with pairs 2024-05-26 12:56:32 +02:00
Christian Clason
98536dd78e build(deps): bump tree-sitter-c to v0.21.3 2024-05-26 12:38:20 +02:00
Christian Clason
61b3a26e5b build(deps): bump tree-sitter-query to v0.4.0 2024-05-26 12:38:20 +02:00
Christian Clason
da7056ffff build(deps): bump luajit to HEAD - 93e87998b 2024-05-26 11:26:12 +02:00
bfredl
b90d7c36cf refactor(tests): more global highlight definitions 2024-05-26 10:24:27 +02:00
bfredl
05a65432b6 Merge pull request #29006 from bfredl/apitest
refactor(tests): use more global highlight definitions
2024-05-26 09:40:05 +02:00
bfredl
fb43741f80 refactor(tests): use more global highlight definitions 2024-05-26 09:22:20 +02:00
zeertzjq
3d39ea3ea9 vim-patch:9.1.0442: hare runtime files outdated (#29011)
Problem:  hare runtime files outdated
Solution: runtime(hare): update hare.vim to match upstream
          (Amelia Clarke)

closes: vim/vim#14836

35dfe58a54

Co-authored-by: Amelia Clarke <selene@perilune.dev>
2024-05-26 07:11:50 +08:00
Christian Clason
eaaf3d9048 vim-patch:0076ddc: runtime(debian): update Debian runtime files (vim/vim#14849)
* Add space in template for 'commentstring'
* Add 'comments' and 'commentstring' support to debcontrol
* debversions: Move Ubuntu releases outside of standard support to unsupported
  Although trust, xenial, and bionic are not EOL yet, their standard support period has ended.

Reported-by: Riley Bruins <ribru17@gmail.com>

0076ddc07d

Co-authored-by: James McCoy <jamessan@debian.org>
Co-authored-by: Riley Bruins <ribru17@gmail.com>
2024-05-25 23:51:55 +02:00
Mathias Fußenegger
7994fdba6a fix(snippet): don't override unnamed register on tabstop select (#28998) 2024-05-25 21:23:04 +02:00
Mathias Fußenegger
f03b1622ad fix(lsp): handle nil root_dir in health check (#29007)
The root directory could show up as something like:

    Root directory: ~/path/to/cwd/v:null

Despite being `nil`
2024-05-25 21:22:41 +02:00
dundargoc
520c2657bb refactor: move provider-related to where they are used 2024-05-25 20:13:17 +02:00
bfredl
1c73bd7d27 Merge pull request #28999 from bfredl/snapshot2
refactor(tests): update screen:snapshot_util() to use new-style highlights
2024-05-25 19:26:47 +02:00
bfredl
a4b5549655 refactor(tests): update screen:snapshot_util() to use new-style highlights
This makes screen:snapshot_util() generate code with the new
screen:add_extra_attr_ids { ... } pattern. For convenience,
the old-style configuration is still detected and supported (until
all tests have been refactored, which is my goal for the 0.11 cycle)

Remove the last traces of the "ignore" attr anti-pattern. This code
is no longer functional, it is just "ignore" argument being passed around
like a hot potato at this point.
2024-05-25 19:01:27 +02:00
dundargoc
52389e7243 test(unit): skip flaky 'typval.c dict extend() works' test 2024-05-25 15:15:36 +02:00
Rafael Kitover
fdeb01cd77 feat(main): expand file ~\ or ~/ prefix on Windows (#28515)
In command_line_scan() for MSWIN, expand "~\" or "~/" prefixed paths to
the USERPROFILE environment variable for the user's profile directory.

Fix #23901

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-05-25 20:44:39 +08:00
zeertzjq
bdb81afab3 refactor(lua): rewrite vim.highlight.range() (#28986)
- Use getregionpos().
- Use a single extmark for non-blockwise selection.
2024-05-25 20:37:33 +08:00
bfredl
75f6ee5b26 Merge pull request #28617 from glepnir/border_hl
fix(float): missing default highlight for title
2024-05-25 11:13:58 +02:00
zeertzjq
4757d497f3 vim-patch:9.1.0444: Not enough tests for getregion() with multibyte chars (#29000)
Problem:  Not enough tests for getregion() with multibyte chars.
Solution: Add a few more tests (zeertzjq).

closes: vim/vim#14844

dff55a3358
2024-05-25 16:53:10 +08:00
Christian Clason
b43244adaf vim-patch:5e45715: runtime(typescript): update outdated syntax files
fixes: vim/vim#14721
fixes: HerringtonDarkholme/yats.vim#277
closes: vim/vim#14840

5e45715084

Co-authored-by: rhysd <lin90162@yahoo.co.jp>
2024-05-25 09:46:33 +02:00
Christian Clason
4c7fd323ec vim-patch:b1ffc52: runtime(i3config/swayconfig): fix floating_modifier highlight (vim/vim#14841)
b1ffc52694

Co-authored-by: Josef Litoš <54900518+JosefLitos@users.noreply.github.com>
2024-05-25 09:46:33 +02:00
glepnir
8b2b1fba2a fix(float): missing default highlight for title
Problem: there is missing default title highlight when highlight not defined in title text chunk.

Solution: when attr is not set use default title highlight group.
2024-05-25 15:34:29 +08:00
dundargoc
93c55c238f test(lintdoc): check that input list is same length as output list (#28976) 2024-05-25 07:39:06 +08:00
Gregory Anders
5d26934c7c feat(lsp): update LSP healthcheck format (#28980)
This is mostly an aesthetic change, although there are a few new pieces
of information included. Originally I wanted to investigate including
server capabilities in the healthcheck, but until we have the ability to
fold/unfold text in health checks that would be too much information.
2024-05-24 18:31:25 -05:00
zeertzjq
06347a64ca vim-patch:9.1.0443: Can't use blockwise selection with width for getregion() (#28985)
Problem:  Can't use a blockwise selection with a width for getregion().
Solution: Add support for blockwise selection with width like the return
          value of getregtype() or the "regtype" value of TextYankPost
          (zeertzjq).

closes: vim/vim#14842

afc2295c22
2024-05-25 05:19:46 +08:00
Gregory Anders
28c04948a1 docs: update LSP quickstart (#28954)
The LSP quickstart can act as our true "entrypoint" for answering the
question "How do I use LSP in Neovim?" As such, it can be a little more
beginniner-friendly than other sections of our help docs by including
explanatory comments and a more fleshed out example (including a
`FileType` autocommand).

This also includes some other minor wording updates and points users
toward `:checkhealth lsp`.
2024-05-24 13:35:39 -05:00
Gregory Anders
2c6b635872 feat(defaults): add LSP default mappings (again) (#28650) 2024-05-24 11:33:49 -05:00
Gregory Anders
206f8f24a2 fix(fs): make vim.fs.root work for relative paths and unnamed buffers (#28964)
If a buffer does not have a backing file then fall back to the current
working directory.
2024-05-24 10:48:32 -05:00
Gregory Anders
e71713ba2b fix: show swapfile warning as a warning (#28971)
The new default SwapExists autocommand displays warning text (W325) but
does not use the WarningMsg highlight group as other warnings do. Use
the WARN log level when displaying this warning.
2024-05-24 10:44:02 -05:00
dundargoc
1a2e6ebc59 refactor: replace deprecated vim.loop with vim.uv 2024-05-24 16:41:02 +02:00
zeertzjq
cf4723c09b vim-patch:9.1.0440: function get_lval() is too long (#28963)
Problem:  function get_lval() is too long
Solution: factor out the get_lval_subscript() function
          (Yegappan Lakshmanan)

closes: vim/vim#14839

44cadaa18c

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-05-24 19:00:39 +08:00
zeertzjq
8db9a0e5a2 vim-patch:8.2.3158: strange error message when using islocked() with a number (#28962)
Problem:    Strange error message when using islocked() with a number.
            (Yegappan Lakshmanan)
Solution:   Check that the name is empty.

1840a7b4e3

Use ll_name_len instead.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-05-24 18:29:17 +08:00
Famiu Haque
a616272f56 feat(complete): specify reason for CompleteDone
Problem: `CompleteDone` currently does not specify the reason for why completion was done, which is problematic for completion plugins as they cannot know whether the event was triggered due to the completion being canceled, accepted, or for some other reason.

Solution: Add a `reason` key to `v:event`, which is set by `CompleteDone` to indicate why completion ended.
2024-05-24 11:57:46 +02:00
dundargoc
d123202ae6 fix: change deprecation presentation
Deprecation with vim.deprecate is currently too noisy. Show the
following warning instead:

[function] is deprecated. Run ":checkhealth vim.deprecated" for more information.

The important part is that the full message needs to be short enough to
fit in one line in order to not trigger the "Press ENTER or type command
to continue" prompt.

The full information and stack trace for the deprecated functions will
be shown in the new healthcheck `vim.deprecated`.
2024-05-24 11:08:00 +02:00
dundargoc
f864b68c5b feat: allow gx to function for markdown links
In other words, `gx` works regardless of where it was used in
`[...](https://...)`. This only works on markdown buffers.

Co-authored-by: ribru17 <ribru17@gmail.com>
2024-05-24 11:07:43 +02:00
dundargoc
6dc62c2e2b docs: extract health to its own file 2024-05-24 11:07:30 +02:00
zeertzjq
4f431bb632 vim-patch:9.1.0439: Cannot filter the history (#28958)
Problem:  Cannot filter the history
Solution: Implement :filter :history

closes: vim/vim#14835

42a5b5a6d0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-05-24 15:45:07 +08:00
zeertzjq
cd05fbef17 vim-patch:9.1.0441: getregionpos() can't properly indicate positions beyond eol (#28957)
Problem:  getregionpos() can't properly indicate positions beyond eol.
Solution: Add an "eol" flag that enables handling positions beyond end
          of line like getpos() does (zeertzjq).

Also fix the problem that a position still has the coladd beyond the end
of the line when its column has been clamped.  In the last test case
with TABs at the end of the line the old behavior is obviously wrong.

I decided to gate this behind a flag because returning positions that
don't correspond to actual characters in the line may lead to mistakes
for callers that want to calculate the length of the selected text, so
the behavior is only enabled if the caller wants it.

closes: vim/vim#14838

2b09de9104
2024-05-24 15:44:52 +08:00
zeertzjq
c836383d21 vim-patch:9.1.0438: Wrong Ex command executed when :g uses '?' as delimiter (#28956)
Problem:  Wrong Ex command executed when :g uses '?' as delimiter and
          pattern contains escaped '?'.
Solution: Don't use "*newp" when it's not allocated (zeertzjq).

closes: vim/vim#14837

3074137542
2024-05-24 15:04:33 +08:00
Christian Clason
521b9930b8 vim-patch:22ac941: runtime(i3config/swayconfig): support floating_modifier none; revert broken highlighting
- fix floating_modifier $mod normal|inverse was being hightlighted as error
  reverting the floating_modifier change from dd83b63
- will currently allow invalid syntax after floating_modifier

fixes: vim/vim#14826
closes: vim/vim#14827

22ac941208

Co-authored-by: James Eapen <james.eapen@vai.org>
Co-authored-by: JosefLitos <litosjos@fit.cvut.cz>
2024-05-24 08:32:08 +02:00
dundargoc
0e9c92a900 build: remove nix flakes (#28863)
It does not work and we don't plan on maintaining these anymore.

The flake files are being moved to
https://github.com/nix-community/neovim-nightly-overlay/pull/516
instead.
2024-05-24 01:08:36 +02:00
zeertzjq
e7859d2ad5 vim-patch:9.1.0436: Crash when using '?' as separator for :s (#28955)
Problem:  Crash when using '?' as separator for :s and pattern contains
          escaped '?'s (after 9.1.0409).
Solution: Always compute startplen. (zeertzjq).

related: neovim/neovim#28935
closes: 14832

789679cfc4
2024-05-24 05:57:00 +08:00
Christian Clason
0d3d198109 vim-patch:9.1.0435: filetype: cygport files are not recognized
Problem:  filetype: cygport files are not recognized
Solution: Recognize '*.cygport' files as sh filetype
          (Ken Takata)

https://cygwin.github.io/cygport/cygport_in.html

closes: vim/vim#14833

cd79f8fbd3

Co-authored-by: K.Takata <kentkt@csc.jp>
2024-05-23 23:47:13 +02:00
Evgeni Chasnovski
9b9f54e2c1 fix(colorscheme): underline StatusLineNC with 'notermguicolors' #28810
Problem: statusline for non-active window can be hard to distinguish
  from normal text with 'notermguicolors'. It was set to use only bold
  text to find a balance between being not too similar to active
  statusline and normal text, and be supported in enough terminal
  emulators (if it does not support 'termguicolors' there is higher
  chance that it also does not support underline).

Solution: reconsider balance by placing more emphasis on making
  non-active statusline more distinguishable.
  This also results into tabline being shown with underline which
  aligns with "make more distinguishable" shift.
2024-05-23 13:59:11 -07:00
Evgeni Chasnovski
0a2218f965 fix(comment): fall back to using trimmed comment markers (#28938)
Problem: Currently comment detection, addition, and removal are done
  by matching 'commentstring' exactly. This has the downside when users
  want to add comment markers with space (like with `-- %s`
  commentstring) but also be able to uncomment lines that do not contain
  space (like `--aaa`).

Solution: Use the following approach:
  - Line is commented if it matches 'commentstring' with trimmed parts.
  - Adding comment is 100% relying on 'commentstring' parts (as is now).
  - Removing comment is first trying exact 'commentstring' parts with
    fallback on trying its trimmed parts.
2024-05-23 15:30:53 -05:00
Saien Govender
c614969570 build(docs): update CSS #28896
Problem:
Not using minified version of bootstrap.
Don't need to load normalize with new version of bootstrap.
See https://github.com/neovim/neovim.github.io/pull/350

Solution:
Update link to bootstrap file.
Remove link to normalize.
2024-05-23 06:20:29 -07:00
Ilia Choly
af200c10cf fix(lsp): check if buffer was detached in on_init callback (#28914)
Co-authored-by: Jongwook Choi <wookayin@gmail.com>
2024-05-23 15:17:53 +02:00
Mathias Fußenegger
2908f71dc9 refactor(lsp): reuse buf_detach_client logic in on_detach (#28939) 2024-05-23 15:17:03 +02:00
Andre Toerien
5ac8db10f0 fix(lsp): trigger LspDetach on buffer delete (#28795)
Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2024-05-23 12:03:47 +02:00
zeertzjq
bdf15dbe69 vim-patch:9.1.0433: Wrong yanking with exclusive selection and ve=all (#28933)
Problem:  Wrong yanking with exclusive selection and virtualedit=all,
          and integer overflow when using getregion() on it.
Solution: Set coladd when decreasing column and 'virtualedit' is active.
          Add more tests for getregion() with 'virtualedit' (zeertzjq).

closes: vim/vim#14830

701ad50a9e
2024-05-23 14:23:09 +08:00
zeertzjq
cd48b72b60 fix(shada): restore search pattern length properly (#28929) 2024-05-23 09:10:16 +08:00
zeertzjq
8802bf875a vim-patch:9.0.1175: the set_ref_in_item() function is too long (#28926)
Problem:    The set_ref_in_item() function is too long.
Solution:   Use a separate function for more complicated types. (Yegappan
            Lakshmanan, closes vim/vim#11802)

ea125393af

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-05-23 07:32:37 +08:00
zeertzjq
a599183a27 vim-patch:8.2.0703: Vim9: closure cannot store value in outer context (#28925)
Problem:    Vim9: closure cannot store value in outer context.
Solution:   Make storing value in outer context work.  Make :disassemble
            accept a function reference.

b68b346e6d

Funcstack is Vim9script-only.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-05-23 07:04:53 +08:00
zeertzjq
5cbd6d9b9f vim-patch:9.1.0430: getregionpos() doesn't handle one char selection (#28924)
Problem:  getregionpos() doesn't handle one char selection.
Solution: Handle startspaces differently when is_oneChar is set.
          Also add a test for an exclusive charwise selection with
          multibyte chars (zeertzjq)

closes: vim/vim#14825

52a6f34887
2024-05-23 06:08:24 +08:00
Christian Clason
3d43bdc81e vim-patch:802fc04: runtime(rescript): include basic rescript ftplugin file (vim/vim#14822)
Reference: https://rescript-lang.org/docs/manual/latest/overview#comments

802fc04a78

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-05-22 23:48:32 +02:00
dundargoc
01b4da65c2 fix: merge all provider healthchecks into a single health.lua
This will help manage the overly granular checkhealth completion to go
from

```
vim.health
vim.lsp
vim.provider.clipboard
vim.provider.node
vim.provider.perl
vim.provider.python
vim.provider.ruby
vim.treesitter
```

to

```
vim.health
vim.lsp
vim.provider
vim.treesitter
```
2024-05-22 21:34:49 +02:00
dundargoc
e8f7025de1 docs: move vim.health documentation to lua.txt
`vim.health` is not a "plugin" but part of our Lua API and the
documentation should reflect that. This also helps make the
documentation maintenance easier as it is now generated.
2024-05-22 20:15:17 +02:00
Ilia Choly
339129ebc9 refactor(lsp): use supports_method where applicable 2024-05-22 09:54:16 +01:00
zeertzjq
10601ac5fa vim-patch:62ccaa6: runtime(termdebug): check for gdb file/dir before using as buffer name (#28908)
Add test so that this doesn't regress.

fixes: vim/vim#12718
closes: vim/vim#14792

62ccaa60d5

Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@volvo.com>
2024-05-22 08:41:07 +08:00
Gregory Anders
d6be78cc98 vim-patch:d1d9316: runtime(zig): refactor zig ftplugin, remove auto format (#28904)
Refactored zig ftplugin, removed upstream comment, aucmd and
auto formatting support. Updated documentation for zig configuration
settings and added new maintainer.

closes: vim/vim#13803

d1d9316c66

Co-authored-by: Tiseno <mathias.lindgren@stabelo.se>
2024-05-21 18:51:51 -05:00
zeertzjq
81a1d7258c vim-patch:9.1.0427: tests: some issues with termdebug mapping test (#28907)
Problem:  tests: some issues with termdebug mapping test
Solution: Use assert_{true,false} if suitable, change
          order of expected and actual arguments in assert() calls.
          (Ken Takata)

closes: vim/vim#14818
related: 7fbbd7f

ffed1540f3

Co-authored-by: Ken Takata <kentkt@csc.jp>
2024-05-22 07:19:12 +08:00
zeertzjq
2d8cb1bc9b Merge pull request #28905 from zeertzjq/vim-9.1.0426
vim-patch:9.1.{0426,0428}: too many strlen() calls in search.c
2024-05-22 06:54:09 +08:00
zeertzjq
59fe8ffdea vim-patch:9.1.0428: Tag guessing leaves wrong search history with very short names
Problem:  Tag guessing leaves wrong search history with very short names
          (after 9.1.0426).
Solution: Use the correct variable for pattern length (zeertzjq).

closes: vim/vim#14817

42cd192daa

Cherry-pick Test_tagbsearch() changes from patch 9.0.0767.
2024-05-22 06:37:26 +08:00
zeertzjq
b86381f425 vim-patch:9.1.0426: too many strlen() calls in search.c
Problem:  too many strlen() calls in search.c
Solution: refactor code and remove more strlen() calls,
          use explicit variable to remember strlen
          (John Marriott)

closes: vim/vim#14796

8c85a2a49a

Co-authored-by: John Marriott <basilisk@internode.on.net>
2024-05-22 06:37:26 +08:00
Ilia Choly
879d17ea8d fix(lsp): detach all clients on_reload to force buf_state reload (#28875)
Problem:  The changetracking state can de-sync when reloading a buffer
          with more than one LSP client attached.
Solution: Fully detach all clients from the buffer to force buf_state to
          be re-created.
2024-05-21 20:02:48 +02:00
Jongwook Choi
56b7a18995 docs: how to get core dump files #28826
Problem: Docs about how to obtain backtraces on Linux is not very
beginner-friendly; some users used to have difficulties in getting
stacktrace against Nvim crash.

For instance, the `core` dump file might not appear in the current
directory on Ubuntu systems with apport, and the current docs do not
fully cover such cases.

Solution: Add more hints about where core dump files can be found. For
example, on Ubuntu where apport is managing core dump files, users would
want to find them in `/var/lib/apport/coredump`.
2024-05-21 09:31:28 -07:00
Riley Bruins
a108852b00 fix(lsp): semantic token functions allow "0" bufnr #28849
aligns with ":help dev-patterns"
2024-05-21 09:25:54 -07:00
Mango The Fourth
d9a2acdab3 fix(lsp): hide layout in codelenses in virtual text (#28794) (#28807)
Problem: layout i.e. whitespace that is part of codelenses is currently
displayed as weird symbols and large amounts of spaces

Solution: replace all consecutive whitespace symbols with a single space
character when trying to display codelenses as virtual text
2024-05-21 18:23:37 +02:00
Tobias Schmitz
ad191be65e feat(signs)!: place higher-priority signs from the left #27781
Problem:
Higher-priority signs may be hidden by lower-priority signs.

Solution:
Place higher-priority signs from the left.

Example:

    nvim_buf_set_extmark(0, ns, 0, -1, {sign_text='H', priority=1})
    nvim_buf_set_extmark(0, ns, 0, -1, {sign_text='W', priority=2})
    nvim_buf_set_extmark(0, ns, 0, -1, {sign_text='E', priority=3})

Before:

            |     |
          H | W E |
          ^ |     |
Not visible

After:

  |     |
  | E W | H
  |     | ^
          Not visible

Fixes #16632
2024-05-21 09:21:42 -07:00
Ilia Choly
8263ed4670 fix(lsp): add textDocument/documentLink to capability map (#28838) 2024-05-21 18:16:53 +02:00
Jongwook Choi
7aaa4a51b7 build(vim-patch.sh): include commit subject #28767
Problem: vim-patch commits lack an informative title and summary in the
very first line of the commit message when the vim-revision is a Git SHA
hash, unlike when is a Vim version. This makes it difficult to discern
at a glance what changes are introduced by such vim-patch commits (in
git log, PR title, changelog generated by git-cliff, etc.).

BEFORE:

    vim-patch:abcdef123456

    runtime(vim): improve performance

    <some details>
    ...

Solution: Repeat the title of the upstream commit message, to improve
the clarity and visibility of the commit message.

AFTER:

    vim-patch:abcdef123456: runtime(vim): improve performance

    <some details>
    ...

Note: the `vim-patch:<hash>` token is still needed by `vim-patch.sh`
(but not necessarily in the very first line of the commit message) to
determine which vim patches have been applied. `<hash>` is internally
normalized to 7 hex digits.
2024-05-21 09:10:39 -07:00
zeertzjq
47c741e30c fix(tui): remove duplicate disabling of synchronized output (#28884)
Synchronized output is enabled and disabled inside flush_buf().
2024-05-21 20:54:20 +08:00
Christian Clason
14f9aacc9d vim-patch:8cf29e4c4a2a
runtime(matchit): update matchit plugin to v1.20

fixes: vim/vim#14814

8cf29e4c4a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-05-21 08:46:38 +02:00
zeertzjq
b7782daace vim-patch:8.2.1520: Vim9: CTRL-] used in :def function does not work (#28880)
Problem:    Vim9: CTRL-] used in :def function does not work.
Solution:   Omit count or prepend colon. (closes vim/vim#6769)

b3ea36c5bc

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-05-21 07:45:59 +08:00
Christian Clason
666911be91 vim-patch:69dff00dfb37
runtime(verilog): set commentstring option

closes: vim/vim#14810

69dff00dfb

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-05-20 22:58:05 +02:00
zeertzjq
91892f56b6 vim-patch:9.1.0399: block_editing errors out when using del (#28867)
Problem:  block_editing errors out when using del
          (@Jamarley)
Solution: Change ins_len from size_t to int and
          properly check that it doesn't become negative

There is a check in os.c that verifies that `ins_len` does not become
negative:
```
if (pre_textlen >= 0 && (ins_len = len - pre_textlen - offset) > 0)
```
However this only works, if ins_len can actually become negative and
unfortunately, ins_len has been declared as `size_t` so instead of
becoming negative it will wrap around and be very large.

So let's define it as integer, after which the condition above
properly catches this condition.

fixes: vim/vim#14734
closes: vim/vim#14735

d5c8c0920e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-05-20 21:45:02 +08:00
zeertzjq
36a9da6547 Merge pull request #28854 from zeertzjq/vim-9.1.0394
vim-patch:9.1.{0394,0395,0423}: getregionpos()
2024-05-20 21:17:21 +08:00
zeertzjq
e0259b9466 vim-patch:9.1.0423: getregionpos() wrong with blockwise mode and multibyte
Problem:  getregionpos() wrong with blockwise mode and multibyte.
Solution: Use textcol and textlen instead of start_vcol and end_vcol.
          Handle coladd properly (zeertzjq).

Also remove unnecessary buflist_findnr() in add_regionpos_range(), as
getregionpos() has already switched buffer.

closes: vim/vim#14805

c95e64f41f
2024-05-20 20:59:54 +08:00
zeertzjq
3383603c13 vim-patch:9.1.0395: getregionpos() may leak memory on error
Problem:  regionpos may leak memory on error, coverity
          complains about dereferencing Null pointer
Solution: free all list pointers (after v9.1.394),
          return early if buflist_findnr() returns NULL

closes: vim/vim#14731

b8ecedce79

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-05-20 20:50:08 +08:00
zeertzjq
d89144626e vim-patch:9.1.0394: Cannot get a list of positions describing a region
Problem:  Cannot get a list of positions describing a region
          (Justin M. Keyes, after v9.1.0120)
Solution: Add the getregionpos() function
          (Shougo Matsushita)

fixes: vim/vim#14609
closes: vim/vim#14617

b4757e627e

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2024-05-20 20:50:08 +08:00
Christian Clason
5c2616846a vim-patch:9.1.0425: filetype: purescript files are not recognized
Problem:  filetype: purescript files are not recognized
Solution: recognize '*.purs' files as purescript filetype,
          include basic purescript filetype plugin
          (Riley Bruins)

Reference: https://github.com/purescript/documentation/blob/master/language/Syntax.md#comments

closes: vim/vim#14813

155583a5c3

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-05-20 14:43:12 +02:00
Christian Clason
70c0b03e61 vim-patch:9.1.0424: filetype: slint files are not recognized
Problem:  filetype: slint files are not recognized
Solution: Detect '*.slint' files as slint filetype,
          include basic sling filetype plugin
          (Riley Bruins)

closes: vim/vim#14808

aa3104b07a

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-05-20 14:43:12 +02:00
Christian Clason
6745cd8d72 vim-patch:f295050fa524
runtime(nim): basic nim ftplugin file for comments (vim/vim#14812)

Reference: https://nim-by-example.github.io/comments/#:~:text=Comments%20in%20Nim%20begin%20with%20the%20hash%20character.&text=Multiline%20or%20block%20comments%20begin,line%20comments%20can%20be%20nested.

f295050fa5

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-05-20 14:43:12 +02:00
Christian Clason
2dfce05ec9 vim-patch:957d903cb7af
runtime(arduino): Add Arduino ftplugin and indent files (vim/vim#14811)

We already have Arduino syntax file, but we didn't have ftplugin and
indent files.

This commit adds a basic ftplugin file and a basic indent file.
Both of them are derived from {ftplugin,indent}/c.vim.

957d903cb7

Co-authored-by: K.Takata <kentkt@csc.jp>
2024-05-20 14:43:12 +02:00
Christian Clason
7d6a8438c9 vim-patch:c3d5c2fc8721
runtime(typst): include basic typst ftplugin file (vim/vim#14809)

Reference: https://typst.app/docs/reference/syntax/#comments

c3d5c2fc87

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-05-20 14:43:12 +02:00
Christian Clason
27a3e92a87 vim-patch:9c4d14dbb4ba
runtime(prisma): include basic prisma ftplugin file (vim/vim#14807)

Reference: https://www.prisma.io/docs/orm/prisma-schema/overview#comments

9c4d14dbb4

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-05-20 14:43:12 +02:00
Christian Clason
31ca341d92 vim-patch:1b5e3d21f6f3
runtime(v): include basic v ftplugin for comment support (vim/vim#14806)

1b5e3d21f6

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-05-20 14:43:12 +02:00
zeertzjq
0e187fe038 vim-patch:9.1.0409: too many strlen() calls in the regexp engine (#28857)
Problem:  too many strlen() calls in the regexp engine
Solution: refactor code to retrieve strlen differently, make use
          of bsearch() for getting the character class
          (John Marriott)

closes: vim/vim#14648

82792db631

Cherry-pick keyvalue_T and its comparison functions from patch 9.1.0256.

vim-patch:9.1.0410: warning about uninitialized variable
vim-patch:9.1.0412: typo in regexp_bt.c in DEBUG code

Co-authored-by: John Marriott <basilisk@internode.on.net>
2024-05-20 12:42:57 +08:00
Christian Clason
b16b287b8f vim-patch:9.1.0421: filetype: hyprlang files are not recognized
Problem:  filetype: hyprlang files are not recognized
Solution: recognize 'hypr{land,paper,idle,lock}.conf' files
          as 'hyprlang' filetype, add hyprlang ftplugin
          (Riley Bruins)

closes: vim/vim#14803

5f1b115afd

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-05-20 00:13:40 +02:00
Christian Clason
ee3c49a44e vim-patch:4d7892bfb1db
runtime(dart): add basic dart ftplugin file

fixes vim/vim#14793
closes vim/vim#14802

4d7892bfb1

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-05-20 00:13:40 +02:00
Christian Clason
ac19c7c8af vim-patch:36e974fdf3f5
runtime(graphql): basic ftplugin file for graphql

closes: vim/vim#14801

36e974fdf3

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-05-20 00:13:40 +02:00
Christian Clason
8b07a18947 vim-patch:df859a36d390
runtime(sql): set commentstring for sql files in ftplugin

closes: vim/vim#14800

df859a36d3

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-05-20 00:13:40 +02:00
Jongwook Choi
9a43ec13e6 fix(diagnostic): show backtrace for deprecation warnings
Problem: On nvim 11.0-dev, deprecation warnings due to an use of
hard-deprecated APIs such as:
- `vim.diagnostic.disable()`
- `vim.diagnostic.is_disabled()`
etc. are not accompanied by backtrace information. It makes difficult
for users to figure out which lines or which plugins are still using
deprecated APIs.

Solution: use `backtrace = true` in vim.deprecate() call.
2024-05-20 00:02:51 +02:00
dundargoc
0f4f7d32ce refactor!: remove nvim and provider module for checkhealth
The namespacing for healthchecks for neovim modules is inconsistent and
confusing. The completion for `:checkhealth` with `--clean` gives

```
nvim
provider.clipboard
provider.node
provider.perl
provider.python
provider.ruby
vim.lsp
vim.treesitter
```

There are now three top-level module names for nvim: `nvim`, `provider`
and `vim` with no signs of stopping. The `nvim` name is especially
confusing as it does not contain all neovim checkhealths, which makes it
almost a decoy healthcheck.

The confusion only worsens if you add plugins to the mix:

```
lazy
mason
nvim
nvim-treesitter
provider.clipboard
provider.node
provider.perl
provider.python
provider.ruby
telescope
vim.lsp
vim.treesitter
```

Another problem with the current approach is that it's not easy to run
nvim-only healthchecks since they don't share the same namespace. The
current approach would be to run `:che nvim vim.* provider.*` and would
also require the user to know these are the neovim modules.

Instead, use this alternative structure:

```
vim.health
vim.lsp
vim.provider.clipboard
vim.provider.node
vim.provider.perl
vim.provider.python
vim.provider.ruby
vim.treesitter
```

and

```
lazy
mason
nvim-treesitter
telescope
vim.health
vim.lsp
vim.provider.clipboard
vim.provider.node
vim.provider.perl
vim.provider.python
vim.provider.ruby
vim.treesitter
```

Now, the entries are properly sorted and running nvim-only healthchecks
requires running only `:che vim.*`.
2024-05-19 11:46:34 +02:00
zeertzjq
63e3a63d2f refactor(path.c): add nonnull attributes (#28829)
This possibly fixes the coverity warning.
2024-05-19 05:38:31 +08:00
zeertzjq
48c2ad5d2d vim-patch:94043780196c (#28831)
runtime(matchparen): fix :NoMatchParen not working (vim/vim#14797)

fixes: neovim/neovim#28828

9404378019
2024-05-18 15:53:26 +08:00
Christian Clason
b3e0457403 vim-patch:cf78d0df51f2
runtime(sshdconfig): add basic ftplugin file for sshdconfig (vim/vim#14790)

cf78d0df51

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-05-18 08:57:07 +02:00
zeertzjq
62eb7e79a5 vim-patch:9.1.0418: Cannot move to previous/next rare word (#28822)
Problem:  Cannot move to previous/next rare word
          (Colin Kennedy)
Solution: Add the ]r and [r motions (Christ van Willegen)

fixes: vim/vim#14773
closes: vim/vim#14780

8e4c4c7d87

Co-authored-by: Christ van Willegen - van Noort <github.com@vanwillegen-vannoort.nl>
2024-05-18 07:09:05 +08:00
zeertzjq
5947f249f8 fix(move): half-page scrolling with resized grid at eob (#28821) 2024-05-18 07:00:29 +08:00
zeertzjq
5f9e7edae6 Merge pull request #28790 from luukvbaal/vim-9.1.0414
vim-patch:9.1.{0414,0416}
2024-05-18 06:13:46 +08:00
dundargoc
512d228111 ci: change label backport to target:release
`backport` is too similar `ci:backport release-x.y` and causes
confusion.
2024-05-17 22:46:20 +02:00
Gregory Anders
4c0d18c197 fix(vim.iter): enable optimizations for arrays (lists with holes) (#28781)
The optimizations that vim.iter uses for array-like tables don't require
that the source table has no holes. The only thing that needs to change
is the determination if a table is "list-like": rather than requiring
consecutive, integer keys, we can simply test for (positive) integer
keys only, and remove any holes in the original array when we make a
copy for the iterator.
2024-05-17 14:17:25 -05:00
Luuk van Baal
f178b8ba49 vim-patch:9.1.0414: Unable to leave long line with 'smoothscroll' and 'scrolloff'
Problem:  Unable to leave long line with 'smoothscroll' and 'scrolloff'.
          Corrupted screen near the end of a long line with 'scrolloff'.
          (Ernie Rael, after 9.1.0280)
Solution: Only correct cursor in case scroll_cursor_bot() was not itself
          called to make the cursor visible. Avoid adjusting for
          'scrolloff' beyond the text line height (Luuk van Baal)

b32055e504

vim-patch:9.1.0416: some screen dump tests can be improved

Problem:  some screen dump tests can be improved (after 9.1.0414)
Solution: Make sure screen state changes properly and is captured in the
          screen dumps (Luuk van Baal)

2e642734f4
2024-05-17 20:28:14 +02:00
Justin M. Keyes
aec4938a21 feat(api): broadcast events to ALL channels #28487
Problem:
`vim.rpcnotify(0)` and `rpcnotify(0)` are documented as follows:

    If {channel} is 0, the event is broadcast to all channels.

But that's not actually true. Channels must call `nvim_subscribe` to
receive "broadcast" events, so it's actually "multicast".

- Assuming there is a use-case for "broadcast", the current model adds
  an extra step for broadcasting: all channels need to "subscribe".
- The presence of `nvim_subscribe` is a source of confusion for users,
  because its name implies something more generally useful than what it
  does.

Presumably the use-case of `nvim_subscribe` is to avoid "noise" on RPC
channels not expected a broadcast notification, and potentially an error
if the channel client reports an unknown event.

Solution:
- Deprecate `nvim_subscribe`/`nvim_unsubscribe`.
  - If applications want to multicast, they can keep their own multicast
    list. Or they can use `nvim_list_chans()` and `nvim_get_chan_info()`
    to enumerate and filter the clients they want to target.
- Always send "broadcast" events to ALL channels. Don't require channels
  to "subscribe" to receive broadcasts. This matches the documented
  behavior of `rpcnotify()`.
2024-05-17 07:37:39 -07:00
zeertzjq
42aa69b076 fix(path): avoid chdir() when resolving path (#28799)
Use uv_fs_realpath() instead.

It seems that uv_fs_realpath() has some problems on non-Linux platforms:
- macOS and other BSDs: this function will fail with UV_ELOOP if more
  than 32 symlinks are found while resolving the given path.  This limit
  is hardcoded and cannot be sidestepped.
- Windows: while this function works in the common case, there are a
  number of corner cases where it doesn't:
  - Paths in ramdisk volumes created by tools which sidestep the Volume
    Manager (such as ImDisk) cannot be resolved.
  - Inconsistent casing when using drive letters.
  - Resolved path bypasses subst'd drives.

Ref: https://docs.libuv.org/en/v1.x/fs.html#c.uv_fs_realpath

I don't know if the old implementation that uses uv_chdir() and uv_cwd()
also suffers from the same problems.
- For the ELOOP case, chdir() seems to have the same limitations.
- On Windows, Vim doesn't use anything like chdir() either. It uses
  _wfullpath(), while libuv uses GetFinalPathNameByHandleW().
2024-05-17 18:39:01 +08:00
MoonFruit
10f9173519 fix(health): broken ruby detect #28804 2024-05-17 03:25:28 -07:00
Jongwook Choi
878dcf1980 docs(gen_help_html.lua): handle modeline and note nodes
Problem:

'modeline' and 'note' are unhandled in the online HTML documentation.

Some (not all) modelines are parsed by the vimdoc parser as a node of
type 'modeline'.

Solution:

- Ignore 'modeline' in HTML rendering.
- Render 'note' text in boldface.
2024-05-17 08:18:01 +02:00
bfredl
06135cc215 Merge pull request #28785 from bfredl/nilversion
fix(version): fix vim.version().prerelease
2024-05-16 22:04:04 +02:00
Lewis Russell
50749f8df8 fix: extend the life of vim.tbl_flatten to 0.13
`vim.iter(t):flatten():totable()` doesn't handle nil so isn't a good
enough replacement.
2024-05-16 20:05:14 +01:00
bfredl
d049752e45 fix(version): fix vim.version().prerelease
fixes #28782 (when backported)
2024-05-16 20:10:54 +02:00
dundargoc
a664246171 feat: remove deprecated features
Remove following functions:
- vim.lsp.util.extract_completion_items
- vim.lsp.util.get_progress_messages
- vim.lsp.util.parse_snippet()
- vim.lsp.util.text_document_completion_list_to_complete_items
- LanguageTree:for_each_child
- health#report_error
- health#report_info
- health#report_ok
- health#report_start
- health#report_warn
- vim.health.report_error
- vim.health.report_info
- vim.health.report_ok
- vim.health.report_start
- vim.health.report_warn
2024-05-16 18:30:59 +02:00
vanaigr
4b02916334 perf(treesitter): use child_containing_descendant() in has-ancestor? (#28512)
Problem: `has-ancestor?` is O(n²) for the depth of the tree since it iterates over each of the node's ancestors (bottom-up), and each ancestor takes O(n) time.
This happens because tree-sitter's nodes don't store their parent nodes, and the tree is searched (top-down) each time a new parent is requested.

Solution: Make use of new `ts_node_child_containing_descendant()` in tree-sitter v0.22.6 (which is now the minimum required version) to rewrite the `has-ancestor?` predicate in C to become O(n).

For a sample file, decreases the time taken by `has-ancestor?` from 360ms to 6ms.
2024-05-16 16:57:58 +02:00
Justin M. Keyes
31dc627969 docs: news #28773 2024-05-16 06:28:27 -07:00
Justin M. Keyes
ecee8ef8a9 version bump 2024-05-16 14:36:13 +02:00
1956 changed files with 237687 additions and 155538 deletions

View File

@@ -6,7 +6,7 @@ freebsd_task:
name: FreeBSD
only_if: $BRANCH != "master"
freebsd_instance:
image_family: freebsd-14-0
image_family: freebsd-14-2
timeout_in: 30m
install_script:
- pkg install -y cmake gmake ninja unzip wget gettext python git

View File

@@ -18,6 +18,7 @@ Checks: >
-bugprone-not-null-terminated-result,
-bugprone-suspicious-memory-comparison,
-bugprone-switch-missing-default-case,
-bugprone-tagged-union-member-count,
-cert-env33-c,
-cert-err33-c,
-cert-err34-c,
@@ -35,6 +36,7 @@ Checks: >
-modernize-macro-to-enum,
-readability-avoid-nested-conditional-operator,
-readability-else-after-return,
-readability-enum-initial-value,
-readability-function-size,
-readability-isolate-declaration,
@@ -56,15 +58,18 @@ Checks: >
-readability-function-cognitive-complexity,
-readability-identifier-length,
-readability-magic-numbers,
-readability-math-missing-parentheses,
-readability-redundant-declaration, Conflicts with our header generation scripts,
-readability-suspicious-call-argument,
Aliases. These are just duplicates of other warnings and should always be ignored,
-bugprone-narrowing-conversions,
-cert-arr39-c,
-cert-dcl37-c,
-cert-dcl51-cpp,
-cert-exp42-c,
-cert-flp37-c,
-cert-int09-c,
-cert-msc24-c,
-cert-msc33-c,
-cppcoreguidelines-avoid-magic-numbers,

View File

@@ -10,9 +10,12 @@ insert_final_newline = true
[*.{c,h,in,lua}]
max_line_length = 100
[src/nvim/{eval,vvars}.lua]
max_line_length = 68
[*.py]
indent_size = 4
[{Makefile,**/Makefile,runtime/doc/*.txt}]
[{Makefile,**/Makefile,*.mk,runtime/doc/*.txt}]
indent_style = tab
indent_size = 8

25
.emmyrc.json Normal file
View File

@@ -0,0 +1,25 @@
{
"$schema": "https://raw.githubusercontent.com/EmmyLuaLs/emmylua-analyzer-rust/refs/heads/main/crates/emmylua_code_analysis/resources/schema.json",
"format": {
"externalTool": {
"program": "stylua",
"args": [
"-",
"--stdin-filepath",
"${file}"
]
}
},
"diagnostics": {
"disable": [
"unnecessary-if"
]
},
"codeAction": {
"insertSpace": true
},
"strict": {
"typeCall": true,
"arrayIndex": true
}
}

0
.gitattributes vendored Executable file → Normal file
View File

View File

@@ -1,6 +1,6 @@
name: Bug Report
description: Report a problem in Neovim
labels: [bug]
description: Report a problem in Nvim
type: 'bug'
body:
- type: markdown
@@ -43,7 +43,7 @@ body:
- type: input
attributes:
label: "Neovim version (nvim -v)"
label: "Nvim version (nvim -v)"
placeholder: "0.6.0 commit db1b0ee3b30f"
validations:
required: true

View File

@@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Question
url: https://vi.stackexchange.com/
about: Ask questions about configuration and usage of Neovim
url: https://github.com/neovim/neovim/discussions
about: Ask about configuration and usage of Nvim

View File

@@ -1,6 +1,6 @@
name: Feature request
description: Request an enhancement for Neovim
labels: [enhancement]
description: Request an enhancement for Nvim
type: 'enhancement'
body:
- type: markdown

View File

@@ -1,6 +1,8 @@
name: Language server (LSP) client bug
description: Report an issue with Neovim LSP
labels: [bug, lsp]
description: Report an issue with Nvim LSP
title: "LSP: "
type: bug
labels: [lsp]
body:
- type: markdown
@@ -59,7 +61,7 @@ body:
- type: input
attributes:
label: "Neovim version (nvim -v)"
label: "Nvim version (nvim -v)"
placeholder: "0.6.0 commit db1b0ee3b30f"
validations:
required: true

5
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,5 @@
<!--
Thank you for contributing to Neovim!
If this is your first time, check out https://github.com/neovim/neovim/blob/master/CONTRIBUTING.md#pull-requests-prs
for our PR guidelines.
-->

View File

@@ -9,16 +9,17 @@ while (($# > 0)); do
esac
done
os=$(uname -s)
if [[ $os == Linux ]]; then
OS=$(uname -s)
ARCH=$(uname -m)
if [[ $OS == Linux ]]; then
sudo apt-get update
sudo apt-get install -y build-essential cmake curl gettext ninja-build
if [[ $CC == clang ]]; then
DEFAULT_CLANG_VERSION=$(echo | clang -dM -E - | grep __clang_major | awk '{print $3}')
CLANG_VERSION=18
CLANG_VERSION=19
if ((DEFAULT_CLANG_VERSION >= CLANG_VERSION)); then
echo "Default clang version is $DEFAULT_CLANG_VERSION, which equal or larger than wanted version $CLANG_VERSION. Aborting!"
echo "Default clang version is $DEFAULT_CLANG_VERSION, which is equal or larger than wanted version $CLANG_VERSION. Aborting!"
exit 1
fi
@@ -30,17 +31,27 @@ if [[ $os == Linux ]]; then
fi
if [[ -n $TEST ]]; then
sudo apt-get install -y locales-all cpanminus attr libattr1-dev gdb fswatch
sudo apt-get install -y locales-all cpanminus attr libattr1-dev gdb inotify-tools xdg-utils
# Use default CC to avoid compilation problems when installing Python modules
CC=cc python3 -m pip -q install --user --upgrade pynvim
CC=cc python3 -m pip -q install --user --upgrade --break-system-packages pynvim
# Skip installing npm on aarch64 as it tends to cause intermittent segmentation faults.
# See https://github.com/neovim/neovim/issues/32339.
if [[ $ARCH != aarch64 ]]; then
npm install -g neovim
npm link neovim
fi
fi
elif [[ $os == Darwin ]]; then
elif [[ $OS == Darwin ]]; then
brew update --quiet
brew install ninja
if [[ -n $TEST ]]; then
brew install cpanminus fswatch
npm install -g neovim
npm link neovim
# Use default CC to avoid compilation problems when installing Python modules
CC=cc python3 -m pip -q install --user --upgrade --break-system-packages pynvim
fi

View File

@@ -2,6 +2,10 @@ build:
- changed-files:
- any-glob-to-any-file: [ CMakeLists.txt, "**/CMakeLists.txt", "**/Makefile", "**/*.cmake", cmake.deps/**/* ]
checkhealth:
- changed-files:
- any-glob-to-any-file: [ "**/health.lua" ]
ci:
- changed-files:
- any-glob-to-any-file: [ .github/actions/**, .github/workflows/**, .github/scripts/** ]
@@ -14,6 +18,14 @@ column:
- changed-files:
- any-glob-to-any-file: [ src/nvim/sign* ]
comment:
- changed-files:
- any-glob-to-any-file: [ runtime/lua/vim/_comment.lua ]
defaults:
- changed-files:
- any-glob-to-any-file: [ runtime/lua/vim/_defaults.lua ]
diagnostic:
- changed-files:
- any-glob-to-any-file: [ runtime/lua/vim/diagnostic.lua ]
@@ -34,6 +46,10 @@ filetype:
- changed-files:
- any-glob-to-any-file: [ runtime/lua/vim/filetype.lua, runtime/lua/vim/filetype/detect.lua ]
filesystem:
- changed-files:
- any-glob-to-any-file: [ runtime/lua/vim/fs.lua ]
folds:
- changed-files:
- any-glob-to-any-file: [ src/nvim/fold* ]
@@ -46,9 +62,9 @@ mouse:
- changed-files:
- any-glob-to-any-file: [ src/nvim/mouse* ]
platform:nix:
netrw:
- changed-files:
- any-glob-to-any-file: [ contrib/flake.lock, contrib/flake.nix ]
- any-glob-to-any-file: [ runtime/autoload/netrw.vim, runtime/plugin/netrwPlugin.vim ]
snippet:
- changed-files:

View File

@@ -23,6 +23,10 @@ module.exports = async ({ github, context }) => {
reviewers.add("lewis6991");
}
if (labels.includes("comment")) {
reviewers.add("echasnovski");
}
if (labels.includes("defaults")) {
reviewers.add("gpanders");
}
@@ -35,26 +39,29 @@ module.exports = async ({ github, context }) => {
reviewers.add("lewis6991");
}
if (labels.includes("documentation")) {
reviewers.add("clason");
}
if (labels.includes("editorconfig")) {
reviewers.add("gpanders");
}
if (labels.includes("extmarks")) {
if (labels.includes("marks")) {
reviewers.add("bfredl");
}
if (labels.includes("filetype")) {
reviewers.add("clason");
reviewers.add("gpanders");
}
if (labels.includes("inccommand")) {
reviewers.add("famiu");
}
if (labels.includes("lsp")) {
reviewers.add("MariaSolOs");
reviewers.add("mfussenegger");
reviewers.add("ribru17");
}
if (labels.includes("netrw")) {
reviewers.add("justinmk");
}
if (labels.includes("options")) {
@@ -78,15 +85,12 @@ module.exports = async ({ github, context }) => {
reviewers.add("famiu");
}
if (labels.includes("test")) {
reviewers.add("justinmk");
}
if (labels.includes("treesitter")) {
reviewers.add("bfredl");
reviewers.add("clason");
reviewers.add("lewis6991");
reviewers.add("wookayin");
reviewers.add("ribru17");
}
if (labels.includes("tui")) {
@@ -98,7 +102,6 @@ module.exports = async ({ github, context }) => {
}
if (labels.includes("vim-patch")) {
reviewers.add("seandewar");
reviewers.add("zeertzjq");
}

View File

@@ -11,26 +11,36 @@ jobs:
if: github.event.pull_request.merged
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ vars.BACKPORT_APP }}
private-key: ${{ secrets.BACKPORT_KEY }}
- name: Create backport PR
id: backport
uses: korthout/backport-action@v2
uses: korthout/backport-action@v3
with:
pull_title: "${pull_title}"
label_pattern: "^ci:backport ([^ ]+)$"
# https://github.com/korthout/backport-action/pull/399
experimental: >
{
"detect_merge_method": true
}
github_token: ${{ steps.app-token.outputs.token }}
- if: ${{steps.backport.outputs.was_successful == 'true'}}
- name: Create failed backport label
if: ${{ steps.backport.outputs.was_successful == 'false' }}
uses: actions/github-script@v7
with:
script: |
github.rest.issues.addLabels({
issue_number: ${{steps.backport.outputs.created_pull_numbers}},
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['backport']
labels: ['needs:backport']
})
- name: Enable automerge
if: ${{ steps.backport.outputs.was_successful == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr merge --rebase --auto ${{ steps.backport.outputs.created_pull_numbers }}

View File

@@ -21,15 +21,30 @@ env:
INSTALL_PREFIX: ${{ github.workspace }}/nvim-install
jobs:
wasmtime:
strategy:
fail-fast: false
matrix:
test: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.test }}
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup
- run: |
cmake -S cmake.deps --preset ci -D ENABLE_WASMTIME=ON
cmake --build .deps
cmake --preset ci -D ENABLE_WASMTIME=ON
cmake --build build
old-cmake:
name: Test oldest supported cmake
runs-on: ubuntu-latest
timeout-minutes: 15
env:
CMAKE_URL: 'https://cmake.org/files/v3.13/cmake-3.13.0-Linux-x86_64.sh'
CMAKE_VERSION: '3.13.0'
CMAKE_URL: 'https://cmake.org/files/v3.16/cmake-3.16.0-Linux-x86_64.sh'
CMAKE_VERSION: '3.16.0'
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: ./.github/actions/setup
- name: Install minimum required version of cmake
@@ -58,7 +73,7 @@ jobs:
name: Test USE_EXISTING_SRC_DIR=ON builds with no network access
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: ./.github/actions/setup
- name: Build bundled dependencies
@@ -74,7 +89,9 @@ jobs:
for d in *; do (cd "$d"; rm -rf ./autom4te.cache; make clean || true; make distclean || true); done
- name: Re-build bundled dependencies with no network access
run: unshare --map-root-user --net make deps DEPS_CMAKE_FLAGS=-DUSE_EXISTING_SRC_DIR=ON
run: |
sudo sysctl kernel.apparmor_restrict_unprivileged_userns=0
unshare --map-root-user --net make deps DEPS_CMAKE_FLAGS=-DUSE_EXISTING_SRC_DIR=ON
- name: Build
run: make CMAKE_FLAGS="-D CI_BUILD=ON"

33
.github/workflows/build_dummy.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
name: build_dummy
on:
pull_request:
branches:
- 'master'
- 'release-[0-9]+.[0-9]+'
# This needs to be an exact complement of `paths` in the build.yml workflow.
# This is required to bypass required checks since a required job is always
# needed to run.
paths-ignore:
- '**.cmake'
- '**/CMakeLists.txt'
- '**/CMakePresets.json'
- 'cmake.*/**'
- '.github/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
old-cmake:
name: Test oldest supported cmake
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- run: echo "success"
use-existing-src:
name: Test USE_EXISTING_SRC_DIR=ON builds with no network access
runs-on: ubuntu-latest
steps:
- run: echo "success"

View File

@@ -22,7 +22,7 @@ jobs:
security-events: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: ./.github/actions/setup
- name: Initialize CodeQL

View File

@@ -8,7 +8,7 @@ jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: ./.github/actions/setup
- name: Download Coverity

View File

@@ -2,13 +2,6 @@ name: docs
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'src/nvim/api/*.[ch]'
- 'src/nvim/eval.lua'
- 'runtime/lua/**.lua'
- 'runtime/doc/**'
- 'scripts/gen_vimdoc.py'
- 'scripts/gen_help_html.lua'
jobs:
docs:
runs-on: ubuntu-latest
@@ -17,7 +10,7 @@ jobs:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: ./.github/actions/setup
- name: Generate docs

View File

@@ -9,7 +9,7 @@ jobs:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/labeler@v5
with:
configuration-path: .github/scripts/labeler_configuration.yml
@@ -33,8 +33,25 @@ jobs:
- name: "Extract if the PR is a breaking change and add it as label"
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')" || true
request-reviewer:
target-release:
needs: ["changed-files", "type-scope"]
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- if: startsWith(github.base_ref, 'release')
uses: actions/github-script@v7
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['target:release']
})
request-reviewer:
needs: ["changed-files", "type-scope", "target-release"]
permissions:
pull-requests: write
uses: ./.github/workflows/reviewers_add.yml

View File

@@ -1,4 +1,4 @@
name: "lintcommit"
name: lintcommit
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
@@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

16
.github/workflows/lintcommit_dummy.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
# Dummy workflow of lintcommit.yml. lintcommit is a required check, but it's
# only designed to work on master. Since required checks are always required to
# run, we can essentially "skip" the lintcommit on release branches with this
# dummy check that automatically passes.
name: lintcommit_dummy
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- 'release-[0-9]+.[0-9]+'
jobs:
lint-commits:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- run: echo "success"

View File

@@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'ci:skip-news')
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
@@ -19,15 +19,15 @@ jobs:
message=$(git log -n1 --pretty=format:%s $commit)
type="$(echo "$message" | sed -E 's|([[:alpha:]]+)(\(.*\))?!?:.*|\1|')"
breaking="$(echo "$message" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')"
if [[ "$type" == "feat" ]] || [[ "$breaking" == "breaking-change" ]]; then
! git diff HEAD~${{ github.event.pull_request.commits }}..HEAD --quiet runtime/doc/news.txt ||
if [[ "$type" == "feat" ]] || [[ "$type" == "perf" ]] || [[ "$breaking" == "breaking-change" ]]; then
! git diff HEAD~${{ github.event.pull_request.commits }}..HEAD --quiet runtime/doc/news.txt runtime/doc/deprecated.txt ||
{
echo "
Pull request includes a new feature or a breaking change, but
news.txt hasn't been updated yet. This is just a reminder
that news.txt may need to be updated. You can ignore this CI
failure if you think the change won't be of interest to
users."
Pull request includes a new feature, performance improvement
or a breaking change, but news.txt hasn't been updated yet.
This is just a reminder that news.txt may need to be updated.
You can ignore this CI failure if you think the change won't
be of interest to users."
exit 1
}
fi

View File

@@ -18,6 +18,8 @@ ${NVIM_VERSION}
2. Run the MSI
3. Run `nvim.exe` on your CLI of choice
Note: On Windows "Server" you may need to [install vcruntime140.dll](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170).
### macOS (x86_64)
1. Download **nvim-macos-x86_64.tar.gz**
@@ -32,39 +34,44 @@ ${NVIM_VERSION}
3. Extract: `tar xzvf nvim-macos-arm64.tar.gz`
4. Run `./nvim-macos-arm64/bin/nvim`
### Linux (x64)
### Linux (x86_64)
Minimum glibc version to run these releases is 2.31. People requiring releases
that work on older glibc versions can find them at
https://github.com/neovim/neovim-releases.
If your system does not have the required glibc version, try the (unsupported) [builds for older glibc](https://github.com/neovim/neovim-releases).
#### AppImage
1. Download **nvim.appimage**
2. Run `chmod u+x nvim.appimage && ./nvim.appimage`
1. Download **nvim-linux-x86_64.appimage**
2. Run `chmod u+x nvim-linux-x86_64.appimage && ./nvim-linux-x86_64.appimage`
- If your system does not have FUSE you can [extract the appimage](https://github.com/AppImage/AppImageKit/wiki/FUSE#type-2-appimage):
```
./nvim.appimage --appimage-extract
./nvim-linux-x86_64.appimage --appimage-extract
./squashfs-root/usr/bin/nvim
```
#### Tarball
1. Download **nvim-linux64.tar.gz**
2. Extract: `tar xzvf nvim-linux64.tar.gz`
3. Run `./nvim-linux64/bin/nvim`
1. Download **nvim-linux-x86_64.tar.gz**
2. Extract: `tar xzvf nvim-linux-x86_64.tar.gz`
3. Run `./nvim-linux-x86_64/bin/nvim`
### Linux (arm64)
#### AppImage
1. Download **nvim-linux-arm64.appimage**
2. Run `chmod u+x nvim-linux-arm64.appimage && ./nvim-linux-arm64.appimage`
- If your system does not have FUSE you can [extract the appimage](https://github.com/AppImage/AppImageKit/wiki/FUSE#type-2-appimage):
```
./nvim-linux-arm64.appimage --appimage-extract
./squashfs-root/usr/bin/nvim
```
#### Tarball
1. Download **nvim-linux-arm64.tar.gz**
2. Extract: `tar xzvf nvim-linux-arm64.tar.gz`
3. Run `./nvim-linux-arm64/bin/nvim`
### Other
- Install by [package manager](https://github.com/neovim/neovim/blob/master/INSTALL.md#install-from-package)
## SHA256 Checksums
```
${SHA_LINUX_64_TAR}
${SHA_APP_IMAGE}
${SHA_APP_IMAGE_ZSYNC}
${SHA_MACOS_X86_64}
${SHA_MACOS_ARM64}
${SHA_WIN_64_ZIP}
${SHA_WIN_64_MSI}
```

View File

@@ -11,7 +11,7 @@ concurrency:
env:
INSTALL_PREFIX: ${{ github.workspace }}/nvim-install
# Double test timeout since it's running via qemu
TEST_TIMEOUT: 2400
TEST_TIMEOUT: 3600
# TEST_FILE: test/functional/shada
# TEST_FILTER: foo
@@ -23,7 +23,7 @@ jobs:
matrix:
test: [functionaltest, oldtest]
runs-on: ubuntu-latest
timeout-minutes: 60
timeout-minutes: 90
steps:
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
- uses: docker://multiarch/ubuntu-core:s390x-focal
@@ -34,7 +34,7 @@ jobs:
bash -c
"
apt-get -y update &&
DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential cmake curl gettext ninja-build locales-all cpanminus git attr libattr1-dev &&
time DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential cmake curl gettext ninja-build locales-all cpanminus git attr libattr1-dev xdg-utils &&
useradd --create-home qemuci &&
chown -R qemuci. . &&
runuser -u qemuci -- git clone --depth=1 https://github.com/neovim/neovim.git &&

View File

@@ -13,7 +13,6 @@ on:
- v[0-9]+.[0-9]+.[0-9]+
# Build on the oldest supported images, so we have broader compatibility
# Build with gcc-10 to prevent triggering #14150 (default is still gcc-9 on 20.04)
jobs:
setup:
runs-on: ubuntu-latest
@@ -39,35 +38,47 @@ jobs:
printf "appimage_tag=${APPIMAGE_TAG}\n" >> $GITHUB_OUTPUT
linux:
runs-on: ubuntu-20.04
needs: setup
strategy:
fail-fast: false
matrix:
runner: [ ubuntu-22.04, ubuntu-22.04-arm ]
include:
- runner: ubuntu-22.04
arch: x86_64
- runner: ubuntu-22.04-arm
arch: arm64
runs-on: ${{ matrix.runner }}
env:
CC: gcc-10
CC: ${{ matrix.cc }}
LDAI_NO_APPSTREAM: 1 # skip checking (broken) AppStream metadata for issues
outputs:
version: ${{ steps.build.outputs.version }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
# Perform a full checkout #13471
fetch-depth: 0
- run: ./.github/scripts/install_deps.sh
- run: sudo apt-get install -y libfuse2
- run: echo "CMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }}" >> $GITHUB_ENV
- name: appimage
run: ./scripts/genappimage.sh ${{ needs.setup.outputs.appimage_tag }}
run: |
./scripts/genappimage.sh ${{ needs.setup.outputs.appimage_tag }}
- name: tar.gz
run: cpack --config build/CPackConfig.cmake -G TGZ
- uses: actions/upload-artifact@v4
with:
name: appimage
name: nvim-appimage-${{ matrix.arch }}
path: |
build/bin/nvim.appimage
build/bin/nvim.appimage.zsync
build/bin/nvim-linux-${{ matrix.arch }}.appimage
build/bin/nvim-linux-${{ matrix.arch }}.appimage.zsync
retention-days: 1
- uses: actions/upload-artifact@v4
with:
name: nvim-linux64
name: nvim-linux-${{ matrix.arch }}
path: |
build/nvim-linux64.tar.gz
build/nvim-linux-${{ matrix.arch }}.tar.gz
retention-days: 1
- name: Export version
id: build
@@ -75,15 +86,14 @@ jobs:
printf 'version<<END\n' >> $GITHUB_OUTPUT
./build/bin/nvim --version | head -n 3 >> $GITHUB_OUTPUT
printf 'END\n' >> $GITHUB_OUTPUT
macos:
needs: setup
strategy:
fail-fast: false
matrix:
runner: [ macos-12, macos-14 ]
runner: [ macos-13, macos-14 ]
include:
- runner: macos-12
- runner: macos-13
arch: x86_64
- runner: macos-14
arch: arm64
@@ -91,7 +101,7 @@ jobs:
env:
MACOSX_DEPLOYMENT_TARGET: 11.0
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
# Perform a full checkout #13471
fetch-depth: 0
@@ -104,7 +114,6 @@ jobs:
-D CMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }} \
-D CMAKE_FIND_FRAMEWORK=NEVER
cmake --build .deps
- name: Build neovim
run: |
cmake -B build -G Ninja \
@@ -112,7 +121,6 @@ jobs:
-D ENABLE_LIBINTL=OFF \
-D CMAKE_FIND_FRAMEWORK=NEVER
cmake --build build
- name: Package
run: cpack --config build/CPackConfig.cmake
@@ -124,9 +132,9 @@ jobs:
windows:
needs: setup
runs-on: windows-2019
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
# Perform a full checkout #13471
fetch-depth: 0
@@ -158,9 +166,9 @@ jobs:
steps:
# Must perform checkout first, since it deletes the target directory
# before running, and would therefore delete the downloaded artifacts
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v5
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y gettext-base
@@ -185,40 +193,6 @@ jobs:
echo 'PRERELEASE=') >> $GITHUB_ENV
gh release delete stable --yes || true
git push origin :stable || true
# `sha256sum` outputs <sha> <path>, so we cd into each dir to drop the
# containing folder from the output.
- name: Generate Linux64 SHA256 checksums
run: |
cd ./nvim-linux64
sha256sum nvim-linux64.tar.gz > nvim-linux64.tar.gz.sha256sum
echo "SHA_LINUX_64_TAR=$(cat nvim-linux64.tar.gz.sha256sum)" >> $GITHUB_ENV
- name: Generate App Image SHA256 checksums
run: |
cd ./appimage
sha256sum nvim.appimage > nvim.appimage.sha256sum
echo "SHA_APP_IMAGE=$(cat nvim.appimage.sha256sum)" >> $GITHUB_ENV
- name: Generate App Image Zsync SHA256 checksums
run: |
cd ./appimage
sha256sum nvim.appimage.zsync > nvim.appimage.zsync.sha256sum
echo "SHA_APP_IMAGE_ZSYNC=$(cat nvim.appimage.zsync.sha256sum)" >> $GITHUB_ENV
- name: Generate macos x86_64 SHA256 checksums
run: |
cd ./nvim-macos-x86_64
sha256sum nvim-macos-x86_64.tar.gz > nvim-macos-x86_64.tar.gz.sha256sum
echo "SHA_MACOS_X86_64=$(cat nvim-macos-x86_64.tar.gz.sha256sum)" >> $GITHUB_ENV
- name: Generate macos arm64 SHA256 checksums
run: |
cd ./nvim-macos-arm64
sha256sum nvim-macos-arm64.tar.gz > nvim-macos-arm64.tar.gz.sha256sum
echo "SHA_MACOS_ARM64=$(cat nvim-macos-arm64.tar.gz.sha256sum)" >> $GITHUB_ENV
- name: Generate Win64 SHA256 checksums
run: |
cd ./nvim-win64
sha256sum nvim-win64.zip > nvim-win64.zip.sha256sum
echo "SHA_WIN_64_ZIP=$(cat nvim-win64.zip.sha256sum)" >> $GITHUB_ENV
sha256sum nvim-win64.msi > nvim-win64.msi.sha256sum
echo "SHA_WIN_64_MSI=$(cat nvim-win64.msi.sha256sum)" >> $GITHUB_ENV
- name: Publish release
env:
NVIM_VERSION: ${{ needs.linux.outputs.version }}
@@ -226,6 +200,6 @@ jobs:
run: |
envsubst < "$GITHUB_WORKSPACE/.github/workflows/notes.md" > "$RUNNER_TEMP/notes.md"
if [ "$TAG_NAME" != "nightly" ]; then
gh release create stable $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos-x86_64/* nvim-macos-arm64/* nvim-linux64/* appimage/* nvim-win64/*
gh release create stable $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos-x86_64/* nvim-macos-arm64/* nvim-linux-x86_64/* nvim-linux-arm64/* nvim-appimage-x86_64/* nvim-appimage-arm64/* nvim-win64/*
fi
gh release create $TAG_NAME $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos-x86_64/* nvim-macos-arm64/* nvim-linux64/* appimage/* nvim-win64/*
gh release create $TAG_NAME $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos-x86_64/* nvim-macos-arm64/* nvim-linux-x86_64/* nvim-linux-arm64/* nvim-appimage-x86_64/* nvim-appimage-arm64/* nvim-win64/*

View File

@@ -13,7 +13,7 @@ jobs:
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/github-script@v7
with:
script: |
@@ -27,7 +27,7 @@ jobs:
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/github-script@v7
with:
script: |

View File

@@ -5,12 +5,12 @@ on:
workflow_call:
jobs:
request-reviewer:
if: github.event.pull_request.state == 'open' && github.event.pull_request.draft == false
if: github.event.pull_request.state == 'open' && github.event.pull_request.draft == false && !endsWith(github.actor, '[bot]')
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: 'Request reviewers'
uses: actions/github-script@v7
with:

View File

@@ -8,7 +8,7 @@ jobs:
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: 'Remove reviewers'
uses: actions/github-script@v7
with:

View File

@@ -8,8 +8,6 @@ on:
branches:
- 'master'
- 'release-[0-9]+.[0-9]+'
paths-ignore:
- 'contrib/**'
workflow_dispatch:
concurrency:
@@ -30,17 +28,17 @@ env:
jobs:
lint:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04-arm
timeout-minutes: 10
env:
CC: clang
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: ./.github/actions/setup
- name: Install stylua
run: |
wget --directory-prefix="$BIN_DIR" https://github.com/JohnnyMorganz/StyLua/releases/latest/download/stylua-linux-x86_64.zip
wget --directory-prefix="$BIN_DIR" https://github.com/JohnnyMorganz/StyLua/releases/latest/download/stylua-linux-aarch64.zip
(cd "$BIN_DIR"; unzip stylua*.zip)
- name: Build third-party deps
@@ -59,6 +57,10 @@ jobs:
name: stylua
run: cmake --build build --target lintlua-stylua
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: luals
run: cmake --build build --target luals
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: luacheck
run: cmake --build build --target lintlua-luacheck
@@ -80,12 +82,12 @@ jobs:
run: cmake --build build --target lintc-uncrustify
clang-analyzer:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04-arm
timeout-minutes: 20
env:
CC: clang
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: ./.github/actions/setup
- name: Build third-party deps
run: |
@@ -95,18 +97,24 @@ jobs:
- run: cmake --build build --target clang-analyzer
posix:
name: ${{ matrix.build.runner }} ${{ matrix.build.flavor }} ${{ matrix.build.cc }} ${{ matrix.test }}
name: ${{ matrix.build.os }} ${{ matrix.build.flavor }} ${{ matrix.build.cc }} ${{ matrix.test }}
strategy:
fail-fast: false
matrix:
# The `os` field is not needed to differentiate between the different
# matrix builds. It is needed to not change the required checks (which
# uses jobs names) each time we bump the runner version. It may be
# possible to remove if we e.g. start using `-latest` runner versions
# or if github introduces a wildcard for required checks in the future.
build:
[
{ runner: ubuntu-22.04, flavor: asan, cc: clang, flags: -D ENABLE_ASAN_UBSAN=ON },
{ runner: ubuntu-22.04, flavor: tsan, cc: clang, flags: -D ENABLE_TSAN=ON },
{ runner: ubuntu-22.04, cc: gcc },
{ runner: macos-12, cc: clang, flags: -D CMAKE_FIND_FRAMEWORK=NEVER, deps_flags: -D CMAKE_FIND_FRAMEWORK=NEVER },
{ runner: macos-14, cc: clang, flags: -D CMAKE_FIND_FRAMEWORK=NEVER, deps_flags: -D CMAKE_FIND_FRAMEWORK=NEVER },
{ runner: ubuntu-22.04, flavor: puc-lua, cc: gcc, deps_flags: -D USE_BUNDLED_LUAJIT=OFF -D USE_BUNDLED_LUA=ON, flags: -D PREFER_LUA=ON },
{ runner: ubuntu-24.04, os: ubuntu, flavor: asan, cc: clang, flags: -D ENABLE_ASAN_UBSAN=ON },
{ runner: ubuntu-24.04, os: ubuntu, flavor: tsan, cc: clang, flags: -D ENABLE_TSAN=ON },
{ runner: ubuntu-24.04, os: ubuntu, flavor: release, cc: gcc, flags: -D CMAKE_BUILD_TYPE=Release -D ENABLE_TRANSLATIONS=ON },
{ runner: ubuntu-24.04-arm, os: ubuntu, flavor: arm, cc: clang, flags: -D CMAKE_BUILD_TYPE=RelWithDebInfo },
{ runner: macos-13, os: macos, flavor: intel, cc: clang, flags: -D CMAKE_FIND_FRAMEWORK=NEVER, deps_flags: -D CMAKE_FIND_FRAMEWORK=NEVER },
{ runner: macos-15, os: macos, flavor: arm, cc: clang, flags: -D CMAKE_FIND_FRAMEWORK=NEVER, deps_flags: -D CMAKE_FIND_FRAMEWORK=NEVER },
{ runner: ubuntu-24.04, os: ubuntu, flavor: puc-lua, cc: gcc, deps_flags: -D USE_BUNDLED_LUAJIT=OFF -D USE_BUNDLED_LUA=ON, flags: -D PREFER_LUA=ON },
]
test: [unittest, functionaltest, oldtest]
exclude:
@@ -116,12 +124,17 @@ jobs:
build: { flavor: puc-lua }
- test: oldtest
build: { flavor: tsan }
- test: unittest
build: { runner: ubuntu-24.04-arm }
- test: oldtest
build: { runner: ubuntu-24.04-arm }
runs-on: ${{ matrix.build.runner }}
timeout-minutes: 45
env:
CC: ${{ matrix.build.cc }}
NVIM_TEST_INTEG: ${{ matrix.build.flavor == 'release' && '1' || '0' }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: ./.github/actions/setup
with:
install_flags: "--test"
@@ -135,13 +148,13 @@ jobs:
echo "Install neovim RubyGem."
gem install --no-document --bindir "$BIN_DIR" --user-install --pre neovim
echo "Install neovim npm package"
npm install -g neovim
npm link neovim
sudo cpanm -n Neovim::Ext || cat "$HOME/.cpanm/build.log"
perl -W -e 'use Neovim::Ext; print $Neovim::Ext::VERSION'
- name: Remove .git directory
if: ${{ matrix.build.os == 'ubuntu' }}
run: cmake -E rm -rf -- .git
- name: Build third-party deps
run: |
cmake -S cmake.deps --preset ci -D CMAKE_BUILD_TYPE=Debug ${{ matrix.build.deps_flags }}
@@ -152,9 +165,15 @@ jobs:
cmake --preset ci -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX ${{ matrix.build.flags }}
cmake --build build
- name: ${{ matrix.test }}
- if: ${{ matrix.test == 'oldtest' }}
name: ${{ matrix.test }}
timeout-minutes: 20
run: make ${{ matrix.test }}
run: make -C test/old/testdir NVIM_PRG=$(realpath build)/bin/nvim
- if: ${{ matrix.test != 'oldtest' }}
name: ${{ matrix.test }}
timeout-minutes: 20
run: cmake --build build --target ${{ matrix.test }}
- name: Install
run: |
@@ -187,50 +206,35 @@ jobs:
name: Show logs
run: cat $(find "$LOG_DIR" -type f)
zig-build:
runs-on: ubuntu-24.04
timeout-minutes: 45
name: build using zig build (linux)
steps:
- uses: actions/checkout@v5
- uses: mlugg/setup-zig@v2
with:
version: 0.14.1
- run: sudo apt-get install -y inotify-tools
- run: zig build test_nlua0
- run: zig build nvim && ./zig-out/bin/nvim --version
- run: zig build unittest
- run: zig build functionaltest
# `zig build nvim` uses a lua script for doctags in order to support cross-compiling
# compare with the builtin generator that they match
- run: cd runtime; ../zig-out/bin/nvim -u NONE -i NONE -e --headless -c "helptags ++t doc" -c quit
- run: diff -u runtime/doc/tags zig-out/runtime/doc/tags
windows:
uses: ./.github/workflows/test_windows.yml
# This job tests the following things:
# - Check if Release, MinSizeRel and RelWithDebInfo compiles correctly.
# - Test the above build types with the GCC compiler specifically.
# Empirically the difference in warning levels between GCC and other
# compilers is particularly big.
# - Test if the build works with multi-config generators. We mostly use
# single-config generators so it's nice to have a small sanity check for
# multi-config.
build-types:
runs-on: ubuntu-22.04
timeout-minutes: 10
env:
CC: gcc
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Build third-party deps
run: |
cmake -S cmake.deps -B .deps -G "Ninja Multi-Config"
cmake --build .deps
- name: Configure
run: cmake --preset ci -G "Ninja Multi-Config"
- name: Release
run: cmake --build build --config Release
- name: RelWithDebInfo
run: cmake --build build --config RelWithDebInfo
- name: MinSizeRel
run: cmake --build build --config MinSizeRel
with-external-deps:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04-arm
timeout-minutes: 10
env:
CC: gcc
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: ./.github/actions/setup
- name: Install dependencies
@@ -238,8 +242,6 @@ jobs:
sudo add-apt-repository ppa:neovim-ppa/stable
sudo apt-get install -y \
libluajit-5.1-dev \
libmsgpack-dev \
libtermkey-dev \
libunibilium-dev \
libuv1-dev \
lua-filesystem \
@@ -247,7 +249,6 @@ jobs:
luajit \
lua-luv-dev
# libtree-sitter-dev \
# libvterm-dev
# Remove comments from packages once we start using these external
# dependencies.

View File

@@ -18,7 +18,7 @@ jobs:
matrix:
test: [functional, old]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: ./.github/actions/setup
- name: Build deps
@@ -60,6 +60,7 @@ jobs:
uses: msys2/setup-msys2@v2
with:
update: true
install: unzip
pacboy: >-
make:p gcc:p diffutils:p
release: false

View File

@@ -15,11 +15,11 @@ jobs:
VERSION_BRANCH: marvim/ci-version-update
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
repository: vim/vim
path: ${{ env.VIM_SOURCE_DIR }}
@@ -28,10 +28,10 @@ jobs:
- run: sudo apt-get install libfuse2
- run: |
gh release download -R neovim/neovim -p nvim.appimage
chmod a+x nvim.appimage
gh release download -R neovim/neovim -p nvim-linux-x86_64.appimage
chmod a+x nvim-linux-x86_64.appimage
mkdir -p $HOME/.local/bin
mv nvim.appimage $HOME/.local/bin/nvim
mv nvim-linux-x86_64.appimage $HOME/.local/bin/nvim
printf '%s\n' "$HOME/.local/bin" >> $GITHUB_PATH
- name: Set up git config
@@ -43,13 +43,13 @@ jobs:
id: update-version
run: |
git checkout -b ${VERSION_BRANCH}
nvim -V1 -es -i NONE +'luafile scripts/vimpatch.lua' +q
nvim -l scripts/vimpatch.lua
printf 'NEW_PATCHES=%s\n' $([ -z "$(git diff)" ]; echo $?) >> $GITHUB_OUTPUT
- name: Automatic PR
if: ${{ steps.update-version.outputs.NEW_PATCHES != 0 }}
run: |
git add -u
git commit -m 'docs: update version.c [skip ci]'
git commit -m 'docs: update version.c'
git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} ${VERSION_BRANCH}
gh pr create --draft --fill --label vim-patch --base ${GITHUB_REF#refs/heads/} --head ${VERSION_BRANCH} || true

4
.gitignore vendored
View File

@@ -10,7 +10,8 @@ compile_commands.json
/.idea/
# Build/deps dir
/build/
/.zig-cache/
/zig-out/
/.deps/
/tmp/
/.clangd/
@@ -44,6 +45,7 @@ compile_commands.json
/test/old/testdir/messages
/test/old/testdir/starttime
/test/old/testdir/viminfo
/test/old/testdir/opt_test.vim
/test/old/testdir/test.ok
/test/old/testdir/*.failed
/test/old/testdir/X*

View File

@@ -38,15 +38,18 @@ globals = {
"vim.bo",
"vim.wo",
"vim.go",
"vim.env"
"vim.env",
"_",
}
exclude_files = {
'test/_meta.lua',
'test/functional/fixtures/lua/syntax_error.lua',
'runtime/lua/vim/treesitter/_meta.lua',
'runtime/lua/vim/_meta/vimfn.lua',
'runtime/lua/vim/_meta/api.lua',
'runtime/lua/vim/re.lua',
'runtime/lua/uv/_meta.lua',
'runtime/lua/coxpcall.lua',
'src/nvim/eval.lua',
}

View File

@@ -5,11 +5,11 @@
},
"workspace": {
"library": [
"runtime/lua",
"${3rd}/busted/library",
"${3rd}/luv/library"
"${3rd}/busted/library"
],
"ignoreDir": [
".deps",
"build",
"test"
],
"checkThirdParty": "Disable"

View File

@@ -18,6 +18,7 @@ Eisuke Kawashima <e-kwsm@users.noreply.github.com> E Kawashima
ElPiloto <luis.r.piloto@gmail.com> Luis Piloto
Eliseo Martínez <eliseomarmol@gmail.com> Eliseo Martínez
Fabian Viöl <f.vioel@googlemail.com> Fabian
Famiu Haque <famiuhaque@proton.me> <famiuhaque@protonmail.com>
Florian Walch <florian@fwalch.com> <fwalch@users.noreply.github.com>
Gabriel Cruz <gabs.oficial98@gmail.com> <LTKills@users.noreply.github.com>
Gaelan Steele <gbs@canishe.com> Gaelan

8
.stylua2.toml Normal file
View File

@@ -0,0 +1,8 @@
# Alternative settings for special snowflakes like: decorations_spec.lua, multigrid_spec.lua, etc.
column_width = 140
line_endings = "Unix"
indent_type = "Spaces"
indent_width = 2
quote_style = "AutoPreferSingle"
call_parentheses = "Input"

View File

@@ -1,14 +1,15 @@
/build/
/.deps/
/runtime/lua/coxpcall.lua
/runtime/lua/vim/_meta
/runtime/lua/vim/re.lua
build/
.deps/
runtime/lua/coxpcall.lua
runtime/lua/uv/_meta.lua
runtime/lua/vim/_meta
runtime/lua/vim/re.lua
# These are formatted explicitly by the "formatlua2" build task.
test/functional/ui/decorations_spec.lua
test/functional/ui/float_spec.lua
test/functional/ui/multigrid_spec.lua
/test/functional/fixtures/lua/syntax_error.lua
/test/functional/legacy/030_fileformats_spec.lua
/test/functional/legacy/044_099_regexp_multibyte_magic_spec.lua
/test/functional/legacy/093_mksession_cursor_cols_latin1_spec.lua
/test/functional/lua/luaeval_spec.lua
test/functional/fixtures/lua/syntax_error.lua
test/functional/legacy/030_fileformats_spec.lua
test/functional/legacy/044_099_regexp_multibyte_magic_spec.lua
test/functional/legacy/093_mksession_cursor_cols_latin1_spec.lua

112
BUILD.md
View File

@@ -5,14 +5,15 @@
1. Install [build prerequisites](#build-prerequisites) on your system
2. `git clone https://github.com/neovim/neovim`
3. `cd neovim && make CMAKE_BUILD_TYPE=RelWithDebInfo`
3. `cd neovim`
- If you want the **stable release**, also run `git checkout stable`.
4. `make CMAKE_BUILD_TYPE=RelWithDebInfo`
- If you want to install to a custom location, set `CMAKE_INSTALL_PREFIX`. See also [INSTALL.md](./INSTALL.md#install-from-source).
- On BSD, use `gmake` instead of `make`.
- To build on Windows, see the [Building on Windows](#building-on-windows) section. _MSVC (Visual Studio) is recommended._
4. `sudo make install`
5. `sudo make install`
- Default install location is `/usr/local`
- On Debian/Ubuntu, instead of installing files directly with `sudo make install`, you can run `cd build && cpack -G DEB && sudo dpkg -i nvim-linux64.deb` to build DEB-package and install it. This should help ensuring the clean removal of installed files.
- On Debian/Ubuntu, instead of `sudo make install`, you can try `cd build && cpack -G DEB && sudo dpkg -i nvim-linux-<arch>.deb` (with `<arch>` either `x86_64` or `arm64`) to build DEB-package and install it. This helps ensure clean removal of installed files. Note: This is an unsupported, "best-effort" feature of the Nvim build.
**Notes**:
- From the repository's root directory, running `make` will download and build all the needed dependencies and put the `nvim` executable in `build/bin`.
@@ -84,7 +85,7 @@ make deps
- Right-click _CMakeLists.txt → Delete Cache_.
- Right-click _CMakeLists.txt → Generate Cache_.
- If you see an "access violation" from `ntdll`, you can ignore it and continue.
4. If you set an error like `msgpackc.dll not found`, try the `nvim.exe (Install)` target. Then switch back to `nvim.exe (bin\nvim.exe)`.
4. If you see an error like `uv.dll not found`, try the `nvim.exe (Install)` target. Then switch back to `nvim.exe (bin\nvim.exe)`.
### Windows / MSVC PowerShell
@@ -131,12 +132,13 @@ https://github.com/cascent/neovim-cygwin was built on Cygwin 2.9.0. Newer `libuv
1. From the MSYS2 shell, install these packages:
```
pacman -S \
mingw-w64-x86_64-{gcc,cmake,make,ninja,diffutils}
mingw-w64-ucrt-x86_64-gcc \
mingw-w64-x86_64-{cmake,make,ninja,diffutils}
```
2. From the Windows Command Prompt (`cmd.exe`), set up the `PATH` and build.
```cmd
set PATH=c:\msys64\mingw64\bin;c:\msys64\usr\bin;%PATH%
set PATH=c:\msys64\ucrt64\bin;c:\msys64\usr\bin;%PATH%
```
3. You have two options:
- Build using `cmake` and `Ninja` generator:
@@ -163,11 +165,40 @@ https://github.com/cascent/neovim-cygwin was built on Cygwin 2.9.0. Newer `libuv
mingw32-make install
```
### Windows WSL
Build Ubuntu/Debian linux binary on [WSL](https://learn.microsoft.com/en-us/windows/wsl/install) (Windows Subsystem for Linux).
```bash
# Install build prerequisites
sudo apt-get install ninja-build gettext cmake build-essential
# Build the linux binary in WSL
make CMAKE_BUILD_TYPE=RelWithDebInfo
# Install the linux binary in WSL (with `<arch>` either `x86_64` or `arm64`)
cd build && cpack -G DEB && sudo dpkg -i nvim-linux-<arch>.deb
# Verify the installation
nvim --version && which nvim # should be debug build in /usr/bin/nvim
```
**Note**: If you encounter linker errors or segfaults during the build, Windows libraries in your PATH may be interfering. Use a clean PATH to avoid conflicts:
```bash
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" make CMAKE_BUILD_TYPE=RelWithDebInfo
```
## Localization
### Localization build
A normal build will create `.mo` files in `build/src/nvim/po`.
Translations are turned off by default. Enable by building Nvim with the CMake flag `ENABLE_TRANSLATIONS=ON`.
Doing this will create `.mo` files in `build/src/nvim/po`. Example:
```
make CMAKE_EXTRA_FLAGS="-DENABLE_TRANSLATIONS=ON"
```
* If you see `msgfmt: command not found`, you need to install [`gettext`](http://en.wikipedia.org/wiki/Gettext). On most systems, the package is just called `gettext`.
@@ -221,7 +252,7 @@ rebuild:
## Third-party dependencies
Reference the [Debian package](https://packages.debian.org/sid/source/neovim) (or alternatively, the [Homebrew formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/neovim.rb)) for the precise list of dependencies/versions.
Reference the [Debian package](https://packages.debian.org/sid/source/neovim) (or alternatively, the [Homebrew formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/n/neovim.rb)) for the precise list of dependencies/versions.
To build the bundled dependencies using CMake:
@@ -240,7 +271,7 @@ cmake --build build
### How to build without "bundled" dependencies
1. Manually install the dependencies:
- libuv libluv libvterm luajit lua-lpeg lua-mpack msgpack-c tree-sitter tree-sitter-bash tree-sitter-c tree-sitter-lua tree-sitter-markdown tree-sitter-python tree-sitter-query tree-sitter-vim tree-sitter-vimdoc unibilium
- libuv libluv libutf8proc luajit lua-lpeg tree-sitter tree-sitter-c tree-sitter-lua tree-sitter-markdown tree-sitter-query tree-sitter-vim tree-sitter-vimdoc unibilium
2. Run CMake:
```sh
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo
@@ -248,7 +279,7 @@ cmake --build build
```
If all the dependencies are not available in the package, you can use only some of the bundled dependencies as follows (example of using `ninja`):
```sh
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_BUNDLED=OFF -DUSE_BUNDLED_LIBVTERM=ON -DUSE_BUNDLED_TS=ON
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_BUNDLED=OFF -DUSE_BUNDLED_TS=ON
cmake --build .deps
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build
@@ -257,11 +288,34 @@ cmake --build build
- Using `ninja` is strongly recommended.
4. If treesitter parsers are not bundled, they need to be available in a `parser/` runtime directory (e.g. `/usr/share/nvim/runtime/parser/`).
### How to build static binary (on Linux)
1. Use a linux distribution which uses musl C. We will use Alpine Linux but any distro with musl should work. (glibc does not support static linking)
2. Run make passing the `STATIC_BUILD` variable: `make CMAKE_EXTRA_FLAGS="-DSTATIC_BUILD=1"`
In case you are not using Alpine Linux you can use a container to do the build the binary:
```bash
podman run \
--rm \
-it \
-v "$PWD:/workdir" \
-w /workdir \
alpine:latest \
bash -c 'apk add build-base cmake coreutils curl gettext-tiny-dev git && make CMAKE_EXTRA_FLAGS="-DSTATIC_BUILD=1"'
```
The resulting binary in `build/bin/nvim` will have all the dependencies statically linked:
```
build/bin/nvim: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, BuildID[sha1]=b93fa8e678d508ac0a76a2e3da20b119105f1b2d, with debug_info, not stripped
```
#### Debian 10 (Buster) example:
```sh
sudo apt install luajit libluajit-5.1-dev lua-mpack lua-lpeg libunibilium-dev libmsgpack-dev
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_BUNDLED=OFF -DUSE_BUNDLED_LIBUV=ON -DUSE_BUNDLED_LUV=ON -DUSE_BUNDLED_LIBVTERM=ON -DUSE_BUNDLED_TS=ON
sudo apt install luajit libluajit-5.1-dev lua-lpeg libunibilium-dev
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_BUNDLED=OFF -DUSE_BUNDLED_LIBUV=ON -DUSE_BUNDLED_LUV=ON -DUSE_BUNDLED_TS=ON -DUSE_BUNDLED_UTF8PROC=ON
cmake --build .deps
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build
@@ -275,7 +329,7 @@ cmake --build build
```
- Example of using a package with some dependencies:
```
make BUNDLED_CMAKE_FLAG="-DUSE_BUNDLED=OFF -DUSE_BUNDLED_LUV=ON -DUSE_BUNDLED_TS=ON -DUSE_BUNDLED_LIBVTERM=ON -DUSE_BUNDLED_LIBUV=ON"
make BUNDLED_CMAKE_FLAG="-DUSE_BUNDLED=OFF -DUSE_BUNDLED_LUV=ON -DUSE_BUNDLED_TS=ON -DUSE_BUNDLED_LIBUV=ON"
```
## Build prerequisites
@@ -283,39 +337,40 @@ cmake --build build
General requirements (see [#1469](https://github.com/neovim/neovim/issues/1469#issuecomment-63058312)):
- Clang or GCC version 4.9+
- CMake version 3.13+, built with TLS/SSL support
- Optional: Get the latest CMake from an [installer](https://github.com/Kitware/CMake/releases) or the [Python package](https://pypi.org/project/cmake/) (`pip install cmake`)
- CMake version 3.16+, built with TLS/SSL support
- Optional: Get the latest CMake from https://cmake.org/download/
- Provides a shell script which works on most Linux systems. After running it, ensure the resulting `cmake` binary is in your $PATH so the the Nvim build will find it.
Platform-specific requirements are listed below.
### Ubuntu / Debian
```sh
sudo apt-get install ninja-build gettext cmake unzip curl build-essential
sudo apt-get install ninja-build gettext cmake curl build-essential git
```
### RHEL / Fedora
```
sudo dnf -y install ninja-build cmake gcc make unzip gettext curl glibc-gconv-extra
sudo dnf -y install ninja-build cmake gcc make gettext curl glibc-gconv-extra git
```
### openSUSE
```
sudo zypper install ninja cmake gcc-c++ gettext-tools curl
sudo zypper install ninja cmake gcc-c++ gettext-tools curl git
```
### Arch Linux
```
sudo pacman -S base-devel cmake unzip ninja curl
sudo pacman -S base-devel cmake ninja curl git
```
### Alpine Linux
```
apk add build-base cmake coreutils curl unzip gettext-tiny-dev
apk add build-base cmake coreutils curl gettext-tiny-dev git
```
### Void Linux
@@ -365,18 +420,21 @@ and replacing `neovim-unwrapped` with `neovim-dev`:
nix-shell '<nixpkgs>' -A neovim-dev
```
Neovim contains a Nix flake in the `contrib` folder, with 3 packages:
A flake for Neovim is hosted at [nix-community/neovim-nightly-overlay](https://github.com/nix-community/neovim-nightly-overlay/), with 3 packages:
- `neovim` to run the nightly
- `neovim-debug` to run the package with debug symbols
- `neovim-developer` to get all the tools to develop on `neovim`
Thus you can run Neovim nightly with `nix run github:neovim/neovim?dir=contrib`.
Similarly to develop on Neovim: `nix develop github:neovim/neovim?dir=contrib#neovim-developer`.
Thus you can run Neovim nightly with `nix run github:nix-community/neovim-nightly-overlay`.
Similarly to develop on Neovim: `nix run github:nix-community/neovim-nightly-overlay#neovim-developer`.
To use a specific version of Neovim, you can pass `--override-input neovim-src .` to use your current directory,
or a specific SHA1 like `--override-input neovim-src github:neovim/neovim/89dc8f8f4e754e70cbe1624f030fb61bded41bc2`.
### FreeBSD
```
sudo pkg install cmake gmake sha unzip wget gettext curl
sudo pkg install cmake gmake sha wget gettext curl git
```
If you get an error regarding a `sha256sum` mismatch, where the actual SHA-256 hash is `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855`, then this is your issue (that's the `sha256sum` of an empty file).
@@ -384,7 +442,7 @@ If you get an error regarding a `sha256sum` mismatch, where the actual SHA-256 h
### OpenBSD
```sh
doas pkg_add gmake cmake unzip curl gettext-tools
doas pkg_add gmake cmake curl gettext-tools git
```
Build can sometimes fail when using the top level `Makefile`, apparently due to some third-party component (see [#2445-comment](https://github.com/neovim/neovim/issues/2445#issuecomment-108124236)). The following instructions use CMake:
@@ -409,7 +467,7 @@ gmake
2. Install [Homebrew](http://brew.sh)
3. Install Neovim build dependencies:
```
brew install ninja cmake gettext curl
brew install ninja cmake gettext curl git
```
- **Note**: If you see Wget certificate errors (for older macOS versions less than 10.10):
```sh
@@ -427,7 +485,7 @@ gmake
2. Install [MacPorts](http://www.macports.org)
3. Install Neovim build dependencies:
```
sudo port install ninja cmake gettext
sudo port install ninja cmake gettext git
```
- **Note**: If you see Wget certificate errors (for older macOS versions less than 10.10):
```sh

View File

@@ -4,14 +4,10 @@
# - pitfalls: https://izzys.casa/2019/02/everything-you-never-wanted-to-know-about-cmake/
# - troubleshooting:
# - variable_watch https://cmake.org/cmake/help/latest/command/variable_watch.html
# - verbose output: cmake --build build --verbose
# Version should match the tested CMAKE_URL in .github/workflows/build.yml.
cmake_minimum_required(VERSION 3.13)
# Can be removed once minimum version is at least 3.15
if(POLICY CMP0092)
cmake_policy(SET CMP0092 NEW)
endif()
cmake_minimum_required(VERSION 3.16)
project(nvim C)
@@ -39,17 +35,26 @@ include(InstallHelpers)
include(PreventInTreeBuilds)
include(Util)
if(NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
# Auto-create a .gitignore in the specified "build" directory.
file(GENERATE OUTPUT .gitignore CONTENT "*")
endif()
#-------------------------------------------------------------------------------
# User settings
#-------------------------------------------------------------------------------
set(DEPS_IGNORE_SHA FALSE)
#-------------------------------------------------------------------------------
# Variables
#-------------------------------------------------------------------------------
set(FUNCS_DATA ${PROJECT_BINARY_DIR}/funcs_data.mpack)
set(TOUCHES_DIR ${PROJECT_BINARY_DIR}/touches)
set(VTERM_TEST_FILE ${PROJECT_BINARY_DIR}/test/vterm_test_output)
file(GLOB DOCFILES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/runtime/doc/*.txt)
set_directory_properties(PROPERTIES
EP_PREFIX "${DEPS_BUILD_DIR}")
if(NOT CI_BUILD)
set(CMAKE_INSTALL_MESSAGE NEVER)
endif()
@@ -112,10 +117,8 @@ if(APPLE)
endif()
if(WIN32 OR APPLE)
# Ignore case when comparing filenames on Windows and Mac.
# Handle case-insensitive filenames for Windows and Mac.
set(CASE_INSENSITIVE_FILENAME TRUE)
# Enable fixing case-insensitive filenames for Windows and Mac.
set(USE_FNAME_CASE TRUE)
endif()
if (MINGW)
@@ -127,38 +130,34 @@ else()
option(ENABLE_LTO "enable link time optimization" ON)
endif()
option(ENABLE_LIBINTL "enable libintl" ON)
option(ENABLE_WASMTIME "enable wasmtime" OFF)
message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
set_default_buildtype(Debug)
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(NOT isMultiConfig)
# Unlike build dependencies in cmake.deps, we assume we want dev dependencies
# such as Uncrustify to always be built with Release.
# Unlike build dependencies in cmake.deps, we want dev dependencies such as
# Uncrustify to always be built with Release.
list(APPEND DEPS_CMAKE_ARGS -D CMAKE_BUILD_TYPE=Release)
endif()
# If not in a git repo (e.g., a tarball) these tokens define the complete
# version string, else they are combined with the result of `git describe`.
set(NVIM_VERSION_MAJOR 0)
set(NVIM_VERSION_MINOR 10)
set(NVIM_VERSION_MINOR 12)
set(NVIM_VERSION_PATCH 0)
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
set(NVIM_VERSION_PRERELEASE "-dev") # for package maintainers
# API level
set(NVIM_API_LEVEL 12) # Bump this after any API change.
set(NVIM_API_LEVEL 14) # Bump this after any API/stdlib change.
set(NVIM_API_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change.
set(NVIM_API_PRERELEASE false)
set(NVIM_API_PRERELEASE true)
# Build-type: RelWithDebInfo
# /Og means something different in MSVC
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -Og -g")
endif()
# We _want_ assertions in RelWithDebInfo build-type.
if(CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DNDEBUG)
string(REPLACE "-DNDEBUG" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
string(REPLACE "/DNDEBUG" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
string(REPLACE "-DNDEBUG" "-DRELDEBUG" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
string(REPLACE "/DNDEBUG" "/DRELDEBUG" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
string(REPLACE " " " " CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") # Remove duplicate whitespace
endif()
@@ -188,6 +187,7 @@ if(NOT PREFER_LUA)
find_program(LUA_PRG NAMES luajit)
endif()
find_program(LUA_PRG NAMES lua5.1 lua5.2 lua)
mark_as_advanced(LUA_PRG)
if(NOT LUA_PRG)
message(FATAL_ERROR "Failed to find a Lua 5.1-compatible interpreter")
endif()
@@ -201,6 +201,7 @@ message(STATUS "Using Lua interpreter: ${LUA_PRG}")
if(NOT LUA_GEN_PRG)
set(LUA_GEN_PRG "${LUA_PRG}" CACHE FILEPATH "Path to the lua used for code generation.")
endif()
mark_as_advanced(LUA_GEN_PRG)
message(STATUS "Using Lua interpreter for code generation: ${LUA_GEN_PRG}")
option(COMPILE_LUA "Pre-compile Lua sources into bytecode (for sources that are included in the binary)" ON)
@@ -220,6 +221,7 @@ if(COMPILE_LUA AND NOT WIN32)
endif()
endif()
endif()
mark_as_advanced(LUAC_PRG)
if(LUAC_PRG)
message(STATUS "Using Lua compiler: ${LUAC_PRG}")
endif()
@@ -230,18 +232,20 @@ if(CI_LINT)
set(LINT_REQUIRED "REQUIRED")
endif()
find_program(SHELLCHECK_PRG shellcheck ${LINT_REQUIRED})
mark_as_advanced(SHELLCHECK_PRG)
find_program(STYLUA_PRG stylua ${LINT_REQUIRED})
mark_as_advanced(STYLUA_PRG)
set(STYLUA_DIRS runtime scripts src test contrib)
add_glob_target(
TARGET lintlua-luacheck
COMMAND $<TARGET_FILE:nvim_bin>
FLAGS -ll ${PROJECT_SOURCE_DIR}/test/lua_runner.lua ${CMAKE_BINARY_DIR}/usr luacheck -q
FLAGS -ll ${PROJECT_SOURCE_DIR}/test/lua_runner.lua ${CMAKE_BINARY_DIR}/usr/share/lua/5.1 luacheck -q
GLOB_DIRS runtime scripts src test
GLOB_PAT *.lua
TOUCH_STRATEGY PER_DIR)
add_dependencies(lintlua-luacheck lua-dev-deps)
add_dependencies(lintlua-luacheck lua_dev_deps)
add_glob_target(
TARGET lintlua-stylua
@@ -250,6 +254,16 @@ add_glob_target(
GLOB_DIRS ${STYLUA_DIRS}
GLOB_PAT *.lua
TOUCH_STRATEGY PER_DIR)
# Special handling of some files (which are ignored in .styluaignore).
# Workaround because stylua doesn't(?) support file-specific settings.
add_custom_target(lintlua-stylua2
COMMAND ${STYLUA_PRG} --config-path "${PROJECT_SOURCE_DIR}/.stylua2.toml"
--color=always --check
"${PROJECT_SOURCE_DIR}/test/functional/ui/decorations_spec.lua"
"${PROJECT_SOURCE_DIR}/test/functional/ui/float_spec.lua"
"${PROJECT_SOURCE_DIR}/test/functional/ui/multigrid_spec.lua"
)
add_dependencies(lintlua-stylua lintlua-stylua2)
add_custom_target(lintlua)
add_dependencies(lintlua lintlua-luacheck lintlua-stylua)
@@ -263,11 +277,11 @@ add_glob_target(
TOUCH_STRATEGY PER_DIR)
add_custom_target(lintcommit
COMMAND $<TARGET_FILE:nvim_bin> -u NONE -l ${PROJECT_SOURCE_DIR}/scripts/lintcommit.lua main)
COMMAND $<TARGET_FILE:nvim_bin> --clean -l ${PROJECT_SOURCE_DIR}/scripts/lintcommit.lua main)
add_dependencies(lintcommit nvim_bin)
add_custom_target(lint)
add_dependencies(lint lintc lintlua lintsh lintcommit)
add_dependencies(lint lintc lintlua lintsh)
# Format
add_glob_target(
@@ -277,7 +291,15 @@ add_glob_target(
GLOB_DIRS ${STYLUA_DIRS}
GLOB_PAT *.lua
TOUCH_STRATEGY PER_DIR)
# Special handling of some files (which are ignored in .styluaignore).
# Workaround because stylua doesn't(?) support file-specific settings.
add_custom_target(formatlua2
COMMAND ${STYLUA_PRG} --config-path "${PROJECT_SOURCE_DIR}/.stylua2.toml"
"${PROJECT_SOURCE_DIR}/test/functional/ui/decorations_spec.lua"
"${PROJECT_SOURCE_DIR}/test/functional/ui/float_spec.lua"
"${PROJECT_SOURCE_DIR}/test/functional/ui/multigrid_spec.lua"
)
add_dependencies(formatlua formatlua2)
add_custom_target(format)
add_dependencies(format formatc formatlua)
@@ -300,26 +322,59 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(cmake.packaging)
endif()
get_externalproject_options(uncrustify ${DEPS_IGNORE_SHA})
ExternalProject_Add(uncrustify
URL https://github.com/uncrustify/uncrustify/archive/uncrustify-0.79.0.tar.gz
URL_HASH SHA256=e7afaeabf636b7f0ce4e3e9747b95f7bd939613a8db49579755dddf44fedca5f
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/uncrustify
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
-D CMAKE_RUNTIME_OUTPUT_DIRECTORY=${DEPS_BIN_DIR}
-D CMAKE_SKIP_RPATH=true
EXCLUDE_FROM_ALL TRUE
DOWNLOAD_NO_PROGRESS TRUE)
${EXTERNALPROJECT_OPTIONS})
option(USE_BUNDLED_BUSTED "Use bundled busted" ON)
if(USE_BUNDLED_BUSTED)
ExternalProject_Add(lua-dev-deps
URL https://github.com/neovim/deps/raw/5a1f71cceb24990a0b15fd9a472a5f549f019248/opt/lua-dev-deps.tar.gz
URL_HASH SHA256=27db2495f5eddc7fc191701ec9b291486853530c6125609d3197d03481e8d5a2
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/lua-dev-deps
get_externalproject_options(lua_dev_deps ${DEPS_IGNORE_SHA})
ExternalProject_Add(lua_dev_deps
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/lua_dev_deps
SOURCE_DIR ${DEPS_SHARE_DIR}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
EXCLUDE_FROM_ALL TRUE
DOWNLOAD_NO_PROGRESS TRUE)
${EXTERNALPROJECT_OPTIONS})
else()
add_custom_target(lua-dev-deps)
add_custom_target(lua_dev_deps)
endif()
if (CMAKE_SYSTEM_PROCESSOR MATCHES "arm|aarch")
set(LUALS_ARCH arm64)
else()
set(LUALS_ARCH x64)
endif()
set(LUALS_VERSION 3.15.0)
set(LUALS "lua-language-server-${LUALS_VERSION}-${CMAKE_SYSTEM_NAME}-${LUALS_ARCH}")
set(LUALS_TARBALL ${LUALS}.tar.gz)
set(LUALS_URL https://github.com/LuaLS/lua-language-server/releases/download/${LUALS_VERSION}/${LUALS_TARBALL})
ExternalProject_Add(download_luals
URL ${LUALS_URL}
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/luals
SOURCE_DIR ${DEPS_BIN_DIR}/luals
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
EXCLUDE_FROM_ALL TRUE
DOWNLOAD_NO_PROGRESS TRUE
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})
file(GLOB_RECURSE LUAFILES runtime/*.lua)
add_target(luals
COMMAND ${DEPS_BIN_DIR}/luals/bin/lua-language-server
--configpath=${PROJECT_SOURCE_DIR}/.luarc.json
--check=${PROJECT_SOURCE_DIR}/runtime
--checklevel=Hint
DEPENDS ${LUAFILES}
CUSTOM_COMMAND_ARGS USES_TERMINAL)
add_dependencies(luals download_luals)

View File

@@ -10,7 +10,7 @@
{
"name": "default",
"displayName": "RelWithDebInfo",
"description": "Enables optimizations (-Og or -O2) with debug information",
"description": "Enables optimizations with debug information",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
},
@@ -19,7 +19,7 @@
{
"name": "debug",
"displayName": "Debug",
"description": "Disables optimizations (-O0), enables debug information",
"description": "No optimizations, enables debug information",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
},
@@ -28,7 +28,7 @@
{
"name": "release",
"displayName": "Release",
"description": "Same as RelWithDebInfo, but disables debug information",
"description": "Optimized for performance, disables debug information",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
},

View File

@@ -42,10 +42,10 @@ Developer guidelines
make distclean
make # Nvim build system uses ninja automatically, if available.
```
- Install `ccache` for faster rebuilds of Nvim. Nvim will use it automatically
if it's found. To disable caching use:
- Install `ccache` or `sccache` for faster rebuilds of Nvim. Nvim will use one
of these automatically if it's found. To disable caching use:
```bash
CCACHE_DISABLE=true make
cmake -B build -D CACHE_PRG=OFF
```
Pull requests (PRs)
@@ -83,7 +83,7 @@ a comment.
### Commit messages
Follow the [conventional commits guidelines][conventional_commits] to *make reviews easier* and to make
the VCS/git logs more valuable. The structure of a commit message is:
the VCS/git logs more valuable (try `make lintcommit`). The structure of a commit message is:
type(scope): subject
@@ -129,7 +129,7 @@ Each pull request must pass the automated builds on [Cirrus CI] and [GitHub Acti
passes various linter checks.
- CI for FreeBSD runs on [Cirrus CI].
- To see CI results faster in your PR, you can temporarily set `TEST_FILE` in
[test.yml](https://github.com/neovim/neovim/blob/e35b9020b16985eee26e942f9a3f6b045bc3809b/.github/workflows/test.yml#L29).
[test.yml](https://github.com/neovim/neovim/blob/ad8e0cfc1dfd937c2577dc032e524c799a772693/.github/workflows/test.yml#L26).
### Coverity
@@ -256,24 +256,24 @@ make lintdoc
```
If you need to modify or debug the documentation flow, these are the main files:
- `./scripts/gen_vimdoc.lua`:
- `./src/gen/gen_vimdoc.lua`:
Main doc generator. Parses C and Lua files to render vimdoc files.
- `./scripts/luacats_parser.lua`:
- `./src/gen/luacats_parser.lua`:
Documentation parser for Lua files.
- `./scripts/cdoc_parser.lua`:
- `./src/gen/cdoc_parser.lua`:
Documentation parser for C files.
- `./scripts/luacats_grammar.lua`:
- `./src/gen/luacats_grammar.lua`:
Lpeg grammar for LuaCATS
- `./scripts/cdoc_grammar.lua`:
- `./src/gen/cdoc_grammar.lua`:
Lpeg grammar for C doc comments
- `./scripts/gen_eval_files.lua`:
- `./src/gen/gen_eval_files.lua`:
Generates documentation and Lua type files from metadata files:
```
runtime/lua/vim/* => runtime/doc/lua.txt
runtime/lua/vim/* => runtime/doc/lua.txt
runtime/lua/vim/lsp/ => runtime/doc/lsp.txt
src/nvim/api/* => runtime/doc/api.txt
src/nvim/eval.lua => runtime/doc/builtin.txt
src/nvim/eval.lua => runtime/doc/vimfn.txt
src/nvim/options.lua => runtime/doc/options.txt
```
@@ -299,7 +299,7 @@ types, etc. See [:help dev-lua-doc][dev-lua-doc].
- If possible, add type information (`table`, `string`, `number`, ...). Multiple valid types are separated by a bar (`string|table`). Indicate optional parameters via `type|nil`.
- If a function in your Lua module should _not_ be documented, add `@nodoc`.
- If the function is internal or otherwise non-public add `@private`.
- Private functions usually should be underscore-prefixed (named "_foo", not "foo").
- Private functions usually should be underscore-prefixed (named "_foo", not "foo"). Prefixing with an underscore implies `@nodoc`.
- Mark deprecated functions with `@deprecated`.
Third-party dependencies

View File

@@ -15,9 +15,10 @@ Install from download
Downloads are available on the [Releases](https://github.com/neovim/neovim/releases) page.
* Latest [stable release](https://github.com/neovim/neovim/releases/latest)
* [macOS x86](https://github.com/neovim/neovim/releases/latest/download/nvim-macos-x86_64.tar.gz)
* [macOS arm](https://github.com/neovim/neovim/releases/latest/download/nvim-macos-arm64.tar.gz)
* [Linux](https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz)
* [macOS x86_64](https://github.com/neovim/neovim/releases/latest/download/nvim-macos-x86_64.tar.gz)
* [macOS arm64](https://github.com/neovim/neovim/releases/latest/download/nvim-macos-arm64.tar.gz)
* [Linux x86_64](https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz)
* [Linux arm64](https://github.com/neovim/neovim/releases/latest/download/nvim-linux-arm64.tar.gz)
* [Windows](https://github.com/neovim/neovim/releases/latest/download/nvim-win64.msi)
* Latest [development prerelease](https://github.com/neovim/neovim/releases/nightly)
@@ -55,21 +56,23 @@ Several Neovim GUIs are available from scoop (extras): [scoop.sh/#/apps?q=neovim
1. Choose a package (**nvim-winXX.zip**) from the [releases page](https://github.com/neovim/neovim/releases).
2. Unzip the package. Any location is fine, administrator privileges are _not_ required.
- `$VIMRUNTIME` will be set to that location automatically.
3. Double-click `nvim-qt.exe`.
3. Run `nvim.exe` from a terminal.
**Optional** steps:
- Add the `bin` folder (e.g. `C:\Program Files\nvim\bin`) to your PATH.
- This makes it easy to run `nvim` and `nvim-qt` from anywhere.
- If `:set spell` does not work, create the `C:/Users/foo/AppData/Local/nvim/site/spell` folder.
- This makes it easy to run `nvim` from anywhere.
- If `:set spell` does not work, create the `%LOCALAPPDATA%/nvim-data/site/spell` folder.
You can then copy your spell files over (for English, located
[here](https://github.com/vim/vim/blob/master/runtime/spell/en.utf-8.spl) and
[here](https://github.com/vim/vim/blob/master/runtime/spell/en.utf-8.sug));
- For Python plugins you need the `pynvim` module. "Virtual envs" are recommended. After activating the virtual env do `pip install pynvim` (in *both*). Edit your `init.vim` so that it contains the path to the env's Python executable:
```vim
let g:python3_host_prog='C:/Users/foo/Envs/neovim3/Scripts/python.exe'
- For Python plugins you need the `pynvim` module. Installation via uv
(https://docs.astral.sh/uv/) is recommended; the `--upgrade` switch ensures
installation of the latest version:
```
- Run `:checkhealth` and read `:help provider-python`.
uv tool install --upgrade pynvim
```
- Run `:checkhealth` and read `:help provider-python` for more details.
- **init.vim ("vimrc"):** If you already have Vim installed you can copy `%userprofile%\_vimrc` to `%userprofile%\AppData\Local\nvim\init.vim` to use your Vim config with Neovim.
@@ -107,35 +110,35 @@ For arm64:
The [Releases](https://github.com/neovim/neovim/releases) page provides pre-built binaries for Linux systems.
```sh
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz
sudo rm -rf /opt/nvim
sudo tar -C /opt -xzf nvim-linux64.tar.gz
sudo tar -C /opt -xzf nvim-linux-x86_64.tar.gz
```
After this step add this to `~/.bashrc`:
Then add this to your shell config (`~/.bashrc`, `~/.zshrc`, ...):
export PATH="$PATH:/opt/nvim-linux64/bin"
export PATH="$PATH:/opt/nvim-linux-x86_64/bin"
### AppImage ("universal" Linux package)
The [Releases](https://github.com/neovim/neovim/releases) page provides an [AppImage](https://appimage.org) that runs on most Linux systems. No installation is needed, just download `nvim.appimage` and run it. (It might not work if your Linux distribution is more than 4 years old.)
The [Releases](https://github.com/neovim/neovim/releases) page provides an [AppImage](https://appimage.org) that runs on most Linux systems. No installation is needed, just download `nvim-linux-x86_64.appimage` and run it. (It might not work if your Linux distribution is more than 4 years old.) The following instructions assume an `x86_64` architecture; on ARM Linux replace with `arm64`.
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
chmod u+x nvim.appimage
./nvim.appimage
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.appimage
chmod u+x nvim-linux-x86_64.appimage
./nvim-linux-x86_64.appimage
To expose nvim globally:
mkdir -p /opt/nvim
mv nvim.appimage /opt/nvim/nvim
mv nvim-linux-x86_64.appimage /opt/nvim/nvim
And the following line to `~/.bashrc`:
And the following line to your shell config (`~/.bashrc`, `~/.zshrc`, ...):
export PATH="$PATH:/opt/nvim/"
If the `./nvim.appimage` command fails, try:
If the `./nvim-linux-x86_64.appimage` command fails, try:
```sh
./nvim.appimage --appimage-extract
./nvim-linux-x86_64.appimage --appimage-extract
./squashfs-root/AppRun --version
# Optional: exposing nvim globally.
@@ -204,7 +207,7 @@ You can also get nightly builds of git master from the [Copr automated build sys
dnf copr enable agriffis/neovim-nightly
dnf install -y neovim python3-neovim
See the [blog post](https://arongriffis.com/2019/03/02/neovim-nightly-builds) for information on how these are built.
See the [blog post](https://arongriffis.com/2019-03-02-neovim-nightly-builds) for information on how these are built.
### Flatpak
@@ -302,7 +305,7 @@ Neovim nightly and stable are available on the [snap store](https://snapcraft.io
**Stable Builds**
```sh
sudo snap install --beta nvim --classic
sudo snap install nvim --classic
```
**Nightly Builds**

View File

@@ -289,3 +289,8 @@ IV) It is not allowed to remove this license from the distribution of the Vim
license for previous Vim releases instead of the license that they came
with, at your option.
====
In addition, different license conditions may apply to some runtime files
included with Vim; these will be specified in the header of each respective
file.

View File

@@ -79,7 +79,9 @@ When a (non-experimental) feature is slated to be removed it should:
`v0.10.0-dev-1957+gd676746c33` then use `0.12`.
- For Vimscript features, use `v:lua.vim.deprecate()`. Use the same version
as described for Lua features.
2. Be _hard_ deprecated in a following a release in which it was soft deprecated.
- `vim.deprecate(…, 'x.y.z')` where major version `x` is greater than the
current Nvim major version, is always treated as _soft_ deprecation.
2. Be _hard_ deprecated in a release following the release in which it was soft deprecated.
- Use of the deprecated feature will still work but should issue a warning.
- Features implemented in C will need bespoke implementations to communicate
to users that the feature is deprecated.
@@ -125,12 +127,12 @@ Some can be auto-bumped by `scripts/bump_deps.lua`.
* [LuaJIT](https://github.com/LuaJIT/LuaJIT)
* [Lua](https://www.lua.org/download.html)
* [Luv](https://github.com/luvit/luv)
* When bumping, also sync [our bundled documentation](https://github.com/neovim/neovim/blob/master/runtime/doc/luvref.txt) with [the upstream documentation](https://github.com/luvit/luv/blob/master/docs.md).
* When bumping, also sync
- [our bundled meta file](https://github.com/neovim/neovim/blob/master/runtime/lua/uv/_meta.lua) with [the upstream meta file](https://github.com/luvit/luv/blob/master/docs/meta.lua);
- [our bundled documentation](https://github.com/neovim/neovim/blob/master/runtime/doc/luvref.txt) with [the upstream documentation](https://github.com/luvit/luv/blob/master/docs/docs.md).
* [gettext](https://ftp.gnu.org/pub/gnu/gettext/)
* [libiconv](https://ftp.gnu.org/pub/gnu/libiconv)
* [libuv](https://github.com/libuv/libuv)
* [libvterm](https://www.leonerd.org.uk/code/libvterm/)
* Downloading from the original source is unreliable, so we use our [mirror](https://github.com/neovim/libvterm) instead.
* [lua-compat](https://github.com/keplerproject/lua-compat-5.3)
* [tree-sitter](https://github.com/tree-sitter/tree-sitter)
* [unibilium](https://github.com/neovim/unibilium)
@@ -143,6 +145,8 @@ These dependencies are "vendored" (inlined), we must update the sources manually
* `src/mpack/`: [libmpack](https://github.com/libmpack/libmpack)
* send improvements upstream!
* `src/mpack/lmpack.c`: [libmpack-lua](https://github.com/libmpack/libmpack-lua)
* send improvements upstream!
* `src/xdiff/`: [xdiff](https://github.com/git/git/tree/master/xdiff)
* `src/cjson/`: [lua-cjson](https://github.com/openresty/lua-cjson)
* `src/klib/`: [Klib](https://github.com/attractivechaos/klib)
@@ -150,7 +154,7 @@ These dependencies are "vendored" (inlined), we must update the sources manually
* `src/nvim/tui/terminfo_defs.h`: terminfo definitions
* Run `scripts/update_terminfo.sh` to update these definitions.
* `runtime/lua/vim/lsp/_meta/protocol.lua`: LSP specification
* Run `scripts/gen_lsp.lua` to update.
* Run `src/gen/gen_lsp.lua` to update.
* `runtime/lua/vim/_meta/lpeg.lua`: LPeg definitions.
* Refer to [`LuaCATS/lpeg`](https://github.com/LuaCATS/lpeg) for updates.
* Update the git SHA revision from which the documentation was taken.
@@ -160,7 +164,6 @@ These dependencies are "vendored" (inlined), we must update the sources manually
* Needs to be updated when LPeg is updated.
* `src/bit.c`: only for PUC lua: port of `require'bit'` from luajit https://bitop.luajit.org/
* `runtime/lua/coxpcall.lua`: coxpcall (only needed for PUC lua, builtin to luajit)
* `src/termkey`: [libtermkey](https://github.com/neovim/libtermkey)
Other dependencies
--------------------------
@@ -170,6 +173,9 @@ Other dependencies
* https://github.com/nvim-winget
* Org secrets/tokens:
* `CODECOV_TOKEN`
* `BACKPORT_KEY`
* Org/repo variables:
* `BACKPORT_APP`
* Domain names (held in https://namecheap.com):
* neovim.org
* neovim.io
@@ -185,10 +191,10 @@ Refactoring
Refactoring Vim structurally and aesthetically is an important goal of Neovim.
But there are some modules that should not be changed significantly, because
they are maintained Vim, at present. Until someone takes "ownership" of these
modules, the cost of any significant changes (including style or structural
changes that re-arrange the code) to these modules outweighs the benefit. The
modules are:
they are maintained by Vim, at present. Until someone takes "ownership" of
these modules, the cost of any significant changes (including style or
structural changes that re-arrange the code) to these modules outweighs the
benefit. The modules are:
- `regexp.c`
- `indent_c.c`
@@ -211,12 +217,12 @@ https://github.com/neovim/neovim-backup
* For special-purpose jobs where the runner version doesn't really matter,
prefer `-latest` tags so we don't need to manually bump the versions. An
example of a special-purpose workflow is `labeler_pr.yml`.
* For our testing job `test.yml`, prefer to use the latest stable (i.e.
non-beta) version explicitly. Avoid using the `-latest` tags here as it
makes it difficult to determine from an unrelated PR if a failure is due
to the PR itself or due to GitHub bumping the `-latest` tag without our
knowledge. There's also a high risk that automatically bumping the CI
versions will fail due to manual work being required from experience.
* For our testing job `test.yml`, prefer to use the latest version
explicitly. Avoid using the `-latest` tags here as it makes it difficult
to determine from an unrelated PR if a failure is due to the PR itself or
due to GitHub bumping the `-latest` tag without our knowledge. There's
also a high risk that automatically bumping the CI versions will fail due
to manual work being required from experience.
* For our release job, which is `release.yml`, prefer to use the oldest
stable (i.e. non-deprecated) versions available. The reason is that we're
trying to produce images that work in the broadest number of environments,
@@ -237,4 +243,4 @@ See also
--------
* https://github.com/neovim/neovim/issues/862
* https://github.com/git/git/blob/master/Documentation/howto/maintain-git.txt
* https://github.com/git/git/blob/master/Documentation/howto/maintain-git.adoc

100
Makefile
View File

@@ -1,3 +1,35 @@
ifeq ($(OS),Windows_NT)
ifeq '$(findstring ;,$(PATH))' ';'
UNIX_LIKE := FALSE
else
UNIX_LIKE := TRUE
endif
else
UNIX_LIKE := TRUE
endif
ifeq ($(UNIX_LIKE),FALSE)
SHELL := powershell.exe
.SHELLFLAGS := -NoProfile -NoLogo
MKDIR := @$$null = new-item -itemtype directory -force
TOUCH := @$$null = new-item -force
RM := remove-item -force
CMAKE := cmake
CMAKE_GENERATOR := Ninja
define rmdir
if (Test-Path $1) { remove-item -recurse $1 }
endef
else
MKDIR := mkdir -p
TOUCH := touch
RM := rm -rf
CMAKE := $(shell (command -v cmake3 || command -v cmake || echo cmake))
CMAKE_GENERATOR ?= "$(shell (command -v ninja > /dev/null 2>&1 && echo "Ninja") || echo "Unix Makefiles")"
define rmdir
rm -rf $1
endef
endif
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
MAKEFILE_DIR := $(dir $(MAKEFILE_PATH))
@@ -9,7 +41,6 @@ filter-true = $(strip $(filter-out 1 on ON true TRUE,$1))
all: nvim
CMAKE ?= $(shell (command -v cmake3 || echo cmake))
CMAKE_FLAGS := -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE)
# Extra CMake flags which extend the default set
CMAKE_EXTRA_FLAGS ?=
@@ -37,21 +68,11 @@ else
checkprefix: ;
endif
CMAKE_GENERATOR ?= $(shell (command -v ninja > /dev/null 2>&1 && echo "Ninja") || \
echo "Unix Makefiles")
DEPS_BUILD_DIR ?= .deps
DEPS_BUILD_DIR ?= ".deps"
ifneq (1,$(words [$(DEPS_BUILD_DIR)]))
$(error DEPS_BUILD_DIR must not contain whitespace)
endif
ifeq (,$(BUILD_TOOL))
ifeq (Ninja,$(CMAKE_GENERATOR))
BUILD_TOOL = ninja
else
BUILD_TOOL = $(MAKE)
endif
endif
DEPS_CMAKE_FLAGS ?=
USE_BUNDLED ?=
@@ -61,7 +82,7 @@ endif
ifneq (,$(findstring functionaltest-lua,$(MAKECMDGOALS)))
BUNDLED_LUA_CMAKE_FLAG := -DUSE_BUNDLED_LUA=ON
$(shell [ -x $(DEPS_BUILD_DIR)/usr/bin/lua ] || rm build/.ran-*)
$(shell [ -x $(DEPS_BUILD_DIR)/usr/bin/lua ] || $(RM) build/.ran-*)
endif
# For use where we want to make sure only a single job is run. This does issue
@@ -69,34 +90,33 @@ endif
SINGLE_MAKE = export MAKEFLAGS= ; $(MAKE)
nvim: build/.ran-cmake deps
$(BUILD_TOOL) -C build
$(CMAKE) --build build
libnvim: build/.ran-cmake deps
$(BUILD_TOOL) -C build libnvim
$(CMAKE) --build build --target libnvim
cmake:
touch CMakeLists.txt
$(TOUCH) CMakeLists.txt
$(MAKE) build/.ran-cmake
build/.ran-cmake: | deps
$(CMAKE) -B build -G '$(CMAKE_GENERATOR)' $(CMAKE_FLAGS) $(CMAKE_EXTRA_FLAGS) $(MAKEFILE_DIR)
touch $@
$(CMAKE) -B build -G $(CMAKE_GENERATOR) $(CMAKE_FLAGS) $(CMAKE_EXTRA_FLAGS) $(MAKEFILE_DIR)
$(TOUCH) $@
deps: | build/.ran-deps-cmake
ifeq ($(call filter-true,$(USE_BUNDLED)),)
$(BUILD_TOOL) -C $(DEPS_BUILD_DIR)
$(CMAKE) --build $(DEPS_BUILD_DIR)
endif
ifeq ($(call filter-true,$(USE_BUNDLED)),)
$(DEPS_BUILD_DIR):
mkdir -p "$@"
$(MKDIR) $@
build/.ran-deps-cmake:: $(DEPS_BUILD_DIR)
$(CMAKE) -S $(MAKEFILE_DIR)/cmake.deps -B $(DEPS_BUILD_DIR) -G '$(CMAKE_GENERATOR)' \
$(BUNDLED_CMAKE_FLAG) $(BUNDLED_LUA_CMAKE_FLAG) $(DEPS_CMAKE_FLAGS)
$(CMAKE) -S $(MAKEFILE_DIR)/cmake.deps -B $(DEPS_BUILD_DIR) -G $(CMAKE_GENERATOR) $(BUNDLED_CMAKE_FLAG) $(BUNDLED_LUA_CMAKE_FLAG) $(DEPS_CMAKE_FLAGS)
endif
build/.ran-deps-cmake::
mkdir -p build
touch $@
$(MKDIR) build
$(TOUCH) "$@"
# TODO: cmake 3.2+ add_custom_target() has a USES_TERMINAL flag.
oldtest: | nvim
@@ -113,16 +133,19 @@ test/old/testdir/%.vim: phony_force nvim
$(SINGLE_MAKE) -C test/old/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst test/old/testdir/%.vim,%,$@)
functionaltest-lua: | nvim
$(BUILD_TOOL) -C build functionaltest
$(CMAKE) --build build --target functionaltest
FORMAT=formatc formatlua format
LINT=lintlua lintsh lintc clang-analyzer lintcommit lintdoc lint
LINT=lintlua lintsh lintc clang-analyzer lintcommit lintdoc lint luals
TEST=functionaltest unittest
generated-sources benchmark $(FORMAT) $(LINT) $(TEST) doc: | build/.ran-cmake
$(CMAKE) --build build --target $@
test: $(TEST)
# iwyu-fix-includes can be downloaded from
# https://github.com/include-what-you-use/include-what-you-use/blob/master/fix_includes.py.
# Create a iwyu-fix-includes shell script in your $PATH that invokes the python script.
iwyu: build/.ran-cmake
$(CMAKE) --preset iwyu
$(CMAKE) --build build > build/iwyu.log
@@ -135,16 +158,19 @@ iwyu: build/.ran-cmake
$(CMAKE) --build build
clean:
test -d build && $(BUILD_TOOL) -C build clean || true
ifneq ($(wildcard build),)
$(CMAKE) --build build --target clean
endif
$(MAKE) -C test/old/testdir clean
$(MAKE) -C runtime/indent clean
distclean:
rm -rf $(DEPS_BUILD_DIR) build
$(call rmdir, $(DEPS_BUILD_DIR))
$(call rmdir, build)
$(MAKE) clean
install: checkprefix nvim
$(BUILD_TOOL) -C build install
$(CMAKE) --install build
appimage:
bash scripts/genappimage.sh
@@ -155,14 +181,10 @@ appimage:
appimage-%:
bash scripts/genappimage.sh $*
# Generic pattern rules, allowing for `make build/bin/nvim` etc.
# Does not work with "Unix Makefiles".
ifeq ($(CMAKE_GENERATOR),Ninja)
build/%: phony_force
$(BUILD_TOOL) -C build $(patsubst build/%,%,$@)
$(DEPS_BUILD_DIR)/%: phony_force
$(BUILD_TOOL) -C $(DEPS_BUILD_DIR) $(patsubst $(DEPS_BUILD_DIR)/%,%,$@)
endif
.PHONY: test clean distclean nvim libnvim cmake deps install appimage checkprefix benchmark $(FORMAT) $(LINT) $(TEST)
.PHONY: emmylua-check
emmylua-check:
-emmylua_check runtime/lua \
--config .luarc.json \
--config .emmyrc.json

View File

@@ -27,7 +27,7 @@ Features
- [API access](https://github.com/neovim/neovim/wiki/Related-projects#api-clients)
from any language including C/C++, C#, Clojure, D, Elixir, Go, Haskell, Java/Kotlin,
JavaScript/Node.js, Julia, Lisp, Lua, Perl, Python, Racket, Ruby, Rust
- Embedded, scriptable [terminal emulator](https://neovim.io/doc/user/nvim_terminal_emulator.html)
- Embedded, scriptable [terminal emulator](https://neovim.io/doc/user/terminal.html)
- Asynchronous [job control](https://github.com/neovim/neovim/pull/2247)
- [Shared data (shada)](https://github.com/neovim/neovim/pull/2506) among multiple editor instances
- [XDG base directories](https://github.com/neovim/neovim/pull/3470) support

462
build.zig Normal file
View File

@@ -0,0 +1,462 @@
const std = @import("std");
const LazyPath = std.Build.LazyPath;
const build_lua = @import("src/build_lua.zig");
const gen = @import("src/gen/gen_steps.zig");
const runtime = @import("runtime/gen_runtime.zig");
const tests = @import("test/run_tests.zig");
const version = struct {
const major = 0;
const minor = 12;
const patch = 0;
const prerelease = "-dev";
const api_level = 14;
const api_level_compat = 0;
const api_prerelease = true;
};
// TODO(bfredl): this is for an upstream issue
pub fn lazyArtifact(d: *std.Build.Dependency, name: []const u8) ?*std.Build.Step.Compile {
var found: ?*std.Build.Step.Compile = null;
for (d.builder.install_tls.step.dependencies.items) |dep_step| {
const inst = dep_step.cast(std.Build.Step.InstallArtifact) orelse continue;
if (std.mem.eql(u8, inst.artifact.name, name)) {
if (found != null) std.debug.panic("artifact name '{s}' is ambiguous", .{name});
found = inst.artifact;
}
}
return found;
}
pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const t = target.result;
const os_tag = t.os.tag;
const is_windows = (os_tag == .windows);
const is_linux = (os_tag == .linux);
const is_darwin = os_tag.isDarwin();
const modern_unix = is_darwin or os_tag.isBSD() or is_linux;
const cross_compiling = b.option(bool, "cross", "cross compile") orelse false;
// TODO(bfredl): option to set nlua0 target explicitly when cross compiling?
const target_host = if (cross_compiling) b.graph.host else target;
const optimize_host = .ReleaseSafe;
// puc lua 5.1 is not ReleaseSafe "safe"
const optimize_lua = if (optimize == .Debug or optimize == .ReleaseSafe) .ReleaseSmall else optimize;
const arch = t.cpu.arch;
const default_luajit = (is_linux and arch == .x86_64) or (is_darwin and arch == .aarch64);
const use_luajit = b.option(bool, "luajit", "use luajit") orelse default_luajit;
const host_use_luajit = if (cross_compiling) false else use_luajit;
const E = enum { luajit, lua51 };
const ziglua = b.dependency("zlua", .{
.target = target,
.optimize = optimize_lua,
.lang = if (use_luajit) E.luajit else E.lua51,
.shared = false,
});
const ziglua_host = if (cross_compiling) b.dependency("zlua", .{
.target = target_host,
.optimize = optimize_lua,
.lang = if (host_use_luajit) E.luajit else E.lua51,
.shared = false,
}) else ziglua;
const lpeg = b.dependency("lpeg", .{});
const iconv = if (is_windows or is_darwin) b.lazyDependency("libiconv", .{ .target = target, .optimize = optimize }) else null;
// this is currently not necessary, as ziglua currently doesn't use lazy dependencies
// to circumvent ziglua.artifact() failing in a bad way.
const lua = lazyArtifact(ziglua, "lua") orelse return;
if (cross_compiling) {
_ = lazyArtifact(ziglua_host, "lua") orelse return;
}
// const lua = ziglua.artifact("lua");
const libuv_dep = b.dependency("libuv", .{ .target = target, .optimize = optimize });
const libuv = libuv_dep.artifact("uv");
const libluv = try build_lua.build_libluv(b, target, optimize, lua, libuv);
const libluv_host = if (cross_compiling) libluv_host: {
const libuv_dep_host = b.dependency("libuv", .{ .target = target_host, .optimize = optimize_host });
const libuv_host = libuv_dep_host.artifact("uv");
break :libluv_host try build_lua.build_libluv(b, target_host, optimize_host, ziglua_host.artifact("lua"), libuv_host);
} else libluv;
const utf8proc = b.dependency("utf8proc", .{ .target = target, .optimize = optimize });
const unibilium = b.dependency("unibilium", .{ .target = target, .optimize = optimize });
// TODO(bfredl): fix upstream bugs with UBSAN
const treesitter = b.dependency("treesitter", .{ .target = target, .optimize = .ReleaseFast });
const nlua0 = build_lua.build_nlua0(b, target_host, optimize_host, host_use_luajit, ziglua_host, lpeg, libluv_host);
// usual caveat emptor: might need to force a rebuild if the only change is
// addition of new .c files, as those are not seen by any hash
const subdirs = [_][]const u8{
"", // src/nvim itself
"os/",
"api/",
"api/private/",
"msgpack_rpc/",
"tui/",
"tui/termkey/",
"event/",
"eval/",
"lib/",
"lua/",
"viml/",
"viml/parser/",
"vterm/",
};
// source names _relative_ src/nvim/, not including other src/ subdircs
var nvim_sources = try std.ArrayList(gen.SourceItem).initCapacity(b.allocator, 100);
var nvim_headers = try std.ArrayList([]u8).initCapacity(b.allocator, 100);
// both source headers and the {module}.h.generated.h files
var api_headers = try std.ArrayList(std.Build.LazyPath).initCapacity(b.allocator, 10);
// TODO(bfredl): these should just become subdirs..
const windows_only = [_][]const u8{ "pty_proc_win.c", "pty_proc_win.h", "pty_conpty_win.c", "pty_conpty_win.h", "os_win_console.c", "win_defs.h" };
const unix_only = [_][]const u8{ "unix_defs.h", "pty_proc_unix.c", "pty_proc_unix.h" };
const exclude_list = if (is_windows) &unix_only else &windows_only;
const src_dir = b.build_root.handle;
for (subdirs) |s| {
var dir = try src_dir.openDir(b.fmt("src/nvim/{s}", .{s}), .{ .iterate = true });
defer dir.close();
var it = dir.iterateAssumeFirstIteration();
const api_export = std.mem.eql(u8, s, "api/");
const os_check = std.mem.eql(u8, s, "os/");
entries: while (try it.next()) |entry| {
if (entry.name.len < 3) continue;
if (entry.name[0] < 'a' or entry.name[0] > 'z') continue;
if (os_check) {
for (exclude_list) |name| {
if (std.mem.eql(u8, name, entry.name)) {
continue :entries;
}
}
}
if (std.mem.eql(u8, ".c", entry.name[entry.name.len - 2 ..])) {
try nvim_sources.append(.{ .name = b.fmt("{s}{s}", .{ s, entry.name }), .api_export = api_export });
}
if (std.mem.eql(u8, ".h", entry.name[entry.name.len - 2 ..])) {
try nvim_headers.append(b.fmt("{s}{s}", .{ s, entry.name }));
if (api_export and !std.mem.eql(u8, "ui_events.in.h", entry.name)) {
try api_headers.append(b.path(b.fmt("src/nvim/{s}{s}", .{ s, entry.name })));
}
}
}
}
const support_unittests = use_luajit;
const gen_config = b.addWriteFiles();
const version_lua = gen_config.add("nvim_version.lua", lua_version_info(b));
var config_str = b.fmt("zig build -Doptimize={s}", .{@tagName(optimize)});
if (cross_compiling) {
config_str = b.fmt("{s} -Dcross -Dtarget={s} (host: {s})", .{ config_str, try t.linuxTriple(b.allocator), try b.graph.host.result.linuxTriple(b.allocator) });
}
const versiondef_step = b.addConfigHeader(.{ .style = .{ .cmake = b.path("cmake.config/versiondef.h.in") } }, .{
.NVIM_VERSION_MAJOR = version.major,
.NVIM_VERSION_MINOR = version.minor,
.NVIM_VERSION_PATCH = version.patch,
.NVIM_VERSION_PRERELEASE = version.prerelease,
.NVIM_VERSION_MEDIUM = "",
.VERSION_STRING = "TODO", // TODO(bfredl): not sure what to put here. summary already in "config_str"
.CONFIG = config_str,
});
_ = gen_config.addCopyFile(versiondef_step.getOutput(), "auto/versiondef.h"); // run_preprocessor() workaronnd
const ptrwidth = t.ptrBitWidth() / 8;
const sysconfig_step = b.addConfigHeader(.{ .style = .{ .cmake = b.path("cmake.config/config.h.in") } }, .{
.SIZEOF_INT = t.cTypeByteSize(.int),
.SIZEOF_INTMAX_T = t.cTypeByteSize(.longlong), // TODO
.SIZEOF_LONG = t.cTypeByteSize(.long),
.SIZEOF_SIZE_T = ptrwidth,
.SIZEOF_VOID_PTR = ptrwidth,
.PROJECT_NAME = "nvim",
.HAVE__NSGETENVIRON = is_darwin,
.HAVE_FD_CLOEXEC = modern_unix,
.HAVE_FSEEKO = modern_unix,
.HAVE_LANGINFO_H = modern_unix,
.HAVE_NL_LANGINFO_CODESET = modern_unix,
.HAVE_NL_MSG_CAT_CNTR = t.isGnuLibC(),
.HAVE_PWD_FUNCS = modern_unix,
.HAVE_READLINK = modern_unix,
.HAVE_STRNLEN = modern_unix,
.HAVE_STRCASECMP = modern_unix,
.HAVE_STRINGS_H = modern_unix,
.HAVE_STRNCASECMP = modern_unix,
.HAVE_STRPTIME = modern_unix,
.HAVE_XATTR = is_linux,
.HAVE_SYS_SDT_H = false,
.HAVE_SYS_UTSNAME_H = modern_unix,
.HAVE_SYS_WAIT_H = false, // unused
.HAVE_TERMIOS_H = modern_unix,
.HAVE_WORKING_LIBINTL = t.isGnuLibC(),
.UNIX = modern_unix,
.CASE_INSENSITIVE_FILENAME = is_darwin or is_windows,
.HAVE_SYS_UIO_H = modern_unix,
.HAVE_READV = modern_unix,
.HAVE_DIRFD_AND_FLOCK = modern_unix,
.HAVE_FORKPTY = modern_unix and !is_darwin, // also on Darwin but we lack the headers :(
.HAVE_BE64TOH = modern_unix and !is_darwin,
.ORDER_BIG_ENDIAN = t.cpu.arch.endian() == .big,
.ENDIAN_INCLUDE_FILE = "endian.h",
.HAVE_EXECINFO_BACKTRACE = modern_unix and !t.isMuslLibC(),
.HAVE_BUILTIN_ADD_OVERFLOW = true,
.HAVE_WIMPLICIT_FALLTHROUGH_FLAG = true,
.HAVE_BITSCANFORWARD64 = null,
.VTERM_TEST_FILE = "test/vterm_test_output", // TODO(bfredl): revisit when porting libvterm tests
});
_ = gen_config.addCopyFile(sysconfig_step.getOutput(), "auto/config.h"); // run_preprocessor() workaronnd
_ = gen_config.add("auto/pathdef.h", b.fmt(
\\char *default_vim_dir = "/usr/local/share/nvim";
\\char *default_vimruntime_dir = "";
\\char *default_lib_dir = "/usr/local/lib/nvim";
, .{}));
// TODO(bfredl): include git version when available
const medium = b.fmt("v{}.{}.{}{s}+zig", .{ version.major, version.minor, version.patch, version.prerelease });
const versiondef_git = gen_config.add("auto/versiondef_git.h", b.fmt(
\\#define NVIM_VERSION_MEDIUM "{s}"
\\#define NVIM_VERSION_BUILD "???"
\\
, .{medium}));
// TODO(zig): using getEmittedIncludeTree() is ugly af. we want unittests
// to reuse the std.build.Module include_path thing
const unittest_include_path = [_]LazyPath{
b.path("src/"),
gen_config.getDirectory(),
lua.getEmittedIncludeTree(),
libuv.getEmittedIncludeTree(),
libluv.getEmittedIncludeTree(),
utf8proc.artifact("utf8proc").getEmittedIncludeTree(),
unibilium.artifact("unibilium").getEmittedIncludeTree(),
treesitter.artifact("tree-sitter").getEmittedIncludeTree(),
if (iconv) |dep| dep.artifact("iconv").getEmittedIncludeTree() else b.path("UNUSED_PATH/"),
};
const gen_headers, const funcs_data = try gen.nvim_gen_sources(b, nlua0, &nvim_sources, &nvim_headers, &api_headers, versiondef_git, version_lua);
const test_config_step = b.addWriteFiles();
_ = test_config_step.add("test/cmakeconfig/paths.lua", try test_config(b));
const test_gen_step = b.step("gen_headers", "debug: output generated headers");
const config_install = b.addInstallDirectory(.{ .source_dir = gen_config.getDirectory(), .install_dir = .prefix, .install_subdir = "config/" });
test_gen_step.dependOn(&config_install.step);
test_gen_step.dependOn(&b.addInstallDirectory(.{ .source_dir = gen_headers.getDirectory(), .install_dir = .prefix, .install_subdir = "headers/" }).step);
const nvim_exe = b.addExecutable(.{
.name = "nvim",
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
}),
});
nvim_exe.rdynamic = true; // -E
nvim_exe.linkLibrary(lua);
nvim_exe.linkLibrary(libuv);
nvim_exe.linkLibrary(libluv);
if (iconv) |dep| nvim_exe.linkLibrary(dep.artifact("iconv"));
nvim_exe.linkLibrary(utf8proc.artifact("utf8proc"));
nvim_exe.linkLibrary(unibilium.artifact("unibilium"));
nvim_exe.linkLibrary(treesitter.artifact("tree-sitter"));
if (is_windows) {
nvim_exe.linkSystemLibrary("netapi32");
}
nvim_exe.addIncludePath(b.path("src"));
nvim_exe.addIncludePath(gen_config.getDirectory());
nvim_exe.addIncludePath(gen_headers.getDirectory());
build_lua.add_lua_modules(nvim_exe.root_module, lpeg, use_luajit, false);
var unit_test_sources = try std.ArrayList([]u8).initCapacity(b.allocator, 10);
if (support_unittests) {
var unit_test_fixtures = try src_dir.openDir("test/unit/fixtures/", .{ .iterate = true });
defer unit_test_fixtures.close();
var it = unit_test_fixtures.iterateAssumeFirstIteration();
while (try it.next()) |entry| {
if (entry.name.len < 3) continue;
if (std.mem.eql(u8, ".c", entry.name[entry.name.len - 2 ..])) {
try unit_test_sources.append(b.fmt("test/unit/fixtures/{s}", .{entry.name}));
}
}
}
const src_paths = try b.allocator.alloc([]u8, nvim_sources.items.len + unit_test_sources.items.len);
for (nvim_sources.items, 0..) |s, i| {
src_paths[i] = b.fmt("src/nvim/{s}", .{s.name});
}
@memcpy(src_paths[nvim_sources.items.len..], unit_test_sources.items);
const flags = [_][]const u8{
"-std=gnu99",
"-DZIG_BUILD",
"-D_GNU_SOURCE",
if (support_unittests) "-DUNIT_TESTING" else "",
if (use_luajit) "" else "-DNVIM_VENDOR_BIT",
if (is_windows) "-DMSWIN" else "",
if (is_windows) "-DWIN32_LEAN_AND_MEAN" else "",
if (is_windows) "-DUTF8PROC_STATIC" else "",
};
nvim_exe.addCSourceFiles(.{ .files = src_paths, .flags = &flags });
nvim_exe.addCSourceFiles(.{ .files = &.{
"src/xdiff/xdiffi.c",
"src/xdiff/xemit.c",
"src/xdiff/xhistogram.c",
"src/xdiff/xpatience.c",
"src/xdiff/xprepare.c",
"src/xdiff/xutils.c",
"src/cjson/lua_cjson.c",
"src/cjson/fpconv.c",
"src/cjson/strbuf.c",
}, .flags = &flags });
const nvim_exe_step = b.step("nvim_bin", "only the binary (not a fully working install!)");
const nvim_exe_install = b.addInstallArtifact(nvim_exe, .{});
nvim_exe_step.dependOn(&nvim_exe_install.step);
const gen_runtime = try runtime.nvim_gen_runtime(b, nlua0, funcs_data);
const runtime_install = b.addInstallDirectory(.{ .source_dir = gen_runtime.getDirectory(), .install_dir = .prefix, .install_subdir = "runtime/" });
const nvim = b.step("nvim", "build the editor");
nvim.dependOn(&nvim_exe_install.step);
nvim.dependOn(&runtime_install.step);
const lua_dev_deps = b.dependency("lua_dev_deps", .{});
const test_deps = b.step("test_deps", "test prerequisites");
test_deps.dependOn(&nvim_exe_install.step);
test_deps.dependOn(&runtime_install.step);
test_deps.dependOn(test_fixture(b, "shell-test", null, target, optimize));
test_deps.dependOn(test_fixture(b, "tty-test", libuv, target, optimize));
test_deps.dependOn(test_fixture(b, "pwsh-test", null, target, optimize));
test_deps.dependOn(test_fixture(b, "printargs-test", null, target, optimize));
test_deps.dependOn(test_fixture(b, "printenv-test", null, target, optimize));
test_deps.dependOn(test_fixture(b, "streams-test", libuv, target, optimize));
const parser_c = b.dependency("treesitter_c", .{ .target = target, .optimize = optimize });
test_deps.dependOn(add_ts_parser(b, "c", parser_c.path("."), false, target, optimize));
const parser_markdown = b.dependency("treesitter_markdown", .{ .target = target, .optimize = optimize });
test_deps.dependOn(add_ts_parser(b, "markdown", parser_markdown.path("tree-sitter-markdown/"), true, target, optimize));
test_deps.dependOn(add_ts_parser(b, "markdown_inline", parser_markdown.path("tree-sitter-markdown-inline/"), true, target, optimize));
const parser_vim = b.dependency("treesitter_vim", .{ .target = target, .optimize = optimize });
test_deps.dependOn(add_ts_parser(b, "vim", parser_vim.path("."), true, target, optimize));
const parser_vimdoc = b.dependency("treesitter_vimdoc", .{ .target = target, .optimize = optimize });
test_deps.dependOn(add_ts_parser(b, "vimdoc", parser_vimdoc.path("."), false, target, optimize));
const parser_lua = b.dependency("treesitter_lua", .{ .target = target, .optimize = optimize });
test_deps.dependOn(add_ts_parser(b, "lua", parser_lua.path("."), true, target, optimize));
const parser_query = b.dependency("treesitter_query", .{ .target = target, .optimize = optimize });
test_deps.dependOn(add_ts_parser(b, "query", parser_query.path("."), false, target, optimize));
const unit_headers: ?[]const LazyPath = if (support_unittests) &(unittest_include_path ++ .{gen_headers.getDirectory()}) else null;
try tests.test_steps(b, nvim_exe, test_deps, lua_dev_deps.path("."), test_config_step.getDirectory(), unit_headers);
}
pub fn test_fixture(
b: *std.Build,
name: []const u8,
libuv: ?*std.Build.Step.Compile,
target: std.Build.ResolvedTarget,
optimize: std.builtin.OptimizeMode,
) *std.Build.Step {
const fixture = b.addExecutable(.{
.name = name,
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
}),
});
const source = if (std.mem.eql(u8, name, "pwsh-test")) "shell-test" else name;
fixture.addCSourceFile(.{ .file = b.path(b.fmt("./test/functional/fixtures/{s}.c", .{source})) });
fixture.linkLibC();
if (libuv) |uv| fixture.linkLibrary(uv);
return &b.addInstallArtifact(fixture, .{}).step;
}
pub fn add_ts_parser(
b: *std.Build,
name: []const u8,
parser_dir: LazyPath,
scanner: bool,
target: std.Build.ResolvedTarget,
optimize: std.builtin.OptimizeMode,
) *std.Build.Step {
const parser = b.addLibrary(.{
.name = name,
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
}),
.linkage = .dynamic,
});
parser.addCSourceFile(.{ .file = parser_dir.path(b, "src/parser.c") });
if (scanner) parser.addCSourceFile(.{ .file = parser_dir.path(b, "src/scanner.c") });
parser.addIncludePath(parser_dir.path(b, "src"));
parser.linkLibC();
const parser_install = b.addInstallArtifact(parser, .{ .dest_sub_path = b.fmt("parser/{s}.so", .{name}) });
return &parser_install.step;
}
pub fn lua_version_info(b: *std.Build) []u8 {
const v = version;
return b.fmt(
\\return {{
\\ {{"major", {}}},
\\ {{"minor", {}}},
\\ {{"patch", {}}},
\\ {{"prerelease", {}}},
\\ {{"api_level", {}}},
\\ {{"api_compatible", {}}},
\\ {{"api_prerelease", {}}},
\\}}
, .{ v.major, v.minor, v.patch, v.prerelease.len > 0, v.api_level, v.api_level_compat, v.api_prerelease });
}
pub fn test_config(b: *std.Build) ![]u8 {
var buf: [std.fs.max_path_bytes]u8 = undefined;
const src_path = try b.build_root.handle.realpath(".", &buf);
// we don't use test/cmakeconfig/paths.lua.in because it contains cmake specific logic
return b.fmt(
\\local M = {{}}
\\
\\M.apple_sysroot = ""
\\M.translations_enabled = "$ENABLE_TRANSLATIONS" == "ON"
\\M.is_asan = "$ENABLE_ASAN_UBSAN" == "ON"
\\M.is_zig_build = true
\\M.vterm_test_file = "test/vterm_test_output"
\\M.test_build_dir = "{[bin_dir]s}" -- bull
\\M.test_source_path = "{[src_path]s}"
\\M.test_lua_prg = ""
\\M.test_luajit_prg = ""
\\ -- include path passed on the cmdline, see test/lua_runner.lua
\\M.include_paths = _G.c_include_path or {{}}
\\
\\return M
, .{ .bin_dir = b.install_path, .src_path = src_path });
}

72
build.zig.zon Normal file
View File

@@ -0,0 +1,72 @@
.{
.name = .neovim,
.fingerprint = 0x66eb090879307a38,
.version = "0.12.0",
.minimum_zig_version = "0.14.0",
.dependencies = .{
.zlua = .{
.url = "git+https://github.com/natecraddock/ziglua#6889b2d90ee6ae96810a9f04ec7c62d9aa91d088",
.hash = "zlua-0.1.0-hGRpCxctBQDEQgDArJ0Kc4RDIsD-Hw3pw9pPPw_kGmmY",
},
.lpeg = .{
.url = "https://github.com/neovim/deps/raw/d495ee6f79e7962a53ad79670cb92488abe0b9b4/opt/lpeg-1.1.0.tar.gz",
.hash = "N-V-__8AAMnaAwCEutreuREG3QayBVEZqUTDQFY1Nsrv2OIt",
},
.luv = .{
.url = "git+https://github.com/luvit/luv?ref=1.51.0-1#4c9fbc6cf6f3338bb0e0426710cf885ee557b540",
.hash = "N-V-__8AAMlNDwCY07jUoMiq3iORXdZy0uFWKiHsy8MaDBJA",
},
.lua_compat53 = .{
.url = "https://github.com/lunarmodules/lua-compat-5.3/archive/v0.13.tar.gz",
.hash = "N-V-__8AADi-AwDnVoXwDCQvv2wcYOmN0bJLqZ44J3lwoQY2",
},
.treesitter = .{
.url = "git+https://github.com/tree-sitter/tree-sitter#d87921bb9c39b0b06c811f2082f9a9991cdca027",
.hash = "tree_sitter-0.26.0-Tw2sRxO7CwC0NyDrSygSi7UXRHMNUFEF8GRq6dK81lRF",
},
.libuv = .{
.url = "git+https://github.com/allyourcodebase/libuv#a2dfd385bd2a00d6d290fda85a40a55a9d6cffc5",
.hash = "libuv-1.51.0-htqqv6liAADxBLIBCZT-qUh_3nRRwtNYsOFQOUmrd_sx",
},
.utf8proc = .{ .path = "./deps/utf8proc/" },
.unibilium = .{ .path = "./deps/unibilium/" },
.libiconv = .{
.url = "git+https://github.com/allyourcodebase/libiconv#9def4c8a1743380e85bcedb80f2c15b455e236f3",
.hash = "libiconv-1.18.0-p9sJwWnqAACzVYeWgXB5r5lOQ74XwTPlptixV0JPRO28",
.lazy = true,
},
.lua_dev_deps = .{
.url = "https://github.com/neovim/deps/raw/06ef2b58b0876f8de1a3f5a710473dcd7afff251/opt/lua-dev-deps.tar.gz",
.hash = "N-V-__8AAGevEQCHAkCozca5AIdN9DFc3Luf3g3r2AcbyOrm",
},
.treesitter_c = .{
.url = "git+https://github.com/tree-sitter/tree-sitter-c?ref=v0.24.1#7fa1be1b694b6e763686793d97da01f36a0e5c12",
.hash = "N-V-__8AANxPSABzw3WBTSH_YkwaGAfrK6PBqAMqQedkDDim",
},
.treesitter_markdown = .{
.url = "git+https://github.com/tree-sitter-grammars/tree-sitter-markdown?ref=v0.5.0#afaa4138517363362f54c89330c9d79391e81168",
.hash = "N-V-__8AAIIZUwD3CGdyI2DiHu7Suj2jIF_EAVlM6REFGwju",
},
.treesitter_lua = .{
.url = "git+https://github.com/tree-sitter-grammars/tree-sitter-lua?ref=v0.4.0#4569d1c361129e71a205b94a05e158bd71b1709f",
.hash = "N-V-__8AAEF5CABqSL9zqc03aQsT6Nni54ZCcL98pnuDL2D3",
},
.treesitter_vim = .{
.url = "git+https://github.com/tree-sitter-grammars/tree-sitter-vim?ref=v0.7.0#3dd4747082d1b717b8978211c06ef7b6cd16125b",
.hash = "N-V-__8AAMArVAB4uo2wg2XRs8HBviQ4Pq366cC_iRolX4Vc",
},
.treesitter_vimdoc = .{
.url = "git+https://github.com/neovim/tree-sitter-vimdoc?ref=v4.0.0#9f6191a98702edc1084245abd5523279d4b681fb",
.hash = "N-V-__8AAI4YCgD7OqxCEAmz2RqT_ohl6eA4F0fGMtLIe7nb",
},
.treesitter_query = .{
.url = "git+https://github.com/tree-sitter-grammars/tree-sitter-query?ref=v0.6.2#8a43889f89fd0667289936341bff3a77bafade17",
.hash = "N-V-__8AAARLBACBLGiXGFTijEzLv8AwiqT_kJpmVjir1BgX",
},
},
.paths = .{
// TODO(bfredl): explicitly list the subdirs which actually are used
"",
},
}

View File

@@ -173,9 +173,7 @@ function(append_target_expression)
${ARGN})
set(TARGET_EXPRESSION "$<TARGET_PROPERTY:nvim_bin,${ARG_PROPERTY}>")
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.15)
set(TARGET_EXPRESSION "$<REMOVE_DUPLICATES:${TARGET_EXPRESSION}>")
endif()
set(TARGET_EXPRESSION "$<REMOVE_DUPLICATES:${TARGET_EXPRESSION}>")
set(TARGET_EXPRESSION "${ARG_PREFIX}$<JOIN:${TARGET_EXPRESSION}, ${ARG_PREFIX}>")
set(VERSION_STRING "${VERSION_STRING} ${TARGET_EXPRESSION} " PARENT_SCOPE)

View File

@@ -34,7 +34,6 @@
#cmakedefine HAVE_WORKING_LIBINTL
#cmakedefine UNIX
#cmakedefine CASE_INSENSITIVE_FILENAME
#cmakedefine USE_FNAME_CASE
#cmakedefine HAVE_SYS_UIO_H
#ifdef HAVE_SYS_UIO_H
#cmakedefine HAVE_READV
@@ -53,3 +52,5 @@
#cmakedefine HAVE_BUILTIN_ADD_OVERFLOW
#cmakedefine HAVE_WIMPLICIT_FALLTHROUGH_FLAG
#cmakedefine HAVE_BITSCANFORWARD64
#define VTERM_TEST_FILE "@VTERM_TEST_FILE@"

View File

@@ -12,6 +12,10 @@
#endif
#define NVIM_VERSION_CFLAGS "${VERSION_STRING}"
#define NVIM_VERSION_BUILD_TYPE "$<CONFIG>"
#ifdef ZIG_BUILD
# define NVIM_VERSION_BUILD_TYPE "${CONFIG}"
#else
# define NVIM_VERSION_BUILD_TYPE "$<CONFIG>"
#endif
#endif // AUTO_VERSIONDEF_H

View File

@@ -1,5 +1,5 @@
# This is not meant to be included by the top-level.
cmake_minimum_required (VERSION 3.13)
cmake_minimum_required(VERSION 3.16)
project(NVIM_DEPS C)
if(POLICY CMP0135)
@@ -27,16 +27,16 @@ set(DEPS_IGNORE_SHA FALSE)
option(USE_BUNDLED "Use bundled dependencies." ON)
option(USE_BUNDLED_LIBUV "Use the bundled libuv." ${USE_BUNDLED})
option(USE_BUNDLED_LIBVTERM "Use the bundled libvterm." ${USE_BUNDLED})
option(USE_BUNDLED_LPEG "Use the bundled lpeg." ${USE_BUNDLED})
# PUC Lua is only used for tests, unless explicitly requested.
option(USE_BUNDLED_LUA "Use the bundled version of lua." OFF)
option(USE_BUNDLED_LUAJIT "Use the bundled version of luajit." ${USE_BUNDLED})
option(USE_BUNDLED_LUV "Use the bundled version of luv." ${USE_BUNDLED})
option(USE_BUNDLED_MSGPACK "Use the bundled msgpack." ${USE_BUNDLED})
option(USE_BUNDLED_TS "Use the bundled treesitter runtime." ${USE_BUNDLED})
option(USE_BUNDLED_TS_PARSERS "Use the bundled treesitter parsers." ${USE_BUNDLED})
option(USE_BUNDLED_UNIBILIUM "Use the bundled unibilium." ${USE_BUNDLED})
option(USE_BUNDLED_UTF8PROC "Use the bundled utf8proc library." ${USE_BUNDLED})
if(USE_BUNDLED AND MSVC)
option(USE_BUNDLED_GETTEXT "Use the bundled version of gettext." ON)
option(USE_BUNDLED_LIBICONV "Use the bundled version of libiconv." ON)
@@ -45,6 +45,19 @@ else()
option(USE_BUNDLED_LIBICONV "Use the bundled version of libiconv." OFF)
endif()
option(ENABLE_WASMTIME "Use treesitter with wasmtime support." OFF)
if(ENABLE_WASMTIME)
if(USE_BUNDLED)
option(USE_BUNDLED_WASMTIME "Use the bundled wasmtime." ON)
else()
option(USE_BUNDLED_WASMTIME "Use the bundled wasmtime." OFF)
endif()
endif()
if(NOT ENABLE_WASMTIME AND USE_BUNDLED_WASMTIME)
message(FATAL_ERROR "ENABLE_WASMTIME is set to OFF while USE_BUNDLED_WASMTIME is set to ON.\
You need set ENABLE_WASMTIME to ON if you want to use wasmtime.")
endif()
option(USE_EXISTING_SRC_DIR "Skip download of deps sources in case of existing source directory." OFF)
set_default_buildtype(Release)
@@ -60,7 +73,7 @@ if(HAS_OG_FLAG)
set(DEFAULT_MAKE_CFLAGS CFLAGS+=-Og ${DEFAULT_MAKE_CFLAGS})
endif()
set(DEPS_INCLUDE_FLAGS "-I${DEPS_INSTALL_DIR}/include -I${DEPS_INSTALL_DIR}/include/luajit-2.1")
set(DEPS_INCLUDE_FLAGS "-I\"${DEPS_INSTALL_DIR}/include\" -I\"${DEPS_INSTALL_DIR}/include/luajit-2.1\"")
# If the macOS deployment target is not set manually (via $MACOSX_DEPLOYMENT_TARGET),
# fall back to local system version. Needs to be done here and in top-level CMakeLists.txt.
@@ -74,25 +87,6 @@ if(APPLE)
message(STATUS "Using deployment target ${CMAKE_OSX_DEPLOYMENT_TARGET}")
endif()
set_directory_properties(PROPERTIES
EP_PREFIX "${DEPS_BUILD_DIR}"
CMAKE_CONFIGURE_DEPENDS deps.txt)
file(READ deps.txt DEPENDENCIES)
STRING(REGEX REPLACE "\n" ";" DEPENDENCIES "${DEPENDENCIES}")
foreach(dep ${DEPENDENCIES})
STRING(REGEX REPLACE " " ";" dep "${dep}")
list(GET dep 0 name)
list(GET dep 1 value)
if(NOT ${name})
# _URL variables must NOT be set when USE_EXISTING_SRC_DIR is set,
# otherwise ExternalProject will try to re-download the sources.
if(NOT USE_EXISTING_SRC_DIR)
set(${name} ${value})
endif()
endif()
endforeach()
if(USE_BUNDLED_LUAJIT)
set(LUA_ENGINE LuaJit)
elseif(USE_BUNDLED_LUA)
@@ -102,10 +96,10 @@ else()
find_package(Lua 5.1 EXACT)
if(LUAJIT_FOUND)
set(LUA_ENGINE LuaJit)
string(APPEND DEPS_INCLUDE_FLAGS " -I${LUAJIT_INCLUDE_DIR}")
string(APPEND DEPS_INCLUDE_FLAGS " -I\"${LUAJIT_INCLUDE_DIR}\"")
elseif(LUA_FOUND)
set(LUA_ENGINE Lua)
string(APPEND DEPS_INCLUDE_FLAGS " -I${LUA_INCLUDE_DIR}")
string(APPEND DEPS_INCLUDE_FLAGS " -I\"${LUA_INCLUDE_DIR}\"")
else()
message(FATAL_ERROR "Could not find system lua or luajit")
endif()
@@ -115,18 +109,10 @@ if(USE_BUNDLED_UNIBILIUM)
include(BuildUnibilium)
endif()
if(USE_BUNDLED_LIBVTERM)
include(BuildLibvterm)
endif()
if(USE_BUNDLED_LIBUV)
include(BuildLibuv)
endif()
if(USE_BUNDLED_MSGPACK)
include(BuildMsgpack)
endif()
if(USE_BUNDLED_LUAJIT)
include(BuildLuajit)
endif()
@@ -155,15 +141,21 @@ if(USE_BUNDLED_TS_PARSERS)
include(BuildTreesitterParsers)
endif()
if(USE_BUNDLED_WASMTIME)
include(BuildWasmtime)
endif()
if(USE_BUNDLED_TS)
include(BuildTreesitter)
endif()
if(USE_BUNDLED_UTF8PROC)
include(BuildUTF8proc)
endif()
if(WIN32)
include(GetBinaryDeps)
GetExecutable(TARGET cat)
GetExecutable(TARGET tee)
GetExecutable(TARGET xxd)
GetBinaryDep(TARGET win32yank_X86_64

View File

@@ -16,8 +16,9 @@
"description": "Build neovim with external deps on ubuntu",
"cacheVariables": {
"USE_BUNDLED":"OFF",
"USE_BUNDLED_LIBVTERM":"ON",
"USE_BUNDLED_TS":"ON"
"USE_BUNDLED_TS":"ON",
"USE_BUNDLED_UTF8PROC":"ON",
"ENABLE_WASMTIME":"OFF"
},
"inherits": ["base"]
}

View File

@@ -1,8 +0,0 @@
get_externalproject_options(libvterm ${DEPS_IGNORE_SHA})
ExternalProject_Add(libvterm
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libvterm
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibvtermCMakeLists.txt
${DEPS_BUILD_DIR}/src/libvterm/CMakeLists.txt
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
${EXTERNALPROJECT_OPTIONS})

View File

@@ -42,7 +42,7 @@ if(APPLE)
endif()
if(UNIX)
BuildLuaJit(INSTALL_COMMAND ${BUILDCMD_UNIX}
BuildLuajit(INSTALL_COMMAND ${BUILDCMD_UNIX}
CC=${DEPS_C_COMPILER} PREFIX=${DEPS_INSTALL_DIR}
${DEPLOYMENT_TARGET} install)
@@ -53,7 +53,7 @@ elseif(MINGW)
else()
set(LUAJIT_MAKE_PRG ${CMAKE_MAKE_PROGRAM})
endif()
BuildLuaJit(BUILD_COMMAND ${LUAJIT_MAKE_PRG} CC=${DEPS_C_COMPILER}
BuildLuajit(BUILD_COMMAND ${LUAJIT_MAKE_PRG} CC=${DEPS_C_COMPILER}
PREFIX=${DEPS_INSTALL_DIR}
CFLAGS+=-DLUA_USE_APICHECK
CFLAGS+=-funwind-tables
@@ -75,7 +75,7 @@ elseif(MINGW)
)
elseif(MSVC)
BuildLuaJit(
BuildLuajit(
BUILD_COMMAND ${CMAKE_COMMAND} -E chdir ${DEPS_BUILD_DIR}/src/luajit/src ${DEPS_BUILD_DIR}/src/luajit/src/msvcbuild.bat
INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_BIN_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/luajit.exe ${DEPS_BIN_DIR}

View File

@@ -1,7 +0,0 @@
get_externalproject_options(msgpack ${DEPS_IGNORE_SHA})
ExternalProject_Add(msgpack
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/msgpack
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
-D MSGPACK_BUILD_TESTS=OFF
-D MSGPACK_BUILD_EXAMPLES=OFF
${EXTERNALPROJECT_OPTIONS})

View File

@@ -1,8 +1,14 @@
if(ENABLE_WASMTIME)
set(TREESITTER_ARGS -D TREE_SITTER_FEATURE_WASM=ON)
endif()
get_externalproject_options(treesitter ${DEPS_IGNORE_SHA})
ExternalProject_Add(treesitter
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/treesitter
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/cmake/TreesitterCMakeLists.txt
${DEPS_BUILD_DIR}/src/treesitter/CMakeLists.txt
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
SOURCE_SUBDIR lib
CMAKE_ARGS ${DEPS_CMAKE_ARGS} ${TREESITTER_ARGS}
${EXTERNALPROJECT_OPTIONS})
if(USE_BUNDLED_WASMTIME)
add_dependencies(treesitter wasmtime)
endif()

View File

@@ -28,7 +28,7 @@ function(BuildTSParser)
${EXTERNALPROJECT_OPTIONS})
endfunction()
foreach(lang c lua vim vimdoc query python bash)
foreach(lang c lua vim vimdoc query)
BuildTSParser(LANG ${lang})
endforeach()
BuildTSParser(LANG markdown CMAKE_FILE MarkdownParserCMakeLists.txt)

View File

@@ -0,0 +1,5 @@
get_externalproject_options(utf8proc ${DEPS_IGNORE_SHA})
ExternalProject_Add(utf8proc
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/utf8proc
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
${EXTERNALPROJECT_OPTIONS})

View File

@@ -0,0 +1,12 @@
# wasmtime is a chungus -- optimize _extra hard_ to keep nvim svelte
get_externalproject_options(wasmtime ${DEPS_IGNORE_SHA})
ExternalProject_Add(wasmtime
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/wasmtime
SOURCE_SUBDIR crates/c-api
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
-D WASMTIME_FASTEST_RUNTIME=ON # build with full LTO
-D WASMTIME_DISABLE_ALL_FEATURES=ON # don't need all that crap...
-D WASMTIME_FEATURE_CRANELIFT=ON # ...except this one (compiles wasm to platform code)
-D WASMTIME_FEATURE_GC_DRC=ON # ...and this one (needed by ts to create engines)
USES_TERMINAL_BUILD TRUE
${EXTERNALPROJECT_OPTIONS})

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.13)
cmake_minimum_required(VERSION 3.16)
project(gettext C)
add_compile_options(-w)
@@ -15,15 +15,20 @@ string(REPLACE "#undef HAVE_LONG_LONG_INT" "#define HAVE_LONG_LONG_INT 1" CONFIG
string(REPLACE "#undef HAVE_ICONV_H" "#define HAVE_ICONV_H 1" CONFIG_CONTENT ${CONFIG_CONTENT})
string(REPLACE "#undef HAVE_ICONV" "#define HAVE_ICONV 1" CONFIG_CONTENT ${CONFIG_CONTENT})
string(REPLACE "#undef ICONV_CONST" "#define ICONV_CONST const" CONFIG_CONTENT ${CONFIG_CONTENT})
string(REPLACE "#undef uintmax_t" "
#if _WIN64
# define intmax_t long long
# define uintmax_t unsigned long long
#elif _WIN32
# define intmax_t long
# define uintmax_t unsigned long
#endif"
CONFIG_CONTENT ${CONFIG_CONTENT})
if(MSVC)
string(REPLACE "#undef HAVE_STDINT_H_WITH_UINTMAX" "#define HAVE_STDINT_H_WITH_UINTMAX 1" CONFIG_CONTENT ${CONFIG_CONTENT})
string(REPLACE "#undef HAVE_STDINT_H" "#define HAVE_STDINT_H 1" CONFIG_CONTENT ${CONFIG_CONTENT})
else()
string(REPLACE "#undef uintmax_t" "
#if _WIN64
# define intmax_t long long
# define uintmax_t unsigned long long
#elif _WIN32
# define intmax_t long
# define uintmax_t unsigned long
#endif"
CONFIG_CONTENT ${CONFIG_CONTENT})
endif()
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gettext-runtime/config.h ${CONFIG_CONTENT})
set(HAVE_NEWLOCALE 0)

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.13)
cmake_minimum_required(VERSION 3.16)
project(libiconv C)
add_compile_options(-w)

View File

@@ -1,28 +0,0 @@
cmake_minimum_required(VERSION 3.13)
project(libvterm C)
add_compile_options(-w)
include(GNUInstallDirs)
include_directories(${CMAKE_SOURCE_DIR}/include)
include_directories(${CMAKE_BINARY_DIR})
file(GLOB VTERM_SOURCES ${CMAKE_SOURCE_DIR}/src/*.c)
add_library(vterm ${VTERM_SOURCES})
install(TARGETS vterm ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES include/vterm.h include/vterm_keycodes.h
DESTINATION include)
if(NOT WIN32)
file(GLOB BIN_SOURCES ${CMAKE_SOURCE_DIR}/bin/*.c)
foreach(EXE_C ${BIN_SOURCES})
get_filename_component(target_name ${EXE_C} NAME_WE)
add_executable(${target_name} ${EXE_C})
target_link_libraries(${target_name} vterm)
install(TARGETS ${target_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endforeach()
endif()
# vim: set ft=cmake:

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.13)
cmake_minimum_required(VERSION 3.16)
project (lpeg C)
include(GNUInstallDirs)

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.13)
cmake_minimum_required(VERSION 3.16)
project(${PARSERLANG} C)
add_compile_options(-w)

View File

@@ -1,17 +0,0 @@
cmake_minimum_required(VERSION 3.13)
project(treesitter C)
add_compile_options(-w)
add_library(tree-sitter lib/src/lib.c)
target_include_directories(tree-sitter
PRIVATE lib/src lib/include)
install(FILES
lib/include/tree_sitter/api.h
DESTINATION include/tree_sitter)
include(GNUInstallDirs)
install(TARGETS tree-sitter DESTINATION ${CMAKE_INSTALL_LIBDIR})
# vim: set ft=cmake:

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.13)
cmake_minimum_required(VERSION 3.16)
project(parser C)
add_compile_options(-w)

View File

@@ -1,23 +1,17 @@
LIBUV_URL https://github.com/libuv/libuv/archive/v1.48.0.tar.gz
LIBUV_SHA256 8c253adb0f800926a6cbd1c6576abae0bc8eb86a4f891049b72f9e5b7dc58f33
LIBUV_URL https://github.com/libuv/libuv/archive/v1.51.0.tar.gz
LIBUV_SHA256 27e55cf7083913bfb6826ca78cde9de7647cded648d35f24163f2d31bb9f51cd
MSGPACK_URL https://github.com/msgpack/msgpack-c/archive/c-6.0.1.tar.gz
MSGPACK_SHA256 58d5fe49d0ee2b374d60a61aabf8028b2c92004e6f11bff04e74b639fc8ad541
LUAJIT_URL https://github.com/LuaJIT/LuaJIT/archive/75e92777988017fe47c5eb290998021bbf972d1f.tar.gz
LUAJIT_SHA256 0f69288190024d732c67645e40ed5b137d67aa950fedf0f44a9ad0f3dba6d5d2
LUAJIT_URL https://github.com/luajit/luajit/archive/871db2c84ecefd70a850e03a6c340214a81739f0.tar.gz
LUAJIT_SHA256 ab3f16d82df6946543565cfb0d2810d387d79a3a43e0431695b03466188e2680
LUA_URL https://www.lua.org/ftp/lua-5.1.5.tar.gz
LUA_SHA256 2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333
UNIBILIUM_URL https://github.com/neovim/unibilium/archive/d72c3598e7ac5d1ebf86ee268b8b4ed95c0fa628.tar.gz
UNIBILIUM_SHA256 9c4747c862ab5e3076dcf8fa8f0ea7a6b50f20ec5905618b9536655596797487
UNIBILIUM_URL https://github.com/neovim/unibilium/archive/v2.1.2.tar.gz
UNIBILIUM_SHA256 370ecb07fbbc20d91d1b350c55f1c806b06bf86797e164081ccc977fc9b3af7a
LIBVTERM_URL https://github.com/neovim/libvterm/archive/0a15c6e983b0db7ef8276e0792414a805d01bdaf.tar.gz
LIBVTERM_SHA256 c4683e7a2d71c04781fd0ab7719a94202800e97a9e091514c16983bb732b0fa7
LUV_URL https://github.com/luvit/luv/releases/download/1.48.0-2/luv-1.48.0-2.tar.gz
LUV_SHA256 2c3a1ddfebb4f6550293a40ee789f7122e97647eede51511f57203de48c03b7a
LUV_URL https://github.com/luvit/luv/archive/1.51.0-1.tar.gz
LUV_SHA256 d4a11178ae8e16ba5886799ea91905dd9b0b479c75aebd67866d37373e41526f
LPEG_URL https://github.com/neovim/deps/raw/d495ee6f79e7962a53ad79670cb92488abe0b9b4/opt/lpeg-1.1.0.tar.gz
LPEG_SHA256 4b155d67d2246c1ffa7ad7bc466c1ea899bbc40fef0257cc9c03cecbaed4352a
@@ -25,10 +19,6 @@ LPEG_SHA256 4b155d67d2246c1ffa7ad7bc466c1ea899bbc40fef0257cc9c03cecbaed4352a
LUA_COMPAT53_URL https://github.com/lunarmodules/lua-compat-5.3/archive/v0.13.tar.gz
LUA_COMPAT53_SHA256 f5dc30e7b1fda856ee4d392be457642c1f0c259264a9b9bfbcb680302ce88fc2
CAT_URL https://github.com/neovim/deps/raw/21c5e8bdda33521a6ed497b315e03265a2785cbc/opt/cat.exe
CAT_SHA256 93b8d307bb15af3968920bdea3beb869a49d166f9164853c58a4e6ffdcae61c6
TEE_URL https://github.com/neovim/deps/raw/21c5e8bdda33521a6ed497b315e03265a2785cbc/opt/tee.exe
TEE_SHA256 950eea4e17fa3a7e89fa2c55374037b5797b3f1a54fea1304634884ab42ec14d
XXD_URL https://github.com/neovim/deps/raw/21c5e8bdda33521a6ed497b315e03265a2785cbc/opt/xxd.exe
XXD_SHA256 7a581e3882d28161cc52850f9a11d634b3eaf2c029276f093c1ed4c90e45a10c
@@ -41,21 +31,28 @@ GETTEXT_SHA256 66415634c6e8c3fa8b71362879ec7575e27da43da562c798a8a2f223e6e47f5c
LIBICONV_URL https://github.com/neovim/deps/raw/b9bf36eb31f27e8136d907da38fa23518927737e/opt/libiconv-1.17.tar.gz
LIBICONV_SHA256 8f74213b56238c85a50a5329f77e06198771e70dd9a739779f4c02f65d971313
TREESITTER_C_URL https://github.com/tree-sitter/tree-sitter-c/archive/v0.21.0.tar.gz
TREESITTER_C_SHA256 6f0f5d1b71cf8ffd8a37fb638c6022fa1245bd630150b538547d52128ce0ea7e
TREESITTER_LUA_URL https://github.com/tree-sitter-grammars/tree-sitter-lua/archive/v0.1.0.tar.gz
TREESITTER_LUA_SHA256 230cfcbfa74ed1f7b8149e9a1f34c2efc4c589a71fe0f5dc8560622f8020d722
TREESITTER_VIM_URL https://github.com/neovim/tree-sitter-vim/archive/v0.4.0.tar.gz
TREESITTER_VIM_SHA256 9f856f8b4a10ab43348550fa2d3cb2846ae3d8e60f45887200549c051c66f9d5
TREESITTER_VIMDOC_URL https://github.com/neovim/tree-sitter-vimdoc/archive/v2.5.1.tar.gz
TREESITTER_VIMDOC_SHA256 063645096504b21603585507c41c6d8718ff3c11b2150c5bfc31e8f3ee9afea3
TREESITTER_QUERY_URL https://github.com/tree-sitter-grammars/tree-sitter-query/archive/v0.3.0.tar.gz
TREESITTER_QUERY_SHA256 f878ff37abcb83250e31a6569e997546f3dbab74dcb26683cb2d613f7568cfc0
TREESITTER_PYTHON_URL https://github.com/tree-sitter/tree-sitter-python/archive/v0.21.0.tar.gz
TREESITTER_PYTHON_SHA256 720304a603271fa89e4430a14d6a81a023d6d7d1171b1533e49c0ab44f1e1c13
TREESITTER_BASH_URL https://github.com/tree-sitter/tree-sitter-bash/archive/v0.21.0.tar.gz
TREESITTER_BASH_SHA256 f0515efda839cfede851adb24ac154227fbc0dfb60c6c11595ecfa9087d43ceb
TREESITTER_MARKDOWN_URL https://github.com/MDeiml/tree-sitter-markdown/archive/v0.2.3.tar.gz
TREESITTER_MARKDOWN_SHA256 4909d6023643f1afc3ab219585d4035b7403f3a17849782ab803c5f73c8a31d5
TREESITTER_URL https://github.com/tree-sitter/tree-sitter/archive/v0.22.6.tar.gz
TREESITTER_SHA256 e2b687f74358ab6404730b7fb1a1ced7ddb3780202d37595ecd7b20a8f41861f
UTF8PROC_URL https://github.com/JuliaStrings/utf8proc/archive/v2.10.0.tar.gz
UTF8PROC_SHA256 6f4f1b639daa6dca9f80bc5db1233e9cbaa31a67790887106160b33ef743f136
TREESITTER_C_URL https://github.com/tree-sitter/tree-sitter-c/archive/v0.24.1.tar.gz
TREESITTER_C_SHA256 25dd4bb3dec770769a407e0fc803f424ce02c494a56ce95fedc525316dcf9b48
TREESITTER_LUA_URL https://github.com/tree-sitter-grammars/tree-sitter-lua/archive/v0.4.0.tar.gz
TREESITTER_LUA_SHA256 b0977aced4a63bb75f26725787e047b8f5f4a092712c840ea7070765d4049559
TREESITTER_VIM_URL https://github.com/tree-sitter-grammars/tree-sitter-vim/archive/v0.7.0.tar.gz
TREESITTER_VIM_SHA256 44eabc31127c4feacda19f2a05a5788272128ff561ce01093a8b7a53aadcc7b2
TREESITTER_VIMDOC_URL https://github.com/neovim/tree-sitter-vimdoc/archive/v4.0.0.tar.gz
TREESITTER_VIMDOC_SHA256 8096794c0f090b2d74b7bff94548ac1be3285b929ec74f839bd9b3ff4f4c6a0b
TREESITTER_QUERY_URL https://github.com/tree-sitter-grammars/tree-sitter-query/archive/v0.6.2.tar.gz
TREESITTER_QUERY_SHA256 90682e128d048fbf2a2a17edca947db71e326fa0b3dba4136e041e096538b4eb
TREESITTER_MARKDOWN_URL https://github.com/tree-sitter-grammars/tree-sitter-markdown/archive/v0.5.0.tar.gz
TREESITTER_MARKDOWN_SHA256 14c2c948ccf0e9b606eec39b09286c59dddf28307849f71b7ce2b1d1ef06937e
TREESITTER_URL https://github.com/tree-sitter/tree-sitter/archive/v0.25.8.tar.gz
TREESITTER_SHA256 178b575244d967f4920a4642408dc4edf6de96948d37d7f06e5b78acee9c0b4e
WASMTIME_URL https://github.com/bytecodealliance/wasmtime/archive/v29.0.1.tar.gz
WASMTIME_SHA256 b94b6c6fd6aebaf05d4c69c1b12b5dc217b0d42c1a95f435b33af63dddfa5304
UNCRUSTIFY_URL https://github.com/uncrustify/uncrustify/archive/uncrustify-0.81.0.tar.gz
UNCRUSTIFY_SHA256 484623dc16b92206adc6ac0770077c6c67c6e441102148c2a121a19549330ff9
LUA_DEV_DEPS_URL https://github.com/neovim/deps/raw/06ef2b58b0876f8de1a3f5a710473dcd7afff251/opt/lua-dev-deps.tar.gz
LUA_DEV_DEPS_SHA256 49f8399e453103064a23c65534f266f3067cda716b6502f016bfafeed5799354

View File

@@ -1,3 +1,7 @@
if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
set(CMAKE_SYSTEM_PROCESSOR arm64)
endif()
set(CPACK_PACKAGE_NAME "Neovim")
set(CPACK_PACKAGE_VENDOR "neovim.io")
set(CPACK_PACKAGE_FILE_NAME "nvim")
@@ -38,6 +42,11 @@ if(WIN32)
# Create start menu and desktop shortcuts
set(CPACK_WIX_PROGRAM_MENU_FOLDER "${CPACK_PACKAGE_NAME}")
set(CPACK_PACKAGE_EXECUTABLES "nvim" "Neovim")
set(CPACK_WIX_INSTALL_SCOPE "perMachine")
set(CPACK_WIX_UI_REF "WixUI_CustomInstallDir")
list(APPEND CPACK_WIX_EXTRA_SOURCES ${CMAKE_CURRENT_LIST_DIR}/WixUI_CustomInstallDir.wxs)
list(APPEND CPACK_WIX_EXTRA_SOURCES ${CMAKE_CURRENT_LIST_DIR}/CustomInstallDirDlg.wxs)
# We use a wix patch to add further options to the installer.
# See: https://cmake.org/cmake/help/v3.7/module/CPackWIX.html#variable:CPACK_WIX_PATCH_FILE
@@ -48,7 +57,7 @@ elseif(APPLE)
set(CPACK_GENERATOR TGZ)
set(CPACK_PACKAGE_ICON ${CMAKE_CURRENT_LIST_DIR}/neovim.icns)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(CPACK_PACKAGE_FILE_NAME "nvim-linux64")
set(CPACK_PACKAGE_FILE_NAME "nvim-linux-${CMAKE_SYSTEM_PROCESSOR}")
set(CPACK_GENERATOR TGZ DEB)
set(CPACK_DEBIAN_PACKAGE_NAME "Neovim") # required
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Neovim.io") # required

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI>
<Dialog Id="CustomInstallDirDlg" Width="370" Height="270" Title="!(loc.InstallDirDlg_Title)">
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" />
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallDirDlgDescription)" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallDirDlgTitle)" />
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallDirDlgBannerBitmap)" />
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="Note" Type="Text" X="20" Y="45" Width="290" Height="45" NoPrefix="yes">
<Text>Note: besides its installation folder, [ProductName] stores configuration, data, and logs in standard locations. These can be further configured by the $NVIM_APPNAME environment variable. Also, the "base" (root) directories conform to the XDG Base Directory Specification. For more information see:</Text>
</Control>
<Control Id="Link1" Type="Hyperlink" X="20" Y="90" Width="290" Height="15">
<Text><![CDATA[<a href="https://neovim.io/doc/user/starting.html#standard-path">https://neovim.io/doc/user/starting.html#standard-path</a>]]></Text>
</Control>
<Control Id="Link2" Type="Hyperlink" X="20" Y="105" Width="290" Height="15">
<Text><![CDATA[<a href="https://neovim.io/doc/user/starting.html#base-directories">https://neovim.io/doc/user/starting.html#base-directories</a>]]></Text>
</Control>
<Control Id="Link3" Type="Hyperlink" X="20" Y="120" Width="290" Height="15">
<Text><![CDATA[<a href="https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME">https://neovim.io/doc/user/starting.html#$NVIM_APPNAME</a>]]></Text>
</Control>
<Control Id="FolderLabel" Type="Hyperlink" X="20" Y="135" Width="290" Height="15">
<Text>Install [ProductName] to:</Text>
</Control>
<Control Id="Folder" Type="PathEdit" X="20" Y="150" Width="320" Height="18" Property="WIXUI_INSTALLDIR" Indirect="yes" />
<Control Id="ChangeFolder" Type="PushButton" X="20" Y="180" Width="56" Height="17" Text="!(loc.InstallDirDlgChange)" />
</Dialog>
</UI>
</Fragment>
</Wix>

View File

@@ -6,7 +6,7 @@
Name='PATH'
Action='set'
Permanent='no'
System='no'
System='yes'
Part='last'
Value='[INSTALL_ROOT]bin'
/>

View File

@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
<!--
First-time install dialog sequence:
- WixUI_WelcomeDlg
- WixUI_LicenseAgreementDlg
- WixUI_InstallDirDlg
- WixUI_VerifyReadyDlg
- WixUI_DiskCostDlg
Maintenance dialog sequence:
- WixUI_MaintenanceWelcomeDlg
- WixUI_MaintenanceTypeDlg
- WixUI_InstallDirDlg
- WixUI_VerifyReadyDlg
Patch dialog sequence:
- WixUI_WelcomeDlg
- WixUI_VerifyReadyDlg
-->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI Id="WixUI_CustomInstallDir">
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<Property Id="WixUI_Mode" Value="InstallDir" />
<DialogRef Id="BrowseDlg" />
<DialogRef Id="DiskCostDlg" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FatalError" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="MsiRMFilesInUse" />
<DialogRef Id="PrepareDlg" />
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ResumeDlg" />
<DialogRef Id="UserExit" />
<Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath" Order="3">1</Publish>
<Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>
<Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="CustomInstallDirDlg">LicenseAccepted = "1"</Publish>
<Publish Dialog="CustomInstallDirDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
<Publish Dialog="CustomInstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="CustomInstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
<Publish Dialog="CustomInstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<Publish Dialog="CustomInstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
<Publish Dialog="CustomInstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="CustomInstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomInstallDirDlg" Order="1">NOT Installed</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">Installed AND PATCH</Publish>
<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
<Property Id="ARPNOMODIFY" Value="1" />
</UI>
<UIRef Id="WixUI_Common" />
</Fragment>
</Wix>

View File

@@ -18,12 +18,8 @@ if(APPLE)
list(APPEND DEPS_CMAKE_ARGS -D CMAKE_FIND_FRAMEWORK=${CMAKE_FIND_FRAMEWORK})
endif()
# Can be removed once minimum version is at least 3.15
if(POLICY CMP0092)
list(APPEND DEPS_CMAKE_ARGS -D CMAKE_POLICY_DEFAULT_CMP0092=NEW)
endif()
find_program(CACHE_PRG NAMES ccache sccache)
mark_as_advanced(CACHE_PRG)
if(CACHE_PRG)
set(CMAKE_C_COMPILER_LAUNCHER ${CMAKE_COMMAND} -E env CCACHE_SLOPPINESS=pch_defines,time_macros ${CACHE_PRG})
list(APPEND DEPS_CMAKE_CACHE_ARGS -DCMAKE_C_COMPILER_LAUNCHER:STRING=${CMAKE_C_COMPILER_LAUNCHER})
@@ -32,6 +28,7 @@ endif()
# MAKE_PRG
if(UNIX)
find_program(MAKE_PRG NAMES gmake make)
mark_as_advanced(MAKE_PRG)
if(NOT MAKE_PRG)
message(FATAL_ERROR "GNU Make is required to build the dependencies.")
else()
@@ -58,6 +55,32 @@ if(CMAKE_OSX_SYSROOT)
set(DEPS_C_COMPILER "${DEPS_C_COMPILER} -isysroot${CMAKE_OSX_SYSROOT}")
endif()
get_filename_component(rootdir ${PROJECT_SOURCE_DIR} NAME)
if(${rootdir} MATCHES "cmake.deps")
set(depsfile ${PROJECT_SOURCE_DIR}/deps.txt)
else()
set(depsfile ${PROJECT_SOURCE_DIR}/cmake.deps/deps.txt)
endif()
set_directory_properties(PROPERTIES
EP_PREFIX "${DEPS_BUILD_DIR}"
CMAKE_CONFIGURE_DEPENDS ${depsfile})
file(READ ${depsfile} DEPENDENCIES)
STRING(REGEX REPLACE "\n" ";" DEPENDENCIES "${DEPENDENCIES}")
foreach(dep ${DEPENDENCIES})
STRING(REGEX REPLACE " " ";" dep "${dep}")
list(GET dep 0 name)
list(GET dep 1 value)
if(NOT ${name})
# _URL variables must NOT be set when USE_EXISTING_SRC_DIR is set,
# otherwise ExternalProject will try to re-download the sources.
if(NOT USE_EXISTING_SRC_DIR)
set(${name} ${value})
endif()
endif()
endforeach()
function(get_externalproject_options name DEPS_IGNORE_SHA)
string(TOUPPER ${name} name_allcaps)
set(url ${${name_allcaps}_URL})

View File

@@ -1,31 +0,0 @@
find_path2(LIBVTERM_INCLUDE_DIR vterm.h)
find_library2(LIBVTERM_LIBRARY vterm)
if(LIBVTERM_INCLUDE_DIR AND EXISTS "${LIBVTERM_INCLUDE_DIR}/vterm.h")
file(STRINGS ${LIBVTERM_INCLUDE_DIR}/vterm.h VTERM_VERSION_MAJOR REGEX "#define VTERM_VERSION_MAJOR")
string(REGEX MATCH "[0-9]+" VTERM_VERSION_MAJOR ${VTERM_VERSION_MAJOR})
file(STRINGS ${LIBVTERM_INCLUDE_DIR}/vterm.h VTERM_VERSION_MINOR REGEX "#define VTERM_VERSION_MINOR")
string(REGEX MATCH "[0-9]+" VTERM_VERSION_MINOR ${VTERM_VERSION_MINOR})
file(STRINGS ${LIBVTERM_INCLUDE_DIR}/vterm.h VTERM_VERSION_PATCH REGEX "#define VTERM_VERSION_PATCH")
# The following is needed to give a coherent error for versions 0.3.2 and
# smaller.
if(VTERM_VERSION_PATCH)
string(REGEX MATCH "[0-9]+" VTERM_VERSION_PATCH ${VTERM_VERSION_PATCH})
string(PREPEND VTERM_VERSION_PATCH ".")
endif()
set(VTERM_VERSION ${VTERM_VERSION_MAJOR}.${VTERM_VERSION_MINOR}${VTERM_VERSION_PATCH})
endif()
find_package_handle_standard_args(Libvterm
REQUIRED_VARS LIBVTERM_INCLUDE_DIR LIBVTERM_LIBRARY
VERSION_VAR VTERM_VERSION)
add_library(libvterm INTERFACE)
target_include_directories(libvterm SYSTEM BEFORE INTERFACE ${LIBVTERM_INCLUDE_DIR})
target_link_libraries(libvterm INTERFACE ${LIBVTERM_LIBRARY})
mark_as_advanced(LIBVTERM_INCLUDE_DIR LIBVTERM_LIBRARY)

View File

@@ -1,4 +1,13 @@
find_library2(LPEG_LIBRARY NAMES lpeg_a lpeg liblpeg_a lpeg${CMAKE_SHARED_LIBRARY_SUFFIX} PATH_SUFFIXES lua/5.1)
find_library2(LPEG_LIBRARY NAMES lpeg_a lpeg liblpeg_a lpeg.so lpeg${CMAKE_SHARED_LIBRARY_SUFFIX} PATH_SUFFIXES lua/5.1)
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND LPEG_LIBRARY MATCHES ".so$")
execute_process(
COMMAND otool -hv "${LPEG_LIBRARY}"
OUTPUT_VARIABLE LPEG_HEADER
)
if(LPEG_HEADER MATCHES ".* BUNDLE .*")
message(FATAL_ERROR "lpeg library found at ${LPEG_LIBRARY} but built as a bundle rather than a dylib, please rebuild with `-dynamiclib` rather than `-bundle`")
endif()
endif()
find_package_handle_standard_args(Lpeg DEFAULT_MSG LPEG_LIBRARY)
mark_as_advanced(LPEG_LIBRARY)

View File

@@ -1,24 +0,0 @@
find_path2(MSGPACK_INCLUDE_DIR msgpack/version_master.h)
if(MSGPACK_INCLUDE_DIR)
file(READ ${MSGPACK_INCLUDE_DIR}/msgpack/version_master.h msgpack_version_h)
string(REGEX REPLACE ".*MSGPACK_VERSION_MAJOR +([0-9]+).*" "\\1" MSGPACK_VERSION_MAJOR "${msgpack_version_h}")
string(REGEX REPLACE ".*MSGPACK_VERSION_MINOR +([0-9]+).*" "\\1" MSGPACK_VERSION_MINOR "${msgpack_version_h}")
string(REGEX REPLACE ".*MSGPACK_VERSION_REVISION +([0-9]+).*" "\\1" MSGPACK_VERSION_REVISION "${msgpack_version_h}")
set(MSGPACK_VERSION_STRING "${MSGPACK_VERSION_MAJOR}.${MSGPACK_VERSION_MINOR}.${MSGPACK_VERSION_REVISION}")
else()
set(MSGPACK_VERSION_STRING)
endif()
find_library2(MSGPACK_LIBRARY NAMES msgpackc msgpack msgpackc_import msgpack-c
NAMES_PER_DIR)
mark_as_advanced(MSGPACK_INCLUDE_DIR MSGPACK_LIBRARY)
find_package_handle_standard_args(Msgpack
REQUIRED_VARS MSGPACK_LIBRARY MSGPACK_INCLUDE_DIR
VERSION_VAR MSGPACK_VERSION_STRING)
add_library(msgpack INTERFACE)
target_include_directories(msgpack SYSTEM BEFORE INTERFACE ${MSGPACK_INCLUDE_DIR})
target_link_libraries(msgpack INTERFACE ${MSGPACK_LIBRARY})

12
cmake/FindUTF8proc.cmake Normal file
View File

@@ -0,0 +1,12 @@
find_path2(UTF8PROC_INCLUDE_DIR utf8proc.h)
find_library2(UTF8PROC_LIBRARY NAMES utf8proc utf8proc_static)
find_package_handle_standard_args(UTF8proc DEFAULT_MSG
UTF8PROC_LIBRARY UTF8PROC_INCLUDE_DIR)
mark_as_advanced(UTF8PROC_LIBRARY UTF8PROC_INCLUDE_DIR)
add_library(utf8proc INTERFACE)
target_include_directories(utf8proc SYSTEM BEFORE INTERFACE ${UTF8PROC_INCLUDE_DIR})
target_link_libraries(utf8proc INTERFACE ${UTF8PROC_LIBRARY})
#TODO(dundargoc): this is a hack that should ideally be hardcoded into the utf8proc project via configure_command
target_compile_definitions(utf8proc INTERFACE "UTF8PROC_STATIC")

22
cmake/FindWasmtime.cmake Normal file
View File

@@ -0,0 +1,22 @@
find_path2(WASMTIME_INCLUDE_DIR wasmtime.h)
find_library2(WASMTIME_LIBRARY wasmtime)
if(WASMTIME_INCLUDE_DIR AND EXISTS "${WASMTIME_INCLUDE_DIR}/wasmtime.h")
file(STRINGS ${WASMTIME_INCLUDE_DIR}/wasmtime.h WASMTIME_VERSION REGEX "#define WASMTIME_VERSION")
string(REGEX MATCH "[0-9]+\.[0-9]\.[0-9]" WASMTIME_VERSION ${WASMTIME_VERSION})
endif()
find_package_handle_standard_args(Wasmtime
REQUIRED_VARS WASMTIME_INCLUDE_DIR WASMTIME_LIBRARY
VERSION_VAR WASMTIME_VERSION)
add_library(wasmtime INTERFACE)
target_include_directories(wasmtime SYSTEM BEFORE INTERFACE ${WASMTIME_INCLUDE_DIR})
target_link_libraries(wasmtime INTERFACE ${WASMTIME_LIBRARY})
if(MSVC)
target_compile_options(wasmtime INTERFACE -DWASM_API_EXTERN= -DWASI_API_EXTERN=)
target_link_libraries(wasmtime INTERFACE ws2_32 advapi32 userenv ntdll shell32 ole32 bcrypt)
endif()
mark_as_advanced(WASMTIME_INCLUDE_DIR WASMTIME_LIBRARY)

View File

@@ -7,6 +7,7 @@ set(ENV{XDG_DATA_HOME} ${BUILD_DIR}/Xtest_xdg/share)
set(ENV{XDG_STATE_HOME} ${BUILD_DIR}/Xtest_xdg/state)
unset(ENV{XDG_DATA_DIRS})
unset(ENV{NVIM}) # Clear $NVIM in case tests are running from Nvim. #11009
unset(ENV{TMUX}) # Nvim TUI shouldn't think it's running in tmux. #34173
# TODO(dundargoc): The CIRRUS_CI environment variable isn't passed to here from
# the main CMakeLists.txt, so we have to manually pass it to this script and
@@ -68,16 +69,16 @@ endif()
execute_process(
# Note: because of "-ll" (low-level interpreter mode), some modules like
# _editor.lua are not loaded.
COMMAND ${NVIM_PRG} -ll ${WORKING_DIR}/test/lua_runner.lua ${DEPS_INSTALL_DIR} busted -v -o test.busted.outputHandlers.nvim
COMMAND ${NVIM_PRG} -ll ${WORKING_DIR}/test/lua_runner.lua ${DEPS_INSTALL_DIR}/share/lua/5.1/ busted -v -o test.busted.outputHandlers.nvim
--lazy --helper=${TEST_DIR}/${TEST_TYPE}/preload.lua
--lpath=${BUILD_DIR}/?.lua
--lpath=${WORKING_DIR}/src/?.lua
--lpath=${WORKING_DIR}/runtime/lua/?.lua
--lpath=?.lua
${BUSTED_ARGS}
${TEST_PATH}
TIMEOUT $ENV{TEST_TIMEOUT}
WORKING_DIRECTORY ${WORKING_DIR}
ERROR_VARIABLE err
RESULT_VARIABLE res
${EXTRA_ARGS})
@@ -86,11 +87,6 @@ file(REMOVE_RECURSE ${RM_FILES})
if(res)
message(STATUS "Tests exited non-zero: ${res}")
if("${err}" STREQUAL "")
message(STATUS "No output to stderr.")
else()
message(STATUS "Output to stderr:\n${err}")
endif()
# Dump the logfile on CI (if not displayed and moved already).
if(CI_BUILD)

View File

@@ -61,6 +61,7 @@ function(add_glob_target)
if(NOT ARG_COMMAND)
add_custom_target(${ARG_TARGET})
add_custom_command(TARGET ${ARG_TARGET}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo "${ARG_TARGET} SKIP: ${ARG_COMMAND} not found")
return()
endif()
@@ -175,8 +176,7 @@ function(add_target)
add_custom_target(${target} DEPENDS ${touch_file})
endfunction()
# Set default build type to BUILD_TYPE. Also limit the list of allowable build
# types to the ones defined in variable allowableBuildTypes.
# Set default build type to BUILD_TYPE.
#
# The correct way to specify build type (for example Release) for
# single-configuration generators (Make and Ninja) is to run
@@ -193,28 +193,24 @@ endfunction()
# Passing CMAKE_BUILD_TYPE for multi-config generators will not only not be
# used, but also generate a warning for the user.
function(set_default_buildtype BUILD_TYPE)
set(allowableBuildTypes Debug Release MinSizeRel RelWithDebInfo)
if(NOT BUILD_TYPE IN_LIST allowableBuildTypes)
message(FATAL_ERROR "Invalid build type: ${BUILD_TYPE}")
endif()
set(defaultBuildTypes Debug Release MinSizeRel RelWithDebInfo)
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(isMultiConfig)
# Multi-config generators use the first element in CMAKE_CONFIGURATION_TYPES as the default build type
list(INSERT allowableBuildTypes 0 ${BUILD_TYPE})
list(REMOVE_DUPLICATES allowableBuildTypes)
set(CMAKE_CONFIGURATION_TYPES ${allowableBuildTypes} PARENT_SCOPE)
# Multi-config generators use the first element in
# CMAKE_CONFIGURATION_TYPES as the default build type
list(INSERT defaultBuildTypes 0 ${BUILD_TYPE})
list(REMOVE_DUPLICATES defaultBuildTypes)
set(CMAKE_CONFIGURATION_TYPES ${defaultBuildTypes} PARENT_SCOPE)
if(CMAKE_BUILD_TYPE)
message(WARNING "CMAKE_BUILD_TYPE specified which is ignored on \
multi-configuration generators. Defaulting to ${BUILD_TYPE} build type.")
endif()
else()
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "${allowableBuildTypes}")
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "${defaultBuildTypes}")
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "CMAKE_BUILD_TYPE not specified, default is '${BUILD_TYPE}'")
set(CMAKE_BUILD_TYPE ${BUILD_TYPE} CACHE STRING "Choose the type of build" FORCE)
elseif(NOT CMAKE_BUILD_TYPE IN_LIST allowableBuildTypes)
message(FATAL_ERROR "Invalid build type: ${CMAKE_BUILD_TYPE}")
else()
message(STATUS "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
endif()

61
contrib/flake.lock generated
View File

@@ -1,61 +0,0 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1713248628,
"narHash": "sha256-NLznXB5AOnniUtZsyy/aPWOk8ussTuePp2acb9U+ISA=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "5672bc9dbf9d88246ddab5ac454e82318d094bb8",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View File

@@ -1,164 +0,0 @@
{
description = "Neovim flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
let
inherit (builtins)
elemAt
foldl'
mapAttrs
match
readFile
;
inherit (nixpkgs.lib)
const
flip
pipe
remove
splitString
toLower
;
in
{
overlay = final: prev: {
neovim = (final.neovim-unwrapped.override {
treesitter-parsers = pipe ../cmake.deps/deps.txt [
readFile
(splitString "\n")
(map (match "TREESITTER_([A-Z_]+)_(URL|SHA256)[[:space:]]+([^[:space:]]+)[[:space:]]*"))
(remove null)
(flip foldl' { }
(acc: matches:
let
lang = toLower (elemAt matches 0);
type = toLower (elemAt matches 1);
value = elemAt matches 2;
in
acc // {
${lang} = acc.${lang} or { } // {
${type} = value;
};
}))
(mapAttrs (const final.fetchurl))
(self: self // {
markdown = final.stdenv.mkDerivation {
inherit (self.markdown) name;
src = self.markdown;
installPhase = ''
mv tree-sitter-markdown $out
'';
};
})
];
}).overrideAttrs (oa: rec {
version = self.shortRev or "dirty";
src = ../.;
preConfigure = oa.preConfigure or "" + ''
sed -i cmake.config/versiondef.h.in -e 's/@NVIM_VERSION_PRERELEASE@/-dev-${version}/'
'';
nativeBuildInputs = oa.nativeBuildInputs ++ [
final.libiconv
];
});
# a development binary to help debug issues
neovim-debug = let
stdenv = if final.stdenv.isLinux then
final.llvmPackages_latest.stdenv
else
final.stdenv;
in (final.neovim.override {
lua = final.luajit;
inherit stdenv;
}).overrideAttrs (oa: {
dontStrip = true;
NIX_CFLAGS_COMPILE = " -ggdb -Og";
cmakeBuildType = "Debug";
disallowedReferences = [ ];
});
# for neovim developers, beware of the slow binary
neovim-developer = let inherit (final.luaPackages) luacheck;
in final.neovim-debug.overrideAttrs (oa: {
cmakeFlags = oa.cmakeFlags ++ [
"-DLUACHECK_PRG=${luacheck}/bin/luacheck"
"-DENABLE_LTO=OFF"
] ++ final.lib.optionals final.stdenv.isLinux [
# https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
# https://clang.llvm.org/docs/AddressSanitizer.html#symbolizing-the-reports
"-DENABLE_ASAN_UBSAN=ON"
];
doCheck = final.stdenv.isLinux;
});
};
} // flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
overlays = [ self.overlay ];
inherit system;
};
lua = pkgs.lua5_1;
pythonEnv = pkgs.python3.withPackages (ps: [
ps.msgpack
]);
in {
packages = with pkgs; {
default = neovim;
inherit neovim neovim-debug neovim-developer;
};
checks = {
shlint = pkgs.runCommand "shlint" {
nativeBuildInputs = [ pkgs.shellcheck ];
preferLocalBuild = true;
} "make -C ${./..} shlint > $out";
};
# kept for backwards-compatibility
defaultPackage = pkgs.neovim;
devShells = {
default = pkgs.neovim-developer.overrideAttrs (oa: {
buildInputs = with pkgs;
oa.buildInputs ++ [
lua.pkgs.luacheck
sumneko-lua-language-server
pythonEnv
include-what-you-use # for scripts/check-includes.py
jq # jq for scripts/vim-patch.sh -r
shellcheck # for `make shlint`
];
nativeBuildInputs = with pkgs;
oa.nativeBuildInputs ++ [
clang-tools # for clangd to find the correct headers
];
shellHook = oa.shellHook + ''
export NVIM_PYTHON_LOG_LEVEL=DEBUG
export NVIM_LOG_FILE=/tmp/nvim.log
export ASAN_SYMBOLIZER_PATH=${pkgs.llvm_18}/bin/llvm-symbolizer
# ASAN_OPTIONS=detect_leaks=1
export ASAN_OPTIONS="log_path=./test.log:abort_on_error=1"
# for treesitter functionaltests
mkdir -p runtime/parser
cp -f ${pkgs.vimPlugins.nvim-treesitter.builtGrammars.c}/parser runtime/parser/c.so
'';
});
};
});
}

View File

@@ -167,13 +167,15 @@ function! s:Spawn(server_cmd, client_cmd, server_addr, reconnect)
if type(a:server_cmd) == type('')
" spawn gdbserver in a vertical split
let server = s:GdbServer.new(gdb)
vsp | enew | let gdb._server_id = termopen(a:server_cmd, server)
server.term = v:true
vsp | enew | let gdb._server_id = jobstart(a:server_cmd, server)
let gdb._jump_window = 2
let gdb._server_buf = bufnr('%')
endif
" go to the bottom window and spawn gdb client
wincmd j
enew | let gdb._client_id = termopen(a:client_cmd, gdb)
gdb.term = v:true
enew | let gdb._client_id = jobstart(a:client_cmd, gdb)
let gdb._client_buf = bufnr('%')
tnoremap <silent> <f8> <c-\><c-n>:GdbContinue<cr>i
tnoremap <silent> <f10> <c-\><c-n>:GdbNext<cr>i

View File

@@ -14,7 +14,7 @@
#
# - Debug: Disables optimizations (-O0), enables debug information.
#
# - RelWithDebInfo: Enables optimizations (-Og or -O2) with debug information.
# - RelWithDebInfo: Enables optimizations (-O2) with debug information.
#
# - MinSizeRel: Enables all -O2 optimization that do not typically
# increase code size, and performs further optimizations
@@ -45,13 +45,12 @@
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_GETTEXT=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LIBICONV=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LIBUV=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LIBVTERM=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LUAJIT=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LUV=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_MSGPACK=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_TS=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_TS_PARSERS=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_UNIBILIUM=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_UTF8PROC=OFF
#
# Or disable all bundled dependencies at once.
#

View File

@@ -2,7 +2,8 @@
for name, url in pairs {
-- ADD PLUGINS _NECESSARY_ TO REPRODUCE THE ISSUE, e.g:
-- some_plugin = 'https://github.com/author/plugin.nvim'
-- 'https://github.com/author1/plugin1',
-- 'https://github.com/author2/plugin2',
} do
local install_path = vim.fn.fnamemodify('nvim_issue/' .. name, ':p')
if vim.fn.isdirectory(install_path) == 0 then

View File

@@ -0,0 +1,36 @@
#compdef nvim
# zsh completions for 'nvim'
# automatically generated with http://github.com/RobSis/zsh-completion-generator
local arguments
arguments=(
'*--cmd[execute <cmd> before any config]:command'
'*-c[Execute <cmd> after config and first file]:command'
'-l[Execute Lua <script> (with optional args)]:script:_files -g "*.lua"' # TODO: remaining args are passed to <script> and not opened by nvim for edit
'-S[source <session> after loading the first file]::session:_files'
'-s[read Normal mode commands from <scriptin>]:file:_files'
'-u[use this config file]:config'
'-d[diff mode]'
{-es,-Es}'[silent (batch) mode]'
'(- *)'{-h,--help}'[print this help message]'
'-i[use this shada file]:shada:_files -g "*.shada"'
'-n[no swap file, use memory only]'
'-o-[open N windows (default: one per file)]::N'
'-O-[open N vertical windows (default: one per file)]::N'
'-p-[open N tab pages (default: one per file)]::N'
'-R[read-only (view) mode]'
'(- *)'{-v,--version}'[print version information]'
'-V[verbose \[level\]\[file\]]'
'(- *)--api-info[write msgpack-encoded API metadata to stdout]'
'--clean["Factory defaults" (skip user config and plugins, shada)]'
'--embed[use stdin/stdout as a msgpack-rpc channel]'
'--headless[dont start a user interface]'
'--listen[serve RPC API from this address]:address'
'--remote[\[-subcommand\] Execute commands remotely on a server]'
'--server[connect to this Nvim server]:address'
'--startuptime[write startup timing messages to <file>]:file:_files'
'*:filename:_files'
)
_arguments -s $arguments

30
deps/unibilium/build.zig vendored Normal file
View File

@@ -0,0 +1,30 @@
const std = @import("std");
pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const upstream = b.dependency("unibilium", .{});
const lib = b.addLibrary(.{
.name = "unibilium",
.linkage = .static,
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
}),
});
lib.addIncludePath(upstream.path(""));
lib.installHeader(upstream.path("unibilium.h"), "unibilium.h");
lib.linkLibC();
lib.addCSourceFiles(.{ .root = upstream.path(""), .files = &.{
"unibilium.c",
"uninames.c",
"uniutil.c",
}, .flags = &.{"-DTERMINFO_DIRS=\"/etc/terminfo:/usr/share/terminfo\""} });
b.installArtifact(lib);
}

12
deps/unibilium/build.zig.zon vendored Normal file
View File

@@ -0,0 +1,12 @@
.{
.name = "unibilium",
.version = "2.1.2",
.paths = .{""},
.dependencies = .{
.unibilium = .{
.url = "git+https://github.com/neovim/unibilium?ref=v2.1.2#bfcb0350129dd76893bc90399cf37c45812268a2",
.hash = "N-V-__8AADO1CgCggvx73yptnBlXbEm7TjOSO6VGIqc0CvYR",
},
},
}

27
deps/utf8proc/build.zig vendored Normal file
View File

@@ -0,0 +1,27 @@
const std = @import("std");
pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const upstream = b.dependency("utf8proc", .{});
const lib = b.addLibrary(.{
.name = "utf8proc",
.linkage = .static,
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
}),
});
lib.addIncludePath(upstream.path(""));
lib.installHeader(upstream.path("utf8proc.h"), "utf8proc.h");
lib.linkLibC();
lib.addCSourceFiles(.{ .root = upstream.path(""), .files = &.{
"utf8proc.c",
}, .flags = &.{"-DUTF8PROC_STATIC"} });
b.installArtifact(lib);
}

12
deps/utf8proc/build.zig.zon vendored Normal file
View File

@@ -0,0 +1,12 @@
.{
.name = "utf8proc",
.version = "2.10.0",
.paths = .{""},
.dependencies = .{
.utf8proc = .{
.url = "git+https://github.com/JuliaStrings/utf8proc?ref=v2.10.0#a1b99daa2a3393884220264c927a48ba1251a9c6",
.hash = "N-V-__8AAPJfKADYDOC95xuKyudrlob6eFqgzfFl8NbpOoU9",
},
},
}

View File

@@ -3,7 +3,7 @@ set(GENERATED_RUNTIME_DIR ${PROJECT_BINARY_DIR}/runtime)
set(GENERATED_HELP_TAGS ${GENERATED_RUNTIME_DIR}/doc/tags)
set(GENERATED_PACKAGE_DIR ${GENERATED_RUNTIME_DIR}/pack/dist/opt)
set(GENERATED_SYN_VIM ${GENERATED_RUNTIME_DIR}/syntax/vim/generated.vim)
set(SYN_VIM_GENERATOR ${PROJECT_SOURCE_DIR}/src/nvim/generators/gen_vimvim.lua)
set(SYN_VIM_GENERATOR ${PROJECT_SOURCE_DIR}/src/gen/gen_vimvim.lua)
file(MAKE_DIRECTORY ${GENERATED_RUNTIME_DIR}/syntax/vim)
@@ -12,12 +12,17 @@ get_directory_property(LUA_GEN_DEPS DIRECTORY ${PROJECT_SOURCE_DIR}/src/nvim DEF
add_custom_command(OUTPUT ${GENERATED_SYN_VIM}
COMMAND ${LUA_GEN} ${SYN_VIM_GENERATOR} ${GENERATED_SYN_VIM} ${FUNCS_DATA}
${PROJECT_SOURCE_DIR}/src/nvim/options.lua
${PROJECT_SOURCE_DIR}/src/nvim/auevents.lua
${PROJECT_SOURCE_DIR}/src/nvim/ex_cmds.lua
${PROJECT_SOURCE_DIR}/src/nvim/vvars.lua
DEPENDS
${LUA_GEN_DEPS}
${SYN_VIM_GENERATOR}
${PROJECT_SOURCE_DIR}/src/nvim/ex_cmds.lua
${PROJECT_SOURCE_DIR}/src/nvim/auevents.lua
${PROJECT_SOURCE_DIR}/src/nvim/options.lua
${PROJECT_SOURCE_DIR}/src/nvim/vvars.lua
${PROJECT_SOURCE_DIR}/src/nvim/eval.c
${FUNCS_DATA}
)
@@ -118,4 +123,4 @@ foreach(D ${RUNTIME_DIRS})
endforeach()
# only foo.sh script in runtime/
install_helper(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/macros/less.sh DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/macros/)
install_helper(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/less.sh DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/scripts/)

View File

@@ -7,7 +7,7 @@ gzip.vim for editing compressed files
netrw*.vim browsing (remote) directories and editing remote files
tar.vim browsing tar files
zip.vim browsing zip files
paste.vim common code for mswin.vim, menu.vim and macmap.vim
paste.vim common code for mswin.vim and menu.vim
spellfile.vim downloading of a missing spell file
Omni completion files:

View File

@@ -1,858 +0,0 @@
----------------------------------------
-- This file is generated via github.com/tjdevries/vim9jit
-- For any bugs, please first consider reporting there.
----------------------------------------
-- Ignore "value assigned to a local variable is unused" because
-- we can't guarantee that local variables will be used by plugins
-- luacheck: ignore 311
local vim9 = require('_vim9script')
local M = {}
local prepended = nil
local grepCache = nil
local Complete = nil
local GetAddition = nil
local Tag2item = nil
local Dict2info = nil
local ParseTagline = nil
local Tagline2item = nil
local Tagcmd2extra = nil
local Nextitem = nil
local StructMembers = nil
local SearchMembers = nil
-- vim9script
-- # Vim completion script
-- # Language: C
-- # Maintainer: The Vim Project <https://github.com/vim/vim>
-- # Last Change: 2023 Aug 10
-- # Rewritten in Vim9 script by github user lacygoill
-- # Former Maintainer: Bram Moolenaar <Bram@vim.org>
prepended = ''
grepCache = vim.empty_dict()
-- # This function is used for the 'omnifunc' option.
Complete = function(findstart, abase)
findstart = vim9.bool(findstart)
if vim9.bool(findstart) then
-- # Locate the start of the item, including ".", "->" and "[...]".
local line = vim9.fn.getline('.')
local start = vim9.fn.charcol('.') - 1
local lastword = -1
while start > 0 do
if vim9.ops.RegexpMatches(vim9.index(line, vim9.ops.Minus(start, 1)), '\\w') then
start = start - 1
elseif
vim9.bool(vim9.ops.RegexpMatches(vim9.index(line, vim9.ops.Minus(start, 1)), '\\.'))
then
if lastword == -1 then
lastword = start
end
start = start - 1
elseif
vim9.bool(
start > 1
and vim9.index(line, vim9.ops.Minus(start, 2)) == '-'
and vim9.index(line, vim9.ops.Minus(start, 1)) == '>'
)
then
if lastword == -1 then
lastword = start
end
start = vim9.ops.Minus(start, 2)
elseif vim9.bool(vim9.index(line, vim9.ops.Minus(start, 1)) == ']') then
-- # Skip over [...].
local n = 0
start = start - 1
while start > 0 do
start = start - 1
if vim9.index(line, start) == '[' then
if n == 0 then
break
end
n = n - 1
elseif vim9.bool(vim9.index(line, start) == ']') then
n = n + 1
end
end
else
break
end
end
-- # Return the column of the last word, which is going to be changed.
-- # Remember the text that comes before it in prepended.
if lastword == -1 then
prepended = ''
return vim9.fn.byteidx(line, start)
end
prepended = vim9.slice(line, start, vim9.ops.Minus(lastword, 1))
return vim9.fn.byteidx(line, lastword)
end
-- # Return list of matches.
local base = prepended .. abase
-- # Don't do anything for an empty base, would result in all the tags in the
-- # tags file.
if base == '' then
return {}
end
-- # init cache for vimgrep to empty
grepCache = {}
-- # Split item in words, keep empty word after "." or "->".
-- # "aa" -> ['aa'], "aa." -> ['aa', ''], "aa.bb" -> ['aa', 'bb'], etc.
-- # We can't use split, because we need to skip nested [...].
-- # "aa[...]" -> ['aa', '[...]'], "aa.bb[...]" -> ['aa', 'bb', '[...]'], etc.
local items = {}
local s = 0
local arrays = 0
while 1 do
local e = vim9.fn.charidx(base, vim9.fn.match(base, '\\.\\|->\\|\\[', s))
if e < 0 then
if s == 0 or vim9.index(base, vim9.ops.Minus(s, 1)) ~= ']' then
vim9.fn.add(items, vim9.slice(base, s, nil))
end
break
end
if s == 0 or vim9.index(base, vim9.ops.Minus(s, 1)) ~= ']' then
vim9.fn.add(items, vim9.slice(base, s, vim9.ops.Minus(e, 1)))
end
if vim9.index(base, e) == '.' then
-- # skip over '.'
s = vim9.ops.Plus(e, 1)
elseif vim9.bool(vim9.index(base, e) == '-') then
-- # skip over '->'
s = vim9.ops.Plus(e, 2)
else
-- # Skip over [...].
local n = 0
s = e
e = e + 1
while e < vim9.fn.strcharlen(base) do
if vim9.index(base, e) == ']' then
if n == 0 then
break
end
n = n - 1
elseif vim9.bool(vim9.index(base, e) == '[') then
n = n + 1
end
e = e + 1
end
e = e + 1
vim9.fn.add(items, vim9.slice(base, s, vim9.ops.Minus(e, 1)))
arrays = arrays + 1
s = e
end
end
-- # Find the variable items[0].
-- # 1. in current function (like with "gd")
-- # 2. in tags file(s) (like with ":tag")
-- # 3. in current file (like with "gD")
local res = {}
if vim9.fn.searchdecl(vim9.index(items, 0), false, true) == 0 then
-- # Found, now figure out the type.
-- # TODO: join previous line if it makes sense
local line = vim9.fn.getline('.')
local col = vim9.fn.charcol('.')
if vim9.fn.stridx(vim9.slice(line, nil, vim9.ops.Minus(col, 1)), ';') >= 0 then
-- # Handle multiple declarations on the same line.
local col2 = vim9.ops.Minus(col, 1)
while vim9.index(line, col2) ~= ';' do
col2 = col2 - 1
end
line = vim9.slice(line, vim9.ops.Plus(col2, 1), nil)
col = vim9.ops.Minus(col, col2)
end
if vim9.fn.stridx(vim9.slice(line, nil, vim9.ops.Minus(col, 1)), ',') >= 0 then
-- # Handle multiple declarations on the same line in a function
-- # declaration.
local col2 = vim9.ops.Minus(col, 1)
while vim9.index(line, col2) ~= ',' do
col2 = col2 - 1
end
if
vim9.ops.RegexpMatches(
vim9.slice(line, vim9.ops.Plus(col2, 1), vim9.ops.Minus(col, 1)),
' *[^ ][^ ]* *[^ ]'
)
then
line = vim9.slice(line, vim9.ops.Plus(col2, 1), nil)
col = vim9.ops.Minus(col, col2)
end
end
if vim9.fn.len(items) == 1 then
-- # Completing one word and it's a local variable: May add '[', '.' or
-- # '->'.
local match = vim9.index(items, 0)
local kind = 'v'
if vim9.fn.match(line, '\\<' .. match .. '\\s*\\[') > 0 then
match = match .. '['
else
res = Nextitem(vim9.slice(line, nil, vim9.ops.Minus(col, 1)), { '' }, 0, true)
if vim9.fn.len(res) > 0 then
-- # There are members, thus add "." or "->".
if vim9.fn.match(line, '\\*[ \\t(]*' .. match .. '\\>') > 0 then
match = match .. '->'
else
match = match .. '.'
end
end
end
res = { { ['match'] = match, ['tagline'] = '', ['kind'] = kind, ['info'] = line } }
elseif vim9.bool(vim9.fn.len(items) == vim9.ops.Plus(arrays, 1)) then
-- # Completing one word and it's a local array variable: build tagline
-- # from declaration line
local match = vim9.index(items, 0)
local kind = 'v'
local tagline = '\t/^' .. line .. '$/'
res = { { ['match'] = match, ['tagline'] = tagline, ['kind'] = kind, ['info'] = line } }
else
-- # Completing "var.", "var.something", etc.
res =
Nextitem(vim9.slice(line, nil, vim9.ops.Minus(col, 1)), vim9.slice(items, 1, nil), 0, true)
end
end
if vim9.fn.len(items) == 1 or vim9.fn.len(items) == vim9.ops.Plus(arrays, 1) then
-- # Only one part, no "." or "->": complete from tags file.
local tags = {}
if vim9.fn.len(items) == 1 then
tags = vim9.fn.taglist('^' .. base)
else
tags = vim9.fn.taglist('^' .. vim9.index(items, 0) .. '$')
end
vim9.fn_mut('filter', {
vim9.fn_mut('filter', {
tags,
function(_, v)
return vim9.ternary(vim9.fn.has_key(v, 'kind'), function()
return v.kind ~= 'm'
end, true)
end,
}, { replace = 0 }),
function(_, v)
return vim9.ops.Or(
vim9.ops.Or(
vim9.prefix['Bang'](vim9.fn.has_key(v, 'static')),
vim9.prefix['Bang'](vim9.index(v, 'static'))
),
vim9.fn.bufnr('%') == vim9.fn.bufnr(vim9.index(v, 'filename'))
)
end,
}, { replace = 0 })
res = vim9.fn.extend(
res,
vim9.fn.map(tags, function(_, v)
return Tag2item(v)
end)
)
end
if vim9.fn.len(res) == 0 then
-- # Find the variable in the tags file(s)
local diclist = vim9.fn.filter(
vim9.fn.taglist('^' .. vim9.index(items, 0) .. '$'),
function(_, v)
return vim9.ternary(vim9.fn.has_key(v, 'kind'), function()
return v.kind ~= 'm'
end, true)
end
)
res = {}
for _, i in vim9.iter(vim9.fn.range(vim9.fn.len(diclist))) do
-- # New ctags has the "typeref" field. Patched version has "typename".
if vim9.bool(vim9.fn.has_key(vim9.index(diclist, i), 'typename')) then
res = vim9.fn.extend(
res,
StructMembers(
vim9.index(vim9.index(diclist, i), 'typename'),
vim9.slice(items, 1, nil),
true
)
)
elseif vim9.bool(vim9.fn.has_key(vim9.index(diclist, i), 'typeref')) then
res = vim9.fn.extend(
res,
StructMembers(
vim9.index(vim9.index(diclist, i), 'typeref'),
vim9.slice(items, 1, nil),
true
)
)
end
-- # For a variable use the command, which must be a search pattern that
-- # shows the declaration of the variable.
if vim9.index(vim9.index(diclist, i), 'kind') == 'v' then
local line = vim9.index(vim9.index(diclist, i), 'cmd')
if vim9.slice(line, nil, 1) == '/^' then
local col =
vim9.fn.charidx(line, vim9.fn.match(line, '\\<' .. vim9.index(items, 0) .. '\\>'))
res = vim9.fn.extend(
res,
Nextitem(
vim9.slice(line, 2, vim9.ops.Minus(col, 1)),
vim9.slice(items, 1, nil),
0,
true
)
)
end
end
end
end
if vim9.fn.len(res) == 0 and vim9.fn.searchdecl(vim9.index(items, 0), true) == 0 then
-- # Found, now figure out the type.
-- # TODO: join previous line if it makes sense
local line = vim9.fn.getline('.')
local col = vim9.fn.charcol('.')
res =
Nextitem(vim9.slice(line, nil, vim9.ops.Minus(col, 1)), vim9.slice(items, 1, nil), 0, true)
end
-- # If the last item(s) are [...] they need to be added to the matches.
local last = vim9.fn.len(items) - 1
local brackets = ''
while last >= 0 do
if vim9.index(vim9.index(items, last), 0) ~= '[' then
break
end
brackets = vim9.index(items, last) .. brackets
last = last - 1
end
return vim9.fn.map(res, function(_, v)
return Tagline2item(v, brackets)
end)
end
M['Complete'] = Complete
GetAddition = function(line, match, memarg, bracket)
bracket = vim9.bool(bracket)
-- # Guess if the item is an array.
if vim9.bool(vim9.ops.And(bracket, vim9.fn.match(line, match .. '\\s*\\[') > 0)) then
return '['
end
-- # Check if the item has members.
if vim9.fn.len(SearchMembers(memarg, { '' }, false)) > 0 then
-- # If there is a '*' before the name use "->".
if vim9.fn.match(line, '\\*[ \\t(]*' .. match .. '\\>') > 0 then
return '->'
else
return '.'
end
end
return ''
end
Tag2item = function(val)
-- # Turn the tag info "val" into an item for completion.
-- # "val" is is an item in the list returned by taglist().
-- # If it is a variable we may add "." or "->". Don't do it for other types,
-- # such as a typedef, by not including the info that GetAddition() uses.
local res = vim9.convert.decl_dict({ ['match'] = vim9.index(val, 'name') })
res[vim9.index_expr('extra')] =
Tagcmd2extra(vim9.index(val, 'cmd'), vim9.index(val, 'name'), vim9.index(val, 'filename'))
local s = Dict2info(val)
if s ~= '' then
res[vim9.index_expr('info')] = s
end
res[vim9.index_expr('tagline')] = ''
if vim9.bool(vim9.fn.has_key(val, 'kind')) then
local kind = vim9.index(val, 'kind')
res[vim9.index_expr('kind')] = kind
if kind == 'v' then
res[vim9.index_expr('tagline')] = '\t' .. vim9.index(val, 'cmd')
res[vim9.index_expr('dict')] = val
elseif vim9.bool(kind == 'f') then
res[vim9.index_expr('match')] = vim9.index(val, 'name') .. '('
end
end
return res
end
Dict2info = function(dict)
-- # Use all the items in dictionary for the "info" entry.
local info = ''
for _, k in vim9.iter(vim9.fn_mut('sort', { vim9.fn.keys(dict) }, { replace = 0 })) do
info = info .. k .. vim9.fn['repeat'](' ', 10 - vim9.fn.strlen(k))
if k == 'cmd' then
info = info
.. vim9.fn.substitute(
vim9.fn.matchstr(vim9.index(dict, 'cmd'), '/^\\s*\\zs.*\\ze$/'),
'\\\\\\(.\\)',
'\\1',
'g'
)
else
local dictk = vim9.index(dict, k)
if vim9.fn.typename(dictk) ~= 'string' then
info = info .. vim9.fn.string(dictk)
else
info = info .. dictk
end
end
info = info .. '\n'
end
return info
end
ParseTagline = function(line)
-- # Parse a tag line and return a dictionary with items like taglist()
local l = vim9.fn.split(line, '\t')
local d = vim.empty_dict()
if vim9.fn.len(l) >= 3 then
d[vim9.index_expr('name')] = vim9.index(l, 0)
d[vim9.index_expr('filename')] = vim9.index(l, 1)
d[vim9.index_expr('cmd')] = vim9.index(l, 2)
local n = 2
if vim9.ops.RegexpMatches(vim9.index(l, 2), '^/') then
-- # Find end of cmd, it may contain Tabs.
while n < vim9.fn.len(l) and vim9.ops.NotRegexpMatches(vim9.index(l, n), '/;"$') do
n = n + 1
d[vim9.index_expr('cmd')] = vim9.index(d, 'cmd') .. ' ' .. vim9.index(l, n)
end
end
for _, i in vim9.iter(vim9.fn.range(vim9.ops.Plus(n, 1), vim9.fn.len(l) - 1)) do
if vim9.index(l, i) == 'file:' then
d[vim9.index_expr('static')] = 1
elseif vim9.bool(vim9.ops.NotRegexpMatches(vim9.index(l, i), ':')) then
d[vim9.index_expr('kind')] = vim9.index(l, i)
else
d[vim9.index_expr(vim9.fn.matchstr(vim9.index(l, i), '[^:]*'))] =
vim9.fn.matchstr(vim9.index(l, i), ':\\zs.*')
end
end
end
return d
end
Tagline2item = function(val, brackets)
-- # Turn a match item "val" into an item for completion.
-- # "val['match']" is the matching item.
-- # "val['tagline']" is the tagline in which the last part was found.
local line = vim9.index(val, 'tagline')
local add = GetAddition(line, vim9.index(val, 'match'), { val }, brackets == '')
local res = vim9.convert.decl_dict({ ['word'] = vim9.index(val, 'match') .. brackets .. add })
if vim9.bool(vim9.fn.has_key(val, 'info')) then
-- # Use info from Tag2item().
res[vim9.index_expr('info')] = vim9.index(val, 'info')
else
-- # Parse the tag line and add each part to the "info" entry.
local s = Dict2info(ParseTagline(line))
if s ~= '' then
res[vim9.index_expr('info')] = s
end
end
if vim9.bool(vim9.fn.has_key(val, 'kind')) then
res[vim9.index_expr('kind')] = vim9.index(val, 'kind')
elseif vim9.bool(add == '(') then
res[vim9.index_expr('kind')] = 'f'
else
local s = vim9.fn.matchstr(line, '\\t\\(kind:\\)\\=\\zs\\S\\ze\\(\\t\\|$\\)')
if s ~= '' then
res[vim9.index_expr('kind')] = s
end
end
if vim9.bool(vim9.fn.has_key(val, 'extra')) then
res[vim9.index_expr('menu')] = vim9.index(val, 'extra')
return res
end
-- # Isolate the command after the tag and filename.
local s = vim9.fn.matchstr(
line,
'[^\\t]*\\t[^\\t]*\\t\\zs\\(/^.*$/\\|[^\\t]*\\)\\ze\\(;"\\t\\|\\t\\|$\\)'
)
if s ~= '' then
res[vim9.index_expr('menu')] = Tagcmd2extra(
s,
vim9.index(val, 'match'),
vim9.fn.matchstr(line, '[^\\t]*\\t\\zs[^\\t]*\\ze\\t')
)
end
return res
end
Tagcmd2extra = function(cmd, name, fname)
-- # Turn a command from a tag line to something that is useful in the menu
local x = ''
if vim9.ops.RegexpMatches(cmd, '^/^') then
-- # The command is a search command, useful to see what it is.
x = vim9.fn.substitute(
vim9.fn.substitute(
vim9.fn.matchstr(cmd, '^/^\\s*\\zs.*\\ze$/'),
'\\<' .. name .. '\\>',
'@@',
''
),
'\\\\\\(.\\)',
'\\1',
'g'
) .. ' - ' .. fname
elseif vim9.bool(vim9.ops.RegexpMatches(cmd, '^\\d*$')) then
-- # The command is a line number, the file name is more useful.
x = fname .. ' - ' .. cmd
else
-- # Not recognized, use command and file name.
x = cmd .. ' - ' .. fname
end
return x
end
Nextitem = function(lead, items, depth, all)
all = vim9.bool(all)
-- # Find composing type in "lead" and match items[0] with it.
-- # Repeat this recursively for items[1], if it's there.
-- # When resolving typedefs "depth" is used to avoid infinite recursion.
-- # Return the list of matches.
-- # Use the text up to the variable name and split it in tokens.
local tokens = vim9.fn.split(lead, '\\s\\+\\|\\<')
-- # Try to recognize the type of the variable. This is rough guessing...
local res = {}
local body = function(_, tidx)
-- # Skip tokens starting with a non-ID character.
if vim9.ops.NotRegexpMatches(vim9.index(tokens, tidx), '^\\h') then
return vim9.ITER_CONTINUE
end
-- # Recognize "struct foobar" and "union foobar".
-- # Also do "class foobar" when it's C++ after all (doesn't work very well
-- # though).
if
(
vim9.index(tokens, tidx) == 'struct'
or vim9.index(tokens, tidx) == 'union'
or vim9.index(tokens, tidx) == 'class'
) and vim9.ops.Plus(tidx, 1) < vim9.fn.len(tokens)
then
res = StructMembers(
vim9.index(tokens, tidx) .. ':' .. vim9.index(tokens, vim9.ops.Plus(tidx, 1)),
items,
all
)
return vim9.ITER_BREAK
end
-- # TODO: add more reserved words
if
vim9.fn.index(
{ 'int', 'short', 'char', 'float', 'double', 'static', 'unsigned', 'extern' },
vim9.index(tokens, tidx)
) >= 0
then
return vim9.ITER_CONTINUE
end
-- # Use the tags file to find out if this is a typedef.
local diclist = vim9.fn.taglist('^' .. vim9.index(tokens, tidx) .. '$')
local body = function(_, tagidx)
local item = vim9.convert.decl_dict(vim9.index(diclist, tagidx))
-- # New ctags has the "typeref" field. Patched version has "typename".
if vim9.bool(vim9.fn.has_key(item, 'typeref')) then
res = vim9.fn.extend(res, StructMembers(vim9.index(item, 'typeref'), items, all))
return vim9.ITER_CONTINUE
end
if vim9.bool(vim9.fn.has_key(item, 'typename')) then
res = vim9.fn.extend(res, StructMembers(vim9.index(item, 'typename'), items, all))
return vim9.ITER_CONTINUE
end
-- # Only handle typedefs here.
if vim9.index(item, 'kind') ~= 't' then
return vim9.ITER_CONTINUE
end
-- # Skip matches local to another file.
if
vim9.bool(
vim9.ops.And(
vim9.ops.And(vim9.fn.has_key(item, 'static'), vim9.index(item, 'static')),
vim9.fn.bufnr('%') ~= vim9.fn.bufnr(vim9.index(item, 'filename'))
)
)
then
return vim9.ITER_CONTINUE
end
-- # For old ctags we recognize "typedef struct aaa" and
-- # "typedef union bbb" in the tags file command.
local cmd = vim9.index(item, 'cmd')
local ei = vim9.fn.charidx(cmd, vim9.fn.matchend(cmd, 'typedef\\s\\+'))
if ei > 1 then
local cmdtokens = vim9.fn.split(vim9.slice(cmd, ei, nil), '\\s\\+\\|\\<')
if vim9.fn.len(cmdtokens) > 1 then
if
vim9.index(cmdtokens, 0) == 'struct'
or vim9.index(cmdtokens, 0) == 'union'
or vim9.index(cmdtokens, 0) == 'class'
then
local name = ''
-- # Use the first identifier after the "struct" or "union"
for _, ti in vim9.iter(vim9.fn.range((vim9.fn.len(cmdtokens) - 1))) do
if vim9.ops.RegexpMatches(vim9.index(cmdtokens, ti), '^\\w') then
name = vim9.index(cmdtokens, ti)
break
end
end
if name ~= '' then
res = vim9.fn.extend(
res,
StructMembers(vim9.index(cmdtokens, 0) .. ':' .. name, items, all)
)
end
elseif vim9.bool(depth < 10) then
-- # Could be "typedef other_T some_T".
res = vim9.fn.extend(
res,
Nextitem(vim9.index(cmdtokens, 0), items, vim9.ops.Plus(depth, 1), all)
)
end
end
end
return vim9.ITER_DEFAULT
end
for _, tagidx in vim9.iter(vim9.fn.range(vim9.fn.len(diclist))) do
local nvim9_status, nvim9_ret = body(_, tagidx)
if nvim9_status == vim9.ITER_BREAK then
break
elseif nvim9_status == vim9.ITER_RETURN then
return nvim9_ret
end
end
if vim9.fn.len(res) > 0 then
return vim9.ITER_BREAK
end
return vim9.ITER_DEFAULT
end
for _, tidx in vim9.iter(vim9.fn.range(vim9.fn.len(tokens))) do
local nvim9_status, nvim9_ret = body(_, tidx)
if nvim9_status == vim9.ITER_BREAK then
break
elseif nvim9_status == vim9.ITER_RETURN then
return nvim9_ret
end
end
return res
end
StructMembers = function(atypename, items, all)
all = vim9.bool(all)
-- # Search for members of structure "typename" in tags files.
-- # Return a list with resulting matches.
-- # Each match is a dictionary with "match" and "tagline" entries.
-- # When "all" is true find all, otherwise just return 1 if there is any member.
-- # Todo: What about local structures?
local fnames = vim9.fn.join(vim9.fn.map(vim9.fn.tagfiles(), function(_, v)
return vim9.fn.escape(v, ' \\#%')
end))
if fnames == '' then
return {}
end
local typename = atypename
local qflist = {}
local cached = 0
local n = ''
if vim9.bool(vim9.prefix['Bang'](all)) then
n = '1'
if vim9.bool(vim9.fn.has_key(grepCache, typename)) then
qflist = vim9.index(grepCache, typename)
cached = 1
end
else
n = ''
end
if vim9.bool(vim9.prefix['Bang'](cached)) then
while 1 do
vim.api.nvim_command(
'silent! keepjumps noautocmd '
.. n
.. 'vimgrep '
.. '/\\t'
.. typename
.. '\\(\\t\\|$\\)/j '
.. fnames
)
qflist = vim9.fn.getqflist()
if vim9.fn.len(qflist) > 0 or vim9.fn.match(typename, '::') < 0 then
break
end
-- # No match for "struct:context::name", remove "context::" and try again.
typename = vim9.fn.substitute(typename, ':[^:]*::', ':', '')
end
if vim9.bool(vim9.prefix['Bang'](all)) then
-- # Store the result to be able to use it again later.
grepCache[vim9.index_expr(typename)] = qflist
end
end
-- # Skip over [...] items
local idx = 0
local target = ''
while 1 do
if idx >= vim9.fn.len(items) then
target = ''
break
end
if vim9.index(vim9.index(items, idx), 0) ~= '[' then
target = vim9.index(items, idx)
break
end
idx = idx + 1
end
-- # Put matching members in matches[].
local matches = {}
for _, l in vim9.iter(qflist) do
local memb = vim9.fn.matchstr(vim9.index(l, 'text'), '[^\\t]*')
if vim9.ops.RegexpMatches(memb, '^' .. target) then
-- # Skip matches local to another file.
if
vim9.fn.match(vim9.index(l, 'text'), '\tfile:') < 0
or vim9.fn.bufnr('%')
== vim9.fn.bufnr(vim9.fn.matchstr(vim9.index(l, 'text'), '\\t\\zs[^\\t]*'))
then
local item =
vim9.convert.decl_dict({ ['match'] = memb, ['tagline'] = vim9.index(l, 'text') })
-- # Add the kind of item.
local s =
vim9.fn.matchstr(vim9.index(l, 'text'), '\\t\\(kind:\\)\\=\\zs\\S\\ze\\(\\t\\|$\\)')
if s ~= '' then
item[vim9.index_expr('kind')] = s
if s == 'f' then
item[vim9.index_expr('match')] = memb .. '('
end
end
vim9.fn.add(matches, item)
end
end
end
if vim9.fn.len(matches) > 0 then
-- # Skip over next [...] items
idx = idx + 1
while 1 do
if idx >= vim9.fn.len(items) then
return matches
end
if vim9.index(vim9.index(items, idx), 0) ~= '[' then
break
end
idx = idx + 1
end
-- # More items following. For each of the possible members find the
-- # matching following members.
return SearchMembers(matches, vim9.slice(items, idx, nil), all)
end
-- # Failed to find anything.
return {}
end
SearchMembers = function(matches, items, all)
all = vim9.bool(all)
-- # For matching members, find matches for following items.
-- # When "all" is true find all, otherwise just return 1 if there is any member.
local res = {}
for _, i in vim9.iter(vim9.fn.range(vim9.fn.len(matches))) do
local typename = ''
local line = ''
if vim9.bool(vim9.fn.has_key(vim9.index(matches, i), 'dict')) then
if vim9.bool(vim9.fn.has_key(vim9.index(vim9.index(matches, i), 'dict'), 'typename')) then
typename = vim9.index(vim9.index(vim9.index(matches, i), 'dict'), 'typename')
elseif vim9.bool(vim9.fn.has_key(vim9.index(vim9.index(matches, i), 'dict'), 'typeref')) then
typename = vim9.index(vim9.index(vim9.index(matches, i), 'dict'), 'typeref')
end
line = '\t' .. vim9.index(vim9.index(vim9.index(matches, i), 'dict'), 'cmd')
else
line = vim9.index(vim9.index(matches, i), 'tagline')
local eb = vim9.fn.matchend(line, '\\ttypename:')
local e = vim9.fn.charidx(line, eb)
if e < 0 then
eb = vim9.fn.matchend(line, '\\ttyperef:')
e = vim9.fn.charidx(line, eb)
end
if e > 0 then
-- # Use typename field
typename = vim9.fn.matchstr(line, '[^\\t]*', eb)
end
end
if typename ~= '' then
res = vim9.fn.extend(res, StructMembers(typename, items, all))
else
-- # Use the search command (the declaration itself).
local sb = vim9.fn.match(line, '\\t\\zs/^')
local s = vim9.fn.charidx(line, sb)
if s > 0 then
local e = vim9.fn.charidx(
line,
vim9.fn.match(line, '\\<' .. vim9.index(vim9.index(matches, i), 'match') .. '\\>', sb)
)
if e > 0 then
res =
vim9.fn.extend(res, Nextitem(vim9.slice(line, s, vim9.ops.Minus(e, 1)), items, 0, all))
end
end
end
if vim9.bool(vim9.ops.And(vim9.prefix['Bang'](all), vim9.fn.len(res) > 0)) then
break
end
end
return res
end
-- #}}}1
-- # vim: noet sw=2 sts=2
return M

View File

@@ -1,8 +1,682 @@
" Generated vim file by vim9jit. Please do not edit
let s:path = expand("<script>")
let s:lua_path = fnamemodify(s:path, ":r") . ".lua"
let s:nvim_module = luaeval('require("_vim9script").autoload(_A)', s:lua_path)
" Vim completion script
" Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2020 Nov 14
function! ccomplete#Complete(findstart, abase) abort
return s:nvim_module.Complete(a:findstart, a:abase)
endfunction
let s:cpo_save = &cpo
set cpo&vim
" This function is used for the 'omnifunc' option.
func ccomplete#Complete(findstart, base)
if a:findstart
" Locate the start of the item, including ".", "->" and "[...]".
let line = getline('.')
let start = col('.') - 1
let lastword = -1
while start > 0
if line[start - 1] =~ '\w'
let start -= 1
elseif line[start - 1] =~ '\.'
if lastword == -1
let lastword = start
endif
let start -= 1
elseif start > 1 && line[start - 2] == '-' && line[start - 1] == '>'
if lastword == -1
let lastword = start
endif
let start -= 2
elseif line[start - 1] == ']'
" Skip over [...].
let n = 0
let start -= 1
while start > 0
let start -= 1
if line[start] == '['
if n == 0
break
endif
let n -= 1
elseif line[start] == ']' " nested []
let n += 1
endif
endwhile
else
break
endif
endwhile
" Return the column of the last word, which is going to be changed.
" Remember the text that comes before it in s:prepended.
if lastword == -1
let s:prepended = ''
return start
endif
let s:prepended = strpart(line, start, lastword - start)
return lastword
endif
" Return list of matches.
let base = s:prepended . a:base
" Don't do anything for an empty base, would result in all the tags in the
" tags file.
if base == ''
return []
endif
" init cache for vimgrep to empty
let s:grepCache = {}
" Split item in words, keep empty word after "." or "->".
" "aa" -> ['aa'], "aa." -> ['aa', ''], "aa.bb" -> ['aa', 'bb'], etc.
" We can't use split, because we need to skip nested [...].
" "aa[...]" -> ['aa', '[...]'], "aa.bb[...]" -> ['aa', 'bb', '[...]'], etc.
let items = []
let s = 0
let arrays = 0
while 1
let e = match(base, '\.\|->\|\[', s)
if e < 0
if s == 0 || base[s - 1] != ']'
call add(items, strpart(base, s))
endif
break
endif
if s == 0 || base[s - 1] != ']'
call add(items, strpart(base, s, e - s))
endif
if base[e] == '.'
let s = e + 1 " skip over '.'
elseif base[e] == '-'
let s = e + 2 " skip over '->'
else
" Skip over [...].
let n = 0
let s = e
let e += 1
while e < len(base)
if base[e] == ']'
if n == 0
break
endif
let n -= 1
elseif base[e] == '[' " nested [...]
let n += 1
endif
let e += 1
endwhile
let e += 1
call add(items, strpart(base, s, e - s))
let arrays += 1
let s = e
endif
endwhile
if complete_check()
" return v:none
return []
endif
" Find the variable items[0].
" 1. in current function (like with "gd")
" 2. in tags file(s) (like with ":tag")
" 3. in current file (like with "gD")
let res = []
if searchdecl(items[0], 0, 1) == 0
" Found, now figure out the type.
" TODO: join previous line if it makes sense
let line = getline('.')
let col = col('.')
if stridx(strpart(line, 0, col), ';') != -1
" Handle multiple declarations on the same line.
let col2 = col - 1
while line[col2] != ';'
if complete_check()
return res
endif
let col2 -= 1
endwhile
let line = strpart(line, col2 + 1)
let col -= col2
endif
if stridx(strpart(line, 0, col), ',') != -1
" Handle multiple declarations on the same line in a function
" declaration.
let col2 = col - 1
while line[col2] != ','
if complete_check()
return res
endif
let col2 -= 1
endwhile
if strpart(line, col2 + 1, col - col2 - 1) =~ ' *[^ ][^ ]* *[^ ]'
let line = strpart(line, col2 + 1)
let col -= col2
endif
endif
if len(items) == 1
" Completing one word and it's a local variable: May add '[', '.' or
" '->'.
let match = items[0]
let kind = 'v'
if match(line, '\<' . match . '\s*\[') > 0
let match .= '['
else
let res = s:Nextitem(strpart(line, 0, col), [''], 0, 1)
if len(res) > 0
" There are members, thus add "." or "->".
if match(line, '\*[ \t(]*' . match . '\>') > 0
let match .= '->'
else
let match .= '.'
endif
endif
endif
let res = [{'match': match, 'tagline' : '', 'kind' : kind, 'info' : line}]
elseif len(items) == arrays + 1
" Completing one word and it's a local array variable: build tagline
" from declaration line
let match = items[0]
let kind = 'v'
let tagline = "\t/^" . line . '$/'
let res = [{'match': match, 'tagline' : tagline, 'kind' : kind, 'info' : line}]
else
" Completing "var.", "var.something", etc.
let res = s:Nextitem(strpart(line, 0, col), items[1:], 0, 1)
endif
endif
if len(items) == 1 || len(items) == arrays + 1
" Only one part, no "." or "->": complete from tags file.
if len(items) == 1
let tags = taglist('^' . base)
else
let tags = taglist('^' . items[0] . '$')
endif
" Remove members, these can't appear without something in front.
call filter(tags, 'has_key(v:val, "kind") ? v:val["kind"] != "m" : 1')
" Remove static matches in other files.
call filter(tags, '!has_key(v:val, "static") || !v:val["static"] || bufnr("%") == bufnr(v:val["filename"])')
call extend(res, map(tags, 's:Tag2item(v:val)'))
endif
if len(res) == 0
" Find the variable in the tags file(s)
let diclist = taglist('^' . items[0] . '$')
" Remove members, these can't appear without something in front.
call filter(diclist, 'has_key(v:val, "kind") ? v:val["kind"] != "m" : 1')
let res = []
for i in range(len(diclist))
if complete_check()
return res
endif
" New ctags has the "typeref" field. Patched version has "typename".
if has_key(diclist[i], 'typename')
call extend(res, s:StructMembers(diclist[i]['typename'], items[1:], 1))
elseif has_key(diclist[i], 'typeref')
call extend(res, s:StructMembers(diclist[i]['typeref'], items[1:], 1))
endif
" For a variable use the command, which must be a search pattern that
" shows the declaration of the variable.
if diclist[i]['kind'] == 'v'
let line = diclist[i]['cmd']
if line[0] == '/' && line[1] == '^'
let col = match(line, '\<' . items[0] . '\>')
call extend(res, s:Nextitem(strpart(line, 2, col - 2), items[1:], 0, 1))
endif
endif
endfor
endif
if len(res) == 0 && searchdecl(items[0], 1) == 0
" Found, now figure out the type.
" TODO: join previous line if it makes sense
let line = getline('.')
let col = col('.')
let res = s:Nextitem(strpart(line, 0, col), items[1:], 0, 1)
endif
" If the last item(s) are [...] they need to be added to the matches.
let last = len(items) - 1
let brackets = ''
while last >= 0
if complete_check()
return res
endif
if items[last][0] != '['
break
endif
let brackets = items[last] . brackets
let last -= 1
endwhile
return map(res, 's:Tagline2item(v:val, brackets)')
endfunc
func s:GetAddition(line, match, memarg, bracket)
" Guess if the item is an array.
if a:bracket && match(a:line, a:match . '\s*\[') > 0
return '['
endif
" Check if the item has members.
if len(s:SearchMembers(a:memarg, [''], 0)) > 0
" If there is a '*' before the name use "->".
if match(a:line, '\*[ \t(]*' . a:match . '\>') > 0
return '->'
else
return '.'
endif
endif
return ''
endfunc
" Turn the tag info "val" into an item for completion.
" "val" is is an item in the list returned by taglist().
" If it is a variable we may add "." or "->". Don't do it for other types,
" such as a typedef, by not including the info that s:GetAddition() uses.
func s:Tag2item(val)
let res = {'match': a:val['name']}
let res['extra'] = s:Tagcmd2extra(a:val['cmd'], a:val['name'], a:val['filename'])
let s = s:Dict2info(a:val)
if s != ''
let res['info'] = s
endif
let res['tagline'] = ''
if has_key(a:val, "kind")
let kind = a:val['kind']
let res['kind'] = kind
if kind == 'v'
let res['tagline'] = "\t" . a:val['cmd']
let res['dict'] = a:val
elseif kind == 'f'
let res['match'] = a:val['name'] . '('
endif
endif
return res
endfunc
" Use all the items in dictionary for the "info" entry.
func s:Dict2info(dict)
let info = ''
for k in sort(keys(a:dict))
if complete_check()
return info
endif
let info .= k . repeat(' ', 10 - len(k))
if k == 'cmd'
let info .= substitute(matchstr(a:dict['cmd'], '/^\s*\zs.*\ze$/'), '\\\(.\)', '\1', 'g')
else
let info .= a:dict[k]
endif
let info .= "\n"
endfor
return info
endfunc
" Parse a tag line and return a dictionary with items like taglist()
func s:ParseTagline(line)
let l = split(a:line, "\t")
let d = {}
if len(l) >= 3
let d['name'] = l[0]
let d['filename'] = l[1]
let d['cmd'] = l[2]
let n = 2
if l[2] =~ '^/'
" Find end of cmd, it may contain Tabs.
while n < len(l) && l[n] !~ '/;"$'
let n += 1
let d['cmd'] .= " " . l[n]
endwhile
endif
for i in range(n + 1, len(l) - 1)
if complete_check()
return d
endif
if l[i] == 'file:'
let d['static'] = 1
elseif l[i] !~ ':'
let d['kind'] = l[i]
else
let d[matchstr(l[i], '[^:]*')] = matchstr(l[i], ':\zs.*')
endif
endfor
endif
return d
endfunc
" Turn a match item "val" into an item for completion.
" "val['match']" is the matching item.
" "val['tagline']" is the tagline in which the last part was found.
func s:Tagline2item(val, brackets)
let line = a:val['tagline']
let add = s:GetAddition(line, a:val['match'], [a:val], a:brackets == '')
let res = {'word': a:val['match'] . a:brackets . add }
if has_key(a:val, 'info')
" Use info from Tag2item().
let res['info'] = a:val['info']
else
" Parse the tag line and add each part to the "info" entry.
let s = s:Dict2info(s:ParseTagline(line))
if s != ''
let res['info'] = s
endif
endif
if has_key(a:val, 'kind')
let res['kind'] = a:val['kind']
elseif add == '('
let res['kind'] = 'f'
else
let s = matchstr(line, '\t\(kind:\)\=\zs\S\ze\(\t\|$\)')
if s != ''
let res['kind'] = s
endif
endif
if has_key(a:val, 'extra')
let res['menu'] = a:val['extra']
return res
endif
" Isolate the command after the tag and filename.
let s = matchstr(line, '[^\t]*\t[^\t]*\t\zs\(/^.*$/\|[^\t]*\)\ze\(;"\t\|\t\|$\)')
if s != ''
let res['menu'] = s:Tagcmd2extra(s, a:val['match'], matchstr(line, '[^\t]*\t\zs[^\t]*\ze\t'))
endif
return res
endfunc
" Turn a command from a tag line to something that is useful in the menu
func s:Tagcmd2extra(cmd, name, fname)
if a:cmd =~ '^/^'
" The command is a search command, useful to see what it is.
let x = matchstr(a:cmd, '^/^\s*\zs.*\ze$/')
let x = substitute(x, '\<' . a:name . '\>', '@@', '')
let x = substitute(x, '\\\(.\)', '\1', 'g')
let x = x . ' - ' . a:fname
elseif a:cmd =~ '^\d*$'
" The command is a line number, the file name is more useful.
let x = a:fname . ' - ' . a:cmd
else
" Not recognized, use command and file name.
let x = a:cmd . ' - ' . a:fname
endif
return x
endfunc
" Find composing type in "lead" and match items[0] with it.
" Repeat this recursively for items[1], if it's there.
" When resolving typedefs "depth" is used to avoid infinite recursion.
" Return the list of matches.
func s:Nextitem(lead, items, depth, all)
" Use the text up to the variable name and split it in tokens.
let tokens = split(a:lead, '\s\+\|\<')
" Try to recognize the type of the variable. This is rough guessing...
let res = []
for tidx in range(len(tokens))
if complete_check()
return res
endif
" Skip tokens starting with a non-ID character.
if tokens[tidx] !~ '^\h'
continue
endif
" Recognize "struct foobar" and "union foobar".
" Also do "class foobar" when it's C++ after all (doesn't work very well
" though).
if (tokens[tidx] == 'struct' || tokens[tidx] == 'union' || tokens[tidx] == 'class') && tidx + 1 < len(tokens)
let res = s:StructMembers(tokens[tidx] . ':' . tokens[tidx + 1], a:items, a:all)
break
endif
" TODO: add more reserved words
if index(['int', 'short', 'char', 'float', 'double', 'static', 'unsigned', 'extern'], tokens[tidx]) >= 0
continue
endif
" Use the tags file to find out if this is a typedef.
let diclist = taglist('^' . tokens[tidx] . '$')
for tagidx in range(len(diclist))
if complete_check()
return res
endif
let item = diclist[tagidx]
" New ctags has the "typeref" field. Patched version has "typename".
if has_key(item, 'typeref')
call extend(res, s:StructMembers(item['typeref'], a:items, a:all))
continue
endif
if has_key(item, 'typename')
call extend(res, s:StructMembers(item['typename'], a:items, a:all))
continue
endif
" Only handle typedefs here.
if item['kind'] != 't'
continue
endif
" Skip matches local to another file.
if has_key(item, 'static') && item['static'] && bufnr('%') != bufnr(item['filename'])
continue
endif
" For old ctags we recognize "typedef struct aaa" and
" "typedef union bbb" in the tags file command.
let cmd = item['cmd']
let ei = matchend(cmd, 'typedef\s\+')
if ei > 1
let cmdtokens = split(strpart(cmd, ei), '\s\+\|\<')
if len(cmdtokens) > 1
if cmdtokens[0] == 'struct' || cmdtokens[0] == 'union' || cmdtokens[0] == 'class'
let name = ''
" Use the first identifier after the "struct" or "union"
for ti in range(len(cmdtokens) - 1)
if cmdtokens[ti] =~ '^\w'
let name = cmdtokens[ti]
break
endif
endfor
if name != ''
call extend(res, s:StructMembers(cmdtokens[0] . ':' . name, a:items, a:all))
endif
elseif a:depth < 10
" Could be "typedef other_T some_T".
call extend(res, s:Nextitem(cmdtokens[0], a:items, a:depth + 1, a:all))
endif
endif
endif
endfor
if len(res) > 0
break
endif
endfor
return res
endfunc
" Search for members of structure "typename" in tags files.
" Return a list with resulting matches.
" Each match is a dictionary with "match" and "tagline" entries.
" When "all" is non-zero find all, otherwise just return 1 if there is any
" member.
func s:StructMembers(typename, items, all)
" Todo: What about local structures?
let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")'))
if fnames == ''
return []
endif
let typename = a:typename
let qflist = []
let cached = 0
if a:all == 0
let n = '1' " stop at first found match
if has_key(s:grepCache, a:typename)
let qflist = s:grepCache[a:typename]
let cached = 1
endif
else
let n = ''
endif
if !cached
while 1
if complete_check()
return []
endif
exe 'silent! keepj noautocmd ' . n . 'vimgrep /\t' . typename . '\(\t\|$\)/j ' . fnames
let qflist = getqflist()
if len(qflist) > 0 || match(typename, "::") < 0
break
endif
" No match for "struct:context::name", remove "context::" and try again.
let typename = substitute(typename, ':[^:]*::', ':', '')
endwhile
if a:all == 0
" Store the result to be able to use it again later.
let s:grepCache[a:typename] = qflist
endif
endif
" Skip over [...] items
let idx = 0
while 1
if complete_check()
return []
endif
if idx >= len(a:items)
let target = '' " No further items, matching all members
break
endif
if a:items[idx][0] != '['
let target = a:items[idx]
break
endif
let idx += 1
endwhile
" Put matching members in matches[].
let matches = []
for l in qflist
let memb = matchstr(l['text'], '[^\t]*')
if memb =~ '^' . target
" Skip matches local to another file.
if match(l['text'], "\tfile:") < 0 || bufnr('%') == bufnr(matchstr(l['text'], '\t\zs[^\t]*'))
let item = {'match': memb, 'tagline': l['text']}
" Add the kind of item.
let s = matchstr(l['text'], '\t\(kind:\)\=\zs\S\ze\(\t\|$\)')
if s != ''
let item['kind'] = s
if s == 'f'
let item['match'] = memb . '('
endif
endif
call add(matches, item)
endif
endif
endfor
if len(matches) > 0
" Skip over next [...] items
let idx += 1
while 1
if complete_check()
return matches
endif
if idx >= len(a:items)
return matches " No further items, return the result.
endif
if a:items[idx][0] != '['
break
endif
let idx += 1
endwhile
" More items following. For each of the possible members find the
" matching following members.
return s:SearchMembers(matches, a:items[idx :], a:all)
endif
" Failed to find anything.
return []
endfunc
" For matching members, find matches for following items.
" When "all" is non-zero find all, otherwise just return 1 if there is any
" member.
func s:SearchMembers(matches, items, all)
let res = []
for i in range(len(a:matches))
if complete_check()
return res
endif
let typename = ''
if has_key(a:matches[i], 'dict')
if has_key(a:matches[i].dict, 'typename')
let typename = a:matches[i].dict['typename']
elseif has_key(a:matches[i].dict, 'typeref')
let typename = a:matches[i].dict['typeref']
endif
let line = "\t" . a:matches[i].dict['cmd']
else
let line = a:matches[i]['tagline']
let e = matchend(line, '\ttypename:')
if e < 0
let e = matchend(line, '\ttyperef:')
endif
if e > 0
" Use typename field
let typename = matchstr(line, '[^\t]*', e)
endif
endif
if typename != ''
call extend(res, s:StructMembers(typename, a:items, a:all))
else
" Use the search command (the declaration itself).
let s = match(line, '\t\zs/^')
if s > 0
let e = match(line, '\<' . a:matches[i]['match'] . '\>', s)
if e > 0
call extend(res, s:Nextitem(strpart(line, s, e - s), a:items, 0, a:all))
endif
endif
endif
if a:all == 0 && len(res) > 0
break
endif
endfor
return res
endfunc
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: noet sw=2 sts=2

View File

@@ -18,6 +18,9 @@ endif
if !has('vim9script')
function dist#vim#IsSafeExecutable(filetype, executable)
let cwd = getcwd()
if empty(exepath(a:executable))
return v:false
endif
return get(g:, a:filetype .. '_exec', get(g:, 'plugin_exec', 0)) &&
\ (fnamemodify(exepath(a:executable), ':p:h') !=# cwd
\ || (split($PATH, has('win32') ? ';' : ':')->index(cwd) != -1 &&

View File

@@ -1,6 +1,6 @@
" Vim autoload file for editing compressed files.
" Maintainer: The Vim Project <https://github.com/vim/vim>
" Last Change: 2023 Aug 10
" Last Change: 2024 Nov 25
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
" These functions are used by the gzip plugin.
@@ -148,6 +148,9 @@ fun gzip#read(cmd)
else
let fname = escape(expand("%:r"), " \t\n*?[{`$\\%#'\"|!<")
endif
if filereadable(undofile(expand("%")))
exe "sil rundo " . fnameescape(undofile(expand("%")))
endif
if &verbose >= 8
execute "doau BufReadPost " . fname
else

26
runtime/autoload/hare.vim Normal file
View File

@@ -0,0 +1,26 @@
" Vim autoload file.
" Language: Hare
" Maintainer: Amelia Clarke <selene@perilune.dev>
" Last Updated: 2024-05-10
" Upstream: https://git.sr.ht/~sircmpwn/hare.vim
" Attempt to find the directory for a given Hare module.
function hare#FindModule(str)
let path = substitute(trim(a:str, ':', 2), '::', '/', 'g')
let dir = finddir(path)
while !empty(path) && empty(dir)
let path = substitute(path, '/\?\h\w*$', '', '')
let dir = finddir(path)
endwhile
return dir
endfunction
" Return the value of HAREPATH if it exists. Otherwise use a reasonable default.
function hare#GetPath()
if empty($HAREPATH)
return '/usr/src/hare/stdlib,/usr/src/hare/third-party'
endif
return substitute($HAREPATH, ':', ',', 'g')
endfunction
" vim: et sts=2 sw=2 ts=8

55
runtime/autoload/hcl.vim Normal file
View File

@@ -0,0 +1,55 @@
" Language: HCL
" Maintainer: Gregory Anders
" Last Change: 2024-09-03
" Based on: https://github.com/hashivim/vim-terraform
" License: ISC
"
" Copyright (c) 2014-2016 Mark Cornick <mark@markcornick.com>
"
" Permission to use, copy, modify, and/or distribute this software for any purpose
" with or without fee is hereby granted, provided that the above copyright notice
" and this permission notice appear in all copies.
"
" THE SOFTWARE IS PROVIDED 'AS IS' AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
" FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
" OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
" TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
" THIS SOFTWARE.
function! hcl#indentexpr(lnum)
" Beginning of the file should have no indent
if a:lnum == 0
return 0
endif
" Usual case is to continue at the same indent as the previous non-blank line.
let prevlnum = prevnonblank(a:lnum-1)
let thisindent = indent(prevlnum)
" If that previous line is a non-comment ending in [ { (, increase the
" indent level.
let prevline = getline(prevlnum)
if prevline !~# '^\s*\(#\|//\)' && prevline =~# '[\[{\(]\s*$'
let thisindent += &shiftwidth
endif
" If the current line ends a block, decrease the indent level.
let thisline = getline(a:lnum)
if thisline =~# '^\s*[\)}\]]'
let thisindent -= &shiftwidth
endif
" If the previous line starts a block comment /*, increase by one
if prevline =~# '/\*'
let thisindent += 1
endif
" If the previous line ends a block comment */, decrease by one
if prevline =~# '\*/'
let thisindent -= 1
endif
return thisindent
endfunction

View File

@@ -1,40 +0,0 @@
function! s:deprecate(type) abort
let deprecate = v:lua.vim.deprecate('health#report_' . a:type, 'vim.health.' . a:type, '0.11')
redraw | echo 'Running healthchecks...'
if deprecate isnot v:null
call v:lua.vim.health.warn(deprecate)
endif
endfunction
function! health#report_start(name) abort
call v:lua.vim.health.start(a:name)
call s:deprecate('start')
endfunction
function! health#report_info(msg) abort
call v:lua.vim.health.info(a:msg)
call s:deprecate('info')
endfunction
function! health#report_ok(msg) abort
call v:lua.vim.health.ok(a:msg)
call s:deprecate('ok')
endfunction
function! health#report_warn(msg, ...) abort
if a:0 > 0
call v:lua.vim.health.warn(a:msg, a:1)
else
call v:lua.vim.health.warn(a:msg)
endif
call s:deprecate('warn')
endfunction
function! health#report_error(msg, ...) abort
if a:0 > 0
call v:lua.vim.health.error(a:msg, a:1)
else
call v:lua.vim.health.error(a:msg)
endif
call s:deprecate('error')
endfunction

Some files were not shown because too many files have changed in this diff Show More