Compare commits

...

6958 Commits

Author SHA1 Message Date
a9a3981669 NVIM v0.11.1
For notable changes, see runtime/doc/news.txt (or `:help news` in Nvim).

Following is a list of fixes/features commits.

BREAKING
--------------------------------------------------------------------------------
- bbf912d72f provider: drop Python 3.7, 3.8 support #33088

FEATURES
--------------------------------------------------------------------------------
- 66953b16a2 lsp: workspace_required (#33608)
- 7efb3ba6f7 checkhealth: use emoji for OK/WARN/ERROR (#33195)
- 91d11c8bc1 clipboard: g:clipboard="foo" forces the "foo" clipboard tool #33235
- 12da443930 float: 'winborder' "bold" style #33189
- 5829b5de0a vim.hl: allow multiple timed highlights simultaneously #33283

FIXES
--------------------------------------------------------------------------------
- 91481ae7d5 bug in stylize_markdown
- 5fc6bd6454 api: nvim_set_keymap() throws error even in pcall() #33228
- 2b2a90051e api: use E226 instead of E227 for duplicate abbreviation (#33159)
- 056dbf3ea7 api: use original LHS in keymap error message #33135
- fb71d631a5 api: wrong return value with reverse range + overlap #32956
- fcee5df0fc checkhealth: check g:loaded_xx_provider for all providers #33168
- 89e0ea1788 checkhealth: check outdated pynvim version properly #33175
- adfd4b9f4f checkhealth: don't override user "q" keymap #33132
- 06df3e0c0d cmdline: avoid empty @: register after :<CR> (#33126)
- 53def2a877 cmdline: empty ext_cmdline block events for :<CR> #33118
- b8e5fd51fd column: don't count signs on lines beyond eob #33410
- e4007551c4 completion: avoid freeing uninitialized value (#33459)
- 6e51d39696 decor: enable decoration provider in on_start #33337
- 837c9d0409 defaults: enable :terminal [[,]] motion in operator-pending mode #33217
- 2182272139 defaults: keywordprg=:help on Windows #33336
- 7e884b78bf defaults: visual-mode [[,]] for :terminal shell prompts #33203
- 2a04161a35 desktop: cannot open filename with spaces using OS file manager #33161
- 2cd735d159 display: scroll logic does not take into account concealed topline (#33054)
- c4a19bff4e display: scroll redrawing doesn't account for virt_lines above fold #33374
- 02123bac0d display: wrong cursor column with 'concealcursor' = "n" and virt_text (#33218)
- 837faf7065 editor: respect [+cmd] when executing :drop #33339
- 155529b91a events: avoid superfluous CursorMovedI on first autocmd (#33588)
- c158d41cec health: expecting nonexistent "inotifywait" function #33312
- 06c2886569 health: message should mention "vim.provider" #33095
- 279a0e78c9 highlight: no match highlight during :substitute prompt #33262
- b5158e8e92 lsp: "bold" border for vim.lsp.buf.hover #33395
- 1e8e74dbff lsp: better handling of "*" configs
- 478f5d0070 lsp: cycling signatures with the default `config.focusable`
- 2435d72283 lsp: opts.reuse_win does not jump if buf is already open #33476
- 95f96a3d1b lsp: prioritize showing active signature
- a9afa6b152 lsp: warn on missing config in :checkhealth #33087
- 2b14447803 man.lua: noisy "ENOENT" error on Windows #33435
- 8aa49a8e9b man.lua: useless executability check #33438
- 4d87229789 marks: clamp conceal_lines corrected line number #33464
- 9da90af0f7 marks: wrong display after inserting/deleting lines #33389
- 3b0c88a537 messages: single msg_show event for multiple :set options #33555
- 3df9db58dc messages: verbose message emitted without kind #33305
- c61e8c6e70 mouse: crash with click on win-separator in statusline (#33091)
- dcd5e4574a mouse: do not fetch clipboard twice when pasting with middle button #33494
- 526444c4ff mouse: mouseclick after conceal_lines is miscalculated #33451
- 326eacef93 move: adjust for concealed lines above topline after scrolling up (#33211)
- 649bce6e73 provider: misleading :checkhealth if user sets g:loaded_python3_provider=1 #32696
- c57a36cd59 pum: fix heap-buffer-overflow with 'rightleft' (#33146)
- c1d3777db2 snippet: use <cmd>call cursor() for visual range
- 70f3e15298 treesitter: don't memoize modified headings (#33186)
- e342b9a25a treesitter: fix `:InspectTree` incorrect injections
- 4c1121bd33 treesitter: not refreshing virtualtext contents #33361
- 646a8f663e tui: ensure all pending escape sequences are processed before exiting #32151
- 9909580df2 ui: exclude unfocusable windows from 'complete' "w" completion
- ccb078bbb0 ui: wincmd _ should not increase 'cmdheight' above 0 (#33056)
- 29011e4d45 vim.hl: nvim_buf_del_extmark on invalid buffer #33331
- 9056c01a95 vim.lsp.inlay_hint: requesting inlay_hints even when disabled #32999
- 4422b9bbd0 vim.system: unclear non-executable message #33455
- a4b6705e87 window: crash on negative window height with 'winbar' #33250

PERFORMANCE
--------------------------------------------------------------------------------
- b9c9b15ad7 snippet: use "[count]|" to move cursor #33571

VIM PATCHES
--------------------------------------------------------------------------------
- a97713485d 9.0.1653: Amiga: default 'viewdir' may not work
- cdd3f2a2e6 9.0.1654: MS-Windows: test for default 'viewdir' fails
- b7de104d86 9.1.0721: tests: test_mksession does not consider XDG_CONFIG_HOME
- 6514e2c7ba 9.1.1247: fragile setup to get (preferred) keys from key_name_entry (#33102)
- 2084cda6f9 9.1.1260: Hang when filtering buffer with NUL bytes (#33192)
- 02bf23b4bf 9.1.1269: completion: compl_shown_match is updated when starting keyword completion
- e3506ede27 9.1.1272: completion: in keyword completion Ctrl_P cannot go back after Ctrl_N
- a92155b86b 9.1.1286: filetype: help files not detected when 'iskeyword' includes ":" (#33377)
- b694131c3b 9.1.1303: missing out-of-memory check in linematch.c (#33487)
- 0c315feddf 9.1.1305: completion menu active after switching windows/tabs (#33488)
- 12298be0fe 9.1.1310: completion: redundant check for preinsert effect (#33505)
- 4205fdee1d 9.1.1314: max allowed string width too small
- 248528c907 9.1.1317: noisy error when restoring folds from session fails
- 1a6ddeee41 9.1.1318: tests: test_format fails
- 448c2cec9d 9.1.1337: Undo corrupted with 'completeopt' "preinsert" when switching buffer (#33600)
2025-04-26 16:29:18 +02:00
478f5d0070 fix(lsp): cycling signatures with the default config.focusable
(cherry picked from commit 342974773c)
2025-04-26 13:55:12 +00:00
95f96a3d1b fix(lsp): prioritize showing active signature
(cherry picked from commit 9e93bfdb5f)
2025-04-26 13:55:12 +00:00
9909580df2 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.
(cherry picked from commit d01b2611a6)
2025-04-25 23:19:28 +00:00
66953b16a2 feat(lsp): workspace_required (#33608)
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: Michael Strobel <71396679+Kibadda@users.noreply.github.com>
2025-04-24 07:06:30 -07:00
448c2cec9d 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
(cherry picked from commit 63689deb45)
2025-04-24 00:45:04 +00:00
c1d3777db2 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.
(cherry picked from commit 019b2050e1)
2025-04-23 09:24:54 +00:00
155529b91a fix(events): avoid superfluous CursorMovedI on first autocmd (#33588)
(cherry picked from commit 1dbede5b93)
2025-04-23 03:47:35 +00:00
c633250cc0 Merge pull request #33589 from zeertzjq/backport
vim-patch:9.1.1305: completion menu active after switching windows/tabs (#33488)
2025-04-23 11:42:36 +08:00
0c315feddf 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-23 11:09:01 +08:00
646a8f663e 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.

(cherry picked from commit 82f08f33c1)
2025-04-22 12:51:47 +00:00
b9c9b15ad7 perf(snippet): use "[count]|" to move cursor #33571
Problem:
Flicker when using vim.snippet.jump().

Solution:
Pass count instead of multiple <right> keys.

(cherry picked from commit d3e495ce03)
2025-04-22 12:21:35 +00:00
fb71d631a5 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.
(cherry picked from commit 65170e8dad)
2025-04-21 23:49:27 +00:00
3b0c88a537 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.
(cherry picked from commit 986b92eb07)
2025-04-21 16:23:38 +00:00
1a6ddeee41 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
(cherry picked from commit 0251a25541)
2025-04-19 00:12:55 +00:00
4205fdee1d 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>
(cherry picked from commit ccdb37b075)
2025-04-19 00:12:55 +00:00
248528c907 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>
(cherry picked from commit e2e6c159d3)
2025-04-18 01:04:01 +00:00
b7de104d86 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>
(cherry picked from commit 0eb708aa8a)
2025-04-18 01:04:01 +00:00
cdd3f2a2e6 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>
(cherry picked from commit bd0555ecd4)
2025-04-18 01:04:01 +00:00
a97713485d 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>
(cherry picked from commit 827cfe4a76)
2025-04-18 01:04:01 +00:00
12298be0fe 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>
(cherry picked from commit f9f6dc4262)
2025-04-17 23:25:23 +00:00
Au.
2435d72283 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.

(cherry picked from commit 6926fc1615)
2025-04-17 15:12:46 +00:00
e342b9a25a fix(treesitter): fix :InspectTree incorrect injections
(cherry picked from commit 284b0e4fa2)
2025-04-16 14:31:32 +00:00
4422b9bbd0 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

(cherry picked from commit 223ac7782e)
2025-04-16 12:38:46 +00:00
dcd5e4574a 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

(cherry picked from commit 7432781e71)
2025-04-16 10:50:01 +00:00
b694131c3b 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>
(cherry picked from commit d2d1b5e944)
2025-04-15 23:37:37 +00:00
4d87229789 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.
(cherry picked from commit 3341ab0776)
2025-04-14 11:38:29 +00:00
e4007551c4 fix(completion): avoid freeing uninitialized value (#33459)
(cherry picked from commit 51caf0a3af)
2025-04-14 05:31:00 +00:00
526444c4ff 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.
(cherry picked from commit 2f8fb4f28a)
2025-04-13 21:57:00 +00:00
8aa49a8e9b 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`

(cherry picked from commit b8763cb215)
2025-04-12 23:53:54 +00:00
2b14447803 fix(man.lua): noisy "ENOENT" error on Windows #33435
Problem:
:Man shows noisy "ENOENT: no such file or directory" error on Windows.

Solution:
Do some checks before calling `vim.system`.

(cherry picked from commit a8dd5c7e41)

Co-authored-by: Emanuel Krollmann <115734183+Sodastream11@users.noreply.github.com>
2025-04-12 15:53:32 -07:00
7384983721 docs: clipboard, eval #33328 2025-04-12 10:56:28 -07:00
b8e5fd51fd 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.
(cherry picked from commit 4a706a7092)
2025-04-11 12:28:22 +00:00
9da90af0f7 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>
(cherry picked from commit 064ff74cdb)
2025-04-11 12:03:53 +00:00
b5158e8e92 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
(cherry picked from commit f068386c9f)
2025-04-09 11:57:22 +00:00
jyn
837faf7065 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().

(cherry picked from commit 3647b821ea)
2025-04-08 13:47:08 +00:00
c4a19bff4e 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.
(cherry picked from commit 5b1561bb71)
2025-04-08 13:20:27 +00:00
a92155b86b 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
(cherry picked from commit 8af9f8ab5e)
2025-04-08 00:52:17 +00:00
6e51d39696 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.
(cherry picked from commit ca16b54c86)
2025-04-07 11:33:43 +00:00
4c1121bd33 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.

(cherry picked from commit cf59631f65)
2025-04-07 11:30:12 +00:00
c158d41cec fix(health): expecting nonexistent "inotifywait" function #33312
Problem:
55e4301036 changed the program name but not the function name.

Solution:
Fix the healthcheck.

(cherry picked from commit bd37348939)
2025-04-07 09:40:09 +00:00
2182272139 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.

(cherry picked from commit 3ebde5ea14)
2025-04-07 09:35:36 +00:00
29011e4d45 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.

(cherry picked from commit 28e8190185)
2025-04-05 23:19:19 +00:00
91481ae7d5 fix: bug in stylize_markdown
`stripped` and `markdown_lines` are iterated together so must have the same length.

(cherry picked from commit 379c37fa0b)
2025-04-04 14:08:52 +00:00
3df9db58dc 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.
(cherry picked from commit 98f5aa2564)
2025-04-04 12:53:23 +00:00
e3506ede27 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>
(cherry picked from commit b01921cb55)
2025-04-04 06:40:34 +00:00
02bf23b4bf 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>
(cherry picked from commit 8cf413e450)
2025-04-04 06:40:34 +00:00
cbf4906c11 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.

(cherry picked from commit d9405c7935)
2025-04-04 04:24:11 +00:00
4cc97cf009 Merge pull request #33295 from siddhantdev/backport-33283-to-release-0.11
feat(vim.hl): allow multiple timed highlights simultaneously #33283
2025-04-04 09:50:29 +08:00
c6ef13dc45 test(lua/hl_spec): fix hang on exit with ASAN (#33298) 2025-04-04 09:25:39 +08:00
1a2d0484ac docs: news.txt 2025-04-04 09:25:14 +08:00
5829b5de0a 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.

(cherry picked from commit eae2d3b145)
2025-04-04 00:14:43 +05:30
dd547ef1ea 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.
(cherry picked from commit 71e133e5e6)
2025-04-03 16:49:58 +00:00
91d11c8bc1 feat(clipboard): g:clipboard="foo" forces the "foo" clipboard tool #33235
(cherry picked from commit 9722bd7b1b)
2025-04-03 14:26:45 +00:00
1daea6e1fd test(lua/secure_spec): fix failure with long path (#33280)
Ref #33278

(cherry picked from commit 974a3aa2c4)
2025-04-03 13:56:49 +00:00
279a0e78c9 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.
(cherry picked from commit 3af43cffa0)
2025-04-02 12:48:35 +00:00
5fc6bd6454 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`).

(cherry picked from commit ec18ebcb41)
2025-04-01 15:50:54 +00:00
2b2a90051e fix(api): use E226 instead of E227 for duplicate abbreviation (#33159)
(cherry picked from commit 99529577cc)
2025-04-01 15:04:03 +00:00
1e8e74dbff 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.

(cherry picked from commit 2ee896201c)
2025-04-01 13:54:47 +01:00
a4b6705e87 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.
(cherry picked from commit 0e7479bb76)
2025-04-01 12:28:28 +00:00
f68e0fed26 docs(eval): fix dict param type of mapset
Match maparg's return type.

(cherry picked from commit ec6670080a)
2025-04-01 10:21:42 +00:00
09fd22d5d7 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.

(cherry picked from commit 4a36f234ac)
2025-04-01 10:21:42 +00:00
326eacef93 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.
(cherry picked from commit 32325a66ca)
2025-04-01 06:34:00 +00:00
02123bac0d 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.
(cherry picked from commit 7e8b7bba21)
2025-04-01 06:31:29 +00:00
8d9b4d8c14 test(float): restore border tests (#33222)
(cherry picked from commit 04901f4ee7)
2025-04-01 00:01:17 +00:00
55be20316a docs: remove duplicate news file (#33227) 2025-03-31 15:16:51 +00:00
12da443930 feat(float): 'winborder' "bold" style #33189
(cherry picked from commit 216cc893bf)
2025-03-31 14:06:11 +00:00
837c9d0409 fix(defaults): enable :terminal [[,]] motion in operator-pending mode #33217
This enables y]] to copy a command and its output.

(cherry picked from commit 57b4fb5c53)
2025-03-31 13:42:29 +00:00
70f3e15298 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
(cherry picked from commit 28eaec5e15)
2025-03-31 09:49:39 +00:00
7e884b78bf fix(defaults): visual-mode [[,]] for :terminal shell prompts #33203
Problem:
:terminal shell prompt jump mappings ]]/[[ don't work in visual mode.

Solution:
Also define them for in visual mode.

(cherry picked from commit cb247e06f0)

Co-authored-by: msaher <77233589+msaher@users.noreply.github.com>
2025-03-30 13:17:46 -07:00
89e0ea1788 fix(checkhealth): check outdated pynvim version properly #33175
Fixes #33174, a regression from #22962.

(cherry picked from commit e87d2ae383)
2025-03-30 17:01:35 +00:00
9056c01a95 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.

(cherry picked from commit 49756ebc70)
2025-03-30 16:07:09 +00:00
d2dd403693 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 17:22:52 +02:00
2084cda6f9 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
(cherry picked from commit 431c037709)
2025-03-30 14:34:33 +00:00
7efb3ba6f7 feat(checkhealth): use emoji for OK/WARN/ERROR (#33195)
Problem:
Health status can be much more visually distinct.

Solution:
Use emoji next to each status.

(cherry picked from commit 75fe540500)

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-03-30 07:04:01 -07:00
649bce6e73 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.

(cherry picked from commit b4906577c9)

Co-authored-by: Sathya Pramodh <94102031+sathya-pramodh@users.noreply.github.com>
2025-03-30 08:09:07 +08:00
fcee5df0fc fix(checkhealth): check g:loaded_xx_provider for all providers #33168
(cherry picked from commit 5f9f5bc04d)
2025-03-29 21:09:55 +00:00
2a04161a35 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.

(cherry picked from commit 6e12ef4a7b)
2025-03-29 16:17:04 +00:00
adfd4b9f4f fix(checkhealth): don't override user "q" keymap #33132
(cherry picked from commit 78d2e0b43e)
2025-03-29 13:58:03 +00:00
056dbf3ea7 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.

(cherry picked from commit 0d73ec5834)
2025-03-29 13:48:06 +00:00
c57a36cd59 fix(pum): fix heap-buffer-overflow with 'rightleft' (#33146)
(cherry picked from commit 2681e1fce3)
2025-03-29 02:58:38 +00:00
06df3e0c0d fix(cmdline): avoid empty @: register after :<CR> (#33126)
Fix https://github.com/neovim/neovim/issues/33125

(cherry picked from commit f4ee0ab2f1)
2025-03-28 21:57:24 +00:00
a9afa6b152 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.

(cherry picked from commit 5554fcc286)
2025-03-28 13:17:38 +00:00
bbf912d72f 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.
(cherry picked from commit ade58885c4)
2025-03-28 12:36:02 +00:00
53def2a877 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`.
(cherry picked from commit 95ab723995)
2025-03-28 12:11:56 +00:00
c61e8c6e70 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.

(cherry picked from commit 18fa61049a)
2025-03-28 07:32:24 +00:00
6514e2c7ba 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>
(cherry picked from commit ae98d0a560)
2025-03-28 00:28:03 +00:00
06c2886569 fix(health): message should mention "vim.provider" #33095
(cherry picked from commit 07f048a8d7)
2025-03-27 23:49:03 +00:00
2cd735d159 fix(display): scroll logic does not take into account concealed topline (#33054)
(cherry picked from commit ce0c0c31a0)
2025-03-27 13:55:34 +00:00
ccb078bbb0 fix(ui): wincmd _ should not increase 'cmdheight' above 0 (#33056)
(cherry picked from commit 703f4037c4)
2025-03-27 13:08:16 +00:00
5e4365b83d version bump 2025-03-26 15:13:05 +01:00
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
6566b66f65 docs(lsp): completion.enable #33063 2025-03-26 06:43:40 -07:00
8a7e1b19b9 docs: news, lsp autocomplete #33047 2025-03-26 05:49:48 -07:00
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
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
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
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
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
76eca62137 Merge #33043 redundar channel_close() 2025-03-24 10:15:35 -07:00
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
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
c4e9ff30a6 fix(treesitter): sync queries with upstream
Update C highlight query from nvim-treesitter
2025-03-24 16:45:36 +01:00
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
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
c982608226 test(checkhealth): nested path 'runtimepath' #33034 2025-03-23 16:30:08 -07:00
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
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
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
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
b165ad0671 build(deps): bump tree-sitter-vim to v0.5.0 2025-03-21 17:53:13 +01:00
0ff630bfad build(deps): bump tree-sitter-markdown to v0.4.1 2025-03-21 17:53:13 +01:00
10c0f6257a build(deps): bump tree-sitter-lua to v0.3.0 2025-03-21 17:53:13 +01:00
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
264b4303a0 docs: LSP completion #33006 2025-03-21 03:34:28 -07:00
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
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
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
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
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
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
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
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
f1fcf653cb fix(diagnostic): clear virtual_lines autocmd only for valid buf #32979 2025-03-19 05:27:20 -07:00
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
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
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
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
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
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
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
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
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
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
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
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
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
eefd72fff7 build(deps): bump tree-sitter-query to v0.5.1 2025-03-18 15:21:37 +01:00
d774fc6b33 build(deps): bump tree-sitter-vimdoc to v3.0.1 2025-03-18 14:44:38 +01:00
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
6623b4e050 docs: misc #32959 2025-03-18 06:20:47 -07:00
7333c39e6c docs: misc #32959 2025-03-18 06:18:37 -07:00
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
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
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
3b1d0e7f70 fix(diagnostic): remove deprecated severity_limit option
Deprecated to be removed in 0.11
2025-03-17 23:43:09 +01:00
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
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
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
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
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
5440e59247 Merge #32810 docs 2025-03-17 04:59:31 -07:00
f96606371c docs: misc 2025-03-17 12:31:53 +01:00
041a939eeb docs(api): rename "handle" => "id" 2025-03-17 12:06:38 +01:00
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
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
96e5b61be1 test(lsp): add a test for refreshing hints after being requested 2025-03-17 14:44:55 +08:00
648b7f6101 test(lsp): add a test for resetting the active request after receiving error 2025-03-17 14:44:51 +08:00
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
c85d15e0d5 perf(lsp): don't construct potentially expensive strings 2025-03-16 19:12:36 +01:00
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
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
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
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
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
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
1862d3210d docs(lsp): simplify example of enabling LSP folding 2025-03-16 11:21:44 +01:00
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
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
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
f8d5811c71 fix(lsp): correctly check for "codeAction/resolve" support 2025-03-15 15:56:47 +01:00
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
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
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
d8eec81560 fix(treesitter): update lua, markdown queries 2025-03-15 12:10:22 +01:00
94de236815 build(deps): bump tree-sitter-c to v0.23.4 2025-03-15 12:10:22 +01:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
543e40624e ci(deps): bump lua-language-server to 3.13.9 2025-03-13 09:23:55 +01:00
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
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
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
dbd76c2c41 test: reduce flakiness in blocking wait tests (#32868) 2025-03-13 00:42:02 +00:00
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
c78728a384 fix(diagnostic): clear autocmd only for valid buf (#32861) 2025-03-12 09:30:05 -05:00
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
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
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
eea0aff4e5 ci(deps): bump lua-language-server to 3.13.8 2025-03-12 12:04:56 +01:00
ed07167261 fix(lsp): handle non-existent configs in lsp.config/enable 2025-03-12 09:06:28 +00:00
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
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
55fe49cadf build(deps): bump luajit to 538a82133 2025-03-12 09:37:55 +01:00
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
a94a2927d0 feat(treesitter): allow passing lang to InspectTree 2025-03-12 08:58:41 +01:00
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
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
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
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
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
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
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
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
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
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
8f056f63e3 ci(deps): bump lua-language-server to 3.13.7 2025-03-11 10:47:11 +01:00
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
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
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
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
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
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
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
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
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
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
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
c9b5ac113a docs(vvars): vim.v.event.windows #32673 2025-03-10 08:18:11 -07:00
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
40a149e7f9 fix(lua): types for vim.api.keyset.win_config #32700 2025-03-10 06:01:51 -07:00
85deb8d52b build(deps): bump luajit to 84cb21ffa (#32803) 2025-03-10 09:14:58 +00:00
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
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
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
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
15f2da55a8 perf(events): use hashy for event name lookup (#32802) 2025-03-10 06:56:02 +08:00
37786ccfcf docs(api): show "since" in API docs #32806 2025-03-09 15:47:45 -07:00
25d3b92d07 Merge #32687 "g<" for ext_messages 2025-03-09 13:38:32 -07:00
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
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
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
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
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
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
2a53ccdb42 Merge pull request #32797 from zeertzjq/vim-3d1a437
vim-patch:{3d1a437,d89770e}
2025-03-09 16:13:56 +08:00
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
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
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
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
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
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
05b9daa1e6 refactor(multiqueue): rename multiqueue_new_parent #32767 2025-03-08 12:28:15 -08:00
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
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
c38c88edfd docs: OSC 133 shell config #32771 2025-03-07 16:37:42 -08:00
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
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
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
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
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
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
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
08d12b57ad test: add benchmark for nvim_replace_termcodes and keytrans() 2025-03-08 05:45:39 +08:00
3824f52e52 refactor(keycodes): generate key_names_table[] using Lua
This allows easier refactoring.
2025-03-08 05:45:38 +08:00
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
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
b31132f1c1 feat(defaults): jump between :terminal shell prompts with ]]/[[ #32736 2025-03-07 05:45:34 -08:00
c8b64b7a43 fix(lua): always use vim.inspect() for :lua= (#32715) 2025-03-07 19:50:00 +08:00
5d08b65ac2 fix(lsp): use unresolved code action when codeAction/resolve fails 2025-03-07 10:23:55 +01:00
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
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
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
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
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
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
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
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
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
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
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
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
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
8448703662 Merge pull request #12049 from bfredl/luverr
convert non-string errors using tostring()
2025-03-05 13:30:06 +01:00
ebb963a4a0 fix(lua): format errors from luv callbacks using __tostring 2025-03-05 12:09:57 +01:00
e4c094a84d build(deps): bump tree-sitter to v0.25.3 2025-03-05 09:59:51 +01:00
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
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
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
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
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
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
90a63d242a refactor(tests): use new-style highlight spec in legacy/ 2025-03-04 12:32:22 +01:00
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
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
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
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
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
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
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
f7fa6d1266 refactor(messages): simplify message history 2025-03-03 11:24:54 +01:00
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
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
c4a0c1d3b0 docs: misc #31996 2025-03-02 14:27:52 -08:00
0a5a0efda6 feat(lua): don't complete private (_) fields after dot (.) #32690 2025-03-02 13:44:13 -08:00
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
59c328bc88 test: simplify ASAN detection 2025-03-02 11:57:41 +01:00
b45a44dd32 test: enable more multigrid popup tests (#32470) 2025-03-02 15:07:46 +08:00
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
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
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
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
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
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
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
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
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
7b4295390f docs(Open): add reference in documentation (#32678) 2025-02-28 23:14:01 +00:00
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
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
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
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
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
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
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
9b25c68db2 fix(treesitter): correctly parse queries with combined injections 2025-02-28 09:33:02 +01:00
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
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
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
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
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
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
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
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
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
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
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
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
1e4c708033 test: option set by Lua autocommand has correct script context (#32652) 2025-02-27 05:48:52 +00:00
877f3b7288 refactor(shada): fix coverity warning about leaking memory (#32650) 2025-02-27 10:38:04 +08:00
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
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
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
3cce657031 refactor: old references to scripts/ dir #32647 2025-02-26 23:00:54 +00:00
4f42b69b4a Merge #32601 vim.text.indent() 2025-02-26 14:31:03 -08:00
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
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
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
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
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
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
7ead328a48 build(cjson): sync with upstream (#32114)
Sync with commit 91ca29db9a
2025-02-26 09:40:02 +01:00
b0a1d35f69 fix(eval): don't shorten $HOME in v:stacktrace (#32634) 2025-02-26 07:33:11 +00:00
f4bb7417b7 refactor: remove unnecessary allocation for "run Nvim with -V1" (#32633) 2025-02-26 05:55:29 +00:00
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
a2b464944a refactor(options): fix coverity warning about unintialized sc_chan (#32630) 2025-02-26 01:47:29 +00:00
93278e7720 fix(extmark): clearer error message for invalid ephemeral mark usage 2025-02-26 01:08:51 +01:00
23f7e5593d Merge pull request #32614 from brianhuster/vim-094494b
vim-patch: improve &keywordprg in Vim ftplugin
2025-02-26 07:51:10 +08:00
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
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
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
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
c3337e357a fix(treesitter): nil check query for has_conceal_line 2025-02-25 16:21:16 +01:00
3bdc3a1689 test(ui/cursor_spec): reduce flakiness (#32627) 2025-02-25 21:29:10 +08:00
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
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
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
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
0c650da799 test: combined injections (#32611)
* refactor: rewrite test without trailing whitespace

* test: combined injection tests
2025-02-25 09:12:49 +00:00
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
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
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
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
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
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
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
6bc7979044 fix(lsp): reset the applied hints on refresh request #32446 2025-02-23 08:48:08 -08:00
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
9304a417af Merge #32503 feat(lsp): use the meta model to generate server capability map 2025-02-23 08:20:19 -08:00
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
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
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
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
d2cca606a1 fix(float): ensure floating window width can fit title 2025-02-23 10:32:20 +00:00
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
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
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
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
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
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
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
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
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
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
e641155b02 fix(runtime): avoid E31 in ftplugin (#32578)
fix: twice nunmap in ftplugin
2025-02-22 14:17:35 +01:00
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
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
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
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
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
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
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
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
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
e4c1f6667b feat(lsp): use the meta model to generate server capability map 2025-02-21 08:40:33 -08:00
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
55b165ac15 fix(treesitter): TSNode:field() returns all children with the given field 2025-02-21 09:47:02 +00:00
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
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
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
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
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
b533c0f222 ci: add "_" to luacheck's list of global variables 2025-02-21 09:56:21 +01:00
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
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
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
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
145c2e720c test(completion_spec): make Enter test descriptions more accurate 2025-02-21 07:45:30 +08:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
5d03060743 test(lua/hl_spec): fix hang on exit with ASAN (#32508) 2025-02-18 21:22:46 +08:00
4c2d14a370 build(deps): bump tree-sitter to v0.25.2 2025-02-18 10:41:11 +01:00
ae2fd91b41 feat(lsp): update LSP types 2025-02-17 17:52:55 -08:00
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
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
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
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
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
5e7801329f test(lua/hl_spec): reduce flakiness (#32489) 2025-02-17 10:32:35 +08:00
bfd59c955f test: reduce flakiness in highlight tests (#32488) 2025-02-17 01:45:53 +00:00
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
a75b09019f docs: stdpath() type #32480 2025-02-16 13:33:56 -08:00
0e8e4a07f5 fix(diagnostic): don't include diagnostic code when using custom formatter #32464 2025-02-16 12:13:29 -08:00
906ad04ddd fix(marks): handle composing in inline virt_text with 'nowrap' (#32477) 2025-02-16 22:54:32 +08:00
8452032554 fix(marks): handle double-with inline virt_text with 'nowrap' (#32476) 2025-02-16 14:05:13 +00:00
efe92f9dff fix(docs): update context type in vim.lsp.LocationOpts.OnList 2025-02-16 11:31:08 +01:00
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
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
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
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
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
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
c091bc3b9a ci(release): change to ubuntu-22.04
Ubuntu 20.04 is deprecated.
2025-02-14 14:54:18 +01:00
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
dc33879dc2 Merge pull request #32442 from zeertzjq/vim-407319f
vim-patch: runtime file updates
2025-02-14 20:48:39 +08:00
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
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
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
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
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
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
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
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
e4c6e732fd feat(lsp): add select kind in showMessageRequest #32387 2025-02-13 05:48:56 -08:00
375847fb33 Merge #32426 fix(lsp): reset active request when reporting an error 2025-02-13 05:19:33 -08:00
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
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
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
2df68d3696 refactor(lsp): handling errors and nil responses together 2025-02-13 12:01:16 +08:00
d76f7fef13 fix(lsp): reset active request when reporting an error 2025-02-13 11:59:18 +08:00
4fd2694f20 fix(lsp): missing method parameter when canceling requests 2025-02-13 10:19:34 +08:00
66b60fe62b Merge pull request #32425 from zeertzjq/vim-4a530a6
vim-patch: update Vim syntax
2025-02-13 09:42:35 +08:00
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
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
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
8117db48ed ci(cirrus): update to freebsd-14-2
Previous `freebsd-14-0` image was dropped
2025-02-12 17:43:42 +01:00
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
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
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
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
6982106f8c refactor(insexpand.c): remove duplicate assignment (#32410) 2025-02-12 10:31:41 +08:00
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
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
891d2f4029 Merge #30860 LSP: symbols_to_items() 2025-02-11 03:38:07 -08:00
e8b5dd1e89 feat(lsp)!: symbol_to_item requires offset_encoding 2025-02-11 18:48:56 +08:00
3abfaafad2 fix(treesitter): detect trees with outdated regions in is_valid() 2025-02-11 09:17:08 +00:00
6722149776 feat(lsp): include end_col and end_lnum in vim.lsp.buf.symbols_to_items 2025-02-11 17:09:39 +08:00
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
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
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
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
c7d13f2895 Merge #32385 UI :detach command 2025-02-10 10:21:47 -08:00
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
69abeaad1d test: use --clean 2025-02-10 18:56:11 +01:00
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
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
524cdd35c2 test(fix): make testing of ext_cmdline optional #32375 2025-02-10 05:51:04 -08:00
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
e1dc824b7e build: set luals checklevel to Hint #32392 2025-02-10 03:04:01 -08:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
893fad2851 test(old): reorder test_functions.vim to match upstream 2025-02-07 06:30:10 +08:00
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
6db830e40e feat(defaults): enable diffopt "linematch" #32346 2025-02-06 04:17:36 -08:00
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
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
38a52caec0 feat(diagnostic): add current_line option for virtual_text handler 2025-02-05 15:27:09 +01:00
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
d769c340b9 build(deps): bump luv to v1.50.0-1 2025-02-05 09:29:14 +01:00
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
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
4317d36669 fix(event-loop): process input before events in getchar() (#32322)
Follow-up to #27358.
2025-02-05 06:48:56 +08:00
e4a58a7ca0 ci(vim-patches): fix failing workflow 2025-02-04 10:48:10 +01:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
eacd662ccb Merge #32082 refactor(treesitter): use coroutines for resuming _parse() 2025-02-03 09:11:04 -08:00
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
445ecca398 feat(diagnostic): format() can filter diagnostics by returning nil #32302 2025-02-03 00:54:31 -08:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
a22f2102ce build(deps): bump tree-sitter to v0.25.1 2025-02-02 10:55:12 +01:00
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
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
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
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
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
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
096ae3bfd7 fix(treesitter): nil access when running string parser async 2025-02-01 17:02:52 +01:00
f3381a8b64 build(deps): bump tree-sitter to v0.25.0 2025-02-01 10:15:32 +01:00
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
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
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
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
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
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
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
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
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
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
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
da0ae95349 feat(treesitter): support modelines in query.set() (#30257) 2025-01-29 08:59:28 +01:00
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
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
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
a119dab40f fix(treesitter): avoid computing foldlevels for reloaded buffer #32233 2025-01-28 08:34:07 -08:00
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
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
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
6aa42e8f92 fix: resolve all remaining LuaLS diagnostics 2025-01-27 16:37:50 +00:00
83479b95ab fix(mpack): remove invalid bool definition
This causes build failures with gcc 15.

Fixes #31723
2025-01-27 16:57:23 +01:00
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
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
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
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
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
c7d4a77ff9 refactor(api): add missing cast #31960 2025-01-26 16:02:33 -08:00
1759b7844a feat(diagnostic): virtual_lines #31959 2025-01-26 15:33:03 -08:00
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
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
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
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
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
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
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
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
851137f679 fix(log): log unset $TMPDIR at "debug" level #32137 2025-01-24 20:05:47 -08:00
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
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
d98827b634 fix(messages): avoid empty msg_showmode with 'noshowmode' 2025-01-24 11:39:39 +01:00
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
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
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
8bc28978b6 fix(column): apply custom highlight to last 'statuscolumn' segment (#32182) 2025-01-24 07:42:24 +08:00
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
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
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
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
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
4c9f3689a1 fix(checkhealth): failed if 'lua' in plugin name 2025-01-23 07:46:40 +00:00
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
fd55c7df6f test(lua/hl_spec): set timeout for transient state (#32169) 2025-01-23 08:11:53 +08:00
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
34344b939c fix(editor): avoid scrolling :substitute confirm message #32149
Regression from 48e2a73.
2025-01-22 07:36:57 -08:00
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
d46ebd2a74 fix(startup): avoid crash with completion from -l script (#32160)
Related #27764
2025-01-22 17:10:29 +08:00
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
a8b6fa07c4 fix(search): avoid quadratic time complexity when computing fuzzy score (#32153) 2025-01-22 09:28:27 +08:00
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
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
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
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
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
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
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
f50f86b9ff fix(treesitter): compute folds on_changedtree only if not nil 2025-01-20 22:32:45 +00:00
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
20e16c1c49 Merge pull request #32099 from bfredl/no_bufhl
feat(api): deprecate nvim_buf_add_highlight()
2025-01-20 15:42:56 +01:00
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
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
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
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
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
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
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
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
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
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
de83cc5842 fix(netrw): re-add missing comment marker in syntax file 2025-01-20 08:20:11 +01:00
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
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
a6f219b06b fix(log): unintuitive message for undefined $TMPDIR 2025-01-19 11:37:04 -08:00
6696ea7f10 fix(treesitter): clean up parsing queue 2025-01-19 15:53:17 +01:00
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
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
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
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
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
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
27da6f7757 refactor: simplify bump_deps.lua
Simplify usage and remove redundant flags and code.
2025-01-18 10:52:51 +01:00
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
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
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
c6cc937512 docs: change augroup names to new convention #32061
Ref: 09e01437c9
2025-01-17 14:56:30 -08:00
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
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
97d5855351 docs(gh): use new issue types 2025-01-17 16:41:39 +01:00
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
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
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
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
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
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
819337a13f test: use esc sequences in vterm unit tests 2025-01-16 16:41:37 -06:00
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
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
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
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
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
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
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
f0fdc1de6c build(deps): bump libuv to v1.50.0 2025-01-15 19:54:54 +01:00
7c65224257 build: fix lint error on macos 2025-01-15 18:54:08 +01:00
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
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
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
9552fe7ef9 Merge #32013 from luukvbaal/shellkind 2025-01-15 02:23:44 -08:00
3ee63edc1b Merge #32001 from MariaSolOs/consistent-namespaces 2025-01-15 02:01:44 -08:00
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
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
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
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
575f4bc7d5 docs: document namespace/augroup convention 2025-01-14 21:25:25 -08:00
09e01437c9 refactor: use nvim.foo.bar format for autocommand groups 2025-01-14 21:25:25 -08:00
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
850084b519 refactor: use nvim.foo.bar format for namespaces 2025-01-14 19:55:29 -08:00
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
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
f1c45fc7a4 feat(terminal): support theme update notifications (DEC mode 2031) (#31999) 2025-01-14 08:18:59 -06:00
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
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
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
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
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
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
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
5a54681025 fix(treesitter): uv_dlclose after uv_dlerror 2025-01-14 09:15:35 +00:00
0dfa4de993 build(deps): bump luajit to HEAD - a4f56a459 2025-01-14 09:00:50 +01:00
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
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
cb7b4e2962 feat(messages): "verbose" message kind #31991 2025-01-13 04:59:34 -08:00
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
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
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
a3ef29d570 test: use temp file #31907 2025-01-13 01:41:49 -08:00
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
99c4bd2f69 Merge pull request #31631 from ribru17/async_parse_attempt_2
feat(treesitter): async parsing
2025-01-13 06:58:33 +00:00
f4cff3077b build(deps): bump tree-sitter to v0.24.7 2025-01-12 19:52:39 +01:00
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
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
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
40bf23adaf build(deps): bump wasmtime to v25.0.3 2025-01-12 12:57:07 +01:00
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
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
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
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
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
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
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
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
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
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
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
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
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
cb02c20569 refactor(treesitter.foldexpr): remove unused parse_injections parameter 2025-01-10 22:06:35 +00:00
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
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
87610d82db fix(decor): set invalid flag for end of invalidated paired marks 2025-01-10 08:14:38 +01:00
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
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
7c00e0efbb docs: misc #31867 2025-01-09 09:26:45 -08:00
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
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
5135a23219 Merge #31900 from luukvbaal/nvim_echo 2025-01-09 06:36:29 -08:00
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
5c92b40b4b feat(api): deprecate nvim_out/err_write(ln) 2025-01-09 13:35:42 +01:00
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
6dd7fcaafd Merge pull request #31898 from bfredl/termbomb
fix(terminal): don't crash on unprintable chars
2025-01-09 13:35:25 +01:00
f8c8a245aa fix(terminal): don't crash on unprintable chars
fixes #31897
2025-01-09 11:22:00 +01:00
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
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
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
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
19c9572d36 Revert "refactor(options): set option value for non-current context directly" (#31924)
Reverts #31112
2025-01-09 12:32:25 +08:00
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
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
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
17b46d01e2 test(treesitter): inspect_tree #31182
To prevent #30986 and #31198 regression update inspect_tree tests
2025-01-08 05:06:09 -08:00
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
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
141114c170 fix(api): crash on invalid buffer to nvim_buf_del_user_command (#31908) 2025-01-08 05:16:41 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
30de00687b refactor(treesitter): simplify condition #31889 2025-01-06 16:56:53 -08:00
b6ab294838 fix: fix incorrect search code 2025-01-06 20:03:17 +00:00
3d9fb975b9 Merge #31625 perf(decor): improve iter_captures() cache 2025-01-06 07:09:34 -08:00
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
dd234135ad refactor: split predicates and directives 2025-01-06 00:35:19 -06:00
8d2ee542a8 perf(decor): join predicates and matches cache 2025-01-06 00:34:48 -06:00
ef77845b97 test: benchmark treesitter highlighing 2025-01-06 00:34:19 -06:00
9b7905df16 Merge pull request #31882 from zeertzjq/vim-0c3e57b
vim-patch: doc updates
2025-01-06 10:17:19 +08:00
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
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
abb19e873b Merge pull request #31881 from zeertzjq/vim-21c37d7
vim-patch: update Vim syntax
2025-01-06 09:43:47 +08:00
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
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
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
570a8da01b fix(health): "q" should not close last window #31876 2025-01-05 11:31:39 -08:00
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
548f19ccc3 feat(health): close checkhealth buffers with q #31870 2025-01-05 09:51:51 -08:00
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
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
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
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
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
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
5e90406487 fix(health): set nomodifiable in checkhealth buffers 2025-01-05 09:43:59 +01:00
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
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
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
4eaf9371ca docs: cleanup news.txt (#31854)
Move non-breaking changes out of the breaking changes section
2025-01-04 12:39:57 -06:00
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
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
a09c7a5d57 Merge #30384 test: spawn_wait() 2025-01-03 10:46:20 -08:00
700a25e621 test: include stderr in EOF failure message 2025-01-03 19:24:04 +01:00
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
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
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
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
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
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
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
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
6aceab7c20 Merge pull request #31635 from bfredl/vtermpirates
feat(terminal): support grapheme clusters, including emoji
2025-01-03 10:43:22 +01:00
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
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
e3bfcf2fd4 feat(terminal): support grapheme clusters, including emoji 2025-01-02 12:55:11 +01:00
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
efe1732c6f fix(jobs): do not block UI when jobwait() doesn't block (#31803) 2025-01-01 18:43:16 -06:00
6dc0eb9f41 fix(vim.fs.abspath): correctly handle UNC paths 2025-01-01 23:42:42 +01:00
dc692f553a docs: misc #31479 2025-01-01 12:29:51 -08:00
9d114b7205 refactor(options): use const in more places (#31791) 2025-01-01 07:45:14 -06:00
59cbe64023 build(deps): bump utf8proc to v2.10.0 2025-01-01 00:04:27 +01:00
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
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
0bef3b911c fix(vim.fs): joinpath() does not normalize slashes on Windows #31782 2024-12-31 07:40:05 -08:00
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
1925000245 test: skip flaky watchdirs() test on macos 2024-12-31 15:54:06 +01:00
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
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
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
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
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
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
e9c077d197 fix(termkey): fix null pointer dereference (#31792) 2024-12-30 16:36:47 -06:00
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
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
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
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
02097e43c8 fix(lsp): check if sig_help window is focusable when configuring cycle keymap 2024-12-29 16:23:23 +00:00
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
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
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
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
48acbc4d64 fix(treesitter.foldexpr): refresh in the buffers affected by OptionSet 2024-12-29 07:35:39 +00:00
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
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
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
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
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
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
6d2c67350a build(deps): bump tree-sitter to v0.24.6 2024-12-27 12:23:22 +01:00
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
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
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
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
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
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
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
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
b51110f4a1 docs(api): return type of nvim_get_keymap() #31708 2024-12-24 09:56:10 -08:00
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
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
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
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
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
c51bf5a6b2 fix(terminal): set cursor cell percentage (#31703)
Fixes: https://github.com/neovim/neovim/issues/31685
2024-12-23 15:39:36 -06:00
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
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
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
a1fa2b3a4e refactor(eval): move funcs to deprecated.c #31650 2024-12-23 07:39:25 -08:00
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
2a7d0ed614 refactor: iwyu #31637
Result of `make iwyu` (after some "fixups").
2024-12-23 05:43:52 -08:00
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
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
7e1c1ff7fc Merge #31661 cmdline_show/hide events 2024-12-22 16:06:46 -08:00
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
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
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
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
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
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
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
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
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
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
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
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
909b18d05a fix(messages): no message kind for completion menu messages #31646 2024-12-20 04:41:57 -08:00
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
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
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
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
a5a4149e97 docs(api): specify when decor provider on_buf is called #31634 2024-12-19 07:04:33 -08:00
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
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
160cbd0ef4 test(cursor_spec): global highlight definitions (#31613) 2024-12-18 19:06:16 +00:00
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
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
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
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
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
738320188f test(old): fix incorrect comment in test_preview.vim (#31619) 2024-12-18 10:21:52 +08:00
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
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
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
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
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
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
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
df367cf91c test: unreliable test "messages &messagesopt wait" #31548 2024-12-17 04:19:55 -08:00
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
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
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
137308a3c9 Merge pull request #31602 from zeertzjq/vim-0a4e57f
vim-patch: doc updates
2024-12-17 09:01:59 +08:00
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
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
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
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
fb8372adb3 build(deps): bump luajit to HEAD - f73e649a9 2024-12-16 17:08:52 +01:00
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
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
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
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
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
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
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
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
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
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
820984daea build(deps): bump tree-sitter to v0.24.5 2024-12-15 12:35:11 +01:00
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
805b84c619 Merge pull request #31580 from zeertzjq/vim-ed89206
vim-patch: doc updates
2024-12-15 08:16:03 +08:00
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
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
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
f9dd682621 docs(annotations): added ---@generic support 2024-12-13 17:05:38 +00:00
65b1733405 Revert "fix(Man.lua): trigger completion even without arguments" #31572
This reverts commit 7940ec6913.
2024-12-13 06:46:40 -08:00
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
7940ec6913 fix(man.lua): :Man <tab> does not complete #31569
closes: #31512
2024-12-13 06:26:20 -08:00
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
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
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
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
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
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
de794f2d24 fix(diagnostic): broken variable reference #31557 2024-12-12 02:41:57 -08:00
130f4344cf refactor(lsp/rpc): move transport logic to separate module 2024-12-12 09:52:08 +00:00
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
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
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
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
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
492ae57aa6 docs(annotation): return types for Vimscript functions #31546 2024-12-11 03:27:08 -08:00
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
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
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
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
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
d1fd674df3 fix(ui): update title in more cases (#31508) 2024-12-10 14:53:02 +08:00
98694c3675 Merge pull request #31534 from zeertzjq/vim-9.0.2112
vim-patch: line shifting fixes
2024-12-10 14:50:27 +08:00
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
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
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
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
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
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
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
3bb2d02759 docs: fix type of vim.validate value 2024-12-09 07:59:51 +00:00
30726c778c Merge pull request #31523 from zeertzjq/vim-eda923e
vim-patch: netrw fixes
2024-12-09 09:35:11 +08:00
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
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
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
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
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
fe1e2eff06 fix(lua): avoid vim._with() double-free with cmdmod (#31505) 2024-12-08 09:25:43 +08:00
7008487b83 vim-patch:336fb22: translation(vi): Update Vietnamese translation
closes: vim/vim#16144

336fb22eae
2024-12-08 08:46:33 +08:00
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
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
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
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
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
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
668d2569b4 refactor: add vim._resolve_bufnr 2024-12-07 16:58:40 +00:00
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
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
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
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
5c245ec3e9 fix: remove vim.lsp._with_extend
Not used anywhere.
2024-12-07 10:08:58 +00:00
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
c2bf09ddff fix(lsp): check for configuration workspace folders when reusing clients 2024-12-07 09:43:45 +00:00
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
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
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
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
2550b5e9bd docs: do not escape Lua keywords #31467 2024-12-06 10:08:46 -08:00
ba7370a902 Merge #30085 #trim! all whitespace 2024-12-06 10:08:20 -08:00
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
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
e8e3b443f8 feat(defaults): disable 'foldcolumn' in terminal buffers (#31480) 2024-12-06 10:19:24 -06:00
1077843b9b fix(filetype): make filetype detection work with :doautocmd (#31470) 2024-12-06 20:57:21 +08:00
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
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
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
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
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
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
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
12901447cb docs: graduate intro.txt to "flow layout" #31462
- move credits and backers to credits.txt
2024-12-05 07:18:27 -08:00
fccef5ec35 refactor: comments, variable names 2024-12-05 08:45:22 -06:00
c57397f981 docs: add comments for DecorRangeSlot struct 2024-12-05 08:45:22 -06:00
3abd7ed4a4 perf: consider only active decorations when drawing lines 2024-12-05 08:45:22 -06:00
845e563421 Merge #31451 docs 2024-12-05 04:02:34 -08:00
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
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
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
540def7d2c test(system_spec): check for .git dir before using git (#31458) 2024-12-05 09:13:22 +00:00
5413c6475e docs: graduate gui.txt to "flow layout" 2024-12-05 01:38:44 +01:00
8f84167c30 refactor(runtime.c): misc 2024-12-04 16:26:04 +00:00
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
52481eecf0 docs: mention new terminal defaults (#31449) 2024-12-04 10:17:19 -06:00
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
6586645d78 docs: help tags for neovim.io searches 2024-12-04 16:34:44 +01:00
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
6551e30630 Merge #31358 fix test failures for release / tarball builds 2024-12-04 07:20:04 -08:00
734dba04d1 fix(vim.system): close pipe handles after process handle
Fixes #30846
2024-12-04 14:44:40 +00:00
56d11b494b defaults: disable 'number', 'relativenumber', and 'signcolumn' in terminal buffers (#31443) 2024-12-04 08:40:01 -06:00
3cb1e825e6 fix(column): check if signcolumn changed in all windows #31439 2024-12-04 05:20:24 -08:00
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
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
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
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
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
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
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
e5d96a69fd test(main_spec): use CMakePresets.json instead of .git for root marker 2024-12-03 06:31:09 -05:00
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
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
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
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
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
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
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
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
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
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
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
6cdcac4492 fix(ui): clamp 'cmdheight' for other tabpages on screen resize (#31419) 2024-12-02 10:05:49 +08:00
8de1dc6923 fix(api): make nvim_set_hl() respect all cterm attributes (#31390) 2024-12-02 08:24:58 +08:00
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
feb62d5429 docs: example keybind for :Inspect #31391 2024-12-01 13:58:28 -08:00
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
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
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
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
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
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
2833925cfc docs(diagnostics): location list / quickfix example #31371 2024-11-29 10:07:08 -08:00
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
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
c867a4f5e3 build(deps): bump luajit to HEAD - 19878ec05 2024-11-29 09:08:52 +01:00
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
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
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
27965627a4 Merge pull request #31377 from zeertzjq/vim-65311c6
vim-patch: :compiler spotbugs
2024-11-29 09:19:51 +08:00
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
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
731f83ea4a test: add decor benchmarks 2024-11-28 14:11:52 -06:00
146b8300a1 docs(lsp): update example, optional parameters #31299 2024-11-28 08:08:27 -08:00
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
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
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
76dcc7029b docs: add tag vim.fs.exists() and document suggested replacement 2024-11-27 19:56:08 +01:00
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
c24e6e66dd ci: remove myself from lsp reviewers 2024-11-27 13:16:06 +01:00
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
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
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
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
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
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
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
f81131cca2 fix(tui): also reset cursor color if it was invisible (#31348) 2024-11-25 16:32:03 -06:00
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
8d55cc218c feat(keysets): teach Union and LuaRefOf 2024-11-25 17:34:02 +00:00
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
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
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
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
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
9e7b0bcf51 fix(editorconfig): fix indent style for local.mk (#31342) 2024-11-24 22:04:27 -06:00
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
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
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
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
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
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
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
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
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
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
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
9a681ad09e fix(lsp): hover keymap (#31208)
* fix: use function call in keymap

* fix: test
2024-11-22 12:51:30 +00:00
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
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
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
6e44a6a289 fix(treesitter): update queries 2024-11-22 09:39:45 +01:00
c2f08d294a build(deps): bump tree-sitter-c to v0.23.2 2024-11-22 09:39:45 +01:00
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
ff75f345ab fix(highlight): 'winhl' shouldn't take priority over API (#31288) 2024-11-22 06:52:32 +08:00
92a83f671b Merge pull request #31193 from bfredl/winrt
refactor(windows)!: only support UCRT, even for mingw
2024-11-21 18:58:51 +01:00
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
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
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
07db909eb5 docs: misc (#31138)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-11-21 06:50:30 +08:00
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
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
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
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
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
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
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
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
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
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
ac7e0ff32f fix(move): redraw for 'concealcursor' after changing w_wcol (#31276) 2024-11-20 08:24:58 +08:00
f111c32ff9 fix(messages): no message kind for search pattern #31272 2024-11-19 16:06:36 -08:00
081beb3659 fix(lsp): restore get_language_id behaviour
Ensure filetype is always passed.

Fixes #31262
2024-11-19 12:19:05 +00:00
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
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
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
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
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
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
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
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
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
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
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
6ea45031d5 fix(api): nvim_echo free text memory with invalid highlight (#31243)
Fix regression from #31195
2024-11-17 22:06:44 +08:00
10beeee06f build(deps): bump uncrustify to uncrustify-0.80.1 2024-11-17 14:09:26 +01:00
38838fb00a fix(lsp): type-errors, other nits in vim.lsp.log #31235 2024-11-16 18:32:09 -08:00
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
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
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
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
be8648f345 build(deps): bump uncrustify to uncrustify-0.80.0 2024-11-16 15:42:55 +01:00
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
2f7b0018b0 docs: standardize doc for ChanInfo/ChanOpen autocmds/v:event (#31099) 2024-11-16 09:37:36 +08:00
2eb227f5b6 test(lua/ui_event_spec): avoid polluting log file (#31229) 2024-11-16 08:56:42 +08:00
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
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
f1748b78e3 feat(default): bind vim.lsp.buf.signature_help in select mode (#31223) 2024-11-15 10:13:41 -06:00
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
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
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
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
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
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
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
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
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
434d5936b6 build(deps): bump luajit to HEAD - fe71d0fb5 2024-11-14 18:00:30 +01:00
d3e4ffafff feat(lsp): support utf-8 and utf-32 position encodings
Resolves #30034
2024-11-14 15:32:49 +00:00
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
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
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
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
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
b820b0e47e Merge pull request #31204 from zeertzjq/vim-8b96858
vim-patch: doc updates
2024-11-14 08:08:35 +08:00
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
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
e5cd5098f8 build(deps): bump luajit to HEAD - 69bbf3c1b 2024-11-13 16:57:25 +01:00
33d10db5b7 fix(lsp): filter completion candidates based on completeopt (#30945) 2024-11-13 15:18:29 +00:00
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
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
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
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
28bf25d012 build(deps): bump tree-sitter to e3c826333 2024-11-13 08:52:14 +01:00
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
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
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
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
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
9aab98a275 refactor(lsp): avoid redundant function wrapping
Leftover from #21026.
2024-11-12 16:10:16 +00:00
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
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
72a1df6065 Merge pull request #31137 from bfredl/hlagain
refactor(tests): use more global highlight definitions
2024-11-11 20:08:26 +01:00
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
3e855d533f perf(lsp): use faster version of str_byteindex 2024-11-11 14:23:38 +00:00
9fa3a0964e fix(messages): pass previous highlight id to ext chunks 2024-11-11 15:15:33 +01:00
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
29fd5ed606 refactor(tests): use more global highlight definitions 2024-11-11 14:27:25 +01:00
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
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
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
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
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
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
f59aeb5a9a build(deps): bump tree-sitter to v0.24.4 2024-11-10 11:34:23 +01:00
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
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
c5f217db01 refactor(lsp): simplify reference range logic 2024-11-10 09:40:37 +00:00
0eae0bc804 Merge pull request #31150 from zeertzjq/vim-bbe5252
vim-patch: Vim syntax updates
2024-11-10 10:35:57 +08:00
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
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
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
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
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
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
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
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
dd4c828c86 Merge pull request #31118 from bfredl/merehl
refactor(tests): continue the global highlight definition work
2024-11-09 13:48:45 +01:00
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
4b001f297a fix(lsp): fix infinite loop
Fixes #31129
2024-11-09 09:41:12 +00:00
b7e1bbfb50 Merge pull request #31130 from zeertzjq/vim-3780c11
vim-patch: runtime file updates
2024-11-09 09:31:52 +08:00
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
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
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
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
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
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
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
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
ad3472e291 fix(vim.system): resolve executable paths on windows
Fixes #31107
2024-11-08 16:29:44 +00:00
7342e6b00d perf(lsp): do not apply semantic tokens to folded lines
Fixes #31106
2024-11-08 14:01:35 +00:00
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
abe6a07c54 refactor(tests): continue the global highlight definition work 2024-11-08 13:19:15 +01:00
475f9f64ef Merge pull request #31073 from bfredl/cmdchar
fix(cmdline): simplify and correct grapheme cluster adjustment
2024-11-08 13:08:14 +01:00
092042b43d fix(cmdline): simplify and correct grapheme cluster adjustment 2024-11-08 11:25:34 +01:00
8ab1903092 Merge pull request #31040 from luukvbaal/cmdpreviewcurs
fix(inccommand): ensure cursor is where it belongs
2024-11-08 11:22:14 +01:00
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
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
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
5a86360400 test: add test for key following ignored mouse move (#31104) 2024-11-07 17:53:30 +08:00
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
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
f8b193a01e ci: adjust reviewers 2024-11-06 11:22:09 +01:00
c0f222d55b Merge pull request #31062 from famiu/refactor/options/ff_macro
refactor(options): remove fileformat macros
2024-11-06 10:19:28 +01:00
04274a4173 refactor(options): remove unnecessary call to find_option() (#31088) 2024-11-06 06:07:29 +08:00
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
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
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
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
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
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
cbc9a03f58 refactor(options): remove fileformat macros 2024-11-05 02:36:51 +06:00
079e5f4f9b feat(defaults): unimpaired empty line below/above cursor #30984 2024-11-04 06:06:18 -08:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
3688a33354 fix(lua): show stacktrace for error in vim.on_key() callback (#31021) 2024-11-02 10:11:06 +08:00
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
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
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
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
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
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
b34e137e43 feat(lua): allow vim.on_key() callback to consume the key (#30939) 2024-11-01 09:11:15 +08:00
8585183ba2 Merge pull request #31011 from lewis6991/refactor/loader 2024-10-31 16:06:18 +00:00
be04bbf781 refactor(loader): format annotations 2024-10-31 15:20:29 +00:00
086e598a6e refactor(loader): use the term stat instead of hash 2024-10-31 15:20:29 +00:00
8d68d883a9 refactor(loader): remove Loader table and use locals 2024-10-31 15:20:29 +00:00
4a0010e267 refactor(loader): rename types 2024-10-31 15:20:29 +00:00
7ccdd9235a refactor(loader): inline Loader.load into Loader.loadfile 2024-10-31 15:20:29 +00:00
ab2f2461b5 refactor(loader): simplify Loader.loader_lib 2024-10-31 15:20:27 +00:00
53536be62a refactor(loader): simplify Loader.write/read 2024-10-31 15:02:12 +00:00
f8fc6cb157 perf(loader): reduce calls to Loader.cache_file 2024-10-31 15:02:08 +00:00
03118c46ab refactor(loader): remove unused _topmods 2024-10-31 14:15:09 +00:00
1d4ba8c1ed fix: another round of type annotation fixes 2024-10-31 11:55:23 +00:00
0ab4d36254 Merge pull request #31008 from zeertzjq/vim-3d7e567
vim-patch: netrw fixes
2024-10-31 19:28:24 +08:00
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
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
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
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
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
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
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
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
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
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
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
8df6822507 test: fix files being left behind (#31004) 2024-10-31 00:04:51 +00:00
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
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
ff93cccbc1 fix(defaults): omit extraneous info from unimpaired mapping errors (#30983) 2024-10-29 10:06:14 -05:00
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
2cd6abf0d7 Merge pull request #30935 from lewis6991/feat/lsp_multi_hover 2024-10-29 09:51:14 +00:00
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
1471dfc859 refactor(lsp): buf_request_all 2024-10-29 09:06:05 +00:00
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
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
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
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
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
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
42fa3d080e refactor: sort various Lua tables in src/ alphabetically (#30977) 2024-10-29 07:57:25 +08:00
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
0b7cc014fc feat(defaults): map gO to LSP document_symbol #30781 2024-10-28 06:29:29 -07:00
0086ee90dd fix(lsp): list all workspace folders in healthcheck #30966 2024-10-28 06:14:56 -07:00
ff29fd8c6e test(pum): add test for item selection with 'rightleft' (#30968) 2024-10-28 17:20:00 +08:00
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
7a20f93a92 fix(treesitter): correct condition in __has_ancestor 2024-10-27 17:56:06 +00:00
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
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
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
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
123c0b6b4e docs(lsp): document alternative for vim.lsp.util.jump_to_location 2024-10-27 09:26:52 +00:00
f60a1f9059 docs(treesitter): specify predicate boolean return value 2024-10-27 09:25:07 +00:00
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
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
01739d4673 fix(defaults): missing ]Q/[Q unimpaired mappings #30943 2024-10-25 06:45:27 -07:00
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
54249d051c feat(lsp): deprecate vim.lsp.buf.completion
Use `vim.lsp.completion.trigger()` instead'
2024-10-24 16:36:14 +01:00
7a7747f1e4 feat(lsp): deprecate execute_command with client:exec_cmd 2024-10-24 15:37:34 +01:00
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
c8d7d65679 fix(lsp): use correct method for prepareTypehierarchy
Regression from #30902
2024-10-24 13:15:25 +01:00
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
5c44c02405 Merge pull request #30929 from lewis6991/fix/lsp_param_encodings 2024-10-24 11:19:38 +01:00
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
3275ae830d fix(lsp.protocal): improve typing of constants 2024-10-24 10:53:03 +01:00
2ee39b7eb4 refactor(lsp.buf): remove buf_request wrapper 2024-10-24 09:58:22 +01:00
ad4e14c201 refactor(lsp.buf): use alias for vim.lsp 2024-10-24 09:55:23 +01:00
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
50e63c8171 fix(options): missing error check for global 'scl' and 'winhl' (#30919) 2024-10-24 10:03:38 +08:00
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
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
19204ebde9 test(old): remove unnecessary :setglobal skips 2024-10-24 06:56:12 +08:00
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
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
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
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
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
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
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
f6f2334ac2 fix(defaults): error messages UX for unimpaired mappings #30884 2024-10-23 04:40:12 -07:00
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
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
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
4ad4225bdb vim-patch:19be0eb: runtime(doc): :ownsyntax also resets 'spelloptions'
closes: vim/vim#15919

19be0eb7f0
2024-10-23 07:38:11 +08:00
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
629a5b71b5 fix(lsp): support multiple clients in typehierarchy 2024-10-22 21:59:48 +01:00
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
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
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
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
8c532a9ea8 fix(options): fix 'winhl' still accepting invalid value (#30896) 2024-10-22 08:10:15 +00:00
772614f9cc refactor(eval): fix clear_evalarg() called with wrong argument (#30899) 2024-10-22 07:23:34 +00:00
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
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
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
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
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
1b9dafa67b fix(options): fix :setglobal not working for 'spelloptions' (#30894) 2024-10-22 11:34:09 +08:00
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
c8e47f6480 fix(meta): do not use hyphens in param names
Fixes #30882
2024-10-21 12:09:33 +01:00
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
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
86832dcd19 Merge #30840 from justinmk/renamehl 2024-10-20 16:44:39 -07:00
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
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
960fdc775a fix(lua): vim.deprecate does not support major>0 2024-10-21 00:54:42 +02:00
c9c17fda80 feat(deprecations): vim._defer_deprecated_module() 2024-10-21 00:54:42 +02:00
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
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
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
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
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
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
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
4833a63929 Merge pull request #30863 from neovim/ci-macos
ci: bump Intel macOS runners to 13
2024-10-19 14:51:59 +02:00
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
54137a798f build(deps): bump libuv to 52a924331 2024-10-19 12:54:15 +02:00
66753a2f0c build(deps): bump libuv to 18d48bc13 2024-10-19 12:54:15 +02:00
4c617f4a47 build(deps): bump libuv to 9cf0710d7 2024-10-19 12:54:15 +02:00
f3241e19e0 build(deps): bump libuv to v1.49.2 2024-10-19 12:54:15 +02:00
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
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
f4b620c4e6 feat(vim.ui.open): support lemonade #30845 2024-10-18 02:22:15 -07:00
564173e556 fix(lsp.util): wrong arguments to 'validate' function 2024-10-18 07:37:36 +01:00
31745b17e6 fix(types): add narrower vim.validate types 2024-10-18 07:36:54 +01:00
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
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
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
fa6ab0d909 Merge pull request #30825 from lewis6991/refactor/lsputil 2024-10-17 13:35:02 +01:00
a18fa2f11c feat(lsp.util): minor codestyle 2024-10-17 12:52:46 +01:00
cbc82011ce feat(lsp.util): improve offset_encoding type annotations 2024-10-17 12:52:45 +01:00
e954a16063 feat(lsp.util): remove some variables 2024-10-17 12:52:45 +01:00
97119a2369 feat(lsp.util): use vim.w/b 2024-10-17 12:52:45 +01:00
3f87e222f7 feat(lsp.util): remove some aliases 2024-10-17 12:52:45 +01:00
8ad000ef7c feat(lsp.util): remove unneeded table 2024-10-17 12:52:45 +01:00
acbc6a7f91 fix(lsp.util): inconsistent handling of offset_encoding 2024-10-17 12:52:45 +01:00
ff1d7d4299 feat(lsp.util): get_bufs_with_prefix -> get_writeable_bufs 2024-10-17 12:52:45 +01:00
1944c0d610 feat(lsp.util): refactor get_border_size() 2024-10-17 12:52:45 +01:00
d44d36b8ff feat(lsp.util): simplify some bounds checking 2024-10-17 12:52:45 +01:00
0621718e3b feat(lsp.util): remove metatable in locations_to_items 2024-10-17 12:52:45 +01:00
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
5bec7288a5 feat(lsp.util): remove uneeded do-end 2024-10-17 12:52:45 +01:00
1edfe5c09e feat(lsp.util): use vim.api alias 2024-10-17 12:52:45 +01:00
92e4e3fb76 feat(lsp.util): fix type errors 2024-10-17 12:52:44 +01:00
21151144c6 feat(meta): add type for quickfix entries 2024-10-17 10:54:19 +01:00
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
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
fae4d3fa1b Merge pull request #30836 from zeertzjq/vim-4bfb899
vim-patch: doc updates
2024-10-17 08:14:58 +08:00
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
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
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
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
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
0e8568d72c feat(lsp.util): remove lsp spec extract 2024-10-16 12:39:28 +01:00
0066dd0f65 feat(lsp.util): use faster version of vim.validate 2024-10-16 12:39:27 +01:00
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
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
ea5b748f24 feat(man.vim): "q" always closes window #30819 2024-10-15 08:34:50 -07:00
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
e0a5c3bb58 fix(lsp): handle multiline signature help labels #30460 2024-10-15 02:36:04 -07:00
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
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
09e7f19511 Merge pull request #30817 from zeertzjq/vim-7b5e52d
vim-patch: doc updates
2024-10-15 08:39:08 +08:00
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
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
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
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
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
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
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
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
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
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
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
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
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
fb74fd2954 test(autocmd/termxx_spec): properly setup TextChangedT tests (#30787) 2024-10-13 11:02:28 +08:00
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
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
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
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
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
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
45f8f957c0 docs(lua): clarify when on_key "typed" will be empty (#30774) 2024-10-12 12:20:06 +08:00
0e42c81c7f fix(lua): avoid recursive vim.on_key() callback (#30753) 2024-10-12 08:07:05 +08:00
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
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
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
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
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
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
c4762b3097 test(tui_spec): use child_exec_lua() more (#30757)
It is more readable.
2024-10-11 08:23:14 +00:00
c3cb702ac7 fix(lsp): set 'smoothscroll' in docs hover #30748 2024-10-11 00:50:09 -07:00
165613ee72 build(deps): bump libuv to v1.49.1 2024-10-11 09:48:32 +02:00
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
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
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
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
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
641c4b1a2a build(deps): bump tree-sitter to v0.24.3 2024-10-10 08:31:23 +02:00
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
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
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
cd8e15e337 build(deps): bump wasmtime to v25.0.2 2024-10-09 20:02:30 +02:00
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
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
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
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
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
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
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
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
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
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
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
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
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
376de1483e fix(drawline): correct highlight priority with Visual selection (#30706) 2024-10-08 06:24:36 +08:00
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
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
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
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
7335988ce6 docs: generate params/returns in builtin.txt #30654 2024-10-07 05:32:49 -07:00
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
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
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
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
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
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
6628741ada feat(docs): improve @see meta docstrings #30693 2024-10-06 09:12:35 -07:00
00d1078ede ci: bump macos runner version to macos-15 2024-10-06 16:06:28 +02:00
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
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
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
dabd7ef906 Merge pull request #30684 from zeertzjq/vim-738ebfe
vim-patch: doc updates
2024-10-06 08:02:30 +08:00
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
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
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
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
8801b77ed0 fix(docs): missing @returns desc in _meta/api.lua #30673 2024-10-05 08:52:57 -07:00
0c9b3ef34d ci: bump ubuntu runner version to ubuntu-24.04
Also bump clang to version 20.
2024-10-05 17:35:41 +02:00
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
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
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
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
9a5bbaf813 docs: more @since annotations #30660 2024-10-04 08:12:17 -07:00
49b1af4e24 build(deps): bump tree-sitter to v0.24.1 2024-10-04 16:47:09 +02:00
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
86c5c8724b fix(mouse): indicate X1 and X2 button clicks on statusline (#30655) 2024-10-04 21:31:28 +08:00
305012ea07 fix(lsp): enable additionalPropertiesSupport 2024-10-04 12:22:46 +02:00
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
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
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
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
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
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
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
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
4075e613b2 fix(defaults): properly pass count to quickfix commands (#30632) 2024-10-03 10:57:54 +08:00
184d5e7543 refactor: fix incorrect use of enum (#30631) 2024-10-03 10:34:55 +08:00
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
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
d3b4772ddc Merge #30595 from justinmk/fixwatch 2024-10-02 08:05:03 -07:00
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
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
391c5084d1 build(deps): bump luajit to HEAD - 97813fb92 2024-10-02 14:41:51 +02:00
9b15f2a0ce build(deps): bump luajit to HEAD - b2915e9ab 2024-10-02 13:02:46 +02:00
865ba42e04 build(deps): bump tree-sitter to HEAD - c3d45a015 (#30589) 2024-10-02 06:59:23 +02:00
3d1e6c56f0 build(deps): bump luajit to HEAD - 2240d8446 2024-10-02 06:27:32 +02:00
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
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
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
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
bb7604edda feat(defaults): add default unimpaired style mappings (#28525) 2024-10-01 07:24:43 -05:00
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
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
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
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
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
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
888966652d build(deps): bump luajit to HEAD - f5fd22203 2024-09-30 22:47:09 +02:00
2c88cfcac4 Merge pull request #30526 from lewis6991/fix/linematchnul 2024-09-30 12:09:36 +01:00
0fb5299e53 test: refactor exec_lua in xdiff_spec 2024-09-30 11:51:33 +01:00
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
20251be15a docs: graduate editorconfig.txt to "flow layout"
fix #25401
2024-09-30 00:43:44 +02:00
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
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
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
df915f3afc fix(float): properly find last window of tabpage (#30571) 2024-09-29 10:38:17 +00:00
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
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
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
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
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
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
610e9666af Merge pull request #30401 from bfredl/casefold2
refactor(multibyte): neo-casefolding without allocation
2024-09-29 11:03:36 +02:00
2dfa6f6033 refactor(multibyte): neo-casefolding without allocation
fixes #30400
2024-09-29 10:14:16 +02:00
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
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
d5f6f61879 fix(column): set signcolumn width after splitting window (#30556) 2024-09-28 17:16:22 +08:00
4349bdbd0b fix(treesitter): specify success status in edit_query return value 2024-09-28 10:54:45 +02:00
4f9311b759 fix(window): making float with title/footer non-float leaks memory (#30551) 2024-09-28 10:21:06 +08:00
0f067cd34d fix(treesitter): suppress get_parser warnings via opts.error 2024-09-28 00:31:45 +02:00
7b71fdbc1e fix(window): respect hide flag of float windows when switching (#30507) 2024-09-28 06:02:14 +08:00
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
f55213ce0e fix(api): fix crash/leak with float title/footer on error (#30543) 2024-09-27 14:33:24 +00:00
eea6b84a87 test(api/window_spec): remove duplicate test (#30538) 2024-09-27 19:10:55 +08:00
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
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
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
a9287dd882 fix(mbyte): check for utf8proc_map() failure (#30531) 2024-09-26 23:40:46 +00:00
98d1c0ebef Merge pull request #30530 from zeertzjq/vim-d9af78b
vim-patch: doc updates
2024-09-27 07:22:54 +08:00
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
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
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
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
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
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
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
8070988247 fix(channel): handle writing to file instead of pipe (#30519) 2024-09-26 08:36:50 +00:00
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
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
046e0956ee build: fix or silence new clang-tidy warnings 2024-09-25 16:09:08 +02:00
f3b7444e66 refactor(lua): vim.keymap.set tests, docs #30511 2024-09-25 07:01:27 -07:00
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
8ba9f0468d build(deps): bump wasmtime to v25.0.1 2024-09-25 11:39:11 +02:00
ce7017b850 docs: render @see, @note items in _meta/api.lua #30494 2024-09-25 02:34:13 -07:00
6c77e840ae build(deps): bump libuv to v1.49.0 2024-09-25 11:24:03 +02:00
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
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
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
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
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
34a40d3a50 Merge #30435 refactor: rename "Dictionary" => "Dict" 2024-09-23 07:14:10 -07:00
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
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
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
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
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
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
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
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
e83ce331da build: use treesitter's CMakeLists.txt 2024-09-22 19:58:03 +02:00
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
511b991e66 feat(fs.lua): add vim.fs.rm()
Analogous to the shell `rm` command.
2024-09-22 15:05:24 +01:00
29bceb4f75 docs(api): nvim_get_runtime_file preserves 'runtimepath' order #30454 2024-09-22 03:51:22 -07:00
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
1d815acd78 build: bump minimum cmake version to 3.16 2024-09-21 23:42:03 +02:00
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
e5c174421d test: support upvalues in exec_lua 2024-09-21 16:04:09 +01:00
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
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
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
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
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
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
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
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
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
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
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
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
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
100bb15d18 docs: link to discussions instead of stackoverflow 2024-09-20 16:13:17 +02:00
a60700f3b1 docs: prefix LSP bug report title 2024-09-20 16:08:55 +02:00
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
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
adbaaa5225 docs(lsp): hover window controls #30347 2024-09-19 08:00:08 -07:00
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
7dbbaaec3f refactor!: rename 'jumpoptions' flag "unload" to "clean" (#30418)
Follow-up to #29347
2024-09-19 18:05:27 +08:00
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
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
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
22553e1f38 docs: graduate tui.txt to "flow layout" #30413 2024-09-18 01:28:00 -07:00
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
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
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
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
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
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
a0d8c2b86e docs(eval): update param types of prompt-buffer functions (#30392) 2024-09-16 18:33:35 +08:00
549c00c791 Merge #29490 feat(vim.ui.open): configurable opener 2024-09-16 03:21:40 -07:00
23dcd7cd73 test(vim.ui.open): opt.cmd 2024-09-16 11:58:04 +02:00
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
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
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
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
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
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
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
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
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
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
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
f2173b1aa2 fix(defaults): cannot remove "How-to disable mouse" menu item #30375 2024-09-14 02:18:38 -07:00
67d6b6f27e ci: skip automerge step if backport failed 2024-09-14 01:55:36 +02:00
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
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
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
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
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
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
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
deac7df80a refactor(stream.c): unused params in stream_close #30356 2024-09-12 09:16:57 -07:00
ae917dbd06 fix(treesitter): sync queries from upstream 2024-09-12 13:41:15 +02:00
c65153893a build(deps): bump tree-sitter-c to v0.23.0 2024-09-12 13:41:15 +02:00
f6cc0394ae build(deps): bump tree-sitter-markdown to v0.3.2 2024-09-12 13:41:15 +02:00
f347c292d1 build(deps): bump tree-sitter-lua to v0.2.0 2024-09-12 13:41:15 +02:00
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
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
98ba65b8be fix: replace NVIM with Nvim in default titlestring (#30348) 2024-09-11 20:32:08 +00:00
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
a30afeeb85 Merge #30342 :checkhealth completion 2024-09-11 03:01:48 -07:00
7b680e0ca9 test(health): "test_plug/health/init.lua" completes as "test_plug" 2024-09-11 11:40:56 +02:00
8501fe621a build(deps): bump unibilium to HEAD - ab28a2ddb 2024-09-11 11:10:40 +02:00
a5bd6665b0 fix(scripts): update bundled dependencies in bump_deps 2024-09-11 11:10:40 +02:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
9ddfcb64bf fix(runtime): add remaining missing commentstrings (#30252) 2024-09-10 15:01:25 +08:00
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
648d6426c8 fix(server): CID 509282: DEADCODE #30316
listen_addr cannot be NULL at this point.
2024-09-09 05:14:47 -07:00
f0334c2c71 Merge #30312 from justinmk/testslashes 2024-09-09 04:00:35 -07:00
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
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
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
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
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
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
0cfbc6eaff Merge #30105 fix(tohtml): quote font-family names 2024-09-08 03:32:33 -07:00
95b65a7554 test(tohtml): simplify font test 2024-09-08 12:17:42 +02:00
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
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
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
5ddf2ab768 test(lua): tbl_deep_extend "after second argument" #30297 2024-09-07 09:41:02 -07:00
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
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
439d031742 Merge pull request #30236 from luukvbaal/invalid
fix(decor): revise marktree metadata for invalid marks
2024-09-06 13:13:51 +02:00
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
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
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
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
e36e68d35c build(deps): bump libuv to HEAD - 0a00e80c3 2024-09-05 16:23:58 +02:00
f4d823b123 refactor(vterm): inline REFLOW macro
cherry-picked from dfc4c5e5b3
2024-09-05 15:38:58 +02:00
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
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
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
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
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
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
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
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
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
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
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
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
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
ae9674704a Merge #30237 validate --listen address 2024-09-02 15:52:18 -07:00
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
137f98cf64 test: tmpname() can skip file creation 2024-09-02 20:19:50 +02:00
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
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
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
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
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
61e9137394 docs: misc #28970 2024-09-01 13:01:24 -07:00
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
318c0415d5 fix(ui): correctly pass metadata to get_node_text #30222
Fixes: #30220
2024-09-01 10:15:02 -07:00
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
9b983e5f6c docs(treesitter): annotate some tables as TSMetadata 2024-09-01 10:45:24 +01:00
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
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
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
bfa365a872 fix(completion): don't include <Lua function> in -complete= (#30209) 2024-09-01 07:57:09 +08:00
f046c3eca6 Merge pull request #30207 from zeertzjq/vim-7c8bbc6
vim-patch: doc updates
2024-09-01 06:53:13 +08:00
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
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
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
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
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
e1937286f0 Merge pull request #30042 from bfredl/bobbytables
refactor(multibyte): replace generated unicode tables with utf8proc
2024-08-31 18:55:09 +02:00
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
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
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
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
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
5f95f1249f Merge pull request #30014 from bfredl/neoemoji
support emojis with ZWJ and variant selectors
2024-08-30 12:58:48 +02:00
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
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
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
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
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
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
7588ff2d89 fix(man): check if buffer is valid before restoring 'tagfunc' (#30180) 2024-08-29 11:53:48 +00:00
6c2186a998 docs(eval): fix wrong return type of getcharsearch() (#30176) 2024-08-29 18:02:23 +08:00
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
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
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
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
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
dad55f5e76 feat(lsp): export diagnostic conversion functions (#30064) 2024-08-27 13:16:33 -05:00
f8e1ebd6f6 fix(treesitter): escape things like " in omnifunc results 2024-08-27 09:27:47 +02:00
d9ccd828b0 fix(lsp): return call hierarchy item, not the index (#30145) 2024-08-26 17:37:36 +02:00
0e394f136f fix(lsp): log when receiving markup messages (#30065) 2024-08-26 17:35:43 +02:00
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
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
664de5ea97 build(deps): bump tree-sitter to v0.23.0 2024-08-26 16:14:36 +02:00
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
b8135a76b7 fix(docs): wrong return value annotation for nvim_buf_get_extmarks 2024-08-25 08:36:00 +01:00
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
84f1c5e072 build(deps): bump luajit to HEAD - f725e44cd 2024-08-24 17:58:20 +02:00
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
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
2c6222c56b Merge pull request #30127 from zeertzjq/vim-7884cc7
vim-patch: update Vim syntax
2024-08-24 08:12:51 +08:00
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
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
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
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
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
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
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
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
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
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
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
4e5607eb37 build(deps): bump luajit to HEAD - c68711cc8 2024-08-21 12:57:18 +02:00
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
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
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
a9e11168f5 Merge pull request #30095 from zeertzjq/vim-175a87c
vim-patch: update :keeppatterns doc
2024-08-21 07:20:59 +08:00
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
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
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
41859c2d8c build(deps): bump luajit to HEAD - 304da39cc 2024-08-20 19:53:35 +02:00
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
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
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
ac53996ebb build(deps): bump luajit to HEAD - fb22d0f80 2024-08-20 10:56:28 +02:00
a8fbe1d409 fix(decor): don't use separate DecorSignHighlight for url (#30096) 2024-08-20 08:20:19 +08:00
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
169f37b94f build(deps): bump luajit to HEAD - fb5e1c9f0 2024-08-19 19:33:02 +02:00
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
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
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
cce1eb0806 fix(api): error properly with invalid field in nvim_open_win (#30078) 2024-08-17 23:10:27 +00:00
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
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
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
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
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
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
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
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
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
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
a837f10d17 vim-patch:cba93ca: runtime(doc): clarify the effect of :keeppatterns after v9.1.0677
cba93cab53
2024-08-17 06:35:42 +08:00
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
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
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
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
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
a901fb875f fix(docs): add missing properties to hl_info #30032 2024-08-16 08:36:23 -07:00
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
ee5aaba215 fix(man): avoid setting v:errmsg (#30052) 2024-08-15 22:02:20 +08:00
4199671047 feat(term): support OSC 8 hyperlinks in :terminal (#30050) 2024-08-15 06:09:14 -05:00
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
40bc48479d build(deps): bump luajit to HEAD - ae4735f62 2024-08-15 09:03:57 +02:00
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
32d17cb6d2 Merge pull request #30045 from bfredl/nodefault5
refactor(tests): again yet more global highlight definitions
2024-08-14 19:38:49 +02:00
6bcefad5a6 fix(highlight): fix the seg fault caused by the invalid linked hl ids 2024-08-14 15:42:55 +01:00
ef4c9b136e refactor(tests): again yet more global highlight definitions 2024-08-14 14:03:34 +02:00
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
ab561302a3 test: remove internal assertions and simplify 2024-08-13 14:05:10 +01:00
b621921074 test: add a test to check the indentation 2024-08-13 14:05:10 +01:00
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
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
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
65a703e060 fix(lua): ignore stdout and stderr for xdg-open
Ref #19724
Fix #29932
2024-08-12 07:03:48 +00:00
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
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
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
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
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
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
0d3f2c4904 docs: update version.c (#30016)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2024-08-09 11:36:03 +08:00
b9913191be Merge pull request #30015 from zeertzjq/vim-8.2.4860
vim-patch: Check NoDefaultCurrentDirectoryInExePath
2024-08-09 07:45:21 +08:00
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
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
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
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
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
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
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
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
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
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
0c99ce0e89 Merge pull request #29999 from zeertzjq/vim-a63f66e
vim-patch: zip plugin updates
2024-08-07 07:34:27 +08:00
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
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
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
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
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
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
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
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
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
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
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
cc26cf0400 fix(docs): do not treat indexes as short_link 2024-08-06 18:18:34 +02:00
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
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
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
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
b04b263e1f Merge pull request #29984 from zeertzjq/vim-217d3c1
vim-patch: runtime file updates
2024-08-06 07:22:03 +08:00
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
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
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
fd1d84c705 Merge pull request #29540 from bfredl/neoshada
refactor(shada): rework msgpack decoding without msgpack-c
2024-08-05 14:08:28 +02:00
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
1247684ae1 build(deps): remove msgpack-c dependency 2024-08-05 12:22:12 +02:00
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
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
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
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
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
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
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
3b58d93aae docs(filetype): consolidate comments in dev_vimpatch.txt 2024-08-03 14:14:42 +02:00
37910f2703 docs(filetype): add note about prefering explicit lists over pattern 2024-08-03 14:14:42 +02:00
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
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
eb629cce91 fix(lsp): redundant spaces in lsp log (#29970) 2024-08-03 11:14:34 +02:00
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
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
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
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
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
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
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
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
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
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
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
2a3561819e fix(eval): handle wrong v:lua in expr option properly (#29953) 2024-08-02 08:00:27 +00:00
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
99bb0a10d3 refactor(eval): treat v:lua call as simple function 2024-08-02 12:56:57 +08:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
cd46383667 refactor(mappings): elide description copy (#29910) 2024-07-30 00:11:21 +00:00
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
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
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
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
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
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
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
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
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
5aa1a9532c docs(treesitter): don't quote metadata 2024-07-28 16:13:11 +02:00
9e80738f30 fix(runtime): sync bundled treesitter queries 2024-07-28 16:13:11 +02:00
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
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
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
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
5be5928771 test(ui/popupmenu_spec): make highlights more consistent 2024-07-27 21:42:31 +08:00
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
8bdfc2ab2b fix(version): return nil with empty string 2024-07-27 14:06:31 +01:00
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
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
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
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
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
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
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
5af9c065ad fix(decor): don't draw invalidated virtual lines (#29858) 2024-07-26 09:04:17 +08:00
41b70a0dea fix(runtime): set 'keywordprg' only once in vim ftplugin 2024-07-26 08:45:51 +08:00
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
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
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
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
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
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
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
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
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
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
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
862338255d fix(runtime): sync bundled treesitter queries 2024-07-24 16:02:53 +02:00
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
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
9793a97778 docs: update version.c (#29760)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2024-07-23 03:40:37 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
410cf29ee6 Merge pull request #29784 from zeertzjq/vim-83d002802644
vim-patch:{83d0028,c3837a4,27f5334}
2024-07-18 14:23:51 +08:00
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
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
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
6720bd440f fix: assert failure in VimL expression parser 2024-07-17 23:37:59 -04:00
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
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
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
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
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
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
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
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
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
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
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
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
bc2bd25f8e test: fix reporting "no flush received" too early (#29735) 2024-07-17 22:39:25 +08:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
8f890f74b6 test(old): reorder test_regexp_latin.vim to match upstream 2024-07-17 10:50:19 +08:00
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
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
1f2f460b4a fix(lsp): don't show codelens for buffers that don't support it (#29690) 2024-07-16 19:48:54 +02:00
5fe4ce6678 fix(snippet): modify base indentation when there's actually whitespace (#29670) 2024-07-16 19:30:22 +02:00
118ae7e5ed fix(tohtml): support ranges again 2024-07-16 15:07:40 +02:00
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
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
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
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
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
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
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
25db0a1385 fix(tohtml): extmark text may be out of bounds 2024-07-16 08:11:26 +01:00
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
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
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
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
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
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
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
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
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
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
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
8703e7bd12 docs(lpeg): merge upstream changes 2024-07-15 21:16:29 +01:00
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
594c7f3d77 fix(ui): avoid ambiguity about last chunk when flushing halfway (#29718) 2024-07-15 18:35:20 +08:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
16f63b964f fix(input): handle vim.on_key() properly with ALT and K_SPECIAL (#29677) 2024-07-13 04:14:29 +08:00
708b5f86ba refactor(filetype): use Lua patterns without implicit anchoring 2024-07-12 21:16:09 +03:00
9d14b76089 refactor(filetype): extract expanding env. vars in separate function 2024-07-12 21:16:09 +03:00
abf4b65a51 perf(filetype): cache (more) pattern data during "add" time 2024-07-12 21:16:09 +03:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
d918ebe3b8 fix(diagnostic): fix backwards compatibility for goto_next and goto_prev (#29593) 2024-07-09 14:08:12 -05:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
73ae7d44a2 fix(quickfix): make shortmess+=O work with cmdheight=0 (#29609) 2024-07-08 10:36:41 +08:00
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
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
51ef445c15 Merge pull request #29606 from zeertzjq/vim-b9bbf1f04439
vim-patch: documentation updates
2024-07-08 06:45:32 +08:00
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
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
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
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
5b778a64ec fix(health): fix fetching url with python in provider health (#29594) 2024-07-07 16:37:39 +08:00
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
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
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
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
bdc6e38781 fix(lua): don't include text after cursor in completion pattern (#29587) 2024-07-06 22:25:35 +08:00
34fa54355a Merge pull request #29584 from zeertzjq/vim-6a4afb1efca1
vim-patch:6a4afb1,aaaa21b
2024-07-06 17:52:28 +08:00
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
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
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
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
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
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
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
9217e0d671 fix(treesitter): display fields for anonymous nodes in :InspectTree 2024-07-05 10:11:48 +02:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
81d2e4446e build(deps): bump luajit to HEAD - 04dca7911 2024-07-04 10:37:28 +02:00
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
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
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
599fc7cee4 test: starting and stopping treesitter highlight (#29546) 2024-07-03 08:40:55 +08:00
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
aec7f1979a fix(lsp): fallback to label for completion items if all others are missing (#29522) 2024-07-02 18:27:51 +02:00
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
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
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
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
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
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
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
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
496091b632 refactor: replace utf_convert with utf8proc conversion functions 2024-06-28 19:47:39 +02:00
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
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
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
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
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
fc9b70826e fix(lsp): avoid vim.keymap.del error when stopping a client (#29478) 2024-06-26 17:03:46 +02:00
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
9dc09a4cdd ci(lintcommit): allow capitalized letter after colon in description (#29480) 2024-06-26 05:08:15 +08:00
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
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
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
cd53db2157 feat(lua): add context.env (environment variables) to vim._with() 2024-06-24 20:23:11 +03:00
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
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
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
b0e5990907 refactor(filetype): change some patterns to extensions (#29472)
Ref #29468
2024-06-24 22:12:15 +08:00
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
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
2bb1a18631 refactor(typval): don't use msgpack_packer for msgpackdump()
Step towords completely eliminating msgpack_packer.
2024-06-24 10:38:36 +02:00
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
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
6c3f7e7e27 fix(gen_vimdoc): correctly generate function fields 2024-06-22 20:00:13 +01:00
5a8a34dafa fix(filetype): source ftdetect/* after creating scripts.vim autocmds (#29445) 2024-06-22 21:17:36 +08:00
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
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
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
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
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
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
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
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
26c2a56d99 vim-patch:6ccf6da: runtime(gomod): add gomod filetype plugin (#29433)
closes: vim/vim#15060

6ccf6da7a2
2024-06-21 12:36:57 +08:00
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
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
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
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
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
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
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
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
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
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
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
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
b1c439cef6 fix(drawline): don't draw beyond end of window with 'rnu' (#29406) 2024-06-19 09:20:24 +08:00
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
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
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
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
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
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
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
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
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
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
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
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
7ce261c064 docs(lsp): format the handwritten part #29295 2024-06-17 16:04:40 -07:00
a46991e1c6 docs(news): fix inconsistencies (#29381) 2024-06-18 07:00:32 +08:00
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
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
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
b60030b7bf Merge #28775 fix(man.vim): signcolumn causes broken wrap 2024-06-17 15:09:30 -07:00
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
7746c54e10 Merge pull request #29357 from luukvbaal/statuscol
feat(column)!: rework 'statuscolumn' %r/l items
2024-06-17 06:33:15 +08:00
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
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
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
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
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
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
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
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
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
7e65f3757b docs: document 'list' behavior when 'listchars' excludes "tab" (#29360) 2024-06-16 06:08:36 +08:00
db7332d687 Merge pull request #29361 from zeertzjq/vim-1c6734291295
vim-patch:1c67342,52f2ff0
2024-06-16 06:08:23 +08:00
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
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
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
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
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
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
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
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
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
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
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
bcca597e17 Merge pull request #29339 from zeertzjq/vim-a3bddb759e77
vim-patch:a3bddb7,d6d4e13,262e25e,c509c00
2024-06-15 06:30:55 +08:00
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
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
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
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
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
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
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
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
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
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
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
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
ba70404c55 Merge pull request #29241 from bfredl/shadapack
refactor(shada): use msgpack_sbuffer less
2024-06-14 11:33:27 +02:00
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
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
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
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
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
5def8714ad fix(terminal): set local values of window options (#29326) 2024-06-14 06:20:42 +08:00
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
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
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
6589d05894 Merge pull request #29322 from zeertzjq/vim-02f3ebacfbfa
vim-patch:02f3eba,d353d27
2024-06-14 05:10:38 +08:00
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
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
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
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
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
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
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
d38912b59f refactor(terminal): move :terminal defaults to _defaults.lua 2024-06-12 10:43:57 -05:00
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
2ca678f57d test: fix vim.deprecate tests 2024-06-12 16:41:26 +01:00
8bf79bd13c fix(vim.wo): never allow non-zero bufnr 2024-06-12 15:42:56 +01:00
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
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
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
af8001d100 Merge pull request #29292 from zeertzjq/vim-059cbe893355
vim-patch:059cbe8,959c3c8
2024-06-12 11:06:57 +08:00
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
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
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
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
39d8651283 Merge pull request #29278 from bfredl/strcat
refactor(memory): use builtin strcat() instead of STRCAT()
2024-06-11 19:21:50 +02:00
c37695a5d5 refactor: use S_LEN(s) instead of s, n (#29219) 2024-06-11 16:40:24 +01:00
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
e947f226be fix(types): use vararg return type annotation
build(types): allow vararg returns in function types
2024-06-11 16:36:29 +01:00
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
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
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
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
5e49ef0af3 refactor(lua): improve type annotations 2024-06-11 12:45:43 +01:00
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
d8e384b7bf Merge pull request #29272 from luukvbaal/signcol
fix(column): clamp line number for legacy signs
2024-06-11 09:52:10 +02:00
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
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
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
37bf4c572a fix(lsp): do not reset buf version when detaching client (#29242) 2024-06-10 18:53:08 +02:00
d9af8c2431 Merge #29238 from clason/feat/help-toc 2024-06-10 05:22:27 -07:00
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
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
20f22f75ee feat(lsp): include end_col, end_lnum in vim.lsp.buf.locations_to_items #29164 2024-06-09 18:14:55 -07:00
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
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
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
b6c1ce8a95 fix(runtime): add commentstring for glsl ftplugin 2024-06-09 14:51:22 +02:00
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
a156038d70 docs: fix more treesitter parsing errors 2024-06-09 13:54:34 +02:00
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
caa2e842a1 refactor(os/shell): we have DynamicBuffer at home
DynamicBuffer at home: KVÄCK
2024-06-09 11:53:56 +02:00
2b2dd6accf Merge pull request #29141 from bfredl/rstream2
refactor(io): make rstream use a linear buffer
2024-06-09 11:33:00 +02:00
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
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
105a9e3dcf build(deps): bump tree-sitter-vimdoc to v3.0.0 2024-06-08 10:19:28 +02:00
4881211097 refactor: quadratic behavior in vim_findfile_stopdir (#29232)
Copies characters in-places instead. Related #27827
2024-06-08 10:12:39 +08:00
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
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
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
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
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
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
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
cb6c0fda71 feat(editorconfig): add support for spelling_language (#28638) 2024-06-06 09:16:43 -05:00
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
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
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
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
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
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
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
43bd9c9c1c fix(lua): don't clamp -1 or v:maxcol in vim.highlight.range() (#29203) 2024-06-05 16:47:43 +08:00
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
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
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
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
f69937fdbd fix(diagnostic): fix float scope filtering (#29134) 2024-06-04 16:35:44 -05:00
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
230bc34ca5 fix(lsp): check if buffer is valid before LspDetach autocmd (#29162) 2024-06-04 17:23:57 +02:00
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
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
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
8cbb1f20e5 refactor(lua): use tuple syntax everywhere #29111 2024-06-04 06:06:02 -07:00
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
8369590eb2 fix(runtime): remove obsolete ftplugin/calender.lua 2024-06-04 12:54:34 +02:00
ae0d562644 refactor(spell.c): reduce scope of locals 2024-06-04 11:07:01 +01:00
aa9f21ee95 fix(filetype): fix typos in filetype detection 2024-06-04 11:26:27 +02:00
46b69aaf14 fixup: include nvim/ascii_defs.h 2024-06-04 09:42:19 +01:00
200e7ad157 fixup: apply the change on more files 2024-06-04 09:42:19 +01:00
4b3845be2e fixup: LNUL 2024-06-04 09:42:19 +01:00
a18982cb83 refactor: replace '\0' with NUL 2024-06-04 09:42:19 +01:00
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
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
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
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
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
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
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
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
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
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
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
56337310ef test: add a test for #29119 2024-06-02 15:18:30 +08:00
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
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
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
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
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
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
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
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
bb6190bec5 refactor: move shared messages to errors.h #26214 2024-06-01 08:19:41 -07:00
9eb0426002 fix(luacats): allow all types inside tuples 2024-06-01 12:56:43 +01:00
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
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
138a93a057 perf(lsp): avoid repeated table lookup in completion.enable 2024-06-01 10:23:01 +02:00
4c938f6d72 refactor(lsp): share completion request logic between omnifunc & trigger 2024-06-01 10:23:01 +02:00
cc1f2d2ca6 perf(lsp): don't copy completion items in filter pass 2024-06-01 10:23:01 +02:00
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
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
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
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
5493fcd52f test: remove checks for failed tests on Windows 2024-05-31 10:04:01 -05:00
d62d181ce0 refactor(lsp): use tuple syntax in generated protocol types (#29110) 2024-05-31 16:48:05 +02:00
217828b20c fixup! docs(luacats): add tuple support 2024-05-31 15:00:17 +01:00
d87ecfc8bc docs(luacats): add tuple support 2024-05-31 15:00:17 +01:00
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
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
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
6566a59b3a refactor(lsp): use predefined types in util function signatures (#29095) 2024-05-31 14:41:10 +02:00
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
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
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
7e44ab696a Merge pull request #29093 from bfredl/noring
refactor(fileio): use a linear buffer for FileDescriptor
2024-05-31 10:13:56 +02:00
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
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
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
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
783f6079b8 ci: update labeler configuration and add reviewers 2024-05-30 20:57:14 +02:00
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
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
b2bad0ac91 feat(lsp): support postfix snippets in completion 2024-05-30 09:24:24 +02:00
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
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
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
f55767afe2 Merge pull request #29016 from bfredl/shadareader
refactor(shada): remove ShaDaReadDef secondary wrapper
2024-05-29 13:23:14 +02:00
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
f09f5c45fa build: reuse code for deps.txt for both deps and main build 2024-05-28 20:58:07 +02:00
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
fc2429962a Merge pull request #29063 from bfredl/noapifile
refactor(fileio): remove useless use of FileDescriptor
2024-05-28 19:42:00 +02:00
0bdd602bf9 Merge pull request #27339 from MariaSolOs/completion
feat(lsp): completion side effects
2024-05-28 12:39:30 -05:00
e6cfcaed18 feat(snippet): add default keymaps during snippet session 2024-05-28 08:49:39 -07:00
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
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
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
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
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
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
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
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
490c2109e6 test(lsp): add completion tests 2024-05-27 14:53:28 -07:00
ff097f2091 feat(lsp): completion side effects 2024-05-27 14:53:28 -07:00
6e8a728e3d refactor: fix luals type warnings 2024-05-27 20:48:46 +02:00
f70af5c3ca ci: bump backport action to version 3 2024-05-27 19:47:49 +02:00
608543f8a9 fix(snippet): cancel snippet session when leaving the buffer (#29031) 2024-05-27 17:18:10 +02:00
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
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
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
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
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
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
9a0239fdc8 fix(drawline): don't draw beyond end of window (#29035) 2024-05-27 14:37:22 +08:00
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
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
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
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
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
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
dd54e81551 Merge #29021 TOhtml fixes 2024-05-26 10:20:59 -07:00
88c7997503 fix(tohtml): show how many warnings are hidden 2024-05-26 13:57:30 +02:00
4f24e1b1d7 Merge pull request #29014 from bfredl/editortest
refactor(tests): more global highlight definitions
2024-05-26 13:32:51 +02:00
8cd9feb501 fix(tohtml): ignore lsp inlay hints 2024-05-26 13:14:40 +02:00
2ed6423c7e fix(tohtml): replace ipairs with pairs 2024-05-26 12:56:32 +02:00
98536dd78e build(deps): bump tree-sitter-c to v0.21.3 2024-05-26 12:38:20 +02:00
61b3a26e5b build(deps): bump tree-sitter-query to v0.4.0 2024-05-26 12:38:20 +02:00
da7056ffff build(deps): bump luajit to HEAD - 93e87998b 2024-05-26 11:26:12 +02:00
b90d7c36cf refactor(tests): more global highlight definitions 2024-05-26 10:24:27 +02:00
05a65432b6 Merge pull request #29006 from bfredl/apitest
refactor(tests): use more global highlight definitions
2024-05-26 09:40:05 +02:00
fb43741f80 refactor(tests): use more global highlight definitions 2024-05-26 09:22:20 +02:00
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
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
7994fdba6a fix(snippet): don't override unnamed register on tabstop select (#28998) 2024-05-25 21:23:04 +02:00
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
520c2657bb refactor: move provider-related to where they are used 2024-05-25 20:13:17 +02:00
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
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
52389e7243 test(unit): skip flaky 'typval.c dict extend() works' test 2024-05-25 15:15:36 +02:00
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
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
75f6ee5b26 Merge pull request #28617 from glepnir/border_hl
fix(float): missing default highlight for title
2024-05-25 11:13:58 +02:00
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
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
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
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
93c55c238f test(lintdoc): check that input list is same length as output list (#28976) 2024-05-25 07:39:06 +08:00
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
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
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
2c6b635872 feat(defaults): add LSP default mappings (again) (#28650) 2024-05-24 11:33:49 -05:00
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
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
1a2e6ebc59 refactor: replace deprecated vim.loop with vim.uv 2024-05-24 16:41:02 +02:00
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
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
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
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
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
6dc62c2e2b docs: extract health to its own file 2024-05-24 11:07:30 +02:00
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
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
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
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
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
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
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
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
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
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
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
2908f71dc9 refactor(lsp): reuse buf_detach_client logic in on_detach (#28939) 2024-05-23 15:17:03 +02:00
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
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
cd48b72b60 fix(shada): restore search pattern length properly (#28929) 2024-05-23 09:10:16 +08:00
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
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
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
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
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
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
339129ebc9 refactor(lsp): use supports_method where applicable 2024-05-22 09:54:16 +01:00
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
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
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
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
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
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
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
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
a108852b00 fix(lsp): semantic token functions allow "0" bufnr #28849
aligns with ":help dev-patterns"
2024-05-21 09:25:54 -07:00
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
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
8263ed4670 fix(lsp): add textDocument/documentLink to capability map (#28838) 2024-05-21 18:16:53 +02:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
63e3a63d2f refactor(path.c): add nonnull attributes (#28829)
This possibly fixes the coverity warning.
2024-05-19 05:38:31 +08:00
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
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
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
5947f249f8 fix(move): half-page scrolling with resized grid at eob (#28821) 2024-05-18 07:00:29 +08:00
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
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
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
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
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
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
10f9173519 fix(health): broken ruby detect #28804 2024-05-17 03:25:28 -07:00
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
06135cc215 Merge pull request #28785 from bfredl/nilversion
fix(version): fix vim.version().prerelease
2024-05-16 22:04:04 +02:00
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
d049752e45 fix(version): fix vim.version().prerelease
fixes #28782 (when backported)
2024-05-16 20:10:54 +02:00
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
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
31dc627969 docs: news #28773 2024-05-16 06:28:27 -07:00
ecee8ef8a9 version bump 2024-05-16 14:36:13 +02:00
27fb62988e NVIM v0.10.0
For notable changes, see runtime/doc/news.txt (or `:help news` in Nvim).
Following is a list of fixes/features commits.

BREAKING
--------------------------------------------------------------------------------
- 649dd00fe2 remove deprecated functions
- 0370e4def0 remove neovim qt
- 880f7d12fe remove vimballs (#22402)
- c48b1421af rename "playground" => "dev" #23919
- 2f85bbe615 rewrite TOhtml in lua
- abe39f2b24 api: change return type of nvim_win_text_height to Dict (#24365)
- 7180ef6901 api: nvim_open_win: noautocmd blocks all autocmds #28192
- 700cab0068 events: trigger CursorMoved later on switching window (#23711)
- e4a136f713 ex_cmds: remove :behave
- e5e0bda41b lsp: add vim.lsp.status, client.progress and promote LspProgressUpdate (#23958)
- 5a363ccac8 lsp: deprecate trim_empty_lines
- 5a2536de0c lsp: move changetracking to separate file (#26577)
- 58618d208a lsp: promote LspRequest to a full autocmd and enrich with additional data (#23694)
- 1b9ccd38a1 lsp: rename vim.lsp.get_active_clients to get_clients (#24113)
- eb1f0e8fcc lsp: replace snippet parser by lpeg grammar
- 448907f65d lsp: vim.lsp.inlay_hint.get(), enable(), is_enabled() #25512
- 7caf0eafd8 lua: add stricter vim.tbl_islist() and rename old one to vim.tbl_isarray() (#16440)
- 747264320c mappings: remove #n as a notation for a function key (#17318)
- f7da472257 options: graduate shortmess+=f flag
- c3d1d9445c options: graduate some more shortmess flags
- 5df4fdf253 options: make OptionSet `v:` values use typval
- 881d17a113 options: remove compatible behaviours for vim 5.0 and earlier
- e19cc9c9b7 options: unify `set_option` and `set_string_option`
- db590e96d5 startup: "nvim -l" message does not end with newline #24215
- 2ca076e45f treesitter: incremental injection parsing
- f5dc453109 treesitter: new standard capture names
- fc0ee871de treesitter: remove deprecated legacy injection format
- 6debb18523 treesitter: remove duplicated diagnostic code (#24976)
- 18da6964cc vim.iter: remove vim.iter.map/filter/totable #26138
- 9b028bd64f vim.iter: rename xxback() => rxx() #28503
- 8d4a53fe6e vim.json: remove global options, "null", "array_mt" #24070
- 40ce857797 vim.ui: change open() to return `result|nil, errmsg|nil` #28612
- e0d92b9cc2 vim.ui: change open() to return pcall-like values #28502

FEATURES
--------------------------------------------------------------------------------
- a66b0fdfaa NVIM_APPNAME supports relative paths #25233
- c0beb8173f add .luarc.json (#24592)
- 14b7ffcf89 add __call typing for vim.inspect()
- ca7e488cfe add link in issue template to minimal config template
- 4bf47222c9 add vim.text module (#26069)
- 0ebc4de0ff allow opting in to builtin clipboard providers (#28083)
- e8d3c4cccb generate types and docs for v variables
- 29fe883aa9 ignore swapfile for running Nvim processes #25336
- 28d1640dd6 improve return type annotations for vim.api.*
- 199a990c9e report "build" in vim.version() #23925
- e688793253 tostring(vim.version())
- c559ab0ae6 update unicode tables (#27317)
- ecdb6465e2 vim.version() returns a Version object
- 4b60267f82 :source: source current ft=lua buffer as Lua code (#23802)
- 428edcde70 api: add forward and back mouse buttons
- 037ea6e786 api: add nvim__redraw for more granular redrawing
- ca9f6f5694 api: add nvim_tabpage_set_win (#27222)
- db8fe63a93 api: add nvim_win_text_height (#24236)
- 16513b3033 api: allow floats to be opened in non-current tabpage (#28480)
- 6b4970f6e0 api: allow open_win/win_set_buf in the cmdwin in some cases
- 5d921e28c1 api: allow win_close in cmdwin to close wins except previous
- 472271199e api: allow win_hide to close cmdwin or non-previous windows
- 6bba4beced api: make nvim_open_win support non-floating windows (#25550)
- b162adbb7c api: pass 0 to nvim_get_chan_info for current channel (#27321)
- 42bbc4fabc api: support abbreviations in nvim_set_keymap
- 98a4ed0a11 api: support getting abbreviations (#26868)
- d3d7d763f3 builtin: improve types
- 748bc4d22d clipboard: add OSC 52 clipboard support
- db57df04b6 clipboard: enable OSC 52 clipboard provider by default (#26064)
- 734848dc1a colorscheme: add semantic tokens modifiers to builtin color scheme
- 1e0996b572 colorscheme: update treesitter groups
- 73de98256c comment: add built-in commenting
- ae4ca4edf8 complete: support f flag for complete buffer part
- 01c51a4913 completion: support completing more string options
- ae3685798d decoration: allow conceal_char to be a composing char
- 30a5c28c87 decoration_provider: log errors as error messages
- 9711370c26 defaults: add :Inspect to right-click menu (#28181)
- 2613ba5000 defaults: enable 'termguicolors' by default when supported by terminal
- 513fc46195 defaults: improve :grep defaults #28545
- c26dc1f77c defaults: map Q and @x to repeat in Visual mode (#26495)
- 8758c6fb87 defaults: set g:netrw_use_errorwindow = 0 #24179
- 1d81d7a268 defaults: treat "•" as a list item prefix #24623
- 20b38677c2 defaults: use ripgrep (rg) for 'grepprg' if available
- 61063653b0 defaults: visual CTRL-R for LSP mappings #28537
- 4ee656e4f3 diagnostic: add `vim.diagnostic.count()` (#26807)
- 73034611c2 diagnostic: add default mappings for diagnostics (#16230)
- fc6d713dd8 diagnostic: add support for many namespaces filtering in GetOpts (#28045)
- 5ed9916a28 diagnostic: enable(…, opts)
- e780177506 diagnostic: filter diagnostics by specific severities (#24736)
- b13e63db1d diagnostic: goto functions jump to highest severity (#28490)
- 26765e8461 diagnostic: is_enabled, enable(…, enable:boolean)
- 9cb7e00b97 diagnostic: provide more control over virtual text display (#24724)
- ee41153a94 diagnostic: revert default behaviour of goto_next/prev()
- 07b60efd80 diagnostic: specify diagnostic virtual text prefix as a function
- a3b3978474 diagnostics: support numhl and linehl for diagnostic signs
- 0381f5af5b diff: grouping optimization for linematch algorithm
- 42333ea98d docs: generate builtin.txt (#24493)
- 9beb40a4db docs: replace lua2dox.lua
- 1d4a5cd185 eval: exists() function supports checking v:lua functions (#26485)
- 4a1ad676ce ex_cmds: no error on :lua with {range} and {code} (#27290)
- c2433589dc ex_cmds: ranged :lua #27167
- b04286a187 extmark: support proper multiline ranges
- 1c032ad703 extmark: window scoped extmark
- 68cb4a7405 extmarks: add "undo_restore" flag to opt out of undo-restoring
- 4e6f559b8c extmarks: add 'invalidate' property to extmarks
- c249058758 extmarks: add sign name to extmark "details" array
- bbd5c6363c extmarks: add virt_text_repeat_linebreak flag (#26625)
- 15e77a56b7 extmarks: subpriorities (relative to declaration order) (#27131)
- f0884f21fa extmarks: support hl_mode "combine" for inline virt_text (#24099)
- 372aa2eb3d float: add fclose command
- 35570e4a11 float: implement footer
- 4200a0f167 float: support toggle show float window
- 1233ac467d fold: transparent foldtext
- 71530cc972 folds: support virtual text format for 'foldtext' (#25209)
- 38b9c322c9 fs: add vim.fs.root (#28477)
- e3e6fadfd8 fs: expose join_paths as `vim.fs.joinpath` (#23685)
- bc67cf3ccd gen_help_html: add anchors to help tags #25112
- b0cf9c5fee gen_help_html: ignore pi_netrw.txt errors
- 81d8fce8f9 gen_help_html: non-default vimdoc.so parser
- da09f9b551 gen_lsp.lua: protocol.Methods #24504
- f41496ce74 gen_lsp.lua: sort by name, handle failure #24504
- 3692fd4c87 gen_lsp.lua: validate CLI args #26514
- 2ff2785c39 health: checkhealth buffer can show in a split window (#26714)
- 4382d2ed56 health: fold successful healthchecks #22866
- d1bc6fca71 health: list attached buffers in LSP report #23561
- 2877672d70 health: make :checkhealth support more split modifiers (#26731)
- ddda5e0a48 help: hide filename of "gO" outline using conceal #27547
- e72c0cd920 highlight: Allow hyphens (-) in highlight group names (#24714)
- 986bf7e78d highlight: add `FloatFooter` highlight group
- 574519d9d6 highlight: tweak default color scheme
- 64a14026d7 highlight: update default color scheme
- a79694a08e issue_template: instruct not to include a package manager
- 69ffbb76c2 iter: add `Iter.take` (#26525)
- cebc00603e l10n: update Turkish translations #24246
- fec51229c4 l10n: update Ukrainian translations (#24882)
- 996dd36c77 lsp: add actionable advice to lsp client quit error msg (#24510)
- 4ff3217bbd lsp: add fswatch watchfunc backend
- 643546b82b lsp: add handlers for inlay hints (#23736)
- 317c80f460 lsp: add method filter to get_active_clients (#24319)
- 6888607415 lsp: add more LSP defaults (#28500)
- 0fe86f7e24 lsp: add opts paramater to vim.lsp.codelens.refresh
- 131a1ee82d lsp: add original LSP Location as item's user_data in locations_to_items (#23743)
- f1775da07f lsp: add snippet API (#25301)
- db0ec84fb4 lsp: add type annotations for lsp.util.locations_to_items (#26694)
- f190f758ac lsp: add vim.lsp.buf.subtypes(), vim.lsp.buf.supertypes() (#28388)
- 451bc50d40 lsp: deprecate severity_limit
- e9b85acfbb lsp: enable workspace/didChangeWatchedFiles by default (#23190)
- 4a09c178a1 lsp: fallback to code-action command on resolve failure (#25464)
- 2f22ed6a00 lsp: handle multiple clients in omnifunc (#24381)
- 63b3408551 lsp: implement textDocument/diagnostic (#24128)
- 5e3cf9fb4b lsp: improve control over placement of floating windows (#24494)
- 15641f38cf lsp: include positionEncodings in default client capabilities
- ddd92a70d2 lsp: initial support for dynamic capabilities (#23681)
- ca5de9306c lsp: inlay hints #23984
- 350d818564 lsp: inlay_hint.is_enabled({filter}) #28523
- 33e1a8cd70 lsp: map K to hover by default #24331
- 97bea3163a lsp: more annotations
- 37079fca58 lsp: move inlay_hint() to vim.lsp (#24130)
- 12c2c16acf lsp: opt-in to dynamicRegistration for inlay hints (#24102)
- a49924a318 lsp: remove notify from vim.lsp.buf_detach_client (#25140)
- 8149bd089e lsp: report fswatch errors
- fb54e6980e lsp: set client offset_encoding if server supports positionEncoding
- 96e19533f6 lsp: set kind in select call for codelens #23889
- 9af3559643 lsp: set workDoneToken in initialize request (#28182)
- f736b075d3 lsp: snippet parsing using lpeg
- 134b9ec483 lsp: soft deprecate vim.lsp.for_each_buffer_client (#24104)
- 63f9c2da9a lsp: support completion itemDefaults
- 3f788e73b3 lsp: support connect via named pipes/unix domain sockets (#26032)
- 7e36c8e972 lsp: support for choice snippet nodes
- 5c40f3e86a lsp: support vim.lsp.ListOpts.loclist in location_handler()
- abd2352bd8 lsp: update LSP protocol 3.18 typings to date (#28730)
- cfd4a9dfaf lsp: use treesitter for stylize markdown
- d5063f4b29 lsp: vim.lsp.inlay_hint.enable(nil) applies to all buffers #28543
- c0952e62fd lua: add `vim.system()`
- 9248dd77ac lua: add hl priority opts on yank (#23509)
- 6425869771 lua: add meta file for vim submodules (#24525)
- 3734519e3b lua: add noref to deepcopy
- 7c661207cc lua: add ringbuffer (#22894)
- 877d04d0fb lua: add vim.func._memoize
- ab1edecfb7 lua: add vim.iter (#23029)
- d675bd01b1 lua: allow vim.F.if_nil to take multiple arguments (#22903)
- c379d72c49 lua: allow vim.wo to be double indexed (#20288)
- e52c25b761 lua: deprecate vim.tbl_add_reverse_lookup
- f1dfe32bf5 lua: enable(enable:boolean, filter:table) #28374
- 5b40a1c09d lua: implement Iter:join() (#26416)
- c01e624b07 lua: more specific error messages for vim.api type checking
- e1ff2c51ca lua: pass keys before mapping to vim.on_key() callback (#28098)
- 2db719f6c2 lua: rename vim.loop -> vim.uv (#22846)
- 6c0812d92e lua: specific error messages for type checking `opts` params
- fd089c8e50 lua: typing for vim.fn.* (#24473)
- 302d3cfb96 lua: use callable table as iterator in vim.iter (#23957)
- 51c754b62e lua: use keyset type information
- 8e5c48b08d lua: vim.fs.normalize() resolves ".", ".." #28203
- 7e70ca0b48 lua: vim.keycode (#22960)
- 9e86f473e0 lua: vim.region accepts getpos() arg (#22635)
- 4d04feb662 lua: vim.tbl_contains supports general tables and predicates (#23040)
- 48d533272e lua-types: types for vim.api.* (#24523)
- 25e7299707 man: allow opening pages in current window (#27861)
- 08db61b19b man: respect 'wrapmargin' when wrapping man pages (#24091)
- f9944a78bc meta: add types for vim.lpeg
- deb6fd6704 msgpack-rpc: show actual request id in error message
- 01fe6b9e6a msgpack_rpc: support out-of-order responses on `msgpack-rpc`
- 619407eb54 nvim_open_term: convert LF => CRLF (#26384)
- e98decf9a6 quickfix: support -q - to read 'errorfile' from stdin (#27303)
- 7b0123dd6a remote: avoid --remote-ui infinite loop (#24465)
- cca6c4c698 rpc: allow empty string key in msgpack => Vim conversion
- d0d4160dd1 runtime: highlight hl groups in syntax.txt (#25050)
- 5f4895200a scripts: add lsp_types.lua (#23750)
- 4e6096a67f server: allow embed with listen (#25709)
- 170c890dca shortmess: "q" flag fully hides recording message (#27415)
- d3582e102b statuscolumn: re-evaluate for every screen line (#25885)
- 224f303ee5 stdlib: add vim.base64 module (#25843)
- fa131de9ad tabline: middle mouse button now closes tab (#27522)
- c855eee919 term: enable reflow by default (#21124)
- cd1b14f027 termdebug: improve `:Evaluate` floating window (#26621)
- cffdf102d4 terminal: allow :terminal to take modifiers (#15427)
- 0c89854da1 terminal: close shell terminals automatically
- 7589336120 terminal: respond to OSC background and foreground request (#17197)
- beca827212 terminal: trigger TermRequest autocommand events (#22159)
- c6ec7fa8d7 treesitter: add 'injection.self' and 'injection.parent'
- 6cfca21bac treesitter: add `@injection.filename`
- 5d8ab32f38 treesitter: add a query editor (#24703)
- cb0a1a10b2 treesitter: add bash parser and queries
- bb15fa0356 treesitter: add folding for `InspectTree` (#27518)
- 9ce1623837 treesitter: add foldtext with treesitter highlighting (#25391)
- 31c4ed26bc treesitter: add injection language fallback (#24659)
- 28f54a7878 treesitter: add lang parameter to the query editor (#25181)
- 88c8803aa1 treesitter: add python parser and queries
- c194acbfc4 treesitter: add query_linter from nvim-treesitter/playground (#22784)
- af040c3a07 treesitter: add support for setting query depths
- 11844dde81 treesitter: bundle markdown parser and queries (#22481)
- 5e6240ffc2 treesitter: handle quantified fold captures
- f69658bc35 treesitter: highlight Lua files by default (#26824)
- 988b472d90 treesitter: highlight help files by default (#26347)
- 845d5b8b64 treesitter: improve query error message
- 189fb62032 treesitter: improved logging (#23638)
- c0b99bb1de treesitter: show root nodes in :InspectTree (#26944)
- cb46f6e467 treesitter: support URLs (#27132)
- ff6092b4ee treesitter: update Bash parser and queries to v0.21.0
- 8dda630ae9 treesitter: update C parser and queries to v0.21.0
- 3836eeb901 treesitter: update C queries from upstream
- aca4ad430b treesitter: update Lua parser and queries to v0.1.0
- 5e875ae8d0 treesitter: update Markdown parsers and queries to v0.2.1
- 8a3385dde7 treesitter: update Python parser and queries to v0.21.0
- 20dcbaaaf8 treesitter: update Vim parser and queries to v0.4.0
- 987dff6713 treesitter: update Vimdoc parser and queries to v2.4.0
- 1384bebd5a treesitter: update query parser to v0.2.0
- 668f16bac7 treesitter: upstream query omnifunc from playground (#23394)
- a478bf936b treesitter: use 0-based indexing to show ranges in `:InspectTree`
- ac8ed77afb tui: add 'termsync' option (#25871)
- 4ee9e58056 tui: query extended underline support using DECRQSS (#28052)
- b4b7ca2d54 tui: support DCS responses in TermResponse event (#26061)
- 622ae2f53e tui: support Super and Meta modifiers (#24357)
- a142670360 tui: support undercurl in WezTerm (#28037)
- 56627ca242 tui: use TermResponse event for OSC responses (#25868)
- 32b49448b2 tutor: add Japanese tutor #27268
- 9c2270b834 types: add `test/.luarc.json`
- d3a8e9217f ui: add chdir UI event (#27093)
- 6ea6b3fee2 ui: add support for OSC 8 hyperlinks (#27109)
- b72931e704 ui: allow non-zero 'cmdheight' with ext_messages
- 2615ed879e ui: allow to get the highlight namespace
- e38027ef69 ui: completeopt support popup like vim
- 2e4e12756a ui: indicate margins for the area used by win_viewport
- efa9b299a7 ui: inline virtual text
- dacd34364f ui-ext: make 'mousehide' into proper ui_option (#25532)
- 43ded8d358 version: unverbose ":version", ":verbose version" #24195
- 0a598c13b1 vim.deprecate: only issue warning if neovim version is high enough
- a767c046f4 vim.iter: add Iter:flatten  (#26786)
- af6e6ccf3d vim.ui: vim.ui.open, "gx" without netrw
- fa4b02fa67 vim.version: add `vim.version.le` and `vim.version.ge`
- 27a566f3f8 vimdoc: support Markdown code blocks (#25127)

FIXES
--------------------------------------------------------------------------------
- f5573fba3d Remove nested for_each_tree in TSTreeView (#26328)
- ae28ef327e adjust error message for error in UI event callback (#28200)
- ebe489d8f0 allow multiline message for echoerr (#25380)
- 592bc831ce avoid ui_grid_cursor_goto when drawing window separators
- d6483793e1 buffer overrun in lmpack_session_receive
- 3bbb0aa399 checkhealth warning even if init.lua exists #25306
- 5cb906e91c correct versions in deprecation warnings
- 118fd8367c deduplicate gen_cflags
- eb4676c67f disallow removing extmarks in on_lines callbacks (#23219)
- 6e9b204afb doc errors
- 77d3526a3d explain that user should run nvim with -V1 to see more information
- fd791db0ec fix ASAN errors on clang 17 (#25469)
- bb38c066a9 fix compiler warning from clang
- 478273a423 fix iter_matches call in query linter (#27496)
- bb7324292c flush UI state before blocking in vim.wait (#25938)
- 44d4ae448d function was renamed (#23772)
- 1dd700a8d9 gf fails on "foo/bar.txt:1:2" on Windows
- 6e703f778f handle argv not present in nvim_get_chan_info
- 56dc8b9212 heap-buffer-overflow in file_name_in_line
- 74b2f6c3d9 ignore non-existent properties during header generation
- f5a09f1b03 invoke changed_bytes when rewriting <Tab> char #25125
- b8273c9a33 lua annotations
- 69d49727d7 luacheck
- 4ce3159e24 missing case in setxattr error handling (#26176)
- 41fb98d6fa move fswatch linux check inside of vim.schedule (#27824)
- ba58c6f8a4 only attempt to close timer if not already closing (#26047)
- b400b947f3 prevent child processes from inheriting ui channel file descriptors
- 99b8a343e1 quick update, squash later
- 83b51b36aa raise TS min version
- a090d43d61 splitting of big UI messages
- 2424c3e696 support UNC paths in vim.fs.normalize
- 43e76cc346 tostring(vim.version()) fails if build is NIL #24097
- 8c7a8be274 transposed xcalloc arguments (#28695)
- 35f453f65d type warnings in shared.lua
- f112ac73bd unreliable "checkhealth completions" test
- b32b5b2711 use BEL to terminate OSC 11 request (#26335)
- d95e3a4c9c use no_ff instead of ffdos as condition
- a1bec02c1e use snprintf instead of sprintf
- ca887b80a9 version-range < and <= #23539
- c1ee187f82 vim.loop in luv threads (#23924)
- fe4583127f vim.validate() order is not deterministic #28377
- be8b15200d windows timeouts have exit code 1
- 1f8fb7c000 :let: fix error when applying operator to boolean option (#24030)
- 5a3752889c NVIM_APPNAME: show error message if $NVIM_APPNAME is invalid
- c4ad15ae32 PVS/V009: add top-level message
- 128e194f64 PVS/V1001: variable is assigned but is not used
- 1bbbca267d PVS/V547: expression is always true/false
- 592e4472da PVS/V564: the '|' operator is applied to bool type value
- 30d311ebcf PVS/V592: expression is enclosed by parentheses twice
- 3ecd45ded0 api: allow negative column arguments for nvim_buf_set_text (#23501)
- 3ac952d4e2 api: avoid assertion when autocmd group id is 0 (#23210)
- b2a8a93147 api: avoid immediate TextChanged with nvim_create_buf (#25492)
- ef7ae66eef api: avoid integer truncation
- b1e24f240b api: avoid open_win UAF if target buf deleted by autocmds
- 0a81ec14a4 api: better topline adjustments in nvim_buf_set_lines
- c18f3cfcdb api: crash after nvim_win_set_config title/footer validation error (#26606)
- aa4e47f704 api: disallow some more functions during textlock
- 22d9338afc api: disallow win_set_buf from changing cmdwin's old curbuf (#24745)
- da979ae04b api: do not re-apply win_config.style when missing
- 344906a08f api: do not update grid position in nvim_win_set_cursor (#28235)
- 22205f36a6 api: don't change title when setting buffer in a window (#23492)
- 711a2f5ff6 api: don't leak memory with nvim_win_get_ns (#27570)
- 1cf51a07a6 api: don't set coladd of mark (#26648)
- 5fd1bac65e api: don't use stl 'fillchar' for "use_statuscol_lnum" (#27501)
- a3751f5de2 api: dont change curwin for nvim_win_set_height
- 1ff4562502 api: dont change curwin for nvim_win_set_width
- 59fed8bb64 api: extmark highlight groups not always included in details (#23179)
- 9b9030ff2c api: fix inconsistent behavior of topline touched in recent refactor
- fc2a56fe61 api: fix set_lines viewport adjustment, but this time good
- b7763d7f6b api: get virtual text with multiple hl properly (#25307)
- b3be7b7413 api: handle NUL in nvim_err_write() and nvim_out_write() (#25354)
- 132bbd1cbd api: handle clearing out last line of non-current buffer
- d942c2b943 api: handle win_split_ins failure properly
- 5cfdaaaeac api: ignore 'autochdir' when renaming other buf (#28376)
- 2fc2343728 api: ignore 'autochdir' when setting buf in other win (#28371)
- 7367838359 api: limit depth of nvim_cmd (#27225)
- 0da27e9bde api: load buffer first on nvim_buf_set_lines (#25823)
- 4e5c633ed4 api: make getting explicit empty hl in virtual text work (#28697)
- d05d63a18f api: make nvim_get_hl not return non-existing groups
- a70eae57bd api: make open_win block only enter/leave events if !enter && !noautocmd
- 5d58136ccc api: make open_win/win_set_config check if splitting allowed
- 4ec8fd43bf api: make width/height for split by nvim_open_win work (#28341)
- b1577d371a api: make win_set_config with "win" for splits need "split/vertical"
- 0330dd9e69 api: mark nvim__complete_set as experimental #28579
- d22172f36b api: more intuitive cursor updates in nvim_buf_set_text
- b051b131f5 api: nvim_buf_get_offset in a new buffer with zero or one lines
- e0453d7f57 api: nvim_cmd{cmd="win_getid"} parsed as :winsize #24181
- 6091df6b7a api: nvim_create_buf assert fails if autocmds set &swapfile
- d5c23d72a5 api: nvim_create_buf leaks memory if buffer is loaded early
- b7708eac24 api: nvim_get_hl should return default flag
- a741c7fd04 api: nvim_parse_cmd error message in pcall() #23297
- e55a502ed4 api: open_win fire Buf* events when !enter && !noautocmd if entered early
- a873f33993 api: open_win fire BufWinEnter for other buffer when !enter && !noautocmd
- e7c262f555 api: patch some cmdwin/textlock holes
- a9968912b7 api: redundant error when using `nvim_cmd` (#24010)
- dbcba26bf1 api: revert unintended change of optional bool params
- b25753381c api: set script context when using nvim_set_hl (#28123)
- d3ea9a04bc api: update "w_scwidth" in nvim_eval_statusline()
- c971f538ab api: update grid cursor in nvim_win_set_cursor()
- 130cb4815a api: use a conditional stack for nvim_cmd (#26341)
- cf9f002f31 api: use correct buffer for "range" in nvim__redraw (#28614)
- 77118d0da8 api: use text_locked() to check textlock
- bcb70eeac4 api: win_set_config autocmds crash when moving win to other tabpage
- 233649bc75 api: win_set_config fires unnecessary autocmds
- b52d15853e api: win_set_config set tp_curwin of win moved from other tabpage
- 54022a2946 api: win_set_config update statuslines after removing splits
- a9cd8467cb api: wrong nvim_buf_set_extmark error for invalid hl_mode
- 4d3a38ac07 api, lua: handle setting v: variables properly (#25325)
- 92760a7f42 api, lua: make blank lines in a message work properly (#24244)
- 08fc1ebbaa api/buffer: fix handling of viewport of non-current buffer
- 24e3ee9d07 api/options: validate buf and win
- 139e6f68f9 autocmd: API functions accept garbage after event name #25523
- 02d00cf3ee backup: E1509 when writing extended attr to symlink (#28014)
- 746a153bc1 base64: only check padding if leftover index is set (#25854)
- 533e01a75b base64: properly handle embedded NULLs when decoding (#28349)
- 095bd8d0f8 buffer: do not filter help buffer
- e5d9b15044 buffer_updates: correct buffer updates when splitting empty line
- 11865dbe39 build: better deps for doc
- ffaf74f147 build: distinguish vim.mpack from global require'mpack'
- f9416470b1 build: include FindPackageHandleStandardArgs
- ade42d531b build: teach cmake about vvars
- da7178cbbf builtin: fix incorrect optional fields for fn.sign_define
- 6fa0f303d7 builtin: parameter mismatch between winsaveview and winrestview
- 3159a2c28f change: update fold after on_bytes (#26364)
- 342c7da4bd channel: use os_write() instead of fwrite() for stderr (#26689)
- cd6458123f charset: fix wrong display of 0xffff (#24158)
- 603f3b36a4 checkhealth: error in node.js check #28348
- b0978fca6b checkhealth: fix crash due to incorrect argument type
- 7f94a032e1 checkhealth: shell_error and cpanm module
- bfdec5b0e7 clang: null pointer dereference in parse_msgpack #25389
- 1027ccac6d clangd: check size of array before applying qsort on it
- cdd8017469 clangd: set block pointer to null in case map is empty
- 6851b265ba clipboard: don't pass --foreground to wl-copy (#25481)
- c3de6524a5 clipboard: ignore exit caused by signal #23378
- 3128cff6b1 clipboard: increase OSC 52 wait timeout (#25936)
- 46ceefb52b clipboard: make getreg() accurate for clipboard registers (#26740)
- d2983dcdb1 clipboard: make osc52 work with PUC Lua (#26014)
- e51e524175 cmake: restore previously undocumented workround, now documented
- 3688735c2b cmdline: don't redraw 'tabline' in Ex mode (#24123)
- c72d877c33 cmdline: wrong 'incsearch' highlighting after :redraw (#27947)
- bc67bbe446 codelens: add buffer and line checks before displaying codelens (#23887)
- 2b1a6e7597 colorscheme: add missing LSP groups
- 0c850add3e colorscheme: default statusline groups usability #26921
- 8b23653695 colorscheme: link LSP semantic tokens to treesitter groups
- 62e0e0349c colorscheme: try .lua files in 'rtp' before .vim files in 'pp' (#23727)
- eca72def1f colorscheme: typo
- d4bd6b1eaa colorscheme: use explicit normal foreground in syntax groups
- 3c724fe1f3 column: 'statuscolumn' not drawn after virt_lines with "n" in 'cpo' (#22967)
- cdc028e97d column: add truncated width during estimation for 'statuscolumn'
- e89071522c column: always set b_signcols.max
- c126a3756a column: apply numhl signs when 'signcolumn' is "no" (#26167)
- 2ded2e75f4 column: avoid exceeding configured 'signcolumn' width
- b50fdcba4a column: clear "b_signcols" before moving saved marks
- 13d50c3b13 column: clear "b_signcols" when marktree is cleared
- ec74538044 column: correct width after truncated 'statuscolumn' error (#26737)
- 2bdef6dd2a column: don't overflow sign column with extmark signs (#23854)
- bab4bcdefb column: don't reset 'statuscolumn' width after it has been drawn
- c509f4907b column: fill 'statuscolumn' clickdefs with evaluated width (#26891)
- 25e62697c3 column: fix wrong cursor with 'statuscolumn' and cpo+=n (#24268)
- dbf6be296d column: full redraw with 'stc, 'rnu' and inserted lines (#27712)
- 7d0a23973b column: handle unprintable chars in 'statuscolumn' (#24198)
- 0db6946b39 column: handle w_redr_statuscol at end filler lines (#27365)
- 97122eaa1c column: ignore empty signcols range (#28177)
- 967c7abde3 column: keep track of number of lines with number of signs
- f871fee8b6 column: pass kFalse when initializing "b_signcols.count"
- 44d4f03573 column: rebuild status column when sign column is invalid
- c6864b0d14 column: redraw 'statuscolumn' on wrapped lines with 'relativenumber'
- 35cec0de4a column: redraw and update signcols for paired extmark
- d88814ef68 column: remove sign from line it was previously on with undo
- df399ea0d2 column: reset decor state before starting from top
- 5a4e0b837f column: use a single path for sign sorting (#27431)
- a878e02d5d column: use maxwidth to allocate/fill 'statuscolumn' click defs #24190
- 783b0aba41 completion: check that healthcheck name is string (#28458)
- fbeef0d4ef completion: don't add backslashes to runtime pattern (#24296)
- cdc8bacc79 completion: filter results with complete+=f (#26029)
- af8500af64 completion: improve popup window position (#26739)
- d1b2a5cf5f completion: make sure the buffer name is valid (#25975)
- e9b9a86cd5 context: don't crash on invalid arg to nvim_get_context (#25977)
- fdaf6bc557 context: don't leak memory on multiple invalid objects (#25979)
- 55be4a4e26 coverity: dead code #25562
- 6d698c86d0 coverity: unhandled retval for marktree_itr_get_overlap() #26518
- 6f49ed58c3 coverity/348240: memory leak in put_view()
- 9d48266bed coverity/471380: null dereference in get_local_additions()
- ae48d965d7 coverity/477623,477624: guard null pointer dereference in kv_concat_len (#27022)
- 2b0acacb3c decor: allow adding providers during redraw
- 5ca330859c decor: check decor kind before accessing union field (#27205)
- 60d320dea3 decoration_provider: don't leak memory on error (#24410)
- 65738202f8 decorations: better approximation of botline #24794
- 2accf24805 decorations: crash with revised mark with changed decoration flags
- a0e9ef09d7 decorations: do not apply sign highlight id as range attr id
- fba17d5b88 decorations: fix imbalanced sign count
- 444f37fe51 decorations: incompletely displayed line should also get decorations
- dc48a98f9a decorations: validate botline for on_win
- 328a237351 defaults: auto-close terminal for &shell with args (#28276)
- 5aa1ba3efe defaults: background detection in tmux (#26557)
- 5e98439f6d defaults: diagnostic mappings descriptions #28646
- ccb5a76e5a defaults: don't use nvim_feedkeys in default mappings (#24520)
- 85cb0b0ddc defaults: make terminal autoclose not block other events (#27581)
- aa1d0ac095 defaults: only repeat macro for each selected line if linewise (#28289)
- eef2aedff6 defaults: remove tmux background detection passthrough (#27571)
- 5b45efbee6 defaults: set 'fsync' #26034
- 8df3742378 defaults: use augroup for default autocommands (#26933)
- a8e4ee2f2b defaults: validate 'channel' before responding to OSC request (#27594)
- 6318edadc3 defaults: visual hash (#) on text with "?"
- abd380e28d defaults: visual mode star (*,#) is fragile
- b9a0e762f1 defaults: visual star (*) on text with "?"
- 9b4b23493d defaults: wait until VimEnter to set background (#26284)
- 72e3d8c3f9 deps: bump luv to 1.48.0-2
- 87db6d894a deps: make sure --force-config takes effect
- 7aad4643f9 deps: remove stray conflict marker
- 8a6716682e deps: restore functionality of USE_EXISTING_SRC_DIR
- d4dc884012 deps: restore functionality of USE_EXISTING_SRC_DIR
- d272143318 diagnostic: always return copies of diagnostic items (#25010)
- 29d5ff6ac4 diagnostic: check for sign namespace instead of sign group
- 3d8f0cb695 diagnostic: check if delete failed in `qf_fill_buffer()` (#25932)
- 89ffdebd20 diagnostic: fix typing on field |diagnostic-severity|
- 83635e4e3d diagnostic: get border from config (#28531)
- 96f59e1b99 diagnostic: invalid col number  compare in next_diagnostic (#28397)
- ad76b050eb diagnostic: open_float on multi-line diagnostics #28301
- 37011bc45e diagnostic: rename buffer → bufnr in type annotation (#23042)
- 50284d07b6 diagnostic: typing
- a4fc3bb0e6 diagnostic: vim.diagnostic.get(…,{lnum=…}) on multi-line diagnostic #28273
- add1b10b79 diagnostic: virtual_text prefix function should have index and total (#25801)
- 35f475d0a5 diagnostics: if buffer not loaded, skip handlers that set extmark (#25628)
- 5a25dcc5a4 diff: filler lines for hunks bigger than linematch limit (#24676)
- 2f9ee9b6cf doc: improve doc generation of types using lpeg
- c4417ae70c doc: prevent doxygen confusion
- 67f5332344 docs: clean up non-docstring comments for vimdoc gen
- ae7020c667 docs: fix TSNode incorrect signatures
- ab65a98adb docs: ignore_invalid #24174
- f40df63bdc docs: make lines not overflow in vim docs
- 0a90e4b05a docs: match DocSearch style with site theme
- 0d149bb186 docs: the runtimepath is not the runtime path
- 957d05d16b docs: too much whitespace around <pre> blocks #24151
- d931b829e9 docs: vimdoc syntax errors
- 036da0d079 docs: vimdoc syntax errors
- 17c59e417f docs: vimdoc syntax errors
- 34b57508a7 drawline: check filler_todo in place of removed draw_state (#27889)
- 455bca1ba8 drawline: combine extmark highligh with area hl correctly
- 3299797150 drawline: consider position in linebuf for foldcolumn (#26803)
- 889f81c65f drawline: don't invoke on_line for filler line (#28219)
- 2b9d3869f8 drawline: don't use temporary "v" variable when not needed (#26777)
- 06694203e5 drawline: fix missing Visual hl on double-width fold char (#24308)
- d5488633f6 drawline: initialize linebuf_attr to 0 instead of -1 (#27840)
- e9280a68f7 drawline: initialize variable
- 2819718873 drawline: initialize variable
- 36941942d6 drawline: inline virt_text hl_mode inside syntax/extmark hl (#24273)
- 37b73cf14b drawline: make cursorlineopt=screenline work with resized grid
- be1d09c427 drawline: missing NUL termination when drawing TAB (#27307)
- 5b31447811 drawline: update prev_ptr after getting syntax attrs (#27072)
- 14839c5d18 edit: backspace adds extra spaces for inline virtual text (#28005)
- 267e90f31d edit: don't go to Terminal mode when stopping Insert mode (#27033)
- b2e8c0df20 edit: fix K_EVENT interfering with 'digraph' (#24258)
- 143a178332 editorconfig: add missing root validation (#23462)
- cbbda3bcd7 editorconfig: check that buffer is valid (#23922)
- abb8c2c453 editorconfig: do not set 'endofline'
- df2f5e3912 editorconfig: highlight properties with dashes (#24407)
- dc45fb4655 editorconfig: only warn once on errors
- cdbc3e3f3e editorconfig: syntax error regression
- bf0c69e504 eval: correct failure return value for readfile/blob (#27722)
- 5b312cd5f6 eval: make has('pythonx') work properly (#27739)
- 0e4086b741 eval: prevent double-free in garbage collection (#22990)
- 12d123959f eval: properly support checking v:lua function in exists() (#27124)
- b8c34efe33 eval: skip over v:lua properly (#27517)
- ad2fad9a3b event-loop: flush UI when no input is available (#25728)
- 6725565258 event-loop: process input before events (#27358)
- 58a1ef8e6a events: avoid unnecessary CursorMoved (#24675)
- bf9e92c81c events: check for WinResized/WinScrolled in terminal mode (#27226)
- dd24ea8195 events: don't expand non-file as file name
- 774a32e5fe events: null dereference in autocmd functions
- a8cfdf43bc events: trigger VimResume on next UI request (#24426)
- a114a21eff ex_getln: initialize pointer with NULL
- 9e7c4fe579 exception: remember whether message is multiline (#25351)
- 4a098b97e5 excmd: append original command to error message
- 75d9c413d4 excmd: make :def unknown rather than unimplemented (#23150)
- f1dd75c2af exitfree: don't use ex commands to close windows in free_all_mem()
- 79a558277b extmark: fix crash when stepping out from internal node
- a78fd18ed9 extmark: fix cursor position with both left and right gravity inline text
- 320e9c1c21 extmark: only invalidate unpaired marks on deleted rows
- 8e97edb93f extmark: restore extmarks when completing original text
- 2d33a766a1 extmarks: `U` changed_bytes after extmark_splice (#26501)
- 23c21e7630 extmarks: account for rightleft when drawing virt text (#25262)
- d54156ed08 extmarks: blending space shouldn't overwrite wide char (#26960)
- 54225bdb02 extmarks: crash with sign after many marks
- 65b1fd00a7 extmarks: do not remove decor from invalid old marks
- 437d35dbf7 extmarks: do not remove invalid marks from decor upon deletion
- a05bbc60ea extmarks: don't position overlay virt_text halfway a char (#24027)
- 4dd43e31db extmarks: don't show virt lines for end mark (#23792)
- dfa8b582a6 extmarks: draw TAB in virt_text properly with 'rl' (#25381)
- a6e4793baf extmarks: draw virt_text below diff filler lines properly (#25170)
- 958cc22836 extmarks: empty inline virt_text interfering with DiffText (#24101)
- 0534ad8ca5 extmarks: empty inline virt_text interfering with Visual highlight
- 31a51acdc3 extmarks: fix heap buffer overflow caused by inline virtual text (#23851)
- 9c41a81dec extmarks: fix virt_text_hide off-by-one hiding (#23795)
- a6dd67f5b6 extmarks: fix virt_text_hide with 'nowrap' and multibyte (#23757)
- 818d7f6daf extmarks: fix win_col virt_text drawn on wrong screen line (#25264)
- c4df2f08b6 extmarks: fix wrong highlight after "combine" virt_text (#24281)
- b65cd7ff1a extmarks: fix wrong virt_text position after wrapped TAB (#25168)
- 4c7cec4e29 extmarks: handle inline virt_text with empty chunk (#24005)
- ee3d4f6b90 extmarks: handle overwriting right half of wide char (#26951)
- f4f1ce1d16 extmarks: hide inline virt_text properly with 'smoothscroll' (#24106)
- 34a786bc49 extmarks: inline virt_text support multiple hl groups (#25303)
- 5a6c7c805b extmarks: make empty "conceal" respect &conceallevel = 1 (#24785)
- 510e1f131b extmarks: make right_align and win_col work on wrapped line (#23759)
- 215244f749 extmarks: missing "spell" and "conceal" in details (#27116)
- 35e50d79c6 extmarks: overlay virt_text position after 'showbreak' (#25175)
- a0790558c3 extmarks: priority order of inline and non-inline virt_text (#27532)
- b52bd8a2de extmarks: properly handle virt_text on next screen line (#25166)
- a376d979bd extmarks: redraw line on adding/removing conceal (#27463)
- 2d9e063a63 extmarks: redraw pre-undo position (#27437)
- 2137edbd4f extmarks: redraw properly with scoped inline virt_text (#27569)
- 1cc358aed6 extmarks: restore old position before revalidating
- 0818d65528 extmarks: skip virt_text if it is out of window (#25658)
- 19d63563e1 extmarks: splice earlier when opening new line (#28108)
- 362df0f793 extmarks: wrong display when changing text with virt_lines (#24879)
- d5a85d737a f_wait: flush UI before blocking (#25962)
- 81f67b79e8 file_search: path with spaces in finddir() and findfile() (#25493)
- a69c720639 fileio: fix off-by-one in rename_with_tmp (#27780)
- c6c21db82b filetype: add typing and dry (#24573)
- 020d1f626a filetype: call on_detect before setting buffer filetype
- fdf5013e21 filetype: correctly detect bash-fc-{id} files as "sh"
- d6f406db45 filetype: don't use fnamemodify() with :e for extension (#27976)
- 670c7609c8 filetype: make sure buffer is valid before call nvim_buf_call (#24922)
- af38b46a25 filetype: return on_detect function when matching by file contents
- 2955c921ce filetype: use unexpanded file name (#27931)
- e32af31ee8 flake: clang-tools moved to nativeBuildInputs (#26955)
- fd08fd3de3 float: add fixd option
- 884470124d float: allow floating window in cmdline area
- 9ecb43b637 float: apply 'winblend' to title/footer highlight (#25999)
- 898371fc9f float: don't relative flaot win itself
- fcdfbb4303 float: fix some other crashes with :unhide or :all (#25328)
- 3ea124a8d9 float: improve error message when reconfig failed (#25076)
- c5abf487f1 float: make "fixed" work with relative=win (#25243)
- 03e8b5fc91 float: make bufpos work properly with resized parent grid
- 437ed3cee2 float: trigger winnew event when float window create
- f5953edbac float: update position of anchored windows first (#25133)
- 9de157bce4 float: win_get_bordertext_col returning negative column number (#25752)
- 5f18dd3013 float: wrong position when bufpos is set
- 0e01e81552 folds: allow overlay virtual text on folded line (#23892)
- ee986ee044 folds: combined Folded and Visual highlights (#23752)
- ded01a819a folds: don't show search or match highlighting on fold (#24084)
- 811140e276 folds: fix missing virt_lines above when fold is hidden (#24274)
- 678548a2b4 folds: show Folded highlight in Visual selection (#23741)
- 58f9486144 folds: update folds in Insert mode with fdm=indent (#24402)
- 38e38d1b40 fs: allow backslash characters in unix paths
- 8a7e3353eb fs: make `normalize()` work with '/' path (#24047)
- ae5095cac9 fs: use generics for better typing
- e4da418ba8 fs.lua: normalize slash truncation (#23753)
- 06fcf71bd0 fswatch: --latency is locale dependent
- 502a7a0558 ftplugin: respect runtimepath ordering
- 03a2c5b772 ftplugin: source Lua files after Vimscript files per directory (#23801)
- be5cf33836 gen_help_html: type warnings, spell_ignore_files #27254
- 6c35fb421e gen_lsp.lua: improve type name, and fix wrong type inheritance
- 214b125132 gen_lsp.lua: no notifications in lsp.Methods #24530
- 765729a145 gen_vimdoc: INCLUDE_DEPRECATED not generating docs for deprecateds
- ccf328172b gen_vimfn_types: don't include tag before signature's line (#24492)
- 86c9d8b53c gen_vimvim: correctly add aliases to vimAutoEvent (#23429)
- 240c41e1af genvimvim: add special abbreviations of :delete (#23172)
- 51ea753747 genvimvim: generate prefixed boolean options properly (#27487)
- 9f32deba56 grid: add start column when getting char on line (#25627)
- 4ed1c2a8af grid: don't draw beyond max column (#26172)
- 9c202b9392 grid: handle clearing half a double-width char (#27023)
- 6a486c44e6 gx: move to to _init_default_mappings #24420
- 67b2ed1004 gx: visual selection, expand env vars
- e39b6d0c52 health: "attempt to concatenate nil"
- 7ffe450173 health: check for _host_prog variables properly (#23014)
- 50cd5ed360 health: check more "old" files
- f6dcc464f2 health: check unmatching python_glob as empty table (#28215)
- 6818ba271c health: clients may not support watchfiles #28710
- 03a021f378 health: combine python and virtualenv healthchecks (#23004)
- c67efe3a9c health: correctly expand and resolve PYENV_ROOT (#26953)
- 88eb0ad149 health: fix tmux RGB capability detection (#26886)
- cde4892b49 health: fix typo in function name
- 63a17322dd health: improve python executable check error handling (#26954)
- ba88fd886a health: malformed call to warn() #26217
- 8c6f97bef8 health: properly use the value of $PYENV_VERSION (#23109)
- c8ebb04e92 health: replace healthFoo with DiagnosticFoo (#23475)
- 843c1bed95 health: stop job properly on timeout (#23877)
- 96d0c709b6 healthcheck: expand vimrc variable (#28379)
- 4229bbe514 helptags: make multibyte help tags work properly (#23975)
- 7b6d041bae heredoc: allow missing end marker for scripts
- a2f17e97ec highlight: add `FloatFooter` to 'highlight_defs.h' (#25577)
- 837f268093 highlight: add `Nvim{Light,Dark}Gray{1,2,3,4}` colors
- 8afb3a49c0 highlight: add create param in nvim_get_hl
- f8ea49cfe1 highlight: add force in nvim_set_hl
- 4ce0ada0d4 highlight: add missing g: prefix for colors_name (#22952)
- 03ca36d1f8 highlight: apply 'winblend' to NormalNC (#23555)
- 6c3e170e56 highlight: apply 'winblend' to float border (#25981)
- d4872377fe highlight: attr set all when normal attr changed
- dcaf207336 highlight: combine ColorColumn with low-priority CursorLine (#23017)
- 66925f14de highlight: consistently spell "Goldenrod"
- 5183651773 highlight: correct hi command output
- ca7dd33fa7 highlight: don't show CursorColumn on current line (#27848)
- 59289fb987 highlight: make CurSearch work properly with 'winhl' (#24448)
- b11a8c1b5d highlight: remove unnecessary assignment to char_attr for 'spell' (#23713)
- 9a2c98087b highlight: update `IncSearch` to link to `CurSearch`
- ab92575753 highlight: winhl receive wrong argument
- b60a2ab4cb inccommand: block errors when parsing command line again (#24374)
- bc5b0da84e inccommand: don't crash with "split" and 'n' flag
- 382ea4d402 inccommand: don't preview in Ex mode (#26587)
- c1c2a1b5dd inccommand: don't save information of a buffer twice (#24501)
- ef44e59729 inccommand: don't set an invalid 'undolevels' value (#24575)
- ba9f86a9ce inccommand: improve preview buffer number handling (#27087)
- 643bea31b8 inccommand: restrict cmdpreview undo calls (#24289)
- 1dba570e63 inccommand: save and restore '[ and '] marks (#26442)
- 35ffe58ea4 inccommand: update topline after moving cursor (#27341)
- a14c780918 input: set termkey buffer size to read stream capacity
- b61575ba70 intro: clear intro if new buffer is shown in focused float
- 9530a23016 intro: link showing intro to state at start
- 0570a19c8a intro: make intro explicitly stateful
- d1a30221fc intro: redrawing intro exposing pseudo-randomness
- 21360523cd intro: still show intro message with floating window
- 6b96122453 iter: add tag to packed table
- 2ee8ace217 iter: make pipeline termination conditions consistent (#24614)
- 9489406879 iter: remove special case totable for map-like tables
- 57ccd82417 job-control: fix use after free (#25223)
- 1c71c32b29 job-control: make jobwait() flush UI after hiding cursor (#25927)
- e057b38e70 json: allow objects with empty keys #25564
- af6537bc66 jumplist: Ctrl+o, Ctrl+i weird behavior when deleting buffers #25461
- 017ff93b02 keycodes: recognize <t_xx> as a key (#24700)
- 6709f7f8f1 keycodes: simplify S- properly when D- is present (#27316)
- 4447cefa48 l10n: update Japanese translations (#27856)
- 7d17ab5b6f l10n: update Ukrainian translations (#26819)
- 908843df61 languagetree: apply `resolve_lang` to `metadata['injection.language']`
- e353c869ce languagetree: don't treat unparsed nodes as occupying full range
- 6b5f44817e languagetree: remove double recursion in LanguageTree:parse
- f5530bf566 linematch: initialize array
- 766f4978d6 lint: lint warnings #24226
- 5465adcbab lint: use tbl_contains
- 0804034c07 loader: cache path ambiguity #24491
- 89135cff03 loader: remove cyclic dependency on vim.fs (when --luamod-dev)
- 66c66d8db8 loader: reset hashes when running the loader
- ec80e4cb4d log: increase size of buffer for nvim instance name
- 4d0f4c3de9 lsp: E403 if doc contains multiple codeblocks #24458
- 20c331915f lsp: SignatureHelp docstring is not escaped #16702
- 01691c5447 lsp: abort callHierarchy on no result (#28102)
- 9abced6ad9 lsp: account for border height in max floating popup height (#25539)
- 3e016fa8d4 lsp: actually send diagnostic-tags back to the server
- 37d8e50459 lsp: add "silent" option to vim.lsp.start (#28478)
- 2e1f5055ac lsp: add assertion for explicit bufnr in apply_text_edits (#27614)
- 542c910a1d lsp: add missing LSP semantic token highlight links
- be5e361154 lsp: add param assert in client_is_stopped (#23857)
- ac0e8323dc lsp: add parentheses to generated union array types (#27560)
- 0fcbda5987 lsp: add snippet regression test (#27618)
- e42fdaad21 lsp: add spacing for inlay hints separately #24079
- 48bcc7b971 lsp: advertise workspace.didChangeConfiguration capability (#26028)
- c07dceba33 lsp: allow Lua pattern chars in code action filter (#24041)
- 3bf887f6e0 lsp: always return boolean in lsp.buf_client_attach (#24077)
- 966eb8e0b3 lsp: announce publishDiagnostics.dataSupport (#24442)
- 39fc340276 lsp: avoid assertion when `client_hints` do not exist (#28461)
- 47dbda97d2 lsp: buffer messages until connected to server (#28507)
- adbe7f3683 lsp: call `on_list()` even for single location (#25830)
- 15983cf2c6 lsp: cancel session when leaving snippet region (#25762)
- 816b56f878 lsp: cancel watchers when closing a client
- 9b8a075539 lsp: change `silent` in lsp.start.Opts to optional (#28524)
- d3e0352574 lsp: check if inlay hints are enabled for a buffer before disabling (#24074)
- fa9a85ae46 lsp: clean up duplicate and unused meta type annotations
- 8bd6f7c20b lsp: clear codelens on LspDetach (#24903)
- 97c0a52416 lsp: correct deprecation message #28403
- aa62898ae3 lsp: correct the error message's cmd on spawning (#27632)
- 77a9f3395b lsp: create codelens request parameters for each buffer (#27699)
- 9281edb334 lsp: create per client params in lsp.buf.code_action
- 39cc38a87b lsp: defer writing error msgs (#27688)
- 1b679ac192 lsp: define LspInlayHint highlight group #24073
- dc8c086c7e lsp: directly rename the existing buffers when renaming (#27690)
- c1a95d9653 lsp: disable didChangeWatchedFiles on Linux
- 2fde6295df lsp: display initialization errors (#25409)
- 94127cb5df lsp: do not add extra indentation
- cc87dda31a lsp: do not assume client capability exists in watchfiles check (#24550)
- 0fe0cf5ada lsp: do not cancel snippet when selecting placeholder (#25835)
- 073035a030 lsp: don't register didChangeWatchedFiles when capability not set (#23689)
- 5eee633c97 lsp: don't start additional client if attach failed (#28744)
- 21fa19f3e8 lsp: don't use hl_mode = combine for inlay hints #24276
- 96b94f8d77 lsp: duplicate on_detach, on_reload callbacks #24067
- b95b6ed975 lsp: empty commands should not be considered executable (#28216)
- c3c673cdec lsp: enable() does not activate inlay hints on open buffers #28629
- b2c26a875b lsp: ensure buffer is not attached more than once
- fa0a25dcb3 lsp: error in reset_timer on second detach #24117
- 72e64a1afe lsp: extra "." when completing with tsserver #24646
- 031088fc0a lsp: filetype matching to documentSelector in dynamic capabilities (#25425)
- d191bdf9d5 lsp: fix attempt to call non existent function (#24212)
- dd3fa64573 lsp: fix dynamic registration of code actions (#23826)
- ce4ea638c7 lsp: fix incorrect typing and doc for `vim.lsp.rpc`
- f487e5af01 lsp: fix infinite loop on vim.lsp.tagfunc
- 74bd4aba57 lsp: fix multi client handling workspace_folder methods (#18839)
- 5e5f5174e3 lsp: fix off-by-one error for omnifunc word boundary
- ba6761eafe lsp: fix omnicomplete in middle of the line (#25787)
- 075a72d5ff lsp: fix relative patterns for `workspace/didChangeWatchedFiles` (#23548)
- 840e1864c2 lsp: handle NUL bytes in popup text (#25612)
- 345bd91db2 lsp: handle absence of a trailing newline #25194
- 0e9a33572d lsp: handle adjacent snippet tabstops
- 853f647da6 lsp: handle reverse lookup in capabilities
- 91f67fabe6 lsp: handle stale bufnr on LspRequest autocmd trigger (#24013)
- 849d82b80b lsp: handle stale bufnr on LspRequest autocmd trigger (#27981)
- 2eecb1b85d lsp: highlight active parameter in signature help #25663
- e55e80d51c lsp: inlay hints: "Failed to delete autocmd" when closing buffer #24469
- 7968322e7a lsp: inlay_hint nil reference error #24202
- ba8f19ebb6 lsp: lint warnings, default offset_encoding #24046
- 3304449946 lsp: log unknown diagnostic tags instead of showing a warning (#25705)
- 251ca45ac9 lsp: markdown code fence should allow space before info string #24364
- add7e106d5 lsp: noisy warning about offset_encodings #24441
- c235959fd9 lsp: only disable inlay hints / diagnostics if no other clients are connected (#24535)
- 1dacf2ecee lsp: prevent code-lens refresh from becoming a permanent  no-op (#28228)
- 597ecf7516 lsp: re-add client.commands and mark private
- 94a904b453 lsp: reapplying already-applied hints #24114
- 4ecc71f6fc lsp: reduce diagnostics and add more types (#23948)
- bc7f86209d lsp: redundant vim.snippet.jumpable #28560
- ee156ca60e lsp: refactor escaping snippet text (#25611)
- 2ecba65b4b lsp: remove unknown LSP protocol property (#24345)
- 7311958e12 lsp: remove unnecessary file load/write when renaming (#27621)
- e14e750998 lsp: rename LspProgress data.result => data.params #28632
- f0e61e6d92 lsp: rename fails on missing parent directory #27291
- b413f5d048 lsp: rename undofile when renaming (#27684)
- d09957e0a0 lsp: rename: load and list new buffer if attached to window (#27408)
- 7668f89d5b lsp: replace @private with @nodoc for public client functions (#24415)
- 52823616bc lsp: replace bug-prone ternary operation #28627
- 5282d3299c lsp: restore marks after apply_text_edits() #14630
- cf5f1492d7 lsp: revert change to buf.clear_references() #24238
- 917172dd96 lsp: semantic token defer loading
- 3be2536ca0 lsp: send back diagnostic tags to the server
- a37d568082 lsp: send empty "added" list when removing workspace folder #24440
- 3c6d971e54 lsp: set extra info only when it has a value (#23868)
- 5785c32f11 lsp: set fallback client name properly
- 370232dbef lsp: track snippet deletion
- ca26ec3438 lsp: use only utf-16 in default client positionEncodings (#23903)
- b302da9ad2 lsp: use percentage format on lsp.status (#23971)
- 2c8f36a3b0 lsp: use plain loop for non-list-like table of protocol values
- 8addd27504 lsp: when renaming directory, check path prefix of buffer names (#27603)
- 597355deae lsp: wrong iterator in registerCapability handler (#24971)
- b2d471ab33 lua: allow nil values in serialized Lua arrays (#26329)
- 68f12e7fcb lua: annotate that TSNode functions can return nil (#24621)
- 4ffc20c951 lua: avoid internal error when :luado deletes lines (#27262)
- 3198038224 lua: correct return value for on_key with no arguments (#25911)
- 84bbe4b0ca lua: disallow vim.wait() in fast contexts
- 22eb2ba183 lua: do not schedule events if Nvim is exiting
- 7d279a09e0 lua: handle array with holes in luaeval() (#26630)
- c43c745a14 lua: improve annotations for stricter luals diagnostics (#24609)
- 2f779b94e7 lua: inspect_pos respect bufnr when get syntax info (#23098)
- e2e63bd045 lua: make highlight.on_yank use win-local highlight (#27349)
- b40170f7a3 lua: memory leak when using invalid syntax with exists() (#26530)
- 4ab9c5fa46 lua: not using global value in vim.opt_global (#25196)
- 20ec4c776a lua: only disable vim.schedule() when closing main loop (#26090)
- f150b62423 lua: only free luarefs when returning from API (#28373)
- 0190771713 lua: remove uri fragment from file paths (#27647)
- 5aa14e1231 lua: return after assert returns assert message (#27064)
- 5331d5772f lua: show error message when failing to set variable (#25321)
- 1294e221a2 lua: vim.fn.has('nvim-0.10') in fast context, used by vim.deprecate
- 37c58226a8 lua: vim.fs typing (#24608)
- 5db076c7cc lua: vim.region on linewise selection #25467
- 622b1ae38a lua: vim.split may trim inner empty items
- a7df0415ab lua2dox: filter out the entire `---@alias` block
- 32e69bd397 luarc.json: ignore test directory to save memory
- 6f936c9d85 man: make :Man with a range work (#25922)
- 59aadf33ef man: pass modifiers also to :tag (#27878)
- a9b4dc9614 man: set the nested flag for the BufReadCmd autocommand (#26285)
- c8d1d8b254 man.lua: don't continue on command error (#23009)
- a4c4b39d55 man.lua: hardwrapped manpage is not resized #25646
- 209ed16f57 man.lua: return support of all sections
- 3a7c30dc93 man.vim: q quits after jump to different tag in MANPAGER modified (#28495)
- 3c667d3e0f mappings: fix mapset() not replacing map with backslash (#26719)
- 0451391ec5 mark: properly init mark views (#22996)
- d432bba4e4 marks: handle switching buffer properly (#25763)
- 62306a29ad marktree: correct qsort usage
- 585549625d marktree: off-by-one error in `marktree_move`
- 34be915f6b marktree: preserve ordering in `marktree_move`
- b97d5038f1 marktree: some marks counted twice when checking for overlap
- ad5a155b1f mbyte: fix bugs in utf_cp_*_off() functions
- b028233991 memline: more curbuf stuff
- 91ef26dece messages: :map output with ext_messages (#26126)
- eabf9de1dc messages: allow more prompt in headless mode with UI (#27905)
- 60fb8a6a8b messages: avoid crash with :intro and ch=0 (#28343)
- 61a0aa6c51 messages: avoid passing negative length to strnlen() (#28753)
- ca258db156 messages: clear new lines when increasing 'cmdheight' (#27421)
- c9f47fca8b messages: ensure msg_grid is at top at more prompt (#23584)
- 2f17ef1fc4 messages: use "Vimscript" instead of "VimL" #24111
- 55dbf5c379 messages: validate msg_grid before using msg_grid_pos (#26189)
- 4db77017fb meta: add nil return types to lpeg functions
- 5198a2555d meta: cleanup lpeg operators
- dae6770b76 meta: include vim.json
- d31f7648ec mkspell: prevent Unicode character overflow (#23760)
- a8a93e517f mouse: avoid dragging after click label popupmenu callback (#26187)
- 6a2a37b1e1 mouse: avoid dragging when clicking next to popupmenu (#26201)
- 091eb4c8c7 mouse: click after eol with conceal and virtual text (#27897)
- 2b475cb5cc mouse: click on 'statuscolumn' with 'rightleft' (#25090)
- e25cf47ad3 mouse: click on empty line with 'foldcolumn'
- 84a4319545 mouse: cmdline click registered as statuscolumn (#23163)
- bf52fb7193 mouse: copy the line before syntax matching (#24320)
- 5fb4c397a1 mouse: drag vsep of window with 'statuscolumn' (#24462)
- dc394b9641 mouse: fix popup menu position check with winbar (#23456)
- 7c1921e9d6 mouse: fix popup_setpos position check with ext_multigrid (#23436)
- a3fba5cafc mouse: handle folded lines with virt_lines attached to line above (#23912)
- 64aa0f7d0b move: check for filler lines properly (#28307)
- 366d0c7887 move: check the correct buffer (#25698)
- 780509aedf move: fix using the wrong window (#28312)
- 60d1e3e471 msgpack: store grid line event as a value
- c52dfb6e84 normal: don't check conceal when pressing 'r' (#27892)
- 088cdf69e3 normal: make "g$" work properly with resized grid
- a1ded1b113 oldtest: always use a 64-bit int for swapfile block number
- 92c59c39c3 ops.c: remove duplicate u_save_cursor()
- 9d01385c6c options: `'modified'` showing incorrect value for scratch buffers
- c3e176f6e2 options: correct condition for calling did_set_option() (#25026)
- 9af03bcd47 options: do not change inccommand during preview (#25462)
- 796df966f3 options: don't update curswant for 'winhl' or 'winbl' (#27515)
- d956bc6379 options: setting 'scroll' with resized grid (#26628)
- c8a27bae3f options: use a union for def_val (#27169)
- 804c828e68 optionstr.c: incorrect use of curbuf/curwin
- a9df0c5ce6 osc52: do not use 'vim.iter' (#27218)
- 5d75d9aef2 osc52: enable OSC 52 by default in tmux sessions (#26072)
- 86c2213b5e osc52: use `p` for primary selection instead of `s` (#26076)
- 1045659097 osc52: use nvim_chan_send() to stderr for copying (#26690)
- e3bd04f2af pager: handle consecutive newlines properly (#27913)
- 1e7e9ee91f path: accept special characters on Windows (#25424)
- f064e72b9b path: check return value of append_path() (#28309)
- f5eabaa940 path: restore space separation in 'path' (#25571)
- 908f247c22 plines: count 'showbreak' for virtual text at eol
- a0cbf1d8d5 plines: cursor position with 'showbreak' and resized grid (#28067)
- 317038e7cb plines: don't return very large height on very long line (#24260)
- 7955c90621 plines: folded lines with virt_lines attached to line above
- 35c3275b48 plines: handle inline virtual text after last char (#24241)
- cbadb39d16 plines.c: initialize cts_max_head_vcol (#24855)
- fc14928719 printf: make positional %zd and %zu work (#24722)
- d0b3c87219 process: avoid potential data race on exit (#27769)
- 3e569d440b process: close handles and timer in pty_process_close() (#27760)
- 268066e014 process: start pty process eof timer on main thread (#27625)
- 49983387ff prompt: emit change event for prompt newline (#28260)
- 7bd6bd1ef7 provider: cannot detect python3.12 #25316
- 61ecb3e16c provider/pythonx: import the correct module (#25342)
- 540941ef83 pum: don't position too far with resized parent grid (#23442)
- f186224dfc pum: fix missing rightmost column with 'rightleft' (#23445)
- 8bc973c6f5 pum: fix missing scrollbar with 'rightleft' (#23448)
- a7550a20e0 pum: handle right-click menu repositioning with multigrid (#26975)
- fbaa278773 pum: make :popup position correctly with float border
- a3dfe1bc89 pum: position properly with ext_multigrid (#23336)
- c1331a65dd pum: show right-click menu above cmdline area (#23298)
- dd0e77d48a query_error: multiline bug
- 5ac2e47acc redo: make redo of Lua mappings in op-pending mode work (#23566)
- 60f69014a8 redraw: multibyte characters are wrapped at the end of a line (#23696)
- cb34d0ddd0 redraw: overwrite double-width char with virt_text properly (#23708)
- d184933cdc redraw: update Visual selection properly with splits (#27343)
- 54044e6dce release.sh: ze version is too big
- cce9460524 remote: make --remote-expr print to stdout (#23980)
- bde59e8147 remote: restore previous --remote-expr output formatting (#23988)
- 468292dcb7 rpc: "grid_line" event parsing crashes (#25581)
- 4d4092ac9e rpc: assertion failure due to invalid msgpack input
- 8921d56053 rpc: do not crash when no input is consumed
- c422722b2e rpc: fix hang with channel closed while waiting for response
- adb2258345 rplugin: dont create data dir if it's a broken symlink #25726
- 65dd3c1180 ruler: show ruler of curwin with no statusline in cmdline
- f5231d61a5 runtime: add commentstring for C# ftplugin (#23039)
- 3387dc4a46 runtime: add commentstring for D ftplugin (#25362)
- 615b48aca6 runtime: add more Nvim-only highlight groups to Vim syntax
- aee6f08ce1 runtime: do not allow breakcheck inside runtime path calculation
- df297e3c2b runtime: don't set gx mapping if already mapped (#24262)
- 9176b5e10a runtime: respect 'fileignorecase' when sourcing (#24344)
- dbb840da01 runtime: respect 'rtp' order for all runtime files (#24335)
- 70a0049296 runtime: source c ftplugins in correct order (#27377)
- d431a4d410 runtime: source old color scheme in bundled color schemes (#26641)
- 3ab6f60dc8 runtime: update 'vim' color scheme to use new tree-sitter groups
- 67fba9affa runtime/tutor: don't try to close fold when there is none (#24953)
- ee56daebb6 shada: update deleted marks (#24936)
- 517dfdf0fc shada: update marks when using delmarks! (#24978)
- 4d52b0cf67 showcmd: clear the rest properly (#28420)
- fcd9905291 sign: avoid deleting from sign map while looping over it (#27158)
- a84b454ebe sign: do not error when defining sign without attributes (#26106)
- a5ade3c63d snippet: correct indent with newline
- 4625394a76 snippet: do not add extra indent on newlines (#28538)
- a1bdf2852d snippet: remove misleading comment about TM_FILENAME_BASE (#26465)
- 8c044f0862 spell: always accept ':' as filename char in 'spellfile' (#27172)
- a803bff89c spell: extmark with spell=false should disable spell (#23400)
- eceb2dffce spell: splice extmarks on :spellrepall (#23929)
- aa65bd478a startup: "nvim -l foo.lua" may not set arg0 #24161
- 628f6cce80 startup: don't truncate when printing with -l (#24216)
- c0fa721ade startup: make recovery mode work without --headless (#24477)
- 8e739af064 startup: multiprocess startuptime #26790
- 8f10362cdc startup: only send one default_colors_set event during startup
- 559c4cfd52 startup: run embedded Nvim with real path (#24282)
- b21d960119 startup: set full_screen when in ex_mode
- 9637b7dae4 startup: stop TUI properly when quitting at swap dialog (#25337)
- d7359a8742 startup: trigger UIEnter for the correct channel (#25860)
- 01e273c340 statuscolumn: don't update clicks if current width is 0 (#24459)
- afd0c648a8 statuscolumn: force full redraw when signcolumn is invalid (#24859)
- dc6c11394b statuscolumn: update number hl for each screen line (#25277)
- a4b2400804 statusline: also allow right click when 'mousemodel' is "popup*" (#23258)
- 4ecf6fdfd8 statusline: bail out properly on negative row (#23535)
- 70da793c5e statusline: corrupted screen with minwid sign item in 'statuscolumn' (#23823)
- d7bb19e013 statusline: fill for double-width char after moving items (#24207)
- 54f5602038 statusline: fix uninitialized variable and possible overflow
- 9f15a18fa5 statusline: missing offset when showing 'keymap' (#27270)
- 7b973c71ea statusline: redraw when VIsual_mode changes (#23933)
- dbc0fa9bd6 stdpath: remove duplicate directories (#26653)
- 1907abb4c2 stream: do not close handle if it is already closing (#26537)
- 9dd48f7832 substitute: properly check if preview is needed (#23809)
- 9753cda591 syntax: use correct diagnostic group for checkhealth (#23538)
- 400b7842a9 termcap: escape escapes in passthrough sequence (#26301)
- e527842211 termcap: only call callback for requested capabilities (#26546)
- ffeb31c2f9 termcap: set 'nested' on TermResponse autocommand
- b7831c7f99 termcap: use tmux passthrough sequence when running in tmux (#26281)
- e6d3f87dfd termdebug: handle partial lines passed to callback (#22950)
- c413b42c45 termdebug: prompt mode breaks with &splitbelow set
- 8aad4b8425 termdebug: send SIGINT when interrupting prompt mode
- af78060b18 termdebug: trim suffixed "\r" in CommOutput
- 684e93054b terminal: assign channel to terminal earlier (#25771)
- 82b1a389ba terminal: avoid Insert mode in Terminal buffer (#25820)
- 99288ecc77 terminal: block input when there is pending TermRequest (#27589)
- f2ce31d3dc terminal: call validate_cursor() before screen update (#24425)
- e09adfdcff terminal: check if mouse on statusline/tabline/winbar/vsep (#26892)
- e115732465 terminal: check terminal size at end of screen update (#25480)
- 120c4ec855 terminal: disable reflow again
- c881092ffe terminal: don't lose focus on <MouseMove> (#25845)
- 16a416cb3c terminal: don't pass incomplete UTF-8 sequence to libvterm (#27922)
- d0d132fbd0 terminal: don't send unknown special keys to terminal (#24378)
- 74776dfb2a terminal: fix duplicate recording with mouse click (#28103)
- 21d466c1b9 terminal: forward horizontal mouse scrolling (#24552)
- d401b33314 terminal: handle horizontal scrolling in another window (#24828)
- 5e78fd7784 terminal: ignore $VIM and $VIMRUNTIME in pty jobs
- 0a7fda6fa0 terminal: include modifiers when forwarding mouse (#24549)
- d4c2fc6ff6 terminal: keep focus when scrolling number column of another window (#25848)
- 5ca6c9e046 terminal: make backslashes in 'shell' work on Windows
- aba954b662 terminal: never propagate $COLORTERM from outer env (#26440)
- b74262a336 terminal: send Shift-Home Shift-End Ctrl-Home Ctrl-End (#24418)
- 0fd8eb8aae terminal: set $COLORTERM unconditionally in :terminal (#24763)
- fa17a5ab49 terminal: use terminal buffer for TermRequest autocommand (#26974)
- 5999214c24 termkey: accept BEL (0x07) as OSC terminator
- ce2f770aaa termkey: do not sign extend mode value
- 50f5864dd2 termkey: include IO header on Windows
- 52e6059415 test: call separate_arguments() correctly to honor $BUSTED_ARGS (#26905)
- c5528e7fd8 test: clean up inline virtual text tests a little
- 380b634ac9 test: fix "indeterminism" warnings in UI tests
- f4c97da262 test: fix strings_spec.lua for AArch64
- 477458f7bf test: more tests for marktree
- d8e330bcec test: remove test/compat.lua
- a7bbda121d test: typing
- 8861ad83fd test/tui_spec: pass the expected NULL-sentinel to execl()
- f859d16aea tests: set SHELL=sh #24941
- 3d44340cea tests: use more global highlight definitions
- e9bfbe99cd textformat: remove unnecessary changed_bytes() (#26027)
- 255e547e18 timer: allow timer_info() to get info about current timer
- a8131aee9e tohtml: replace hex escape with digit escape (#27728)
- 0246f1a897 tohtml: set filetype of generated HTML to `html`
- ccc0980f86 treesitter: Use the correct replacement args for #gsub! directive (#23015)
- 71d9b7d15c treesitter: _trees may not be list-like
- a4743487b7 treesitter: `language.add` - only register parser if it exists
- 4a8bf24ac6 treesitter: adjust indentation in inspector highlights (#26302)
- ef64e225f6 treesitter: allow foldexpr without highlights (#23672)
- 6a264e0897 treesitter: allow optional directive captures (#28664)
- cf612c64b0 treesitter: allow passing lang to vim.treesitter.get_node() now correctly takes opts.lang (#26360)
- 32849d5667 treesitter: avoid # of nil in _query_linter
- 3fd7449d5a treesitter: check that buf is loaded in autocommands (#25679)
- e7f50f43c8 treesitter: clip end row early
- 6b19170d44 treesitter: correctly calculate bytes for text sources (#23655)
- bd5008de07 treesitter: correctly handle query quantifiers (#24738)
- fba18a3b62 treesitter: do not calc folds on unloaded buffers
- c30ebb17f6 treesitter: document more standard highlight groups
- 040369e1e4 treesitter: don't forcefully open folds
- 72ed99319d treesitter: don't invalidate parser when discovering injections
- 4607807f9f treesitter: don't update fold if tree is unchanged
- 26b5405d18 treesitter: enforce lowercase language names (#28546)
- 3a8265266e treesitter: escape "\" in :InspectTree #28613
- 369f58797d treesitter: escape quotes in :InspectTree view #24582
- 6e45567b49 treesitter: fix TSNode:tree() double free (#24796)
- 50a03c0e99 treesitter: fix another TSNode:tree() double free
- 7c6f9690f7 treesitter: fix indexing in foldexpr
- 01b91deec7 treesitter: fix parens stacking in inspector display (#26304)
- f40a109716 treesitter: fix trim predicate
- 1f551e068f treesitter: fixup for InspectTree
- 26cc946226 treesitter: foldexpr tweaks
- e85e7fc7bc treesitter: handle empty region when logging (#24173)
- 12faaf40f4 treesitter: highlight injections properly
- 6f75facb9d treesitter: improve vim.treesitter.foldexpr
- 6c8387067d treesitter: inspect-tree remember opts on buf change
- 8179d68dc1 treesitter: logger memory leak
- b6e339eb90 treesitter: make InspectTree correctly handle nested injections (#26085)
- 3af59a415c treesitter: make Visual hl work consistently with foldtext (#25484)
- c7e7f1d4b4 treesitter: make foldexpr work without highlighting (#24167)
- 0211f889b9 treesitter: make sure injections don't return empty ranges (#24595)
- 0df681a91d treesitter: make tests for memoize more robust
- 7fa292c52d treesitter: outdated highlight due to tree with outdated region
- 617d1b28d6 treesitter: prefix treesitter types with vim
- 90a12d4a16 treesitter: prepare highlight states for [s, ]s
- 7e5ce42977 treesitter: properly combine injection.combined regions
- 19a793545f treesitter: redraw added/removed injections properly (#23287)
- 7a76fb8547 treesitter: remove more double recursion
- e124672ce9 treesitter: reset cursor max_start_depth
- 7d97150084 treesitter: return correct match table in iter_captures()
- 3b29b39e6d treesitter: revert to using iter_captures in highlighter
- 315c711700 treesitter: set cursor position when opening inspector
- 48085e40bb treesitter: stop() should treat 0 as current buffer #24450
- 32dc484ec9 treesitter: support subfiletypes in get_lang (#23605)
- b6fdde5224 treesitter: text alignment in checkhealth vim.treesitter
- 0f85aeb478 treesitter: treecursor regression
- 26143d7a5c treesitter: update @markup default links
- 9ff59517cb treesitter: update c queries
- c44d819ae1 treesitter: update folds in all relevant windows (#24230)
- ffb340bf63 treesitter: update folds only once on InsertLeave
- edf9a897f0 treesitter: update highlights for query (#23699)
- b697c0cd4f treesitter: update lua parser and queries (#24148)
- ad95b36985 treesitter: update markdown parser and queries (#24429)
- 39a0e6bf3c treesitter: update parsers and queries
- 3d4eb9d544 treesitter: update queries
- c97de026e3 treesitter: update vimdoc and vimscript queries
- dc7ccd6bca treesitter: use 0 as initial value for computing maximum (#27837)
- 7bc5ee7f93 treesitter: use proper query syntax for inspector (#26274)
- 00e6651880 treesitter: use tree range instead of tree root node range
- 8c9dab3e0d treesitter: use vim.highlight.priorities instead of hardcoded 100 (#24052)
- 674f2513d4 treesitter: validate language alias for injections
- 2bf3e82676 treesitter: validate window before updating preview highlights
- ab2811746e treesitter playground: fix the wrong range of a node displayed i… (#23209)
- f85aa2e67f treesitter.c: improve comments on fenv usage
- c5b9fb2f25 treesitter.foldexpr: check for all insert submodes
- b3bda2f043 tui: `space_buf` overflow when clearing screen (#27352)
- cb2b5e2780 tui: disable DECRQM and DECRQSS queries for Terminal.app (#28453)
- 405bad5e08 tui: do not toggle cursor visibility when flushing the buffer (#26055)
- b76cc974b9 tui: don't forget to update cursor visibility (#26523)
- 911f3d9623 tui: don't overwrite an assertion faliure message on exit
- 168e69ae01 tui: don't set cursor color when there is none (#28236)
- 5a08b5be3c tui: don't set tty background if &bg was set before VimEnter (#23701)
- 00b7428b3b tui: don't use DECRQSS in screen or tmux (#28086)
- 846714ca3e tui: don't use tui->params[] for 'termsync' (#26565)
- 197827321a tui: grid_clear properly clears the screen
- 884a83049b tui: grow termkey's internal buffer for large escape sequences (#26309)
- ad867fee26 tui: handle cursor visibility properly (#26091)
- fd50185492 tui: initialize clear attrs with current terminal background
- c26b39a9aa tui: make :cquit work properly with remote TUI (#25313)
- 3ae62c4706 tui: make disabling title restore old title from stack (#23585)
- 4c31a1b807 tui: make setcellwidths() work for non-ambiwidth chars (#28322)
- 4f235e3caf tui: position cursor at bottom-left before stopping (#23369)
- 0f1b511f23 tui: redraw on SIGWINCH even if size didn't change
- 8e69716953 tui: restore title before exiting alternate screen (#23776)
- 999e167a52 tui: start flush earlier (#26463)
- 367e52cc79 tui: use buflen to calculate remaining buffer size (#26942)
- 3198598e69 tui: use uv_timer_t instead of TimeWatcher for input (#26435)
- 0ce065a332 tui: v:argv does not report the original argv[0] #24015
- bc6fc0123d tutor: Tutor steps don't work on Windows #25251
- bf5703042b tutor: don't use concealed text in expected lines #24316
- e34c23b701 tutor: set a value for ":syntax iskeyword" (#27833)
- 04232a19cc type: remove incorrect arguments from vim.rpc*
- 21152f7905 types: add more annotations to eval.lua
- b7d5b55f74 types: add some return/parameter type annotations (#24867)
- e6947bb1e8 types: make filetype.add parameters optional
- 191cca2566 types: move type annotation for `IterMod`
- 813dd36b72 types: rename win_get_config return type to win_config
- b3342171d5 typing: vim.fn.execute
- 1355861b92 typval: don't treat v:null as truthy (#23281)
- 0592fd5e17 ui: "resize -1" with cmdheight=0 #24758
- ab1c2220f0 ui: activating all ext capabilities without remote UI #28555
- 5b111a8f00 ui: adjust 'smoothscroll' for inner dimensions
- 389f5ca39d ui: adjust the cursor when inserting virtual text
- 046c9a83f7 ui: always use stl/stlnc fillchars when drawing statusline (#25267)
- 0c86828ac5 ui: avoid ambiguity about chunk that clears part of line (#24982)
- e778e01161 ui: avoid recursiveness and invalid memory access #28578
- 0ce3910868 ui: cursor pos with left gravity inline virt_text at eol (#24329)
- 91a4938edf ui: data corruption in remote_ui_raw_line
- 1de82e16c1 ui: delay win_viewport until screen update #24182
- a916523574 ui: doesn't trigger au event when enter is false
- b5a38530ba ui: don't force 'cmdheight' to zero with ext_messages
- fdc8e966a9 ui: don't send empty grid_line with redrawdebug=compositor (#23899)
- 13f55750e9 ui: empty line before the next message after :silent command
- d41b8d4758 ui: ext_cmdline should not move cursor to curwin
- a38d7f9984 ui: fix cursor position with multiple inline virtual text
- e0707d3529 ui: fix edge case around flushing
- 75f350aac6 ui: fix incorrect highlighting when virtual text next to match
- 332b70d2ed ui: fix incorrect highlighting when virtual text wraps with number
- 0c7fa3bdcc ui: fix multi-byte characters highlight in virtual text
- a37c990483 ui: fix overflowing nowrap virtual text not displaying if tab follows
- 5d7afb2e9f ui: fix tabs not being spaced properly after virtual text with no wrap
- 34d862942c ui: fix virtual text not displaying when two overlapping inlines (nowrap)
- c5bf838f8a ui: fix visual and search highlighting interfering with virtual text
- 1936285d98 ui: fixes incorrect rendering when virtual text is not visable and nowrap
- 64e8a3c4d1 ui: handle virtual text with multiple hl in more cases (#25304)
- 981acc2922 ui: propagate line wrapping state on grid_line events
- b8c1b36061 ui: set 'cmdheight' to zero for all open tabpages
- a8522f02e9 ui: startup intro message should be visible with ext_multigrid
- 1cd7824dd6 ui: trigger TabNewEntered after split new tab
- 7626f431d8 ui: update ext_ui widgets when attaching non-remote UI
- 128091a256 ui: wrong cursor position with left gravity inline virt text at eol
- a9418ef8cf ui: wrong display with 0-width inline virt_text at eol (#24854)
- e8b3ed74bc ui-ext: "scroll_delta" handle topfill and skipcol (#24249)
- 43d66c0ebb ui-ext: send title to newly-attached UI
- 519b9929e9 ui.open: some URLs fail on Windows
- 4d654472e6 ui_client: check return code of dup()
- 633bf61d3b ui_client: check return value of channel_job_start (#27729)
- 71ad771ea4 ui_compositor: only reset skipstart at first column (#24776)
- 840749d6c9 undo: fix crash caused by checking undolevels in wrong buffer
- c0a29931e2 unhide: close floating windows first (#25318)
- 9afbfb4d64 unittests: ignore __s128 and __u128 types in ffi
- 9e79f7433e usercmd: Fix buffer overflow in uc_list() (#23225)
- 9802de9334 userfunc: fix possible out of bound access
- 5a8fe0769c vim.deprecate: show deprecation warning in devel versions as well
- ca6dbf3558 vim.iter: use correct cmp function when truncating tail in `take` (#27998)
- e15991c811 vim.json: properly treat luanil options as booleans (#28622)
- fec5e3ab24 vim.region: handle multibyte inclusive selection properly (#26129)
- 2afb04758c vim.system: close check handle (#24270)
- 9b7cf4f0be vim.system: don't process non-fast events during wait() (#27300)
- a44521f46e vim.system: let on_exit handle cleanup after kill
- 6d5f12efd2 vim.system: make timeout work properly
- 57adf8c6e0 vim.ui: open() may wait indefinitely #28325
- e644e7ce0b vim.ui.open: return (don't show) error message
- fd085d9082 vim.ui.open: try wslview before explorer.exe #28424
- 5e4a5f1aaa vim.ui.open: use explorer.exe instead of wslview #26947
- 6cc76011ca watchfiles: skip Created events when poll starts (#23139)
- 9bd4a28079 window: :close crash if WinClosed from float closes window (#27794)
- 731e7f51ee window: :close crash with autocmd, floats and tabpage (#27793)
- 33dfb5a383 window: :close may cause Nvim to quit with autocmd and float
- 2cbfa4b9af window: don't go to unfocusable float when closing (#28455)
- a47be0b2d9 window: prevent win_size_restore from changing cmdheight
- 4bfc7802f0 windows: set stdout to binary mode for --api-info

PERFORMANCE
--------------------------------------------------------------------------------
- a9c551e5e3 cache breakindent/showbreak width in win_lbr_chartabsize
- b5653984e5 don't decode utf8 character multiple times in getvcol()
- cca8a78ea2 improve utf_char2cells() performance (#27353)
- 2f2f12122f remove loop for computing last position in getvcol()
- 32a4c9f4f9 remove redundant strlen in skipwhite (#26177)
- cdf848a314 reuse fast character size calculation algorithm from getvcol()
- 2289ca273c column: avoid counting when max signs are removed from a range
- 4a34da82c1 column: keep track of number of lines that hold up the 'signcolumn'
- f4001d27ef column: only invalidate lines affected by added sign
- 7f084770c2 diagnostic: avoid table copies to filter by severity (#28491)
- 1cb6040554 events: store autocommands in flat vectors (#23256)
- 9af2be292d extmarks: add metadata for efficient filtering of special decorations
- 929e1b7f1c extmarks: avoid unnecessary invalidations for virt_text (#27435)
- 19fb573ad9 extmarks: avoid unnecessary marktree traversal with folds (#24306)
- d44ed3a885 extmarks: better track whether namespace has extmarks (#28615)
- ef94fb69c6 extmarks: don't handle inline virt_text if there is none (#24322)
- 8bb67d64e2 fs: normalize path only once in fs.dir
- 40db569014 iter: make ListIter.totable more efficient (#23714)
- ef1801cc7c iter: reduce number of table allocations
- dcdefd0428 loader: use a quicker version of vim.fs.normalize
- 648f777931 lsp: load buffer contents once when processing semantic tokens responses (#23484)
- 2f4792943a lsp: only joinpath for dirs in watchdirs
- edf05b005f lsp: process semantic tokens response in a coroutine that yields every 5ms (#23375)
- 79a5b89d66 lsp: reduce polling handles for workspace/didChangeWatchedFiles (#23500)
- 4d3a04279d lsp: remove grouping logic from lsp.status (#24096)
- de28a0f84c lsp: replace file polling on linux with per dir watcher  (#26108)
- 7e97c773e3 lsp: use async fs_stat for file watching on linux (#26123)
- cdd87222c8 lua: avoid spairs in vim.validate happy path
- c5af5c0b9a lua: faster vim.deprecate() #28470
- c5990f2cdc os/env: os_getenv() allocation when there is no env var set
- 18e62c1bdb redraw: only redraw Visual area when cursor has moved (#27340)
- 94085cfce8 redraw: reduce redraw with undo and extmarks or 'spell' (#27442)
- 516b173780 rtp: reduce rtp scans (#24191)
- 0e11bf0e1a substitute: don't reallocate new_start every time (#24997)
- 4fd852b8cb treesitter: cache fold query (#24222)
- 07080f67fe treesitter: do not scan past given line for predicate match
- c0cb1e8e94 treesitter: filter out trees outside the visible range early
- 2b6c9bbe7f treesitter: incremental foldupdate
- 3ba930844c treesitter: insert/remove items efficiently (#23443)
- a76b689b47 ui-ext: approximate scroll_delta when scrolling too much (#24234)
- 0d1bc795f8 ui_client: skip some initialization not necessary for ui client
- 14a5813c20 vim.fs.normalize: use iterator

BUILD
--------------------------------------------------------------------------------
- c1ff216668 actually export symbols on mac
- 664f2749e6 add "ci" configure preset to reduce verbosity
- 1094d0c0db add CMAKE_C_FLAGS to --version output
- 1290121722 add CMakePresets for deps build to reduce verbosity
- ce6075f82a add check to clint to prevent non-defs header includes
- 624de849de add function add_target
- 82bb7bbc48 add luajit runtime files when installing (#23514)
- 831d662ac6 add sub-targets to the doc target
- 1bf29a0ae1 add system lua include dir for lpeg
- 4cc69f45b4 add ubsan default options
- 4880385809 adjust clang-tidy warning exclusion logic
- b80a8e2c16 adjust how find order is prioritized
- d561830a52 align .clang-format rules with uncrustify config
- c18d7941ef allow sccache as compiler cache
- cd097ab8cc allow using system rocks
- 54d357dce0 bump lpeg to 1.1.0 (#25016)
- 7840760776 bump minimum cmake version to 3.13
- 7a5effb0f9 bump required minimum libvterm version to 0.3.3
- 2835b0daad bump uncrustify to version 0.77
- 77c0d5415b bump uncrustify to version 0.78.1
- 87a45ad9b9 bump uncrustify to version 0.79.0 (#28756)
- 1798a4b5e9 bump uncrustify version
- 826b95203a bundle uncrustify
- 37bc73e9bc change dependency URLs to cache variables
- 1086016477 cmake cleanup
- 404fdb0f36 cmake fixes
- f8310beeed create BINARY_LIB_DIR directory before adding parser
- 9909668111 create a text file for specifying dependency information
- 5a7280ba68 create helper function for simplifying luarocks installation
- f936a962d0 create separate targets for nvim with and without runtime files
- bcaff309b6 disable UnusedIncludes from clangd
- 7a80e169c5 disable all compiler warnings from dependencies
- 8fdc84d0aa disable conversion warnings for GCC
- 310fb2efc3 disable conversion warnings for older GCC versions
- a1c2da56ec do not use GIT_REPOSITORY for local dependencies
- da2130934b don't allow Xcode as generator
- 543e0256c1 don't define FUNC_ATTR_* as empty in headers (#26317)
- 24b60b0f71 don't format deleted files
- c2e47e7bec don't print installed files locally
- f30844008b download busted from own neovim/deps repository
- 5abba97d77 download dependencies with unreliable mirrors from deps repo
- 71384129f7 download libiconv and gettext from `deps` repository
- 801ac2accb drop diff.exe from windows builds
- f0eb3ca916 eliminate semicolons from --version string
- 397b92e02d enable ASAN for MSVC
- 40139738eb enable IWYU on mac
- 25cfe3fd43 enable formatting during rebase
- 517f0cc634 enable lintlua for scripts/ dir #26391
- 45fe4d11ad enable lintlua for src/ dir #26395
- 59d117ec99 enable lintlua for test/ dir
- c3836e40a2 enable lintlua for test/unit/ dir #26396
- 03c3f7887d enforce PREFER_LUA
- 7cb29a572b ensure `make clean` doesn't remove source files
- 0a3645a723 find system luv on ubuntu
- 5bb17958c5 fix "make iwyu" not working (#24873)
- 12ccea5967 fix --luamod-dev not working properly (#24519)
- 75b80516d5 fix link error for `_BitScanForward64` (#28173)
- 3f188bc533 fix parser installation location
- 4fb1739e6f fix uncrustify
- 896b400bff fix universal mac builds
- 01e4a70d66 improve git-cliff CHANGELOG output
- ef92b5a994 include all dependency directories when generating headers
- 187ae67735 introduce variable DEPS_IGNORE_SHA for skipping dependency hash check
- 30a0299bc6 make dependency URL variables non-cached (#23577)
- b4da4783f9 make genappimage.sh work with existing CMAKE_INSTALL_PREFIX
- 9f9cef1b56 make lpeg an imported library
- c1a05f6112 make the vimdoc generation depend on the nvim target (#25876)
- 8b8e607284 move luarocks and rocks installation to main build
- d1bb9bffd5 remove BUSTED_PRG dead code (#23340)
- 8206954a67 remove LOG_DEBUG option
- c48f94d1f3 remove LOG_LIST_ACTIONS option and related code
- 353a4be7e8 remove PVS
- 88366641ad remove USE_BUNDLED_BUSTED option
- ca243f06dd remove `lintdoc` from `lint` target
- 675522af18 remove clint checks and style text covered by uncrustify
- 8be24fed8f remove config-specific find_package search for libuv
- c40872acbd remove duplicate include directories in --version output
- ebb10d6248 remove functionaltest-lua target
- 8ae39eb584 remove git requirement
- 9f8f287c61 remove luarocks
- 339011f59c remove uninstall target
- c8fd82b26d reorder compiler option setting
- 78239f0bbc reorganize cmake files
- 55793bcfa1 revert accidental permission changes (#23319)
- f31f260f0c rework --version generation
- a827003e30 rework IWYU mapping files
- e5d7003b02 rework formatting to use add_glob_target
- 1997ef134a set char to always be signed
- a75ef40f4c set deps default build type to Release (#27495)
- a1550dbf0a silence new clang-tidy warnings
- 383018dbb8 simplify policy-setting for dependencies
- 4788abf2da stop installing parser.h from treesitter
- 26033eee1d suppress bugprone-reserved-identifier warnings
- 34509bbea3 sync IWYU and clint to ignore the same headers (#26228)
- 0a8e66898d update builtin terminfo (#27272)
- a388c852c4 update libtermkey commit
- 706f871014 update uncrustify to 0.76
- f4136c9d42 use -O3 optimization for release builds
- 2c1e8f7e96 use `GIT_REPOSITORY` for local URLs
- e0d97d264f use built nvim artifact to generate eval files (#25875)
- 3d3717de4e use libvterm commit with generated *.inc files
- 4f526b9fd8 use neovim/libtermkey instead of neovim/deps for libtermkey
- 8405649f92 use neovim/libvterm instead of neovim/deps for libvterm
- 2a57613b9b use stylua with add_glob_target
- ae3eed53d6 various build improvements
- c8667c8756 various cmake fixes
- 5cefec7349 various cmake fixes
- bec2ebebda various cmake fixes
- c50951a4d0 various fixes
- 4c91194611 various fixes
- bf0be0f63e various improvements
- 404043e74c vendor libtermkey
- e38a053692 IWYU: export generated headers
- 71141e8cf5 IWYU: fix headers for arabic.h
- 8b428ca8b7 IWYU: fix includes for func_attr.h
- f4aedbae4c IWYU: fix includes for undo_defs.h
- 17d81ac2ab IWYU: map everything in the C99 specification
- c2a5105e88 IWYU: remove arabic_defs.h (#26235)
- 38a20dd89f IWYU: replace most private mappings with pragmas (#26247)
- 09541d514d IWYU: replace public-to-public mappings with pragmas (#26237)
- 39771b2238 Makefile: add nvim to oldtest phony target
- 6823fdb20b PVS: exclude build directory
- 5d387c3388 ci: ensure correct headers are used on macOS
- dcb11c1091 clint: don't allow INIT() in non-header files (#27407)
- c98ef2d7c6 clint: fix deprecation and linter warnings
- 7e2387f41b clint: more precise check for "defs" headers (#26236)
- cf8b2c0e74 iwyu: add a few more _defs.h mappings (#25435)
- 5f03a1eaab lint: remove unnecessary clint.py rules
- eecddd2416 lint: use stylua without add_glob_target
- 25e51d393a lua: vendor coxpcall
- 4dc86477b6 luarc.json: disable luadoc-miss-see-name #24108
- fd9ac5aa8e makefile: remove a phony target uninstall (#24349)
- 978962f9a0 release.sh: regenerate docs after changing NVIM_API_PRERELEASE (#28229)
- 9ca81b0259 release.sh: set VIMRUNTIME when regenerating docs (#28765)
- 4399c4932d release.sh: use git cliff, drop old script
- d0ae529861 scripts: allow a git ref for lsp_types #24377
- bfb81e1a85 snap: remove obsolete snapcraft.yaml
- 981301d11f terminfo: include user capabilities in comments (#28066)
- 6801befcc5 uninstall: don't build if installation manifest not found
- 345dcba629 windows: set longPathAware in manifest #28389
2024-05-16 14:34:32 +02:00
83a32e2d98 fix(test): failure after version bump #28771
Problem:
- The test for vim.deprecate() has a "mock" which is outdated because
  vim.deprecate() no longer uses that.
- The tests get confused after a version bump.

Solution:
Make the tests adapt to the current version.
2024-05-16 05:33:04 -07:00
b5c3687b6d docs: misc (#28761)
Co-authored-by: Florian Zeitz <florob@babelmonkeys.de>
2024-05-16 17:37:46 +08:00
668b5fc155 docs: nvim.appdata.xml, set faq to "flow" layout #28769 2024-05-16 01:53:33 -07:00
174da7fe68 docs(gen_help_html.lua): fix broken pre text, and handle linewrap
Problem:

- Since #28678, pre-formatted text in the online documentation do not
  render whitespaces correctly: should be pre-like text, but shown like
  normal paragraph (see #28754).

- Code blocks with long lines should not be wrapped (e.g. see
  |dev-vimpatch-list-management|).

Solution:

- Use `white-space: pre-wrap`. Compared to `white-space: pre`, this
  option will make long lines including a very long URL wrapped.
  This properly fixes #28754 and #28678.

- Use horizontal scrollbar for the code blocks that are horizontally too
  long, instead of wrapping text. This will make the code easy to read
  while the pre-text block not interfering with the navigation bar.
2024-05-16 09:01:05 +02:00
618e34ca09 vim-patch:5faeb60480c6 (#28768)
runtime(doc): clarify {special} argument for shellescape()

closes: vim/vim#14770

5faeb60480

N/A patch:
vim-patch:c0e038b59f84

Co-authored-by: Enno <Konfekt@users.noreply.github.com>
2024-05-16 14:29:56 +08:00
9ca81b0259 build(release.sh): set VIMRUNTIME when regenerating docs (#28765) 2024-05-16 07:21:19 +08:00
7c13d1a4a8 Merge #28747 from justinmk/doc 2024-05-15 15:44:10 -07:00
4399c4932d build(release.sh): use git cliff, drop old script 2024-05-16 00:19:17 +02:00
54044e6dce fix(release.sh): ze version is too big 2024-05-16 00:19:17 +02:00
007adde199 vim-patch:fed01960d2b0 (#28764)
runtime(doc): add missing entries for the keys CTRL-W g<Tab> and <C-Tab>

fixes: vim/vim#14777

fed01960d2

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-05-16 06:07:17 +08:00
acaac07b64 vim-patch:9.1.0413: smoothscroll may cause infinite loop (#28763)
Problem:  smoothscroll may cause infinite loop, with
          very narrow windows
          (Jaehwang Jung, after v9.1.0280)
Solution: Check for width1 being negative, verify
          that win_linetabsize does not overflow

fixes: vim/vim#14750
closes: vim/vim#14772

eff20eb35d

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-05-16 05:36:24 +08:00
01b6bff7e9 docs: news
Set dev_xx.txt help files to use "flow" layout.
2024-05-15 23:19:26 +02:00
cdd87222c8 perf(lua): avoid spairs in vim.validate happy path
Problem:

`vim.validate` is too slow, mainly because of `vim.spairs`.

Solution:

Collect all errors in via `pairs`, and sort the errors via `spairs`.
2024-05-15 13:48:29 +01:00
ffb4b50e74 docs(lua): restore missing indexing for vim.bo and vim.wo (#28751) 2024-05-15 19:39:35 +08:00
61a0aa6c51 fix(messages): avoid passing negative length to strnlen() (#28753)
Problem:  Compiler warning when building Nvim in Release mode:

    In function ‘msg_puts_display’,
        inlined from ‘disp_sb_line’ at **/src/nvim/message.c:2647:5:
    **/src/nvim/message.c:2165:18: warning: ‘strnlen’ specified bound 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overread]
     2165 |     size_t len = strnlen(str, (size_t)maxlen);
          |                  ^

Solution: Use strlen() when maxlen is negative.
2024-05-15 19:38:50 +08:00
14a5813c20 perf(vim.fs.normalize): use iterator
~10% faster.
2024-05-15 12:38:26 +01:00
dcdefd0428 perf(loader): use a quicker version of vim.fs.normalize
Problem:

vim.fs.normalize() normalizes too much vim.loader and is slow.

Solution:

Make it faster by doing less. This reduces the times spent in
vim.fs.normalize in vim.loader from ~13ms -> 1-2ms.

Numbers from a relative benchmark:
- Skipping `vim.validate()`: 285ms -> 230ms
- Skipping `path_resolve_dot()`: 285ms -> 60ms
- Skipping `double_slash`: 60ms -> 35ms
2024-05-15 12:38:26 +01:00
87a45ad9b9 build: bump uncrustify to version 0.79.0 (#28756)
new non-default option `sp_string_string = force`
2024-05-15 12:28:19 +02:00
7acf39ddab docs: misc (#28609)
Closes https://github.com/neovim/neovim/issues/28484.
Closes https://github.com/neovim/neovim/issues/28719.

Co-authored-by: Chris <crwebb85@gmail.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Jake B <16889000+jakethedev@users.noreply.github.com>
Co-authored-by: Jonathan Raines <jonathan.s.raines@gmail.com>
Co-authored-by: Yi Ming <ofseed@foxmail.com>
Co-authored-by: Zane Dufour <zane@znd4.me>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-05-15 07:18:33 +08:00
b83d5fabc6 ci(labeler): adjust configuration 2024-05-14 19:45:51 +02:00
5eee633c97 fix(lsp): don't start additional client if attach failed (#28744)
If a client for a server was already running and lsp.start was called in
an unloaded buffer it started another client instead of bailing out.
2024-05-14 19:38:22 +02:00
6a264e0897 fix(treesitter): allow optional directive captures (#28664) 2024-05-14 09:14:43 -05:00
6818ba271c fix(health): clients may not support watchfiles #28710 2024-05-14 07:08:13 -07:00
abd2352bd8 feat(lsp): update LSP protocol 3.18 typings to date (#28730)
Make the LSP protocol typings up-to-date with LSP protocol (upcoming)
version 3.18, before and in preparation for the Nvim 0.10.0 release.
2024-05-14 08:33:03 -05:00
ebba7ae095 docs(gen_help_html.lua): wrap legacy help at word-boundary #28678
Problem:
On the page: https://neovim.io/doc/user/dev_vimpatch.html
The links extend beyond the container and thus end up behind the navigation to the right.

Solution:
Add these lines to get_help_html.lua:

    white-space: normal;
    word-wrap: break-word;
2024-05-14 04:23:43 -07:00
2f4792943a perf(lsp): only joinpath for dirs in watchdirs
Doesn't have a huge impact, but showed up in profile output using
`require("jit.p").start("i1", "/tmp/profile")`

before:

    31%  joinpath
    25%  fs.lua:0
    13%  normalize
    13%  skip
     8%  _watchfunc
     5%  gsplit
     3%  spairs

after:

    34%  skip
    29%  fs.lua:0
    12%  joinpath
     7%  normalize
     5%  _watchfunc
     5%  spairs
2024-05-14 09:42:42 +01:00
8bb67d64e2 perf(fs): normalize path only once in fs.dir
Re-normalizing a path after a `joinpath` isn't necessary. Calling
`normalize` on each child directory had quite a bit of impact when
traversing a large directory.

A simple test showed:

Before: ~144ms
After: ~80ms

running the following logic against a dir with 4367 child folders and
25826 files:

    local files = {}
    local start = uv.hrtime()
    for name, type in vim.fs.dir(path, { depth = max_depth }) do
      table.insert(files, { name, type })
    end
    local duration = uv.hrtime() - start

Relates to https://github.com/neovim/neovim/issues/23291
2024-05-14 09:42:10 +01:00
e889f6781b vim-patch:7961210b861c
runtime(python): Fix wrong define regex in ftplugin (vim/vim#14763)

7961210b86

Co-authored-by: Tom Picton <tom@tompicton.com>
2024-05-14 08:27:30 +02:00
bb789bd872 vim-patch:86f6e2c2eed7
ftplugin(python): E16 fix, async keyword support for define (vim/vim#14751)

This change includes the following changes:
- Fix "E16: Invalid range" when using a count with jump to start/end of class/method
- Update define with optional async keyword
- Update maintainer email

86f6e2c2ee

Co-authored-by: Tom Picton <tom@tompicton.com>
2024-05-14 08:27:30 +02:00
ccc0b750b7 vim-patch:43f2edc096cb
runtime(netrw): prefer scp over pscp

regression introduced in ce2ad9ffd79fe6b2307cd46b9

The current logic is a bit funny, in that it checks for an executable of
scp, then pscp and if neither exists, it uses: scp :/
Anyway, let's fall back to the logic used before the above commit.

related: vim/vim#14739

43f2edc096

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-05-14 08:27:17 +02:00
025e2e07d9 vim-patch:679f5abb9930
runtime(i3config/swayconfig): allow indented commands (vim/vim#14757)

fixes: vim/vim#14752

679f5abb99

Co-authored-by: Josef Litoš <54900518+JosefLitos@users.noreply.github.com>
Co-authored-by: jamespeapen <jamespeapen@users.noreply.github.com>
2024-05-14 08:27:17 +02:00
a0a189a8ed test: fix incorrect function import (#28735) 2024-05-14 08:39:37 +08:00
e3ec974324 refactor(lua): remove deprecated features #28725 2024-05-13 05:00:39 -07:00
b6fdde5224 fix(treesitter): text alignment in checkhealth vim.treesitter
Problem: The column width 10 for parser name (lang) is too short.
For example, `markdown_inline` has 15 characters, which results in a
slight misalignment with other lines.

e.g. it looked like:

```
- OK Parser: markdown   ABI: 14, path: .../parser/markdown.so
- OK Parser: markdown_inline  ABI: 14, path: .../parser/markdown_inline.so
- OK Parser: php        ABI: 14, path: .../parser/php.so
```

Solution: Use column width 20. As of now, the longest name among those
available in nvim-treesitter has length 18 (`haskell_persistent`).

e.g.:

```
- OK Parser: markdown             ABI: 14, path: .../parser/markdown.so
- OK Parser: markdown_inline      ABI: 14, path: .../parser/markdown_inline.so
- OK Parser: php                  ABI: 14, path: .../parser/php.so
```
2024-05-13 09:19:54 +02:00
c7958356be Merge #28432 nvim_win_xx_ns are EXPERIMENTAL 2024-05-12 15:07:10 -07:00
97c7646501 refactor(api): nvim_win_xx_ns are EXPERIMENTAL
Problem:
The nvim_win_xx_ns function family introduced in ba0370b1d7
needs more bake-time. Currently it's narrowly defined for windows, but
other scopes ("buffer") and features are likely in the future.

Solution:
- Rename the API with double-underscore to mark it as EXPERIMENTAL.

TODO/FUTURE:
- Rename and change the signature to support more than just "window"
  scope, and for other flexibility.
- Open question: we could choose either:
  - "store scopes on namespaces", or
  - "store namespaces on scopes (w:/b:/…)"
2024-05-12 23:53:24 +02:00
8f0a166da4 refactor(api): rename nvim_win_remove_ns
Problem:
nvim_win_remove_ns does not follow `help dev-naming` API naming conventions.

Solution:
Rename it.
2024-05-12 23:41:00 +02:00
d8b395b10f Merge pull request #28717 from bfredl/rpcmsg
fix(ui): data corruption in remote_ui_raw_line
2024-05-12 19:22:45 +02:00
91a4938edf fix(ui): data corruption in remote_ui_raw_line
This particular repro is quite niche but there could be other cases,
whenever the the second last cell plus the "fill" cell togheter are too
complex
2024-05-12 12:19:29 +02:00
4e5c633ed4 fix(api): make getting explicit empty hl in virtual text work (#28697) 2024-05-12 05:39:33 +08:00
c1396afa7c ci(build): use latest over explicit image version
These jobs should be safe to just use the latest as there's not many
moving parts as opposed to `test.yml`.
2024-05-11 12:58:35 +02:00
e1a81c8d8b vim-patch:9.1.0407: Stuck with long line and half-page scrolling (#28704)
Problem:  No scrolling happens with half-page scrolling with line
          filling entire window when 'smoothscroll' is disabled.
          (Mathias Rav, after v9.1.0285)
Solution: Adjust amount to move cursor by so that it is moved the same
          number of lines as was scrolled, even when scrolling different
          number of lines than requested with 'nosmoothscroll'.

58448e09be
2024-05-11 18:17:57 +08:00
7a03cd1dba vim-patch:1c5728e0c4a9 (#28703)
runtime(doc): update and remove  some invalid links

closes: vim/vim#14748

1c5728e0c4

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-05-11 18:14:03 +08:00
14693353d5 vim-patch:9.1.0406: Divide by zero with getmousepos() and 'smoothscroll' (#28701)
Problem:  Divide by zero with getmousepos() and 'smoothscroll'.
Solution: Don't compute skip_lines when width1 is zero.
          (zeertzjq)

closes: vim/vim#14747

031a745608
2024-05-11 17:46:22 +08:00
854c362cc8 vim-patch:b23c1fc59650 (#28702)
runtime(doc): Add Makefile for the Vim documentation on Windows (vim/vim#13467)

* Makefile for the Vim documentation on Windows

* Corrected comments

b23c1fc596

Co-authored-by: Restorer <69863286+RestorerZ@users.noreply.github.com>
2024-05-11 17:43:23 +08:00
6ec6fafd66 vim-patch:c16c4a21eb39
runtime(netrw): Recursively delete directories by default with netrw delete command

closes: vim/vim#14742

c16c4a21eb

Co-authored-by: Nir Lichtman <nir@lichtman.org>
2024-05-11 09:52:03 +02:00
7f500289eb vim-patch:d3952e8cfe7b
runtime(java): Strive to remain compatible for at least Vim 7.0 (vim/vim#14744)

Also:

- Limit all look-behind regexp patterns.
- Cache regexp capabilities for [:upper:] and [:lower:].

d3952e8cfe

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-05-11 09:52:03 +02:00
a6873450b9 vim-patch:9.1.0402: filetype: mdd files detected as zsh filetype
Problem:  filetype: mdd files detected as zsh filetype
Solution: detect '*.mdd' files as sh filetype, add links
          to reference documentation (Wu, Zhenyu)

closes: vim/vim#14741

63f2a5b8ad

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-05-11 09:13:57 +02:00
a9fd17e232 vim-patch:9.1.0401: filetype: zsh module files are not recognized
Problem:  filetype: zsh module files are not recognized
Solution: Detect '*.mdh' and '*.epro' as C filetype, '*.mdd' as zsh
          filetype, determine zsh-modules '*.pro' from from it's content
          (Wu, Zhenyu)

closes: vim/vim#14737

887a38cee7

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-05-11 09:13:57 +02:00
8c7a8be274 fix: transposed xcalloc arguments (#28695) 2024-05-11 08:11:15 +08:00
a2c158ad06 Merge pull request #28676 from luukvbaal/tuiflush
fix(tui): initialize clear attrs with current terminal background
2024-05-10 20:01:17 +02:00
17d8f3b32a vim-patch:06bdac158072
runtime(java): Stop handpicking syntax groups for @javaTop (vim/vim#14727)

* runtime(java): Stop handpicking syntax groups for @javaTop

Also:

- Remove the obsolete comment for g:java_allow_cpp_keywords.
- Remove the commented out groups java\%[Debug\]StringError.
- Infer and set the preferred formatting Vim options from
  the modeline.

Since vim-6-0u, non-contained syntax groups can be referred
to by using the "contains=TOP..." argument.

* Set &encoding and &termencoding to "utf-8" for test files

* Limit non-ASCII charset to [§ƒɐɘʬʭΑ-Τα-μ] for test files

06bdac1580

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-05-10 18:26:35 +02:00
c1a95d9653 fix(lsp): disable didChangeWatchedFiles on Linux
Problem:

The file watcher backends for Linux have too many limitations and
doesn't work reliably.

Solution:

disable didChangeWatchedFiles on Linux

Ref: #27807, #28058, #23291, #26520
2024-05-10 14:59:44 +01:00
fd50185492 fix(tui): initialize clear attrs with current terminal background
Problem:  Invalidated regions that are flushed during startup are
          cleared with unitialized "clear_attrs", which is perceived as
          flickering.
Solution: Initialize "clear_attrs" with current terminal background color.
2024-05-10 14:13:02 +02:00
ca735c7554 vim-patch:cb3691811be9 (#28684)
runtime(spec): add new items to scripts section in syntax plugin

- %generate_buildrequires — added in RPM 4.15
- %conf — added in RPM 4.18

closes: vim/vim#14723

Ref: https://rpm-software-management.github.io/rpm/manual/spec.html#build-scriptlets

cb3691811b

Co-authored-by: Maxwell G <maxwell@gtmx.me>
2024-05-10 06:12:09 +08:00
a7a9b205b5 vim-patch:ce2ad9ffd79f
runtime(netrw): Remove hardcoded private.ppk logic from netrw

closes: vim/vim#14739

ce2ad9ffd7

Co-authored-by: Nir Lichtman <nir@lichtman.org>
2024-05-10 00:05:52 +02:00
c18d7941ef build: allow sccache as compiler cache
Also enable caching for dependencies.

Closes https://github.com/neovim/neovim/issues/28670
2024-05-09 16:39:45 +02:00
d3fa88b70f vim-patch:9.1.0396: filetype: jj files are not recognized (#28672)
Problem:  jj files are not recognized
Solution: recognize '*.jjdescription' files as jj filetype
          (Gregory Anders)

See: https://github.com/martinvonz/jj

closes: vim/vim#14733

6a4ea471d2
2024-05-08 18:39:18 -05:00
9b1628da98 vim-patch:1e34b95e4402
runtime(netrw): Remove and cleanup Win9x legacy from netrw

closes: vim/vim#14732

1e34b95e44

Co-authored-by: Nir Lichtman <nir@lichtman.org>
2024-05-09 00:15:08 +02:00
e4e230a0cd vim-patch:9.1.0397: Wrong display with 'smoothscroll' when changing quickfix list (#28674)
Problem:  Wrong display with 'smoothscroll' when changing quickfix list.
Solution: Reset w_skipcol when replacing quickfix list (zeertzjq).

closes: vim/vim#14730

c7a8eb5ff2
2024-05-09 06:11:56 +08:00
064f3e42e8 refactor(change): check all tabpages in changed_lines_invalidate_buf() (#28666)
This most likely doesn't matter as all windows are redrawn when
switching tabpages and w_valid is reset is entering window, but still
check all tabpages for consistency with changed_common().
2024-05-08 14:00:45 +08:00
17c89eac1a vim-patch:c5def6561d56
runtime(cpp): Fix digit separator in syntax script for octals and floats

Also fix the incorrect rendering of floats that start with ".".

closes: vim/vim#14724

c5def6561d

Co-authored-by: Wu Yongwei <wuyongwei@gmail.com>
2024-05-07 23:23:04 +02:00
69bd611d2d Merge #28637 more support for vim.lsp.ListOpts.loclist 2024-05-07 12:56:39 -07:00
5c40f3e86a feat(lsp): support vim.lsp.ListOpts.loclist in location_handler() 2024-05-07 21:34:28 +02:00
b0cc85c005 docs(lsp): document vim.lsp.ListOpts.loclist 2024-05-07 21:27:21 +02:00
80d108eeee refactor(lsp): use vim.cmd instead of api.nvim_command
As suggested in
https://github.com/neovim/neovim/pull/28483#discussion_r1586878457 and
https://github.com/neovim/neovim/pull/28483#discussion_r1586878226
2024-05-07 21:27:18 +02:00
cdc0974063 docs(lsp): fix type annotations in response_to_list(...) 2024-05-07 20:20:35 +02:00
6ffc209a8a refactor(lsp): move repeated table construction into a variable
As suggested in https://github.com/neovim/neovim/pull/28483#discussion_r1581712828
2024-05-07 20:20:35 +02:00
e14e750998 fix(lsp): rename LspProgress data.result => data.params #28632
Rename the field `result` to `params` in the `data` table for
`LspProgress` autocmds. This aligns with LspNotify.

The previous name was chosen because the initial handler implementation
mistakenly had a parameter name `result` instead of `params` for the
`$/progress` LSP "notification" handler. However, `params` would be a
more appropriate name that is more consistent with the underlying LSP
type (`ProgressParams`).

See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#progress
2024-05-07 11:09:27 -07:00
3da251efc6 refactor(lsp): use vim.is_callable() 2024-05-07 19:55:09 +02:00
4e5086a67e refactor(lsp): s/options/opts for parameters in vim.lsp.buf
See https://github.com/neovim/neovim/pull/28483#discussion_r1583344120
2024-05-07 19:55:09 +02:00
e7f50f43c8 fix(treesitter): clip end row early
Problem:
UINT32_MAX + 1 passed to vim._foldupdate.

Solution:
Clip the end row from treesitter asap to avoid such issues.
2024-05-07 14:36:55 +01:00
4caf71af58 refactor(fold): avoid coverity false-positive
Also add some more argument checks.
2024-05-07 14:36:55 +01:00
93940af1d4 docs(luacats): support backtick captured generic type
Problem:
While LuaCATS's generics system are still considered WIP by luals, they
currently support type captured generics.

See "Capture with Backtick" example:
https://luals.github.io/wiki/annotations/#generic

Solution:
Add support for it in the LuaCATS grammar
2024-05-07 14:33:14 +01:00
c3c673cdec fix(lsp): enable() does not activate inlay hints on open buffers #28629
Problem:
inlay_hint `enable(<no args>)` does not activate inlay hints on open
buffers. If a buffer does not have a corresponding `bufstate` in
`bufstates`, then `enable` all buffers will not take effect on it.

Solution:
Make the effective range determined by the loaded buffers.

Fix #28624
2024-05-07 02:30:19 -07:00
d8deb91819 vim-patch:8d8cb45756cb (#28657)
runtime(sh,zsh): clear $MANPAGER in ftplugin before shelling out

Say you use Vim and set MANPAGER='vim -M +MANPAGER --not-a-term -'; then
:{Zs,S}hKeywordPrg (or K) will crap out and spew terminal garbage into
less when bash's "help" fails. This was introduced by 2f25e40b1
(runtime: configure keywordpg for some file types (vim/vim#5566), 2023-08-23)
and may be present in other files touched by that commit.

Make the "man" invocation sensible by unsetting MANPAGER in the
environment.

Note that changing MANPAGER for `:terminal` is not needed; Vim within
Vim is perfectly fine.

closes: vim/vim#14679

8d8cb45756

Co-authored-by: D. Ben Knoble <ben.knoble+github@gmail.com>
2024-05-07 17:05:55 +08:00
d40b0a96c4 build(deps): bump tree-sitter-query to v0.3.0
add support for supertype nodes (used in Haskell)
2024-05-07 00:24:25 +02:00
bb032d952b revert: default LSP mappings (#28649)
Revert the default LSP mappings before the 0.10 release as these might
need some further consideration. In particular, it's not clear if "c"
prefixed maps in Normal mode are acceptable as defaults since they
interfere with text objects or operator ranges.

We will re-introduce default mappings at the beginning of the 0.11
release cycle, this reversion is only for the imminent 0.10 release.
2024-05-06 08:13:50 -05:00
783c1e596c refactor(snippet): rename exit() => stop() #28628 2024-05-06 04:42:30 -07:00
b024643ca7 vim-patch:53753f6a4925 (#28647)
runtime(doc): Fix typos in help documents

closes: vim/vim#14720

53753f6a49

Co-authored-by: h-east <h.east.727@gmail.com>
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2024-05-06 06:43:01 +08:00
3d4eb9d544 fix(treesitter): update queries 2024-05-05 23:22:11 +02:00
97b7ddc376 build(deps): bump tree-sitter to v0.22.6 2024-05-05 23:22:11 +02:00
3d3717de4e build: use libvterm commit with generated *.inc files
This allows us to skip generating them during our build process.
2024-05-05 21:38:36 +02:00
5e98439f6d fix(defaults): diagnostic mappings descriptions #28646 2024-05-05 07:45:47 -07:00
efb44e0cad docs: fix lua type warnings (#28633) 2024-05-05 06:08:17 +08:00
e948d7feba vim-patch:ad4881cb3c04 (#28636)
runtime(doc): correct getscriptinfo() example (vim/vim#14718)

When "sid" is specified, it returns a List with a single item.

ad4881cb3c
2024-05-04 15:53:42 +08:00
3a8265266e fix(treesitter): escape "\" in :InspectTree #28613
Some parsers for, e.g., LaTeX or PHP have anonymous nodes like `"\"` or `"\text"` that behave wonkily (especially the first example) in the `InspectTree` window, so this PR escapes them by adding another backslash in front of them
2024-05-03 09:34:02 -07:00
d50596e1e3 docs: deduplicate information in deprecated.txt
Refer to `deprecated.txt` in `news.txt` in the deprecated section and
order `deprecated.txt` according to which version a feature was
deprecated in.
2024-05-03 18:31:43 +02:00
383018dbb8 build: simplify policy-setting for dependencies
Passing `CMAKE_POLICY_DEFAULT_CMP0092=NEW` to all dependencies is
simpler than setting it manually in each file.
2024-05-03 18:22:20 +02:00
52823616bc fix(lsp): replace bug-prone ternary operation #28627
ref #28624
2024-05-03 07:18:55 -07:00
ca243f06dd build: remove lintdoc from lint target
`lintdoc` takes too long to be part of `lint`. It may be reintroduced
once it's possible to only run lintdoc on files that have been changed.
2024-05-03 15:18:09 +02:00
e15991c811 fix(vim.json): properly treat luanil options as booleans (#28622)
Note: Upstream doesn't have this. It's an Nvim addition.
2024-05-03 19:26:56 +08:00
40ce857797 fix(vim.ui)!: change open() to return result|nil, errmsg|nil #28612
reverts e0d92b9cc2 #28502

Problem:
`vim.ui.open()` has a `pcall()` like signature, under the assumption
that this is the Lua idiom for returning result-or-error. However, the
`result|nil, errmsg|nil` pattern:
- has precedent in:
  - `io.open`
  - `vim.uv` (`:help luv-error-handling`)
- has these advantages:
  - Can be used with `assert()`:
    ```
    local result, err = assert(foobar())
    ```
  - Allows LuaLS to infer the type of `result`:
    ```
    local result, err = foobar()
    if err then
      ...
    elseif result then
      ...
    end
    ```

Solution:
- Revert to the `result|nil, errmsg|nil` pattern.
- Document the pattern in our guidelines.
2024-05-03 03:20:03 -07:00
d44ed3a885 perf(extmarks): better track whether namespace has extmarks (#28615)
This avoids redraw when adding/removing an empty namespace for a window.

This also avoids marktree traversal when clearing a namespace that has
already been cleared, which is added as a benchmark.
2024-05-03 18:02:25 +08:00
cf9f002f31 fix(api): use correct buffer for "range" in nvim__redraw (#28614) 2024-05-03 10:35:32 +08:00
01e4a70d66 build: improve git-cliff CHANGELOG output
- Sort sections according to custom preference instead of
  alphabetically. It is ordered according to "most relevant" to "least
  relevant" to users.
- Sort commits alphabetically
- Don't uppercase the first letter of the commit message
2024-05-02 22:57:07 +02:00
e5c69df679 Merge #28101 nvim__redraw 2024-05-02 07:49:07 -07:00
350d818564 feat(lsp): inlay_hint.is_enabled({filter}) #28523
vim.diagnostic.enable and vim.diagnostic.is_enabled() use the same pattern.
2024-05-02 07:26:07 -07:00
037ea6e786 feat(api): add nvim__redraw for more granular redrawing
Experimental and subject to future changes.
Add a way to redraw certain elements that are not redrawn while Nvim is waiting
for input, or currently have no API to do so. This API covers all that can be
done with the :redraw* commands, in addition to the following new features:
- Immediately move the cursor to a (non-current) window.
- Target a specific window or buffer to mark for redraw.
- Mark a buffer range for redraw (replaces nvim__buf_redraw_range()).
- Redraw the 'statuscolumn'.
2024-05-02 15:57:06 +02:00
7b14eb543d refactor: add win_T argument to setcursor_mayforce() 2024-05-02 15:46:15 +02:00
d5063f4b29 feat(lsp): vim.lsp.inlay_hint.enable(nil) applies to all buffers #28543
Problem:
Inlay hints `enable()` does not fully implement the `:help dev-lua` guidelines:

    Interface conventions ~
    - When accepting a buffer id, etc., 0 means "current buffer", nil means "all
      buffers".  Likewise for window id, tabpage id, etc.
      - Examples: |vim.lsp.codelens.clear()| |vim.diagnostic.enable()|

Solution:
Implement globally enabling inlay hints.
* refactor(lsp): do not rely on `enable` to create autocmds
* refactor(lsp): make `bufstates` a defaulttable
* refactor(lsp): make `bufstate` inherit values from `globalstate`
* feat(lsp): `vim.lsp.inlay_hints` now take effect on all buffers by default
* test(lsp): add basic tests for enable inlay hints for all buffers
* test(lsp): add test cases cover more than one buffer
2024-05-02 06:16:20 -07:00
2becec289c vim-patch:9.1.0390: filetype: inko files are not recognized
Problem:  filetype: inko files are not recognized
Solution: Detect '*.inko' as ink filetype
          (Yorick Peterse)

See:
- https://github.com/inko-lang/inko.vim
- https://inko-lang.org/

closes: vim/vim#14699

a01968448a

Co-authored-by: Yorick Peterse <git@yorickpeterse.com>
2024-05-02 14:14:56 +02:00
ebf8237af8 vim-patch:9.1.0389: filetype: templ files are not recognized
Problem:  filetype: templ files are not recognized
Solution: Detect '*.templ' files as filetype templ
          (Tristan Knight)

See:
- https://github.com/a-h/templ
- https://templ.guide/

closes: vim/vim#14697

54e79157c5

Co-authored-by: tris203 <admin@snappeh.com>
2024-05-02 14:14:56 +02:00
cb2a36bb5f docs(CONTRIBUTING): mention process of changing ft detection (#28598) 2024-05-02 20:11:58 +08:00
089c8d033d test: override XDG_STATE_HOME as well (#28604)
This prevents tested Nvim from affecting ~/.local/state/
2024-05-02 20:09:20 +08:00
c4627676f9 vim-patch:9.1.0388: cursor() and getregion() don't handle v:maxcol well (#28602)
Problem:  cursor() and getregion() don't handle v:maxcol well.
Solution: Add special handling for v:maxcol like setpos() does.
          (zeertzjq)

closes: vim/vim#14698

2ffdae7948
2024-05-02 19:33:54 +08:00
d26943a6e1 ci: don't try to label backport PR if it was not created 2024-05-02 11:45:07 +02:00
54dfee8f0a docs: add hl-SnippetTabstop tag 2024-05-02 11:39:31 +02:00
2b1a6e7597 fix(colorscheme): add missing LSP groups 2024-05-02 11:39:31 +02:00
9e2f378b6d vim-patch:9.1.0386: filetype: stylus files not recognized
Problem:  filetype: stylus files not recognized
Solution: Detect '*.styl' and '*.stylus' as stylus filetype,
          include indent, filetype and syntax plugin
          (Philip H)

closes: vim/vim#14656

2d919d2744

Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2024-05-02 00:37:16 +02:00
e778e01161 fix(ui): avoid recursiveness and invalid memory access #28578
Problem:  Calling :redraw from vim.ui_attach() callback results in
          recursive cmdline/message events.
Solution: Avoid recursiveness where possible and replace global "call_buf"
          with separate, temporary buffers for each event so that when a Lua
          callback for one event fires another event, that does not result
          in invalid memory access.
2024-05-01 13:51:06 -07:00
631d5189ad ci: improve default backport pull request title
`[Backport release-x.y]` will no longer be part of the pull request
title. This means the PR titles will go from looking like

```
[Backport release-0.9] fix(languagetree): remove double recursion in LanguageTree:parse
```

to

```
fix(languagetree): remove double recursion in LanguageTree:parse
```

The benefit of this is that pull requests merged with the "Squash and
Merge" strategy (which uses the PR title as the commit message), will
still follow the conventional commits specification. This will help
tools that rely on conventional commits such as git-cliff.

The `backport` label is added to backported PRs to help distinguish
between backport PRs with regular PRs in the "Pull Requests" tab on
github.

To reduce confusion with the `backport` label, the label to trigger the
backporting has been changed from `backport release-x.y` to
`ci:backport release-x.y`. This is also more consistent with other
labels that trigger a CI job which all use the `ci:` prefix.
2024-05-01 22:30:17 +02:00
947335be91 ci: update vim_patches.yml to follow conventional commits
This will change the commits messages from

```
version.c: update [skip ci]
```

to

```
docs: update version.c [skip ci]
```
2024-05-01 22:26:11 +02:00
0b8a72b739 revert: "feat(extmarks): subpriorities (relative to declaration order) (#27131)" (#28585)
This reverts commit 15e77a56b7.

Subpriorities were added in https://github.com/neovim/neovim/pull/27131
as a mechanism for enforcing query order when using iter_matches in the
Tree-sitter highlighter. However, iter_matches proved to have too many
complications to use in the highlighter so we eventually reverted back
to using iter_captures (https://github.com/neovim/neovim/pull/27901).
Thus, subpriorities are no longer needed and can be removed.
2024-05-01 08:08:22 -05:00
b5583acc48 vim-patch:9.1.0383: filetype: .out files recognized as tex files
Problem:  filetype: .out files recognized as tex files
Solution: Do not set an explicit filetype until it is clear what this
          should be (shane.xb.qian)

closes: vim/vim#14670

e35478bc9d

Co-authored-by: shane.xb.qian <shane.qian@foxmail.com>
2024-05-01 10:34:03 +02:00
e7ae913953 vim-patch:9.1.0382: filetype: Kbuild files are not recognized
Problem:  Kbuild files are not recognized.
Solution: Detect Kbuild files as make files.
          (Bruno Belanyi)

closes: vim/vim#14676

5cbc9a69e5

Co-authored-by: Bruno BELANYI <bruno@belanyi.fr>
2024-05-01 10:34:03 +02:00
cb24a3907c docs: format vim_diff.txt for "flow" layout #28584 2024-04-30 09:37:45 -07:00
dafa51c16d docs(api): sort unreleased nvim__ functions last #28580 2024-04-30 06:06:14 -07:00
ee41153a94 feat(diagnostic): revert default behaviour of goto_next/prev()
Follow-up to #28490

Problem:

The new behaviour of goto_next/prev() of navigating to the next highest
severity doesn't work well when diagnostic providers have different
interpretations of severities. E.g. the user may be blocked from
navigating to a useful LSP warning, due to some linter error.

Solution:

The behaviour of next highest severity is now a hidden option
`_highest = true`. We can revisit how to integrate this behaviour
during the 0.11 cycle.
2024-04-30 13:39:27 +01:00
0330dd9e69 fix(api): mark nvim__complete_set as experimental #28579
Problem:
nvim_complete_set was added in 5ed55ff14c
but needs more bake time.

Solution:
Rename it, mark it as experimental.
2024-04-30 05:12:51 -07:00
71cf75f96a docs: misc #24163
- Also delete old perl scripts which are not used since 8+ years ago.

fix #23251
fix #27367
ref https://github.com/neovim/neovim/issues/2252#issuecomment-1902662577

Helped-by: Daniel Kongsgaard <dakongsgaard@gmail.com>
Co-authored-by: Kevin Pham <keevan.pham@gmail.com>
2024-04-30 04:30:21 -07:00
efaf37a2b9 test(old): restore default 'grepprg' and 'grepformat' (#28574)
This prevents test failure when "rg" is executable.
2024-04-30 07:44:25 +08:00
234b5f6701 docs: various fixes (#28208)
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: Famiu Haque <famiuhaque@proton.me>
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Guilherme Soares <guilhermesoares1970@gmail.com>
Co-authored-by: Jannik Buhr <jannik.m.buhr@gmail.com>
Co-authored-by: thomaswuhoileong <72001875+thomaswuhoileong@users.noreply.github.com>
Co-authored-by: tom-anders <13141438+tom-anders@users.noreply.github.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-04-30 07:04:42 +08:00
b7e5769132 vim-patch:c4d0c8c81245
runtime(java): Improve the recognition of the "indent" method declarations (vim/vim#14659)

There is a flaw in the current implementation that has been
exacerbated around v5.2.  It lies in the recognition of all
three indentation styles simultaneously: a tab, two space,
and eight space character(s).  With it, it is not uncommon
to misidentify various constructs as method declarations
when they belong to two-space indented members and other
blocks of a type and are offset at eight space characters or
a tab from the start of the line.

For example,

------------------------------------------------------------
class Test
{
  static String hello() { return "hello"; }

  public static void main(String[] args)
  {
    try {
      if (args.length > 0) {
        // FIXME: eight spaces.
        System.out.println(args[0]);
      } else {
        // FIXME: a tab.
	System.out.println(hello());
      }
    } catch (Exception e) {
      throw new Error(e);
    }
  }
}
------------------------------------------------------------

------------------------------------------------------------
:let g:java_highlight_functions = 'indent'
:doautocmd Syntax
------------------------------------------------------------

A better approach is to pick an only indentation style out
of all supported styles (so either two spaces _or_ eight
spaces _or_ a tab).  Note that tabs and spaces can still be
mixed, only the leading tab or the leading run of spaces
matters for the recognition.  And there is no reason to not
complement the set of valid styles with any number of spaces
from 1 to 8, inclusively.

Please proceed with the necessary change as follows:

- rename from "indent" to "indent2" for a 2-space run;
- rename from "indent" to "indent8" for an 8-space run;
- continue to have "indent" for a tab run;
- define an "indent" variable with a suffix number denoting
  the preferred amount of indentation for any other run of
  spaces [1-8].

As before, this alternative style of recognition of method
declarations still does not prescribe naming conventions and
still cannot recognise method declarations in nested types
that are conventionally indented.

The proposed changes also follow suit of "style" in stopping
the claiming of constructor and enum constant declarations.

c4d0c8c812

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-04-30 00:10:02 +02:00
672138245f vim-patch:dc5c90554145
runtime(jq): remove undefined var s:save_cpoptions and add include setting

closes: vim/vim#14661
closes: vim/vim#14663

dc5c905541

Co-authored-by: GodFather <vito.blog@gmail.com>
Co-authored-by: itchyny <itchyny@cybozu.co.jp>
2024-04-30 00:10:02 +02:00
f59db07cdc vim-patch:9.1.0381: cbuffer and similar commands don't accept a range (#28571)
Problem:  cbuffer and similar quickfix and locationlist commands don't
          accept a range, even so it is documented they should
          (ilan-schemoul, after 8.1.1241)
Solution: Define ex commands with ADDR_LINES instead of ADDR_OTHER

fixes: vim/vim#14638
closes: vim/vim#14657

652c821366

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-30 06:02:38 +08:00
9eb87c5de6 vim-patch:04e1aaa94e3b (#28570)
runtime(doc): Fix a typo in usr_30.txt

closes: vim/vim#14662

04e1aaa94e

Co-authored-by: UM-Li <um-li@tuta.io>
2024-04-30 05:54:03 +08:00
bc7f86209d fix(lsp): redundant vim.snippet.jumpable #28560 2024-04-29 13:45:53 -07:00
a1c9da2d5a Merge pull request #28566 from bfredl/memoize
fix(treesitter): make tests for memoize more robust, also fix memoize to work
2024-04-29 19:31:59 +02:00
0df681a91d fix(treesitter): make tests for memoize more robust
Instead of painfully messing with timing to determine if queries were
reparsed, we can simply keep a counter next to the call to ts_query_new

Also memoization had a hidden dependency on the garbage collection of
the the key, a hash value which never is kept around in memory. this was
done intentionally as the hash does not capture all relevant state for the
query (external included files) even if actual query objects still
would be reachable in memory. To make the test fully deterministic in
CI, we explicitly control GC.
2024-04-29 16:20:46 +02:00
ca432069eb Merge pull request #28563 from bfredl/ui_attach_point
perf(ui_client): skip some initialization not necessary for ui client
2024-04-29 13:40:44 +02:00
0d1bc795f8 perf(ui_client): skip some initialization not necessary for ui client
In particular, TUI manages its own screen buffers and highlight table, so we don't need
to run init_highlight() and default_grid_alloc() in the ui client process.
2024-04-29 10:35:40 +02:00
ab1c2220f0 fix(ui): activating all ext capabilities without remote UI #28555 2024-04-28 17:51:33 -07:00
05be00a2d1 vim-patch:2e9b9e9a9ebf
runtime(asm): missing setlocal in indent plugin (vim/vim#14658)

2e9b9e9a9e

Co-authored-by: Marc Sven Schulte <167623652+msschulte@users.noreply.github.com>
2024-04-29 00:10:03 +02:00
a26c114577 vim-patch:f351fd829204 (#28551)
runtime(ssa): improve syntax file performance (vim/vim#14654)

fixes: vim/vim#14653
fixes: neovim/neovim#25950

f351fd8292
2024-04-29 05:50:13 +08:00
54d8786d10 vim-patch:9.1.0380: Calculating line height for unnecessary amount of lines (#28553)
Problem:  Calculating line height for unnecessary amount of lines with
          half-page scrolling (zhscn, after 9.1.0280)
Solution: Replace "limit_winheight" argument with higher resolution
          "max" argument to which to limit the calculated line height
          in plines_m_win() to (Luuk van Baal)

32d701f51b
2024-04-29 05:38:34 +08:00
61063653b0 feat(defaults): visual CTRL-R for LSP mappings #28537
Problem:
The new LSP "refactor menu" keybinding "crr" is also defined in visual
mode, which overlaps with the builtin "c".

Solution:
Use CTRL-R instead of "crr" for visual mode.

fix #28528
2024-04-28 09:02:18 -07:00
513fc46195 feat(defaults): improve :grep defaults #28545
Based on feedback from #28324, pass -H and -I to regular grep
(available on all platforms officially supported by Neovim), and
only pass -uu to ripgrep. This makes :grep ignore binary files by
default in both cases.
2024-04-28 09:00:48 -07:00
83635e4e3d fix(diagnostic): get border from config (#28531)
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
2024-04-28 10:15:10 -05:00
26b5405d18 fix(treesitter): enforce lowercase language names (#28546)
* fix(treesitter): enforce lowercase language names

Problem: On case-insensitive file systems (e.g., macOS), `has_parser`
will return `true` for uppercase aliases, which will then try to inject
the uppercase language unsuccessfully.

Solution: Enforce and assume parser names to be lowercase when
resolving language names.
2024-04-28 16:27:47 +02:00
4625394a76 fix(snippet): do not add extra indent on newlines (#28538)
Reverts parts of https://github.com/neovim/neovim/pull/27674

LSP snippets typically do include tabs or spaces to add extra
indentation and don't rely on the client using `autoindent`
functionality.

For example:

    public static void main(String[] args) {\n\t${0}\n}

Notice the `\t` after `{\n`

Adding spaces or tabs independent of that breaks snippets for languages
like Haskell where you can have snippets like:

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

To generate:

    name ::
    name = undefined
2024-04-28 12:49:25 +02:00
c3061a40f7 Merge pull request #28532 from bfredl/regularization
refactor(build): make all generated c files headers
2024-04-28 09:20:06 +02:00
a41546d4ac docs: breaking change in diagnostic goto #28541 2024-04-27 15:48:35 -07:00
96f59e1b99 fix(diagnostic): invalid col number compare in next_diagnostic (#28397)
Problem: when line is blank link then there will got an invalid column number in math.min compare.

Solution: make sure the min column number is 0 not an illegal number.
2024-04-27 16:05:41 -05:00
3711a0387a refactor(build): make all generated c files headers
There's no "rule" or bad practice or whatever that says we cannot
generate c files. it is is just that we have ~20 generated headers
and ~2 generated sources and there is nothing in these two generated
source files which sets them aparts. Lua bindings are not different from
rpc bindings, and pathdef is not different from versiondef.

So to simplify build logic and ease the future port to build.zig,
streamline the build to only have generated headers, no direct generated
.c files.

Also "nlua_add_api_functions" had its prototype duplicated twice which
defeated the point of having mandatory prototypes (one source of truth).
2024-04-27 18:59:48 +02:00
158e329725 Merge #28522 handle ui_attach side effects 2024-04-27 06:37:40 -07:00
499070148d vim-patch:92917069b1a8
runtime(debversions): Add oracular (24.10) as Ubuntu release name

closes: vim/vim#14645

92917069b1

Co-authored-by: Simon Quigley <simon@tsimonq2.net>
2024-04-27 13:08:12 +02:00
41ceadd458 vim-patch:9.1.0375: tests: 1-second delay after Test_BufEnter_botline() (#28534)
Problem:  tests: 1-second delay after Test_BufEnter_botline()
          (after v9.1.0374)
Solution: Wipe the created buffers (zeertzjq).

closes: vim/vim#14647

340643e977
2024-04-27 18:02:18 +08:00
0547347e72 vim-patch:79952b9c6774
runtime(jq): include syntax, ftplugin and compiler plugin

closes: vim/vim#14619

79952b9c67

Co-authored-by: Vito <vito.blog@gmail.com>
2024-04-27 11:01:14 +02:00
b8c1b36061 fix(ui): set 'cmdheight' to zero for all open tabpages
Problem:  Enabling ext_messages claims to set 'cmdheight' to zero, but
only does so for the current tabpage.
Solution: Set stored 'cmdheight' value to zero for all tabpages.
2024-04-27 01:00:55 +02:00
435dee74bb vim-patch:9.1.0374: wrong botline in BufEnter (#28530)
Problem:  When :edit an existing buffer, line('w$') may return a
          wrong result.
Solution: Reset w_valid in curwin_init() (Jaehwang Jung)

`do_ecmd()` reinitializes the current window (`curwin_init()`) whose
`w_valid` field may have `VALID_BOTLINE` set. Resetting `w_botline`
without marking it as invalid makes subsequent `validate_botline()`
calls a no-op, thus resulting in wrong `line('w$')` value.

closes: vim/vim#14642

eb80b8304e

Co-authored-by: Jaehwang Jung <tomtomjhj@gmail.com>
2024-04-27 06:32:25 +08:00
694756252b Merge pull request #28529 from zeertzjq/vim-fe1e2b5e2d65
vim-patch: clarify syntax vs matching mechanism
2024-04-27 06:31:55 +08:00
e81eb34aa1 vim-patch:9525f6213604
runtime(doc): fix typo synconcealend -> synconcealed (vim/vim#14644)

9525f62136

Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2024-04-27 05:52:47 +08:00
a1568f5df0 vim-patch:00ae5c5cba7b
runtime(doc): fix typo

00ae5c5cba

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-27 05:52:15 +08:00
f1f5fb911b vim-patch:fe1e2b5e2d65
runtime(doc): clarify syntax vs matching mechanism

fixes: vim/vim#14643

fe1e2b5e2d

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-27 05:51:52 +08:00
9b8a075539 fix(lsp): change silent in lsp.start.Opts to optional (#28524) 2024-04-26 20:26:21 +02:00
73034611c2 feat(diagnostic): add default mappings for diagnostics (#16230) 2024-04-26 13:16:12 -05:00
3a7c30dc93 fix(man.vim): q quits after jump to different tag in MANPAGER modified (#28495) 2024-04-26 13:14:45 -05:00
6888607415 feat(lsp): add more LSP defaults (#28500)
- crn for rename
- crr for code actions
- gr for references
- <C-S> (in Insert mode) for signature help
2024-04-26 11:12:49 -05:00
9b028bd64f refactor(vim.iter)!: rename xxback() => rxx() #28503
Problem:
vim.iter has both `rfind()` and various `*back()` methods, which work
in "reverse" or "backwards" order. It's inconsistent to have both kinds
of names, and "back" is fairly uncommon (rust) compared to python
(rfind, rstrip, rsplit, …).

Solution:
- Remove `nthback()` and let `nth()` take a negative index.
  - Because `rnth()` looks pretty obscure, and because it's intuitive
    for a function named `nth()` to take negative indexes.
- Rename `xxback()` methods to `rxx()`.
  - This informally groups the "list-iterator" functions under a common
    `r` prefix, which helps discoverability.
- Rename `peekback()` to `pop()`, in duality with the existing `peek`.
2024-04-26 08:43:29 -07:00
b2c26a875b fix(lsp): ensure buffer is not attached more than once
Fixes regression introduced in #28030

If an LSP server is restarted, then the associated `nvim_buf_attach`
call will not detach if no buffer changes are sent between the client
stopping and a new one being created. This leads to `nvim_buf_attach`
being called multiple times for the same buffer, which then leads to
changetracking sending duplicate requests to the server (one per
attach).

To solve this, introduce separate tracking (client agnostic) on which
buffers have had calls to `nvim_buf_attach`.
2024-04-26 16:21:37 +01:00
7626f431d8 fix(ui): update ext_ui widgets when attaching non-remote UI
Problem:  Updating internalized UI capabilities is postponed until a
          remote UI attaches.
Solution: Always update active UI widgets in ui_refresh().
2024-04-26 16:42:08 +02:00
b8273c9a33 fix: lua annotations 2024-04-26 15:13:06 +01:00
c5b9fb2f25 fix(treesitter.foldexpr): check for all insert submodes 2024-04-26 15:07:10 +01:00
37d8e50459 fix(lsp): add "silent" option to vim.lsp.start (#28478)
vim.notify cannot be suppressed and it is not always necessary to
display a visible warning to the user if the RPC process fails to start.
For instance, a user may have the same LSP configuration across systems,
some of which may not have all of the LSP server executables installed.
In that case, the user receives a notification every time a file is
opened that they cannot suppress.

Instead of using vim.notify in vim.lsp.rpc, propagate a normal error up
through the call stack and use vim.notify in vim.lsp.start() only if
the "silent" option is not set.

This also updates lsp.start_client() to return an error message as its
second return value if an error occurred, rather than calling vim.notify
directly. Callers of lsp.start_client() will need to update call sites
appropriately if they wish to report errors to the user (or even better,
switch to vim.lsp.start).
2024-04-26 08:15:44 -05:00
567f8a300b refactor(lsp): rename foos_by_bar to bar_foos #28505 2024-04-26 04:25:55 -07:00
47dbda97d2 fix(lsp): buffer messages until connected to server (#28507)
`handle:write(msg)` can fail if the socket is not yet connected to the
server.

Should address https://github.com/neovim/neovim/pull/28398#issuecomment-2078152491
2024-04-26 09:57:59 +02:00
a736e845a4 vim-patch:partial:9.1.0373: ops.c code uses too many strlen() calls (#28508)
Problem:  ops.c code uses too many strlen() calls
Solution: Refactor code and remove more strlen() calls
          (John Marriott)

closes: vim/vim#14598

38b9f45253

Co-authored-by: John Marriott <basilisk@internode.on.net>
2024-04-26 07:18:50 +08:00
d855c7a2fb vim-patch:98b12ede3175
runtime(asm): fix undefined variable in indent plugin

It's an indent script, so we need to set the  b:undo_indent variable
instead of the b:undo_ftplugin var.

fixes: vim/vim#14602

98b12ede31

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-25 23:46:46 +02:00
af8500af64 fix(completion): improve popup window position (#26739) 2024-04-25 21:36:18 +08:00
b13e63db1d feat(diagnostic): goto functions jump to highest severity (#28490)
When the "severity" option is nil, vim.diagnostic.goto_next() and
vim.diagnostic.goto_prev() jump to the next diagnostic with the highest
severity.
2024-04-25 08:07:44 -05:00
e0d92b9cc2 fix(vim.ui)!: change open() to return pcall-like values #28502
Problem:
`vim.ui.open` unnecessarily invents a different success/failure
convention. Its return type was changed in 57adf8c6e0, so we might as
well change it to have a more conventional form.

Solution:
Change the signature to use the `pcall` convention of `status, result`.
2024-04-25 04:15:58 -07:00
a1c2da56ec build: do not use GIT_REPOSITORY for local dependencies
This reverts a large portion of
2c1e8f7e96.

The conclusion from that commit is incorrect: local builds are not
used/updated correctly so much as it's not used at all. Instead the
build will always use `master` branch rather than the current files.
2024-04-25 11:17:54 +02:00
2b9df3f795 Merge pull request #28492 from bfredl/hotfix
fix(lua): vim.fn.has('nvim-0.10') in fast context, used by vim.deprecate
2024-04-25 08:58:58 +02:00
1294e221a2 fix(lua): vim.fn.has('nvim-0.10') in fast context, used by vim.deprecate 2024-04-25 08:37:18 +02:00
30374db955 vim-patch:a4c085a3e607
runtime(java): Improve the recognition of the "style" method declarations

- Request the new regexp engine (v7.3.970) for [:upper:] and
  [:lower:].

- Recognise declarations of in-line annotated methods.

- Recognise declarations of _strictfp_ methods.

- Establish partial order for method modifiers as shown in
  the MethodModifier production; namely, _public_ and
  friends should be written the leftmost, possibly followed
  by _abstract_ or _default_, or possibly followed by other
  modifiers.

- Stop looking for parameterisable primitive types (void<?>,
  int<Object>, etc., are malformed).

- Stop looking for arrays of _void_.

- Acknowledge the prevailing convention for method names to
  begin with a small letter and for class/interface names to
  begin with a capital letter; and, therefore, desist from
  claiming declarations of enum constants and constructors
  with javaFuncDef.
  Rationale:
    + Constructor is distinct from method:
      * its (overloaded) name is not arbitrary;
      * its return type is implicit;
      * its _throws_ clause depends on indirect vagaries of
        instance (variable) initialisers;
      * its invocation makes other constructors of its type
        hierarchy invoked one by one, concluding with the
        primordial constructor;
      * its explicit invocation, via _this_ or _super_, can
        only appear as the first statement in a constructor
        (not anymore, see JEP 447); else, its _super_ call
        cannot appear in constructors of _record_ or _enum_;
        and neither invocation is allowed for the primordial
        constructor;
      * it is not a member of its class, like initialisers,
        and is never inherited;
      * it is never _abstract_ or _native_.
    + Constructor declarations tend to be few in number and
      merit visual recognition from method declarations.
    + Enum constants define a fixed set of type instances
      and more resemble class variable initialisers.

Note that the code duplicated for @javaFuncParams is written
keeping in mind for g:java_highlight_functions a pending 3rd
variant, which would require none of the :syn-cluster added
groups.

closes: vim/vim#14620

a4c085a3e6

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-04-25 08:23:39 +02:00
38b9c322c9 feat(fs): add vim.fs.root (#28477)
vim.fs.root() is a function for finding a project root relative to a
buffer using one or more "root markers". This is useful for LSP and
could be useful for other "projects" designs, as well as for any plugins
which work with a "projects" concept.
2024-04-24 21:43:46 -05:00
16513b3033 feat(api): allow floats to be opened in non-current tabpage (#28480)
\
2024-04-25 09:14:05 +08:00
c32fcd1ed5 refactor(source): remove unnecessary concatenation with Lua (#28499) 2024-04-25 08:26:49 +08:00
7f084770c2 perf(diagnostic): avoid table copies to filter by severity (#28491)
Instead of adding all diagnostics matching lnum filters to a table, and
then copying that table to another table while applying the severity
filter, this changes the flow to only add diagnostics matching both
filters in the first pass.
2024-04-24 21:47:02 +02:00
a1550dbf0a build: silence new clang-tidy warnings 2024-04-24 10:28:55 +02:00
7d28c427e3 vim-patch:8.2.2332: Vim9: missing :endif not reported when using :windo (#28482)
Problem:    Vim9: missing :endif not reported when using :windo.
Solution:   Pass a getline function to do_cmdline(). (closes vim/vim#7650)

9567efa1b4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-04-24 13:30:57 +08:00
c81b7849a0 refactor(lsp): merge subtypes and supertypes into typehierarchy (#28467)
Both methods had pretty much the same documentation and shared the
implementation.
2024-04-23 19:05:01 +02:00
052498ed42 test: improve test conventions
Specifically, functions that are run in the context of the test runner
are put in module `test/testutil.lua` while the functions that are run
in the context of the test session are put in
`test/functional/testnvim.lua`.

Closes https://github.com/neovim/neovim/issues/27004.
2024-04-23 18:17:04 +02:00
c5af5c0b9a perf(lua): faster vim.deprecate() #28470
Problem: `vim.deprecate()` can be relatively significantly slower than
  the deprecated function in "Nvim" plugin.
Solution: Optimize checks for "Nvim" plugin. This also results into not
  distinguishing "xxx-dev" and "xxx" versions when doing checks, which
  is essentially covered by the deprecation logic itself.

With this rewrite I get the times from #28459: `{ 0.024827, 0.003797, 0.002024, 0.001774, 0.001703 }`.
For quicker reference:
    -  On current Nightly it is something like `{ 3.72243, 0.918169, 0.968143, 0.763256, 0.783424 }`.
    - On 0.9.5: `{ 0.002955, 0.000361, 0.000281, 0.000251, 0.00019 }`.
2024-04-23 08:23:45 -07:00
a4fc3bb0e6 fix(diagnostic): vim.diagnostic.get(…,{lnum=…}) on multi-line diagnostic #28273
Problem:
vim.diagnostic.get(…,{lnum=…}) does not match multi-line diagnostics.

Solution: add end_lnum support.
2024-04-23 04:13:58 -07:00
ad76b050eb fix(diagnostic): open_float on multi-line diagnostics #28301
Problem: when diagnostic have a range of line, open_float not work.

Solution: filter diagnostic by line number range.
2024-04-23 04:06:41 -07:00
aef120d1e9 vim-patch:9.1.0366: filetype: ondir files are not recognized
Problem:  filetype: ondir files are not recognized
Solution: Detect '.ondirrc' as ondir filetype
          (Jon Parise)

closes: vim/vim#14604

ea999037a4

Co-authored-by: Jon Parise <jon@indelible.org>
2024-04-23 09:38:46 +02:00
3305bb9e41 vim-patch:9.1.0364: tests: test_vim9_builtin is a bit slow (#28466)
Problem:  tests: test_vim9_builtin is a bit slow
Solution: source tests from a buffer instead of
          writing and sourcing a file (Yegappan Lakshmanan)

closes: vim/vim#14614

22697b6179

N/A patch:
vim-patch:9.1.0299: Vim9: return type not set for a lambda assigned to script var

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-04-23 08:28:51 +08:00
7508f1e607 vim-patch:f7a38650eaf6 (#28465)
runtime(doc): update documentation

closes: vim/vim#14616

f7a38650ea

Co-authored-by: RestorerZ <restorer@mail2k.ru>
2024-04-23 08:20:36 +08:00
d0ab67410c vim-patch:9.1.0365: Crash when typing many keys with D- modifier (#28464)
Problem:  Crash when typing many keys with D- modifier (after 9.1.0227).
Solution: Don't treat a 0x80 byte inside a special sequence as the start
          of a special sequence (zeertzjq).

closes: vim/vim#14613

6b13e3d4e4
2024-04-23 08:18:42 +08:00
cb2b5e2780 fix(tui): disable DECRQM and DECRQSS queries for Terminal.app (#28453)
**Problems**

When launching Neovim on Terminal.app on macOS (Apple Terminal),
it briefly shows like
`p$qm+q5463;524742;73657472676266;73657472676262$qm` in orange
background color partially on the screen.

**Solution**

Since Terminal.app seems not supporting DECRQM and DECRQSS queries,
calling `tui_request_term_mode` and `tui_query_extended_underline`
caused this unexpected output.

Therefore, if we know it's Apple Terminal (when `nsterm` is `true`),
don't call these checks.

Tested on Terminal.app (2.14, 453) on macOS 14.4.1.

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
2024-04-23 08:17:43 +08:00
39fc340276 fix(lsp): avoid assertion when client_hints do not exist (#28461) 2024-04-22 20:18:49 +02:00
ea1c9f60e0 vim-patch:9.1.0357: Page scrolling should place cursor at window boundaries (#28429)
Problem:  Page scrolling does not always place the cursor at the top or
          bottom of the window (Mathias Rav)
Solution: Place the cursor at the top or bottom of the window.
          (Luuk van Baal)

4b6b0c4024
2024-04-22 21:24:32 +08:00
783b0aba41 fix(completion): check that healthcheck name is string (#28458) 2024-04-22 19:35:02 +08:00
f2db5521eb Merge pull request #28434 from glepnir/23120
fix(float): wrong position when bufpos is out of range
2024-04-22 13:31:41 +02:00
fb5e2db4c7 refactor(api): deprecate nvim_call_atomic #28433
TODO:
FUNC_API_REMOTE_ONLY APIs such as `nvim_ui_*` cannot (yet) be used in
`nvim_exec_lua`. We can change FUNC_API_REMOTE_ONLY to allow
Vimscript/Lua to pass an explicit `channel_id`. #28437
2024-04-22 04:28:16 -07:00
013afc6863 refactor(lua): deprecate tbl_flatten #28457
forgot some changes in 9912a4c81b
2024-04-22 04:27:57 -07:00
2cbfa4b9af fix(window): don't go to unfocusable float when closing (#28455) 2024-04-22 17:57:49 +08:00
2088521263 Merge #28450 deprecate tbl_flatten 2024-04-21 18:04:21 -07:00
f112ac73bd fix: unreliable "checkhealth completions" test
ref https://github.com/neovim/neovim/issues/19596

    FAILED   test/functional/plugin/health_spec.lua @ 37: :checkhealth completions can be listed via getcompletion()
    test/functional/plugin/health_spec.lua:40: Expected objects to be the same.
    Passed in:
    (string) 'provider.node'
    Expected:
    (string) 'provider.clipboard'

    stack traceback:
            test/functional/plugin/health_spec.lua:40: in function <test/functional/plugin/health_spec.lua:37>
2024-04-22 02:43:24 +02:00
9912a4c81b refactor(lua): deprecate tbl_flatten
Problem:
Besides being redundant with vim.iter():flatten(), `tbl_flatten` has
these problems:

- Has `tbl_` prefix but only accepts lists.
- Discards some results! Compare the following:
  - iter.flatten():
    ```
    vim.iter({1, { { a = 2 } }, { 3 } }):flatten():totable()
    ```
  - tbl_flatten:
    ```
    vim.tbl_flatten({1, { { a = 2 } }, { 3 } })
    ```

Solution:
Deprecate tbl_flatten.

Note:
iter:flatten() currently fails ("flatten() requires a list-like table")
on this code from gen_lsp.lua:

    local anonym = vim.iter({ -- remove nil
      anonymous_num > 1 and '' or nil,
      '---@class ' .. anonymous_classname,
    }):flatten():totable()

Should we enhance :flatten() to work for arrays?
2024-04-22 02:11:23 +02:00
35e38833c5 vim-patch:9.1.0363: tests: test_winfixbuf is a bit slow (#28446)
Problem:  tests: test_winfixbuf is a bit slow
Solution: use defer if possible, reset hidden option, use --not-a-term
          when starting Vim using system() (Yegappan Lakshmanan)

closes: vim/vim#14611

4baf908d60

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-04-22 06:24:22 +08:00
7b8e582f1c vim-patch:d3ff129ce8c6
runtime(astro): Add filetype, syntax and indent plugin

related: vim/vim#14558
closes: vim/vim#14561

ported from: https://github.com/wuelnerdotexe/vim-astro

d3ff129ce8

Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2024-04-22 00:18:34 +02:00
f694d020c5 Merge #28440 rename tbl_islist, tbl_isarray 2024-04-21 09:16:16 -07:00
5c8dfb0e37 refactor(lua): rename tbl_isarray => isarray
tbl_isarray was not released yet, so it will not go through
a deprecation cycle.

ref #24572
2024-04-21 17:42:17 +02:00
d9d890562e refactor(lua): rename tbl_islist => islist
ref #24572
2024-04-21 17:08:07 +02:00
032df963bb refactor(treesitter): language loading 2024-04-21 14:09:27 +01:00
6d732ad3c9 refactor: add function attributes to xmemcpyz() (#28435)
Also attempt to fix the new coverity warning.
2024-04-21 16:44:40 +08:00
2b6c9bbe7f perf(treesitter): incremental foldupdate
Problem:
While the fold level computation is incremental, the evaluation of the
foldexpr is done on the full buffer. Despite that the foldexpr reads
from the cache, it can take tens of milliseconds for moderately big (10K
lines) buffers.

Solution:
Track the range of lines on which the foldexpr should be evaluated.
2024-04-21 10:42:00 +02:00
f42ab1dc48 Merge pull request #27872 from luukvbaal/cmdheight
fix(ui): don't force 'cmdheight' to zero with ext_messages
2024-04-21 09:31:24 +02:00
5f18dd3013 fix(float): wrong position when bufpos is set
Problem: when lnum in bufpos is out of range the position of float is wired.

Solution: avoid the height value out of buffer line range.
2024-04-21 15:25:46 +08:00
344906a08f fix(api): do not update grid position in nvim_win_set_cursor (#28235)
Revert commit c971f538ab.
Forcing grid cursor position will need a new API like originally proposed in #27858.
2024-04-21 08:15:18 +08:00
9e1bbb9813 vim-patch:564166f68184
ftplugin(cmake): Add include and suffixesadd

closes: vim/vim#14520

564166f681

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-21 00:09:48 +02:00
5e6240ffc2 feat(treesitter): handle quantified fold captures 2024-04-20 22:11:45 +02:00
8886b1807c refactor(lua): "module" => "M" #28426
Most of the codebase uses the `M` convention for Lua module.
Update the last remaining cases.
2024-04-20 09:06:49 -07:00
b5a38530ba fix(ui): don't force 'cmdheight' to zero with ext_messages
Remove remaining code that prevents non-zero 'cmdheight' with ext_messages.
2024-04-20 15:44:12 +02:00
f190f758ac feat(lsp): add vim.lsp.buf.subtypes(), vim.lsp.buf.supertypes() (#28388)
Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
Co-authored-by: Maria José Solano <majosolano99@gmail.com>
2024-04-20 15:40:01 +02:00
fd085d9082 fix(vim.ui.open): try wslview before explorer.exe #28424
Problem:
explorer.exe is unreliable on WSL.

Solution:
Try wslview before explorer.exe.

fix #28410
2024-04-20 05:47:08 -07:00
0ea38c9a53 refactor: add xmemcpyz() and use it in place of some xstrlcpy() (#28422)
Problem:  Using xstrlcpy() when the exact length of the string to be
          copied is known is not ideal because it requires adding 1 to
          the length and an unnecessary strlen().
Solution: Add xmemcpyz() and use it in place of such xstrlcpy() calls.
2024-04-20 19:31:00 +08:00
4d52b0cf67 fix(showcmd): clear the rest properly (#28420) 2024-04-20 08:12:45 +08:00
52d2851ca4 vim-patch:9.1.0355: filetype: flake.lock files are not recognized
Problem:  filetype: flake.lock files are not recognized
Solution: Detect 'flake.lock' as json filetype
          (Riley Bruins)

closes: vim/vim#14589

ce736033ae

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-04-19 16:09:41 +02:00
57c8f68e3b vim-patch:cee034112d41
runtime(bp): fix comment definition in filetype plugin (vim/vim#14594)

I somehow messed up the previous patch, I think a copy-paste error when
creating the file.

Blueprint files have C and C++ style comments, not shell-like '#'
comments.

cee034112d

Co-authored-by: Bruno BELANYI <bruno@belanyi.fr>
2024-04-19 16:09:30 +02:00
18da6964cc refactor(vim.iter)!: remove vim.iter.map/filter/totable #26138
Problem:
The use-case for the convenience functions vim.iter.map(),
vim.iter.filter(), vim.iter.totable() is not clear.

Solution:
Drop them for now. We can revisit after 0.10 release.
2024-04-19 06:22:41 -07:00
9319d97679 build(deps): bump luajit to HEAD - 75e927779 2024-04-19 09:11:51 +02:00
8d77061051 vim-patch:9.1.0354: runtime(uci): No support for uci file types (#28409)
Problem:  runtime(uci): No support for uci file types
          (Wu, Zhenyu)
Solution: include basic uci ftplugin and syntax plugins
          (Colin Caine)

closes: vim/vim#14575

4b3fab14db

Co-authored-by: Colin Caine <complaints@cmcaine.co.uk>
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-19 14:50:12 +08:00
3e6a9fb599 vim-patch:36e667ab837c (#28407)
runtime(java): Support "g:ftplugin_java_source_path" with archived files

Also, document for "g:ftplugin_java_source_path" its current
modification of the local value of the 'path' option.

closes: vim/vim#14570

36e667ab83

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-04-19 14:49:33 +08:00
13ebfafc95 vim-patch:9.1.0351: No test that completing a partial mapping clears 'showcmd' (#28406)
Problem:  No test that completing a partial mapping clears 'showcmd'.
Solution: Complete partial mappings in Test_showcmd_part_map() instead
          of using :echo.  Adjust some comments (zeertzjq).

closes: vim/vim#14580

094c4390bd
2024-04-19 05:45:25 +08:00
c791aa8aae docs: update supported platforms 2024-04-18 23:39:26 +02:00
97c0a52416 fix(lsp): correct deprecation message #28403 2024-04-18 12:06:52 -07:00
f1dfe32bf5 feat(lua): enable(enable:boolean, filter:table) #28374
Problem:
We need to establish a pattern for `enable()`.

Solution:
- First `enable()` parameter is always `enable:boolean`.
- Update `vim.diagnostic.enable()`
- Update `vim.lsp.inlay_hint.enable()`.
    - It was not released yet, so no deprecation is needed. But to help
      HEAD users, it will show an informative error.
- vim.deprecate():
    - Improve message when the "removal version" is a *current or older* version.
2024-04-18 07:57:58 -07:00
97323d821b refactor(lsp): merge rpc.domain_socket_connect into rpc.connect (#28398)
See discussion in https://github.com/neovim/neovim/pull/26850
2024-04-18 15:34:10 +02:00
206475d791 build(nix): update flake to prevent build errors #28394
- Updates nixpkgs to source a necessary Tree-sitter version
- Updates to a new llvm version as the old one was removed from nixpkgs
- Properly moves `doCheck` from a regular param to an attribute option
2024-04-18 04:48:07 -07:00
345dcba629 build(windows): set longPathAware in manifest #28389
ref https://github.com/neovim/neovim/issues/28384

Allows Windows file APIs (and anything that uses them) to bypass the 260-character `MAX_PATH` limitation on Windows 10 1607 or later.

NOTE: This change by itself does not change the behaviour of running Neovim. The system must also have the Windows registry key `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled` set to a `REG_DWORD` with value 1.

See https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=powershell#enable-long-paths-in-windows-10-version-1607-and-later for more information.
2024-04-18 04:28:36 -07:00
e1ca7a7bfc test: 'showcmd' with ext_messages and Visual selection (#28393)
Also slightly reorder some code to make comments look less out-of-place.
2024-04-18 08:33:08 +08:00
562719033e vim-patch:9.1.0343: 'showcmd' wrong for partial mapping with multibyte (#28392)
Problem:  'showcmd' is wrong for partial mapping with multibyte char,
          and isn't very readable with modifyOtherKeys.
Solution: Decode multibyte char and merge modifiers into the char.
          (zeertzjq)

This improves the following situations:
- Multibyte chars whose individual bytes are considered unprintable are
  now shown properly in 'showcmd' area.
- Ctrl-W with modifyOtherKeys now shows ^W in 'showcmd' area.

The following situation may still need improvement:
- If the char is a special key or has modifiers that cannot be merged
  into it, internal keycodes are shown in 'showcmd' area like before.
  This applies to keys typed in Normal mode commands as well, and it's
  hard to decide how to make it more readable due to the limited space
  taken by 'showcmd', so I'll leave it for later.

closes: vim/vim#14572

acdfb8a979
2024-04-18 06:23:11 +08:00
de6eb96fc9 vim-patch:9.1.0344: Cursor wrong after using setcellwidth() in terminal (#28391)
Problem:  Cursor wrong after using setcellwidth() in terminal
          (mikoto2000)
Solution: output additional spaces, so the behaviour matches the GUI
          (mikoto2000)

fixes: vim/vim#14539
closes: vim/vim#14540

Fix CUI `setcellwidths` characters draw behavior to same GUI behavior.

e20fa59903

This is already fixed and tested in Nvim in #28322.

Co-authored-by: mikoto2000 <mikoto2000@gmail.com>
2024-04-18 05:41:19 +08:00
6488a9268a Merge pull request #28355 from theofabilous/msgpack-crash-fix
fix(msgpack): retain grid line event memory
2024-04-17 19:12:52 +02:00
b0f9228179 docs: remove mentions of scan-build
These same checks are already checked by the clang-analyzer job, so this
duplication is not necessary.
2024-04-17 13:12:37 +02:00
96d0c709b6 fix(healthcheck): expand vimrc variable (#28379) 2024-04-17 14:31:13 +08:00
2f371ad7d0 vim-patch:9.1.0341: Problem: a few memory leaks are found (#28382)
Problem:  a few memory leaks are found
          (LuMingYinDetect )
Solution: properly free the memory

Fixes the following problems:
- Memory leak in f_maplist()
  fixes: vim/vim#14486

- Memory leak in option.c
  fixes: vim/vim#14485

- Memory leak in f_resolve()
  fixes: vim/vim#14484

- Memory leak in f_autocmd_get()
  related: vim/vim#14474

- Memory leak in dict_extend_func()
  fixes: vim/vim#14477
  fixes: vim/vim#14238

closes: vim/vim#14517

29269a71b5

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-17 06:52:29 +08:00
0b2b1b0185 vim-patch:9.1.0340: Problem: Error with matchaddpos() and empty list (#28381)
Problem:  Error with matchaddpos() and empty list
          (@rickhow)
Solution: Return early for an empty list

fixes: vim/vim#14525
closes: vim/vim#14563

f7d31adcc2

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-17 06:49:23 +08:00
329fc0e5b7 test: API can return Lua function to Lua code (#28380) 2024-04-17 06:34:10 +08:00
f150b62423 fix(lua): only free luarefs when returning from API (#28373) 2024-04-17 05:44:06 +08:00
60d1e3e471 fix(msgpack): store grid line event as a value 2024-04-16 16:41:13 -04:00
8e5c48b08d feat(lua): vim.fs.normalize() resolves ".", ".." #28203
Problem:
`vim.fs.normalize` does not resolve `.` and `..` components. This makes
no sense as the entire point of normalization is to remove redundancy
from the path. The path normalization functions in several other
languages (Java, Python, C++, etc.) also resolve `.` and `..`
components.

Reference:
- Python: https://docs.python.org/3/library/os.path.html#os.path.normpath
- Java: https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html#normalize--
- C++: https://en.cppreference.com/w/cpp/filesystem/path/lexically_normal

Solution:
Resolve "." and ".." in `vim.fs.normalize`.

    Before:
    "~/foo/bar/../baz/./" => "~/foo/bar/../baz/."
    After:
    "~/foo/bar/../baz/./" => "~/foo/baz"
2024-04-16 12:13:44 -07:00
20b38677c2 feat(defaults): use ripgrep (rg) for 'grepprg' if available 2024-04-16 19:21:02 +02:00
fe4583127f fix: vim.validate() order is not deterministic #28377
Problem:
The order of the validation performed by vim.validate() is
unpredictable.
- harder to write reliable tests.
- confusing UX because validation result might return different errors randomly.

Solution:
Iterate the input using `vim.spairs()`.

Future:
Ideally, the caller could provide an "ordered dict".
2024-04-16 07:31:43 -07:00
5cfdaaaeac fix(api): ignore 'autochdir' when renaming other buf (#28376)
Problem:  Renaming non-current buffer changes working directory when
          'autochdir' is set.
Solution: Temporarily disable 'autochdir'.  Add more tests for the
          win_set_buf change.
2024-04-16 20:57:01 +08:00
2fc2343728 fix(api): ignore 'autochdir' when setting buf in other win (#28371)
Problem:  Wrong working directory when setting buffer in another window with
          'autochdir' enabled.
Solution: Temporarily disable 'autochdir'.
2024-04-16 19:49:56 +08:00
3065e2fa5d Merge #28227 feat(diagnostic): is_enabled, enable(…, enable:boolean) 2024-04-16 04:37:54 -07:00
7fa24948a9 test: make mapping tests more consistent (#28368)
- Test maparg() and maplist() in the same test.
- Use matches() instead of string.match().
- Avoid overlong lines and strange spacing in exec_lua().
- Revert code change from last PR as the variable may be needed.
2024-04-16 14:05:09 +08:00
47ba96a6b3 test: getting autocmd Lua callback in Vimscript (#28367)
Also remove unnecessary variable in API converter.
2024-04-16 11:59:55 +08:00
60fb8a6a8b fix(messages): avoid crash with :intro and ch=0 (#28343)
This just copies code from msg_start() to wait_return().  Not sure if
there is a better place to put such a block.
2024-04-16 10:38:17 +08:00
e3c083832c vim-patch:9.1.0335: String interpolation fails for List type (#28364)
Problem:  String interpolation fails for List type
Solution: use implicit string(list) for string interpolation and :put =
          (Yegappan Lakshmanan)

related: vim/vim#14529
closes: vim/vim#14556

bce51d9005

Cherry-pick eval_to_string_eap() from patch 8.2.1914.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-04-16 10:18:24 +08:00
b1e8b799a5 vim-patch:9.1.0332: tests: some assert_equal() calls have wrong order of args (#28363)
Problem:  tests: some assert_equal() calls have wrong order of args
Solution: Correct the order (zeertzjq).

closes: vim/vim#14555

757f32141b
2024-04-16 10:00:48 +08:00
9b485e3f42 vim-patch:8a31de6dd275 (#28361)
compiler(rime_deployer): include new compiler, use it for '*.custom.yaml' files (vim/vim#14460)

8a31de6dd2

Co-authored-by: wzy <32936898+Freed-Wu@users.noreply.github.com>
2024-04-16 09:33:51 +08:00
fb7ffac69f vim-patch:9.1.0326: filetype: some requirements files are not recognized (#28360)
Problem:  filetype: some requirements files are not recognized
Solution: Detect '*-requirements.txt', 'constraints.txt',
          'requirements.in', 'requirements/*.txt' and 'requires/*.txt'
          as requirements filetype, include pip compiler, include
          requirements filetype and syntax plugin
          (Wu, Zhenyu, @raimon49)

closes: vim/vim#14379

f9f5424d3e

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Co-authored-by: raimon <raimon49@hotmail.com>
2024-04-16 09:33:33 +08:00
07661009c5 vim-patch:9.1.0325: CMakeCache.txt files not recognized (#28359)
vim-patch:9.1.0325: filetype: CMakeCache.txt files not recognized

Problem:  filetype: CMakeCache.txt files not recognized
Solution: Detect 'CMakeCache.txt' files as cmakecache filetype,
          include basic syntax script for cmakecache
          (Wu, Zhenyu, @bfrg)

closes: vim/vim#14384

62c09e032c

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Co-authored-by: bfrg <bfrg@users.noreply.github.com>
2024-04-16 09:33:16 +08:00
537ba34953 vim-patch:4052474a1bd2 (#28358)
runtime(java): Recognise non-ASCII identifiers (vim/vim#14543)

* runtime(java): Recognise non-ASCII identifiers

Also:

- Remove the already commented out and less general in its
  definition javaFuncDef alternative.

- Stop recognising some bespoke {p,trace} debugging API.

Non-ASCII identifiers have been supported from the outset
of the Java language.

> An _identifier_ is an unlimited-length sequence of _Java
> letters_ and _Java digits_, the first of which must be a
> Java letter.  An identifier cannot have the same spelling
> (Unicode character sequence) as a keyword . . . Boolean
> literal . . . or the null literal . . .
> . . . . . . . .
> Letters and digits may be drawn from the entire Unicode
> character set . . .
> . . . . . . . .
> A Java letter is a character for which the method
> Character.isJavaLetter . . . returns true.  A Java
> letter-or-digit is a character for which the method
> Character.isJavaLetterOrDigit . . . returns true.
> . . . . . . . .
> The Java letters include . . . for historical reasons, the
> ASCII underscore (_) . . . and dollar sign ($) . . .

(Separate syntax tests will be written when particular parts
now touched will have been further improved.)

Reference:
https://javaalmanac.io/jdk/1.0/langspec.pdf [§3.8]

* Take on the maintenance of Java filetype and syntax files

4052474a1b

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-04-16 09:32:55 +08:00
14fb2ef4fb vim-patch:8.2.3415: Vim9: not all function argument types are properly checked (#28362)
Problem:    Vim9: Not all function argument types are properly checked.
Solution:   Add and improve argument type checks. (Yegappan Lakshmanan,
            closes vim/vim#8839)

fc3b775055

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-04-16 09:32:36 +08:00
3ce85b7c8a Merge pull request #28357 from zeertzjq/vim-9.1.0322
vim-patch:9.1.{0322,0323,0324}: filetype not recognized
2024-04-16 08:50:02 +08:00
ca2f24cbbd vim-patch:9.1.0324: filetype: some json files are not recognized
Problem:  filetype: some json files are not recognized
Solution: Detect '.jscsrc' and '.vsconfig' as jsonc filetype
          (Wu, Zhenyu)

See:
- https://github.com/microsoft/PowerToys/blob/main/.vsconfig
- https://jscs-dev.github.io/

closes: vim/vim#14452

c59a8648b2

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-16 08:32:08 +08:00
fcf17c8859 vim-patch:9.1.0323: filetype: cabal config files may not be recognized
Problem:  filetype: cabal config files may not be recognized
Solution: Change filetype pattern to '*/{,.}cabal/config'
          (Wu Zhenyu)

closes: vim/vim#14498

799dedec0e

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-16 08:22:37 +08:00
6717cc5b41 vim-patch:9.1.0322: filetype: some mail tools not recognized
Problem:  filetype: some mail tools not recognized
Solution: Detect '.mbsncrc' as conf, '.msmtprc' as msmtp
          and '.notmuch-config' as ini filetype
          (Shane-XB-Qian)

closes: vim/vim#14533

a7a9a476cf

Co-authored-by: shane.xb.qian <shane.qian@foxmail.com>
2024-04-16 08:19:17 +08:00
b4ddee1116 vim-patch:fb8f31ea7d7f (#28356)
runtime(doc): document pandoc compiler and enable configuring arguments

closes: vim/vim#14550

fb8f31ea7d

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-04-16 08:13:21 +08:00
8c970d3403 vim-patch:dd83b63eb5b7 (#28351)
runtime(i3config/swayconfig): update syntax scripts

modifications with the goals of:
- simplifying structure by using group `cluster`s
- improving visual highlighting responsiveness by using `nextgroup`
- improving recursive wm-msg command highlighting
- separating command variants meant for runtime and for config only

closes: vim/vim#14544

dd83b63eb5
2024-04-16 07:48:15 +08:00
b35f08ddb1 vim-patch:9.1.0334: No test for highlight behavior with 'ambiwidth' (#28354)
Problem:  No test for highlight behavior with 'ambiwidth'.
Solution: Add a screendump test for 'ambiwidth' with 'cursorline'.
          (zeertzjq)

closes: vim/vim#14554

a59e031aa0
2024-04-16 06:50:23 +08:00
5ed9916a28 feat(diagnostic): enable(…, opts)
Problem:
vim.diagnostic.enable() does not match the signature of vim.lsp.inlay_hint.enable()

Solution:
- Change the signature so that the first 2 args are (bufnr, enable).
- Introduce a 3rd `opts` arg.
    - Currently it only supports `opts.ns_id`.
2024-04-15 21:32:31 +02:00
603f3b36a4 fix(checkhealth): error in node.js check #28348
Problem:
:checkhealth node.js check fails:

    ERROR Failed to run healthcheck for "provider.node" plugin ...
    node/health.lua:98: attempt to call local 'message' (a string value)

`message` is called as a function, when it is actually a string.

Solution:
Pass `message` to `warn()` as an argument.

Fix #28346
2024-04-15 09:23:22 -07:00
533e01a75b fix(base64): properly handle embedded NULLs when decoding (#28349) 2024-04-15 11:06:54 -05:00
26765e8461 feat(diagnostic): is_enabled, enable(…, enable:boolean)
Problem:
`vim.diagnostic.is_disabled` and `vim.diagnostic.disable` are unnecessary
and inconsistent with the "toggle" pattern (established starting with
`vim.lsp.inlay_hint`, see https://github.com/neovim/neovim/pull/25512#pullrequestreview-1676750276

As a reminder, the rationale is:
- we always need `enable()`
- we always end up needing `is_enabled()`
- "toggle" can be achieved via `enable(not is_enabled())`
- therefore,
    - `toggle()` and `disable()` are redundant
    - `is_disabled()` is a needless inconsistency

Solution:
- Introduce `vim.diagnostic.is_enabled`, and `vim.diagnostic.enable(…, enable:boolean)`
    - Note: Future improvement would be to add an `enable()` overload `enable(enable:boolean, opts: table)`.
- Deprecate `vim.diagnostic.is_disabled`, `vim.diagnostic.disable`
2024-04-15 13:54:33 +02:00
57adf8c6e0 fix(vim.ui): open() may wait indefinitely #28325
Problem:
vim.ui.open "locks up" Nvim if the spawned process does not terminate. #27986

Solution:
- Change `vim.ui.open()`:
    - Do not call `wait()`.
    - Return a `SystemObj`. The caller can decide if it wants to `wait()`.
- Change `gx` to `wait()` only a short time.
    - Allows `gx` to show a message if the command fails, without the
      risk of waiting forever.
2024-04-15 04:33:09 -07:00
4ec8fd43bf fix(api): make width/height for split by nvim_open_win work (#28341) 2024-04-15 17:55:57 +08:00
5371ed36b7 Merge pull request #28339 from zeertzjq/vim-9.1.0321
vim-patch:9.1.{0321,0328}
2024-04-15 08:30:27 +08:00
ba24dab8d6 vim-patch:9.1.0328: CI fails with t_?? test
Problem:  CI fails with t_?? test
Solution: use assert_match instead of assert_equal
          and test only until t_xo, depending on system
          there may be several more termcap codes coming

0d87e3c711

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-15 08:00:29 +08:00
dea0d50f7f vim-patch:9.1.0321: Garbled output on serial terminals with XON/XOFF flow control
Problem:  When used terminal with XON/XOFF flow control, vim tries to
          still make CTRL-S mapping available, which results in severe
          screen corruption, especially on large redraws, and even
          spurious inputs (John Tsiombikas)
Solution: Disallow CTRL-S mapping if such terminal is recognized.
          Don't remove IXON from the bitmask inversion.
          (Anton Sharonov)

*** When started like this:

    TERM=vt420 vim

:set termcap

    shows "t_xon=y"

map <C-S> :echo "abc"<CR>

    does nothing (after <C-S> output freezes and subsequent <C-Q>
    unfreezes it)

*** When started like this:

    TERM=xterm vim

:set termcap

    shows "t_xon="

map <C-S> :echo "abc"<CR>

    works (after <C-S> one see "abc" string echo-ed)

fixes: vim/vim#12674
closes: vim/vim#14542

49528da8a6

Co-authored-by: Anton Sharonov <anton.sharonov@gmail.com>
2024-04-15 07:59:45 +08:00
0f5c94c04b vim-patch:4ba70cab37d2 (#28338)
runtime(vim): Update base-syntax, fix nested function folding (vim/vim#14397)

Only match function folding start and end patterns at the start of a
line, excluding heredocs and :append/:change/:insert commands.

Fixes vim/vim#14393

4ba70cab37

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-04-15 07:46:14 +08:00
bcfad7fe62 vim-patch:e92ed1b45c54 (#28337)
runtime(vim): don't set compiler, update a comment for vimdoc compiler (vim/vim#14532)

e92ed1b45c

Co-authored-by: Shane-XB-Qian <shane.qian@foxmail.com>
2024-04-15 07:39:32 +08:00
43f8d7e3ef vim-patch:9.1.0329: String interpolation fails for Dict type (#28335)
Problem:  String interpolation fails for Dict type
Solution: Support Dict data type properly, also support :put =Dict
          (without having to convert it to string() first)
          (Yegappan Lakshmanan)

fixes: vim/vim#14529
closes: vim/vim#14541

f01493c550

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-04-15 07:11:39 +08:00
7180ef6901 feat(api)!: nvim_open_win: noautocmd blocks all autocmds #28192
Problem: noautocmd is confusing; despite its name, it doesn't block all
autocommands (instead it blocks only those related to setting the buffer), and
is commonly used by plugins to open windows while producing minimal
side-effects.

Solution: be consistent and block all autocommands when noautocmd is set.
This includes WinNew (again), plus autocommands from entering the window (if
enter is set) like WinEnter, WinLeave, TabEnter, .etc.

See the discussion at https://github.com/neovim/neovim/pull/14659#issuecomment-2040029517
for more information.

Remove win_set_buf's noautocmd argument, as it's no longer needed.

NOTE: pum_create_float_preview sets noautocmd for win_set_buf, but all its
callers already use block_autocmds.

Despite that, pum_create_float_preview doesn't actually properly handle
autocommands (it has no checks for whether those from win_enter or
nvim_create_buf free the window).

For now, ensure autocommands are blocked within it for correctness (in case it's
ever called outside of a block_autocmds context; the function seems to have been
refactored in #26739 anyway).
2024-04-14 16:10:16 -07:00
e3fb937545 build(deps): bump tree-sitter to v0.22.5 2024-04-15 01:02:28 +02:00
6685481dfa vim-patch:9.1.0320: Wrong cursor position after using setcellwidths() (#28334)
Problem:  Wrong cursor position after using setcellwidths().
Solution: Invalidate cursor position in addition to redrawing.
          (zeertzjq)

closes: vim/vim#14545

05aacec6ab

Reorder functions in test_utf8.vim to match upstream.
2024-04-15 06:11:30 +08:00
1d73ecda7f vim-patch:9.1.0319: Using heredoc in string not tested with :execute (#28333)
Problem:  Using heredoc in string not tested with :execute.
Solution: Test with both :execute and execute() (zeertzjq).

closes: vim/vim#14546

3d93630605
2024-04-15 04:15:43 +08:00
aa1d0ac095 fix(defaults): only repeat macro for each selected line if linewise (#28289)
As mentioned in #28287, repeating a macro for each selected line doesn't
really make sense in non-linewise Visual mode.

Fix #28287
2024-04-15 03:43:33 +08:00
f6a3fdd684 refactor: fix clang NonNullParamChecker warnings (#28327) 2024-04-14 21:48:32 +08:00
c34c31af73 ci: enable unittests on macos-14
Add more filters so that LuaJIT can parse headers on macOS 14.

The system headers use a style of enum introduced in C++11 (and allowed
as an extension in C by clang) of the form:

    enum Name : Type {

The system headers also use bitfields in the mach_vm_range_recipe* types:

    struct Foo { int bar : 32; }

Neither of these constructs can be parsed by LuaJIT, so filter the lines
out. Neither of these declarations are used by neovim's unittests.

There is a (now closed) issue about bitfields for LuaJIT:

    https://github.com/LuaJIT/LuaJIT/issues/951

Fixes #26145.
2024-04-14 15:27:04 +02:00
4ca6e08327 vim-patch:9.1.0318: filetype: translate shell config files are not recognized
Problem:  filetype: translate shell config files are not recognized
Solution: Detect 'init.trans', 'translate-shell' and '.trans' files as
          clojure (Wu, Zhenyu)

See: https://github.com/soimort/translate-shell/wiki/Configuration

closes: vim/vim#14499

4b5cd7257e

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-14 13:21:10 +02:00
391200f198 vim-patch:9.1.0317: filetype: matplotlibrc files are not recognized
Problem:  filetype: matplotlibrc files are not recognized
Solution: Detect 'matplotlibrc' file as yaml filetype
          (Wu, Zhenyu)

See: https://matplotlib.org/stable/users/explain/customizing.html#the-matplotlibrc-file

closes: vim/vim#14501

55d4f3c006

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-14 13:21:10 +02:00
737091d234 vim-patch:9.1.0316: filetype: some sh and confini files not recognized
Problem:  filetype: some sh and confini files not recognized
Solution: Detect neofetch, '.xprofile', XDG-User-Dirs files,
          paru and makepkg config files
          (Wu, Zhenyu)

See:
- https://github.com/dylanaraps/neofetch/wiki/Customizing-Info#config-file-location
- https://www.freedesktop.org/wiki/Software/xdg-user-dirs/

closes: vim/vim#14505

5a9f7e6750

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-14 13:21:10 +02:00
420f130223 vim-patch:9.1.0315: filetype: a few more dosini files are not recognized
Problem:  filetype: a few more dosini files are not recognized
Solution: Detect wakatime, reply config files, flatpak, nfs config files
          and a few more python tools as dosini (or toml)
          (Wu, Zhenyu)

Refer:
- https://packaging.python.org/en/latest/specifications/pypirc/
- https://jorisroovers.com/gitlint/latest/configuration/
- https://pylint.pycqa.org/en/latest/user_guide/usage/run.html#command-line-options
- https://docs.bpython-interpreter.org/en/latest/configuration.html
- https://mypy.readthedocs.io/en/stable/config_file.html#the-mypy-configuration-file
- https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-via-a-file
- https://github.com/wakatime/wakatime-cli?tab=readme-ov-file#usage
- https://metacpan.org/dist/Reply/view/bin/reply#-cfg-~/.replyrc

close: vim/vim#14512

0881329d12

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-14 13:21:10 +02:00
4c31a1b807 fix(tui): make setcellwidths() work for non-ambiwidth chars (#28322) 2024-04-14 09:29:38 +08:00
a928228355 vim-patch:ce06493aeb3d (#28321)
runtime(vim): Update base-syntax, add legacy header folding

Allow for syntax-based folding of Vim9 script legacy header regions.

This is enabled with the "H" flag of the g:vimsyn_folding config variable.

closes: vim/vim#14530

ce06493aeb

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-04-14 07:35:08 +08:00
7e9eade7ea Merge pull request #28310 from zeertzjq/vim-9.1.0312
vim-patch:9.1.{0312,0313}
2024-04-14 05:25:04 +08:00
e81fe387d6 vim-patch:9.1.0313: Crash when using heredoc with comment in command block
Problem:  Crash when using heredoc with comment in command block.
Solution: Handle a newline more like the end of the line, fix coverity
          warning (zeertzjq).

closes: vim/vim#14535

1f5175d9af
2024-04-14 05:06:50 +08:00
617a385142 vim-patch:9.1.0312: heredocs are not supported for :commands
Problem:  heredocs are not supported for :commands
          (balki)
Solution: Add heredoc support
          (Yegappan Lakshmanan)

fixes: vim/vim#14491
closes: vim/vim#14528

e74cad3321

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-04-14 05:03:31 +08:00
b87212e669 vim-patch:5392970921ab
runtime(i3config): Line continuation is not detected for 'set' command (vim/vim#14531)

Problem:  Valid i3config syntax is highlighted as error.
Solution: Skip over line-breaks correctly.

5392970921

Co-authored-by: julio-b <julio.bacel@gmail.com>
2024-04-13 22:41:51 +02:00
ee18c26f26 vim-patch:122d06858568
runtime(go): fix highlighting import string followed by some comment (vim/vim#14538)

122d068585

Co-authored-by: Linda_pp <rhysd@users.noreply.github.com>
2024-04-13 22:41:51 +02:00
328a237351 fix(defaults): auto-close terminal for &shell with args (#28276)
Problem:
The `:terminal` auto-close logic does not support `&shell` that has
arguments, e.g., `/bin/bash -O globstar`.

Solution:
Join `argv` and match `&shell`. This is not perfect since `&shell` may
contain irregular spaces and quotes, but it seems to be good enough.
2024-04-13 19:41:59 +08:00
5ce6b4a294 Merge pull request #28315 from zeertzjq/vim-159dc0fcf950
vim-patch: runtime file updates
2024-04-13 18:16:10 +08:00
ab1203b2eb vim-patch:0549c503ba20
runtime(dts): include ftplugin support (vim/vim#14522)

0549c503ba

Co-authored-by: wzy <32936898+Freed-Wu@users.noreply.github.com>
2024-04-13 17:28:55 +08:00
3b639222ff vim-patch:159dc0fcf950
runtime(kconfig): add include to ftplugin (vim/vim#14524)

related: vim/vim#14521

159dc0fcf9

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-13 17:28:39 +08:00
05f9db1c6d build(deps): bump tree-sitter to v0.22.4 2024-04-13 11:25:26 +02:00
3ea124a8d9 fix(float): improve error message when reconfig failed (#25076)
Problem: The current error message isn't very accurate.
Solution: Improve the error message.
2024-04-13 14:36:17 +08:00
f064e72b9b fix(path): check return value of append_path() (#28309)
If the filename passed to vim_FullName() is a relative directory, and
does not exist, it is appended to the current working directory. Since
the return value of append_path() was ignored, and if the buffer length
was too small to fit getcwd() + dirname(filename), it would still try to
append the basename(filename).

This was manifesting as a failure in test/unit/path_spec.lua in:
    itp('fails and uses filename if given filename contains non-existing directory', ..

This failure occurs when running the tests from directory with a short
path such as: /work/src/nv

    test/unit/path_spec.lua:420: Expected objects to be the same.
    Passed in:
    (string) '/work/src/nv/test.file'
    Expected:
    (string) 'non_existing_dir/test.file'

This return value for the second call to append_path() to append
basename(filename) was checked, and this is where it would fail for
normal / longer getcwd()s.
2024-04-13 11:25:55 +08:00
780509aedf fix(move): fix using the wrong window (#28312) 2024-04-13 10:32:49 +08:00
355c149ba0 vim-patch:9.1.0311: filetype: Some config files are not recognized (#28311)
Problem:  Some config files are not recognized
Solution: Add some patterns for chktex, ripgreprc and ctags config
          files.

See: https://www.nongnu.org/chktex/
See: https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md#configuration-file
See: https://docs.ctags.io/en/latest/option-file.html#order-of-loading-option-files

closes: vim/vim#14506

a1dcd76ce7

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-13 09:59:53 +08:00
66220d164a revert: "feat(health): fold successful healthchecks #22866"
This reverts commit 4382d2ed56.

The story for this feature was left in an incomplete state. It was never
the intention to unilaterally fold all information, only the ones that
did not contain relevant information. This feature does more harm than
good in its incomplete state.
2024-04-13 01:18:40 +02:00
4f3d018d15 vim-patch:9.0.2180: POSIX function name in exarg causes issues (#28308)
Problem:  POSIX function name in exarg struct causes issues
          on OpenVMS
Solution: Rename getline member in exarg struct to ea_getline,
          remove isinf() workaround for VMS

There are compilers that do not treat well POSIX functions - like
getline - usage in the structs.

Older VMS compilers could digest this... but the newer OpenVMS compilers
( like VSI C x86-64 X7.4-843 (GEM 50XB9) ) cannot deal with these
structs. This could be limited to getline() that is defined via
getdelim() and might not affect all POSIX functions in general - but
avoiding POSIX function names usage in the structs is a "safe side"
practice without compromising the functionality or the code readability.

The previous OpenVMS X86 port used a workaround limiting the compiler
capabilities using __CRTL_VER_OVERRIDE=80400000
In order to make the OpenVMS port future proof, this pull request
proposes a possible solution.

closes: vim/vim#13704

6fdb628082

Co-authored-by: Zoltan Arpadffy <zoltan.arpadffy@gmail.com>
2024-04-13 06:39:30 +08:00
64aa0f7d0b fix(move): check for filler lines properly (#28307)
vim-patch:9.1.0310: Filler lines not checked properly in get_scroll_overlap()
2024-04-13 06:18:45 +08:00
2c5fd3f966 Merge pull request #28306 from jgouly/strings_spec_negative_zero
fix(test): fix strings_spec.lua for AArch64
2024-04-12 19:22:54 +02:00
f4c97da262 fix(test): fix strings_spec.lua for AArch64
LuaJIT does not handle -0.0 correctly in 'dual number mode' (which is
the default, and only supported mode for LuaJIT arm64). If LuaJIT is
forced to use 'dual number mode' on X64 (where the default is single),
this test will fail in the same manner.

Fix this by using tonumber("-0.0") instead of a -0.0 literal.

See: https://github.com/LuaJIT/LuaJIT/issues/858
2024-04-12 17:37:57 +01:00
8697f3274b Merge pull request #26774 from glepnir/24129
fix(float): don't relative float win itself
2024-04-12 14:31:42 +02:00
a629978cb6 vim-patch:9.1.0305: filetype: some history files are not recognized (#28300)
Problem:  filetype: some history files are not recognized
Solution: Add some history patterns to filetype.vim
          (Wu, Zhenyu)

closes: vim/vim#14513

da70feabea

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 18:08:54 +08:00
58da7ec80b Merge pull request #28299 from zeertzjq/vim-9.1.0291
vim-patch:9.1.{0291,0292,0293,0295,0306,0307}: filetype not recognized
2024-04-12 17:39:30 +08:00
8c112a8235 vim-patch:9.1.0307: filetype: texdoc config files is not recognized
Problem:  filetype: texdoc config files is not recognized
Solution: Detect 'texdoc.cnf' as conf filetype
          (Wu, Zhenyu)

See: https://github.com/TeX-Live/texdoc/blob/master/texdoc.cnf

closes: vim/vim#14507

7fdbd1bb58

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:22:16 +08:00
be7d8ff0e4 vim-patch:9.1.0306: filetype: x11vnc config file is not recognized
Problem:  filetype: x11vnc config file is not recognized
Solution: Detect '.x11vncrc' as conf filetype
          (Wu, Zhenyu)

See: https://linux.die.net/man/1/x11vnc

closes: vim/vim#14511

58ce78ad43

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:21:28 +08:00
7334e9055b vim-patch:9.1.0295: filetype: pip config files are not recognized
Problem:  filetype: pip config files are not recognized
Solution: detect pip.conf as dosini filetype
          (Wu, Zhenyu)

closes: vim/vim#14448

d2b95b8446

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:19:10 +08:00
60ced890f3 vim-patch:9.1.0293: filetype: lxqt config files are not recognized
Problem:  filetype: lxqt config files are not recognized
Solution: Detect {lxqt,screengrab}/*.conf files as dosini,
          fix failing filetype test for */tex/latex/**.cfg
          (Wu, Zhenyu)

closes: vim/vim#14450

41208884b8

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:17:39 +08:00
b0ded42680 vim-patch:9.1.0292: filetype: XDG mimeapps.list file is not recognized
Problem:  filetype: XDG mimeapps.list file is not recognized
Solution: Detect mimeapps.list as dosini filetype
          (Wu, Zhenyu)

Refer: https://wiki.archlinux.org/title/XDG_MIME_Applications#Format

closes: vim/vim#14451

efd752ec38

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:15:44 +08:00
07c5969aa9 vim-patch:9.1.0291: filetype: libreoffice config files are not recognized
Problem:  filetype: libreoffice config files are not recognized
Solution: Detect Libreoffice config fils as xml/dosini
          (Wu, Zhenyu)

closes: vim/vim#14453

73c89bcf79

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:14:43 +08:00
611cc7de43 vim-patch:9.1.0304: filetype: cgdb config file is not recognized (#28294)
Problem:  filetype: cgdb config file is not recognized
Solution: Detect cgdbrc files as cgdbrc filetype
          (Wu, Zhenyu)

closes: vim/vim#14458

1492fe6903

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:07:24 +08:00
e4fb3e2007 vim-patch:9.1.0303: filetype: some protocol buffer files not recognized (#28293)
Problem:  filetype: some protocol buffer files not recognized
Solution: Detect '*.textproto', '*.textpb', '*.txtpb' as pbtxt files
          (Bruno Belanyi)

See: https://protobuf.dev/reference/protobuf/textformat-spec/#text-format-files

closes: vim/vim#14463

e54a8e7c73

Co-authored-by: Bruno BELANYI <bruno@belanyi.fr>
2024-04-12 17:06:21 +08:00
a93a045e63 vim-patch:9.1.0302: filetype: blueprint files are not recognized (#28292)
Problem:  filetype: blueprint files are not recognized
Solution: Detect '*.bp' files as blueprint files, add
          a minimal filetype plugin (Bruno Belanyi)

See: https://source.android.com/docs/setup/build

closes: vim/vim#14488

6be7ef5bc7

Co-authored-by: Bruno BELANYI <bruno@belanyi.fr>
2024-04-12 17:05:11 +08:00
da3059b00f vim-patch:9.1.0290: filetype: xilinx files are not recognized (#28295)
Problem:  filetype: xilinx files are not recognized
Solution: Add a few xilinx specific file patterns,
          inspect lpr files for being xml/pascal
          (Wu, Zhenyu)

closes: vim/vim#14454

614691ceef

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:03:45 +08:00
5aee587970 vim-patch:9.1.0289: filetype: some TeX files are not recognized (#28291)
Problem:  filetype: some TeX files are not recognized
Solution: Add more patterns for TeX files and inspect
          a few more files for being TeX files
          (Wu, Zhenyu)

closes: vim/vim#14456

61ee833a50

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:02:25 +08:00
fe42574230 vim-patch:83424105cb42 (#28298)
runtime(doc): mention :argded for :argedit

related: vim/vim#14464

83424105cb

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-12 16:56:22 +08:00
8cca787155 test: macros in Visual mode without default mappings (#28288) 2024-04-12 09:16:13 +08:00
18ee9f9e7d test(old): make line wrapping in test_filetype.vim match Vim (#28286) 2024-04-12 07:20:03 +08:00
c6d1144515 vim-patch:fcbefe74f161 (#28285)
runtime(compiler): add vimdoc

closes: vim/vim#14459

https://github.com/google/vimdoc generates vim help files from vimscript files

fcbefe74f1

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 05:48:25 +08:00
3b9a152396 vim-patch:3cb2b3776700 (#28283)
runtime(doc): clarify behaviour or :argadd and :argedit

related: vim/vim#14464

3cb2b37767

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-12 05:39:30 +08:00
4459e0cee8 Merge pull request #28277 from zeertzjq/vim-556c62165963
vim-patch: runtime file updates
2024-04-11 18:49:10 +08:00
55ffca2f9f vim-patch:dbca7d80457d
ftplugin(asm): add Matchit support

closes: vim/vim#14461

Refer https://github.com/vim/vim/blob/master/runtime/ftplugin/masm.vim#L18-L29

dbca7d8045

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-11 18:23:18 +08:00
d2d4ad4b32 vim-patch:27f17a6d3493
runtime(asm): add basic indent support

closes: vim/vim#14383

27f17a6d34

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-11 18:22:57 +08:00
245745f9f0 vim-patch:556c62165963
ftplugin(gdb): add matchit support

closes: vim/vim#14462

556c621659

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-11 18:22:32 +08:00
1746b9234c vim-patch:6ce07edd600e (#28275)
runtime(compiler): fix inaccuracies in pandoc compiler (vim/vim#14467)

as kindly pointed out by @Freed-Wu

6ce07edd60

Co-authored-by: Enno <Konfekt@users.noreply.github.com>
2024-04-11 17:59:29 +08:00
7aa56370f3 vim-patch:9.0.2114: overflow detection not accurate when adding digits (#28271)
Problem:  overflow detection not accurate when adding digits
Solution: Use a helper function

Use a helper function to better detect overflows before adding integer
digits to a long or an integer variable respectively. Signal the
overflow to the caller function.

closes: vim/vim#13539

22cbc8a4e1

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-11 09:34:43 +08:00
4528a69c87 test: remove unnecessary nil argument to testutil (#28270) 2024-04-11 08:51:06 +08:00
509c053161 test: fix off-by-one test IDs in logs (#28269)
Run the global before_each() before all other before_each(), so that
clear() uses the test ID of the current test, not the previous one.

Don't skip generating test IDs for skipped tests, as that'll make a
skipped test have the same test ID as the previous one.
2024-04-11 07:51:25 +08:00
d627497156 vim-patch:04e5363b8238 (#28268)
runtime(vim): Improve Vim9 and legacy-script comment highlighting (vim/vim#13104)

This is a first-pass attempt to limit matching of Vim9 and legacy-script
comments to the appropriate syntactic contexts.

Vim9-script comments are highlighted at top level in a Vim9-script file,
in all :def functions, and in all :autocmd and :commmand command blocks.
Legacy-script comments are highlighted at top level in a legacy script
file, in all :func functions and in the Vim9-script preamble before the
:vim9script marker command.

Fixes vim/vim#13047, vim/vim#11307 and vim/vim#9587.

04e5363b82

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-04-11 07:41:44 +08:00
d0afb2dc4e vim-patch:9.1.0297: Patch 9.1.0296 causes too many issues (#28263)
Problem:  Patch 9.1.0296 causes too many issues
          (Tony Mechelynck, chdiza, CI)
Solution: Back out the change for now

Revert "patch 9.1.0296: regexp: engines do not handle case-folding well"

This reverts commit 7a27c108e0509f3255ebdcb6558e896c223e4d23 it causes
issues with syntax highlighting and breaks the FreeBSD and MacOS CI. It
needs more work.

fixes: vim/vim#14487

c97f4d61cd

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-11 07:40:16 +08:00
adb70a351d vim-patch:c9ec20d94ea5 (#28267)
runtime(doc): Update documentation

- Add security e-mail for private bugreports
- Remove mentioning of the voting feature

closes: vim/vim#14483

c9ec20d94e

Co-authored-by: RestorerZ <restorer@mail2k.ru>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-11 07:39:29 +08:00
f504e799a3 vim-patch:9.1.0301: Vim9: heredoc start may be recognized in string (#28266)
Problem:  Vim9: heredoc start may be recognized in string.
Solution: Don't skip to closing bracket for invalid list assignment.
          (zeertzjq)

closes: vim/vim#14472

1817ccdb10
2024-04-11 07:39:10 +08:00
85099e989b vim-patch:9.1.0300: Missing test for what patch v9.1.0285 fixes
Problem:  Missing test for what patch v9.1.0285 fixes
Solution: Add a test for cursor movement at buffer boundaries.
          (Luuk van Baal)

aa8e22b035

vim-patch:9.1.0225: test_matchparen not run in CI

Problem:  test_matchparen not run in CI
Solution: add test_matchparen.res to NEW_TESTS_RES in Makefile,
          update changed highlighting dump from v9.1.61

059aeac2be

Changes N/A and test result was restored in patch 9.1.0258 (included in #28160).
2024-04-11 07:37:49 +08:00
00e6651880 fix(treesitter): use tree range instead of tree root node range 2024-04-10 15:54:52 +01:00
81fc27124b refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
889f81c65f fix(drawline): don't invoke on_line for filler line (#28219)
Problem:
Decoration provider `on_line` handler is invoked for diff filler line
below the last buffer line. This does not match the documentation:
"called for each buffer line".

Solution:
Check `end_fill`.
2024-04-10 20:18:14 +08:00
1dacf2ecee fix(lsp): prevent code-lens refresh from becoming a permanent no-op (#28228)
To avoid repeatedly requesting a buffer multiple times before a request is completed, the current implementation puts the requested buffer into the active_refreshes table before requesting.

But since we only remove the buffer from active_refreshes in the lsp-handler of textDocument/codeLens, this will cause if the user sends a request that cannot trigger lsp-handler (for example, if there is an LSP server attached to the current buffer, and especially when the user creates an autocmd which performs vim.lsp.codelens.refresh after the BufEnter event is triggered like in the document example), this buffer will be put into active_refreshes, and there is no way to remove it, which will result in all subsequent vim.lsp.codelens.refresh not requesting textDocument/codeLens.
2024-04-10 12:27:37 +02:00
b95b6ed975 fix(lsp): empty commands should not be considered executable (#28216)
According to the LSP specification, the CodeLens.command is optional but the CodeLens.command.command is not optional, which means the correct representation of a display-only code lens is indeed one with a command with a title to display and an empty string as command.
2024-04-10 12:23:47 +02:00
898371fc9f fix(float): don't relative flaot win itself
Problem: when reconfig current float win without win key in nvim_win_set_config will cause float win position changed when move.

Solution: don't relative itself.
2024-04-10 15:10:37 +08:00
49983387ff fix(prompt): emit change event for prompt newline (#28260)
Co-authored-by: Ilia Choly <ilia.choly@gmail.com>
2024-04-10 08:50:36 +08:00
f49408454d vim-patch:9.1.0296: regexp: engines do not handle case-folding well (#28259)
Problem:  Regex engines do not handle case-folding well
Solution: Correctly calculate byte length of characters to skip

When the regexp engine compares two utf-8 codepoints case insensitively
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' so 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

The same 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.

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.

fixes: vim/vim#14294
closes: vim/vim#14433

7a27c108e0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-10 07:08:49 +08:00
7142c5dde9 vim-patch:e43ace558aee (#28258)
runtime(vim): Update base-syntax, no curly-brace names in Vim9 script (vim/vim#14466)

Remove curly-brace name matching for :def functions.  This is not
supported in Vim9 script.

e43ace558a

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-04-10 06:31:10 +08:00
efb6640b29 vim-patch:9.1.0287: Vim9: comment may be treated as heredoc start (#28257)
Problem:  Vim9: comment may be treated as heredoc start.
          (Ernie Rael)
Solution: Use skip_var_list() instead of find_name_end().
          (zeertzjq)

fixes: vim/vim#14444
closes: vim/vim#14446

9a91d2b72c
2024-04-10 06:07:29 +08:00
f398552eb1 Merge pull request #28256 from luukvbaal/vim-9.1.0285
vim-patch:9.1.{0285,0294}
2024-04-10 06:07:04 +08:00
d4956e16d9 vim-patch:9.1.0294: Text height function does not respect it's argument
Problem:  plines_m_win() does not take into account it's "limit_winheight"
          argument for filler lines below the last line of the buffer.
          (after v9.1.0280)
Solution: Check window height when "limit_winheight" is TRUE.
          (Luuk van Baal)

08b0f632c1
2024-04-09 23:43:42 +02:00
832857ae09 vim-patch:9.1.0285: Still problems with cursor position for CTRL-D/U
Problem:  Problems with cursor position when scrolling half a page.
Solution: Rework the cursor logic. (Luuk van Baal)

78c51500f1
2024-04-09 21:44:42 +02:00
4946489e2e vim-patch:9.1.0283: Several small issues in doc and tests (#28249)
Problem:  Wrong doc style for pandoc syntax description,
          Test_diff_eob_halfpage() may fail depending on
          screen size, using braces in highlight.c when
          not necessary
Solution: Fix pandoc documentation, make sure the window
          for the test has 7 lines, remove the braces.

a040019be6

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-09 16:42:39 +08:00
102720be94 vim-patch:9.1.0281: CI: fails Test_compiler_completion
Problem:  CI: fails Test_compiler_completion
Solution: Add pandoc compiler

d33cb3f65e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-09 10:24:49 +02:00
41521658b1 vim-patch:9.1.0276: No pandoc syntax support
Problem:  No pandoc syntax support
Solution: Add pandoc syntax and compiler plugins
          (Wu, Zhenyu, Konfekt)

closes: vim/vim#14389

7005b7ee7f

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-04-09 10:24:49 +02:00
Sam
168e69ae01 fix(tui): don't set cursor color when there is none (#28236) 2024-04-09 16:05:15 +08:00
4a1eec85dd vim-patch:a2385c233499
runtime(cuda): Update cuda keywords, remove uncommonly used enumeration constants

closes: vim/vim#14406

a2385c2334

Co-authored-by: jiangyinzuo <jiangyinzuo@foxmail.com>
2024-04-09 09:54:16 +02:00
cbe982bbd5 vim-patch:9.1.0278: filetype: zathurarc files not recognized
Problem:  filetype: zathurarc files not recognized
Solution: Detect '.zathurarc' files as zathurarc filetype,
          add zathurarc filetype (Wu, Zhenyu)

closes: vim/vim#14380

72d81a66ed

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-09 09:54:07 +02:00
2857cde070 vim-patch:9.1.0275: filetype: R history files are not recognized
Problem:  filetype: R history files are not recognized
Solution: Detect '.Rhistory' files as r filetype
          (Wu, Zhenyu)

closes: vim/vim#14440

fc21b6437c

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-09 09:53:58 +02:00
bef4ad6507 vim-patch:9.1.0279: filetype: roc files are not recognized
Problem:  filetype: roc files are not recognized
Solution: Detect '*.roc' files as roc filetype,
          add a basic filetype plugin (nat-418)

closes: vim/vim#14416

196b6678c5

Co-authored-by: nat-418 <93013864+nat-418@users.noreply.github.com>
2024-04-09 09:53:49 +02:00
a663eb10bd Merge pull request #28230 from bfredl/hl_cleanup_3
fix(tests): use more global highlight definitions
2024-04-09 09:41:35 +02:00
3d44340cea fix(tests): use more global highlight definitions 2024-04-09 09:09:41 +02:00
c695caa7ee vim-patch:8.2.4395: some code lines not covered by tests (#28248)
Problem:    Some code lines not covered by tests.
Solution:   Add a few more test cases.  Fix getting more than one error for
            invalid assignment.

8b716f5f22

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-04-09 11:06:02 +08:00
869d303043 vim-patch:8.2.0981: Vim9: cannot compile "[var, var] = list" (#28247)
Problem:    Vim9: cannot compile "[var, var] = list".
Solution:   Implement list assignment.

47a519a933

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-04-09 10:10:47 +08:00
6d1e41432d test(terminal/buffer_spec): use screen:expect(), not retry() (#28246)
Without creating new lines, using screen:expect() is faster and avoids
RPC requests.
2024-04-09 09:32:27 +08:00
56123fb271 test(terminal/buffer_spec): avoid other keys in double clicks (#28245)
Having unrelated keys between double clicks may make the test flaky as
'mousetime' is more easily reached.
2024-04-09 08:51:14 +08:00
2528093bbe vim-patch:9.1.0277: Cannot highlight the Command-line (#28244)
Problem:  Cannot highlight the Command-line
Solution: Add the MsgArea highlighting group
          (Shougo Matsushita)

closes: vim/vim#14327

be2b03c6ee

Cherry-pick Test_highlight_User() from patch 8.2.1077.

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2024-04-09 07:20:49 +08:00
66e86d3095 Merge pull request #28160 from luukvbaal/vim-9.1.0258
vim-patch:9.1.{0258,0260,0280}
2024-04-09 07:08:52 +08:00
8f5fd0884b vim-patch:9.1.0280: several issues with 'smoothscroll' support
Problem:  Logic to make sure cursor is in visible part of the screen after
          scrolling the text with 'smoothscroll' is scattered, asymmetric
          and contains bugs.
Solution: Adjust and create helper function for 'smoothscroll' cursor logic.
          (Luuk van Baal)

9148ba8a46
2024-04-09 00:51:06 +02:00
e21423bb35 vim-patch:9.1.0260: Problems with "zb" and scrolling to new topline with 'smoothscroll'
Problem: "zb" does not reveal filler lines at the start of a buffer.
          Scrolled cursor position with 'smoothscroll' is unpredictable,
          and may reset skipcol later if it is not visible (after v9.1.258)
Solution: Replace confusing for loop that reaches final control value too
          early with while loop. Set "w_curswant" accordingly so cursor
          will be placed in visible part of topline.
          (Luuk van Baal)

bd28cae1f1
2024-04-08 23:15:43 +02:00
e6cfa22c4c vim-patch:9.1.0258: half-page scrolling broke backward compatibility
Problem:  Support for 'smoothscroll' in (half-)page scrolling
          broke backward compatibility and can be made to work better.
          (after v9.1.215)
Solution: Restore the previous cursor and end-of-buffer behavior for
          half-page scrolling and improve 'smoothscroll' support.
          (Luuk van Baal)

cb204e688e
2024-04-08 23:15:43 +02:00
7035125b2b test: improve test conventions
Work on https://github.com/neovim/neovim/issues/27004.
2024-04-08 22:51:00 +02:00
978962f9a0 build(release.sh): regenerate docs after changing NVIM_API_PRERELEASE (#28229)
After #25574, the value of NVIM_API_PRERELEASE can affect docs, so docs
need to be regenerated after changing NVIM_API_PRERELEASE.
2024-04-08 17:46:41 +08:00
624de849de build: add function add_target
It's a combination of add_custom_target and add_custom_command that does
what most users probably expect should happen.

This also fixes `make clean` removing files tracked by git.
2024-04-08 10:52:53 +02:00
be2a4b52b9 docs(BUILD): mention treesitter parser dependencies (#28226)
Also add missing mention of libvterm and remove mention of libtermkey.
2024-04-08 16:04:54 +08:00
541c2d3816 vim-patch:9.1.0273: filetype: keymap files are not recognized
Problem:  filetype: keymap files are not recognized
Solution: Detect '*.keymap' files as Device Tree Files
          (0xadk)

closes: vim/vim#14434

b78753db5f

Co-authored-by: 0xadk <0xadk@users.noreply.github.com>
2024-04-08 00:35:38 +02:00
d188b929d4 vim-patch:9.1.0272: autocmd may change cwd after :tcd and :lcd (#28223)
Problem:  Autocommand may change currect directory after :tcd and :lcd.
Solution: Also clear tp_localdir and w_localdir when using aucmd_win.
          (zeertzjq)

closes: vim/vim#14435

9d956ee8ea
2024-04-08 06:25:22 +08:00
d32cbef595 vim-patch:9cd9e759ab1e (#28224)
runtime(doc): Normalise builtin-function optional parameter formatting

These should generally be formatted as func([{arg}]) and referenced as
{arg} in the description.

closes: vim/vim#14438

9cd9e759ab

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-04-08 06:11:31 +08:00
067f51e3aa Merge pull request #28183 from bfredl/intechnicolor
refactor(tests): use more standard colors but with extra colors
2024-04-07 11:49:13 +02:00
f6dcc464f2 fix(health): check unmatching python_glob as empty table (#28215) 2024-04-07 11:50:45 +08:00
98d687a4e1 test: more tests for aucmd_win remaining floating (#28214) 2024-04-07 07:10:32 +08:00
9dd112dd48 refactor: remove fn_bool
It's better to use vim.fn directly instead of creating minor
abstractions like fn_bool.
2024-04-06 16:42:26 +02:00
7560aee595 vim-patch:9.1.0266: filetype: earthfile files are not recognized (#28207)
Problem:  filetype: earthfile files are not recognized
Solution: Detect 'Earthfile' as earthfile
          (Gaëtan Lehmann)

closes: vim/vim#14408

28e5e7c484

Co-authored-by: Gaëtan Lehmann <gaetan.lehmann@gmail.com>
2024-04-06 21:11:57 +08:00
0443f06b71 docs: don't mention executable() can return -1
This cannot happen for neovim.
2024-04-06 12:47:28 +02:00
703f97568d docs: tags for commenting mappings without "-default" suffix (#28205)
This actually won't cause "duplicate tag" errors if plugins have tags of
the same name, because E154 is only given for duplicate tags in the same
directory.

Without those tags, trying to use :h for these mappings jumps to other
places, because there are matches with higher score.
2024-04-06 18:40:38 +08:00
406ff52824 test: fix vimscript/server_spec leaving behind a dir (#28204) 2024-04-06 15:19:13 +08:00
f4df49a959 revert: "vim-patch:9.1.0055: formatting long lines is slow"
Revert "vim-patch:9.1.0055: formatting long lines is slow (#27199)"

This reverts commit 89a9745a1a.

Fix #28197
2024-04-06 12:04:24 +08:00
ae28ef327e fix: adjust error message for error in UI event callback (#28200)
Also close Nvim instance before removing log file, otherwise the Nvim
instance will still write to the log file.

Also adjust log level in libuv_process_spawn(). Ref #27660
2024-04-06 11:18:43 +08:00
ddbd2b4e40 version.c: update [skip ci] (#28201)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2024-04-06 11:15:08 +08:00
fe0f1f1c19 vim-patch:cec44eae82c1 (#28199)
runtime: Remove more fallback :CompilerSet definitions from compiler plugins

Continue with vim/vim#14399

vim/vim@cec44ea
2024-04-06 11:13:56 +08:00
97122eaa1c fix(column): ignore empty signcols range (#28177)
Problem:  Invalid assert for empty signcols range. The empty range
          should already be removed from "b_signcols" at this point.
          The "clear" == kTrue call before the splice that made the
          range empty will have removed it, and the "clear" == kNone
          call after the splice already ignores the empty range.
Solution: Return early when "row2" < "row1".
2024-04-06 09:32:07 +08:00
5581a90e20 test: reduce sleep for file timestamp change (#28196)
Now that Nvim always supports nanotime, sleeping for some milliseconds
is enough.
2024-04-06 08:59:50 +08:00
08ae0c840b test(old): sleep for 1 second on non-Windows in test_stat.vim (#28195)
Now that Nvim always supports nanotime, sleeping for some milliseconds
is actually enough, but for test_stat.vim keeping some longer sleeps may
increase test coverage, so just match the upstream test.
2024-04-06 08:33:07 +08:00
a4e4e493df Merge pull request #28194 from zeertzjq/vim-9.1.0267
vim-patch:9.1.{0267,0268,0269}
2024-04-06 06:18:50 +08:00
c7d12a5e01 vim-patch:9.1.0269: Test for TextChanged is still flaky with ASAN
Problem:  Test for TextChanged is still flaky with ASAN.
Solution: Don't index the result of readfile().
          (zeertzjq)

It turns out that with ASAN the file may become empty during a write
even if it's non-empty both before and after the write, in which case
indexing the result of readfile() will error, so use join() instead.

Also don't delete the file halfway the test, just in case it may cause
errors on the next read.

closes: vim/vim#14421

e9ff79a7c9
2024-04-06 05:59:13 +08:00
f4a0c853db vim-patch:9.1.0268: Two tests in test_filechanged.vim are slow
Problem:  Two tests in test_filechanged.vim are slow.
Solution: Sleep for shorter if the +nanotime feature is available.
          (zeertzjq)

closes: vim/vim#14418

83cd2c7bf0
2024-04-06 05:58:55 +08:00
dcf4c5744a vim-patch:9.1.0267: File name entered in GUI dialog is ignored
Problem:  File name entered in GUI dialog is ignored (after v9.1.0265)
Solution: Only set file name to "Untitled" if GUI dialog didn't set it.
          (zeertzjq)

closes: vim/vim#14417

c20bdf1107
2024-04-06 05:58:21 +08:00
66568ed452 vim-patch:b73faa1c02d0 (#28193)
runtime: fix :compiler leaving behind a g:makeprg variable (vim/vim#14414)

Problem:  :compiler may leave behind a g:makeprg variable after vim/vim#14336.
Solution: Use a script local variable.

b73faa1c02

Also apply previously omitted change to compiler/context.vim.
2024-04-06 05:44:37 +08:00
7098341387 build(deps): bump msgpack-c to v6.0.1 2024-04-05 18:49:42 +02:00
39a0e6bf3c fix(treesitter): update parsers and queries 2024-04-05 18:36:17 +02:00
73de98256c feat(comment): add built-in commenting
Design

- Enable commenting support only through `gc` mappings for simplicity.
  No ability to configure, no Lua module, no user commands. Yet.

- Overall implementation is a simplified version of 'mini.comment'
  module of 'echasnovski/mini.nvim' adapted to be a better suit for
  core. It basically means reducing code paths which use only specific
  fixed set of plugin config.

  All used options are default except `pad_comment_parts = false`. This
  means that 'commentstring' option is used as is without forcing single
  space inner padding.

As 'tpope/vim-commentary' was considered for inclusion earlier, here is
a quick summary of how this commit differs from it:

- **User-facing features**. Both implement similar user-facing mappings.
  This commit does not include `gcu` which is essentially a `gcgc`.
  There are no commands, events, or configuration in this commit.

- **Size**. Both have reasonably comparable number of lines of code,
  while this commit has more comments in tricky areas.

- **Maintainability**. This commit has (purely subjectively) better
  readability, tests, and Lua types.

- **Configurability**. This commit has no user configuration, while
  'vim-commentary' has some (partially as a counter-measure to possibly
  modifying 'commentstring' option).

- **Extra features**:
    - This commit supports tree-sitter by computing `'commentstring'`
      option under cursor, which can matter in presence of tree-sitter
      injected languages.

    - This commit comments blank lines while 'tpope/vim-commentary' does
      not. At the same time, blank lines are not taken into account when
      deciding the toggle action.

    - This commit has much better speed on larger chunks of lines (like
      above 1000). This is thanks to using `nvim_buf_set_lines()` to set
      all new lines at once, and not with `vim.fn.setline()`.
2024-04-05 18:07:43 +02:00
2b9d8dc87e vim-patch:408281e16a36
runtime: Remove fallback :CompilerSet definition from compiler plugins

The :CompilerSet command was added in version Vim 6.4 which was released
twenty years ago.  Other runtime files do not support versions of that
vintage so it is reasonable to remove this fallback command definition
now.

closes: vim/vim#14399

408281e16a

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-04-05 15:45:13 +02:00
9af3559643 feat(lsp): set workDoneToken in initialize request (#28182)
Problem:

Some servers don't report progress during initialize unless the client
sets the `workDoneToken`

See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initiatingWorkDoneProgress

In particular:

> There is no specific client capability signaling whether a client will
> send a progress token per request. The reason for this is that this is
> in many clients not a static aspect and might even change for every
> request instance for the same request type. So the capability is signal
> on every request instance by the presence of a workDoneToken property.

And:

> Servers can also initiate progress reporting using the
> window/workDoneProgress/create request. This is useful if the server
> needs to report progress outside of a request (for example the server
> needs to re-index a database). The token can then be used to report
> progress using the same notifications used as for client initiated
> progress.

So far progress report functionality was relying entirely on the latter.

Solution:

Set a `workDoneToken`

Closes https://github.com/neovim/neovim/issues/27938
2024-04-05 13:24:39 +02:00
6ecb5d2d0c vim-patch:9.1.0265: console dialog cannot save unnamed buffers (#28185)
Problem:  console dialog cannot save unnamed buffers
Solution: set bufname before save (glepnir). Define dialog_con_gui
          to test for GUI+Console dialog support, use it to skip
          the test when the GUI feature has been defined.

Note: The dialog_changed() function will also try to call the
browse_save_fname() function, when FEAT_BROWSE is defined (which is only
defined in a GUI build of Vim). This will eventually lead to a call of
do_browse(), which causes an error message if a GUI is not currently
running (see the TODO: in do_browse()) and will then lead to a failure
in Test_goto_buf_with_onfirm().

Therefore, we must disable the Test_goto_buf_with_onfirm(), when the
dialog_con_gui feature is enabled (which basically means dialog feature
for GUI and Console builds, in contrast to the dialog_con and dialog_gui
feature).

(Previously this wasn't a problem, because the test aborted in the YES
case for the :confirm :b XgotoConf case and did therefore not run into
the browse function call)

closes: vim/vim#14398

df46115fc8

Co-authored-by: glepnir <glephunter@gmail.com>
2024-04-05 18:32:04 +08:00
9711370c26 feat(defaults): add :Inspect to right-click menu (#28181)
Ref #21393

- Move default user commands to _defaults.lua as that now contains all
  kinds of defaults rather than just default mappings and menus.
- Remove the :aunmenu as there are no menus when _defaults.lua is run.
2024-04-05 18:08:54 +08:00
a500c5f808 vim-patch:8.1.0815: dialog for file changed outside of Vim not tested (#28184)
Problem:    Dialog for file changed outside of Vim not tested.
Solution:   Add a test.  Move FileChangedShell test.  Add 'L' flag to
            feedkeys().

5e66b42aae

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-04-05 18:04:45 +08:00
e920d0f941 refactor(tests): use more standard colors but with extra colors 2024-04-05 11:00:10 +02:00
4add77ddbf vim-patch:5ccdcc482e29
runtime(java): Improve the matching of contextual keywords

- Recognise a _record_ contextual keyword.
- Recognise _non-sealed_, _sealed_, and _permits_ contextual
  keywords.
- Admit _$_ to keyword characters.
- Group _abstract_, _final_, _default_, _(non-)sealed_
  (apart from _(non-)sealed_, the incompossibility of these
  modifiers calls for attention).
- Remove another _synchronized_ keyword redefinition.

I have also replaced a function with an expression.  Before
patch 8.1.0515, it should have been declared :function! to
work with repeatable script sourcing; there is less to worry
about with an expression.

References:
https://openjdk.org/jeps/395 (Records)
https://openjdk.org/jeps/409 (Sealed Classes)
https://docs.oracle.com/javase/specs/jls/se21/html/jls-3.html#jls-3.8

closes: vim/vim#14403

5ccdcc482e

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-04-05 09:07:07 +02:00
75b80516d5 build: fix link error for _BitScanForward64 (#28173)
Problem: The usage of `_BitScanForward64` causes linking to fail on some systems.
Solution: Correctly check if it exists using `check_c_source_compiles`.
2024-04-05 09:56:35 +08:00
dc69c475a5 vim-patch:9.1.0262: Test for TextChanged is flaky with ASAN (#28180)
Problem:  Test for TextChanged is flaky with ASAN.
Solution: Wait for the file to be non-empty.
          (zeertzjq)

closes: vim/vim#14404

4a65391ca2
2024-04-05 07:24:25 +08:00
e016f5bee6 test: reduce exec_lua calls
`exec_lua` makes code slighly harder to read, so it's beneficial to
remove it in cases where it's possible or convenient.

Not all `exec_lua` calls should be removed even if the test passes as it
changes the semantics of the test even if it happens to pass.

From https://github.com/neovim/neovim/pull/28155#discussion_r1548185779:

"Note for tests like this, which fundamentally are about conversion, you
end up changing what conversion you are testing. Even if the result
happens to be same (as they often are, as we like the rules to be
consistent if possible), you are now testing the RPC conversion rules
instead of the vim script to in-process lua conversion rules."

From https://github.com/neovim/neovim/pull/28155#discussion_r1548190152:

"A test like this specifies that the cursor is valid immediately and not
after a separate cycle of normal (or an other input-processing) mode."
2024-04-04 13:10:11 +02:00
56701cd21e vim-patch:08d2401fbc6d
runtime(netrw): filetype not detected when editing remote files

fixes: vim/vim#14400

08d2401fbc

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-04 10:29:58 +02:00
15a2dd9e96 vim-patch:89cc03af71d9 (#28168)
runtime(doc): sort filetype.txt in the alphabetical order (vim/vim#14395)

89cc03af71

Co-authored-by: K.Takata <kentkt@csc.jp>
2024-04-04 06:19:13 +08:00
a469745338 vim-patch:9.1.0259: Normal mode TextChanged isn't tested properly (#28167)
Problem:  Normal mode TextChanged isn't tested properly.
Solution: Combine Test_Changed_ChangedI() and Test_Changed_ChangedI_2()
          and also run it on Windows. Fix a typo in main.c.
          (zeertzjq)

closes: vim/vim#14396

c422662933
2024-04-04 06:11:17 +08:00
1b55ed58ec Merge pull request #28156 from bfredl/attr_extend
refactor(tests): allow to extend the new base set of attrs
2024-04-03 13:39:08 +02:00
dbc0fa9bd6 fix(stdpath): remove duplicate directories (#26653) 2024-04-03 18:44:57 +08:00
ab0d3c4098 Merge pull request #28157 from fredizzimo/fsundvik/fix-io
fix: prevent child processes from inheriting ui channel file descriptors
2024-04-03 12:35:57 +02:00
e74cd1d9ff vim-patch:9.1.0253: filetype: typespec files are not recognized
Problem:  filetype: typespec files are not recognized
Solution: Detect '*.tsp' files as typespec
          (Hilmar Wiegand)

Specs is at https://typespec.io/

closes: vim/vim#14392

6c9f4f98f1

Co-authored-by: Hilmar Wiegand <me@hwgnd.de>
2024-04-03 10:45:29 +02:00
99b3a068de vim-patch:8.2.4098: typing "interrupt" at debug prompt may keep exception around (#28161)
Problem:    Typing "interrupt" at debug prompt may keep exception around,
            causing function calls to fail.
Solution:   Discard any exception at the toplevel. (closes vim/vim#9532)

069613c9e8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-04-03 10:43:03 +08:00
30b94ae494 Merge pull request #28153 from zeertzjq/vim-9.0.0581
vim-patch:9.{0.0581,1.0254}
2024-04-03 06:15:31 +08:00
aeabd8e245 vim-patch:9.1.0254: [security]: Heap buffer overflow when calling complete_add() in 'cfu'
Problem:  [security]: Heap buffer overflow when calling complete_add()
          in the first call of 'completefunc'
Solution: Call check_cursor() after calling 'completefunc' (zeertzjq)

closes: vim/vim#14391

0a419e07a7
2024-04-03 05:55:50 +08:00
a941207523 vim-patch:9.0.0581: adding a character for incsearch fails at end of line
Problem:    Adding a character for incsearch fails at end of line.
Solution:   Only check cursor line number.

d4566c14e7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-04-03 05:55:50 +08:00
b400b947f3 fix: prevent child processes from inheriting ui channel file descriptors 2024-04-02 22:15:34 +03:00
fa74f75710 refactor(tests): allow to extend the new base set of attrs
We start at 100 so we can make the base set larger if needed. (It might need to
grow/shrink as a result of adopting the new default color scheme as the
default for tests)

Usage best illustrataded by example.

Improving the workflow for making new tests with `screen:snapshot_util()` will
be a follow up.
2024-04-02 20:28:27 +02:00
d9235efa76 refactor(lsp): move workspace folder logic into the client
- Changed `reuse_client` to check workspace folders in addition to
  root_dir.
2024-04-02 16:47:17 +01:00
ffe3002568 test: silence expected errors
This will remove unrelated errors in .nvimlog at the end of test output.
2024-04-02 17:07:44 +02:00
6cfca21bac feat(treesitter): add @injection.filename
Problem: Injecting languages for file redirects (e.g., in bash) is not
possible.

Solution: Add `@injection.filename` capture that is piped through
`vim.filetype.match({ filename = node_text })`; the resulting filetype
(if not `nil`) is then resolved as a language (either directly or
through the list maintained via `vim.treesitter.language.register()`).

Note: `@injection.filename` is a non-standard capture introduced by
Helix; having two editors implement it makes it likely to be upstreamed.
2024-04-02 11:13:16 +02:00
b3f9da9524 refactor: informative error msg for 'noautocmd' (#28147)
Problem: Attempting to set 'noautocmd' for an existing window throws an error
that just says "Invalid key: 'noautocmd'" which is not very helpful.
Solution: Explain that 'noautocmd' can't be used with existing windows.
2024-04-02 12:48:21 +08:00
feaab21c71 vim-patch:cc7597c1edf4
runtime(yaml): improve syntax highlighting for YAML

- Recognize block scalar style to avoid unexpected highlighting by `yamlFlowString` (fix vim/vim#11517)
- Improve performance of `yamlFlowMappingKey` by allowing execution by the NFA engine (fix vim/vim#10730)
  - It was intentionally disabled before patterns were optimized by `s:SimplifyToAssumeAllPrintable`.
- Fix detection of flow style mapping indicators (fix vim/vim#8234).
- Enable highlighting of explicit mapping value indicators and node properties in flow style.
- Add syntax highlighting tests

closes: vim/vim#14354

cc7597c1ed

Co-authored-by: itchyny <itchyny@cybozu.co.jp>
2024-04-01 15:52:26 +02:00
4a6b4b00cb vim-patch:9.1.0251: Filetype test fails (#28142)
Problem:  Filetype test fails.
Solution: Move detection by name before detection by extension.
          Improve TextChanged test and remove wrong test and fix
          a typo in a comment (zeertzjq).

closes: vim/vim#14373

8eb7523802

The changes to filetype.vim are N/A since Nvim always prefers filename
matches to extension matches.
2024-04-01 21:49:44 +08:00
381806729d vim-patch:9.0.1643: filetype detection fails if file name ends in many '~' (#28141)
Problem:    Filetype detection fails if file name ends in many '~'.
Solution:   Strip multiple '~' at the same time. (closes vim/vim#12553)

c12e4eecbb

In Nvim this already works as Lua filetype detection isn't subject to
such a small recursion limit as autocommands, but it still makes sense
to avoid unnecessary recursion.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-04-01 18:43:30 +08:00
2e97ae2664 vim-patch:9.1.0250: filetype: ldscripts cannot be recognized
Problem:  filetype: ldscripts cannot be recognized
Solution: Detect '*/ldscripts/*' as ld
          (Wu, Zhenyu)

closes: vim/vim#14371

4c7098b00a

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
000431820e vim-patch:9.1.0249: filetype: rock_manifest and config.ld files are not recognized
Problem:  filetype: rock_manifest and config.ld files are not recognized
Solution: Detect 'rock_manifest' and 'config.ld' as lua
          (Wu, Zhenyu)

closes: vim/vim#14370

a917bd58bd

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
19ee281809 vim-patch:9.1.0248: filetype: yarn lock files are not recognized
Problem:  filetype: yarn lock files are not recognized
Solution: Detect 'yarn.lock' files as yaml
          (Wu, Zhenyu)

closes: vim/vim#14369

3b497aa247

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
de1a54dfe1 vim-patch:9.1.0247: filetype: bundle config files are not recognized
Problem:  filetype: bundle config files are not recognized
Solution: Detect '*/.bundle/config' as yaml
          (Wu, Zhenyu)

closes: vim/vim#14368

3f6fa93b3b

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
09869c3745 vim-patch:9.1.0246: filetype: fontconfig files are not recognized
Problem:  filetype: fontconfig files are not recognized
Solution: detect 'fonts.conf' as xml
          (Wu, Zhenyu)

closes: vim/vim#14367

a2c27b01dc

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
fa863c17b2 vim-patch:9.1.0245: filetype: zsh theme, history and zunit files are not recognized
Problem:  filetype: zsh theme, history and zunit files are not
          recognized.
Solution: Detect '.zsh_history', '*.zsh-theme' and '*.zunit' as zsh
          (Wu, Zhenyu)

closes: vim/vim#14366

a55a22a1a3

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
239101e32a vim-patch:9.1.0244: filetype: bash history files are not recognized
Problem:  filetype: bash history files are not recognized
Solution: detect .bash-history and .bash_history files as bash
          (Wu, Zhenyu)

closes: vim/vim#14365

84ce55001a

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
1a0b27965c vim-patch:9.1.0243: filetype: netrw history file is not recognized
Problem:  filetype: netrw history file is not recognized
Solution: Detect .netrwhist as vim files (Wu, Zhenyu)

closes: vim/vim#14364

abbb4a4f70

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
5cdbb22c34 vim-patch:9.1.0242: filetype: octave history files are not recognized
Problem:  filetype: octave history files are not recognized
Solution: Detect octave/history files as octave
          (Wu, Zhenyu)

closes: vim/vim#14363

be71ac694f

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
afc7a5611e vim-patch:9.1.0241: filetype: mysql history files are not recognized
Problem:  filetype: mysql history files are not recognized
Solution: Detect .mysql_history as mysql
          (Wu, Zhenyu)

closes: vim/vim#14362

6b285c8cfd

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
a978e83158 vim-patch:9.1.0240: filetype: some python tools config files are not recognized
Problem:  filetype: some python tools config files are not recognized
Solution: Detect config files for setuptools, pudb, coverage as dosini
          (Wu, Zhenyu)

closes: vim/vim#14361

665220a17b

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
acac56360f vim-patch:9.1.0239: filetype: gnuplot history files are not recognised
Problem:  filetype: gnuplot history files are not recognised
Solution: detect .gnuplot_history files as gnuplot
          (Wu, Zhenyu)

closes: vim/vim#14360

8e47eb31cc

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
ce69056e95 vim-patch:9.1.0238: filetype: jupyterlab and sublime config are not recognized
Problem:  filetype: jupyterlab and sublime config are not recognized
Solution: Detect jupyterlab and sublime config files as json
          (Wu, Zhenyu)

closes: vim/vim#14359

75c607dff7

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
f29ba3c46c vim-patch:9.1.0237: filetype: mplstyle files are not recognized
Problem:  filetype: mplstyle files are not recognized
Solution: Detect '*.mplstyle' files as yaml (Wu, Zhenyu)

closes: vim/vim#14358

0fd560d46a

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
2e0233d003 vim-patch:9.1.0236: filetype: texlua files are not recognized
Problem:  filetype: texlua files are not recognized
Solution: Add '*.tlu' pattern for texlua files (Wu, Zhenyu)

Reference: https://github.com/TeX-Live/texdoc/tree/master/script

closes: vim/vim#14357

a75f4791b1

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
96d77b2051 vim-patch:9.1.0235: filetype: supertux files are not recognized
Problem:  filetype: supertux files are not recognized
Solution: Supertux uses lisp to store hotkeys in config and game stage information,
          so add a pattern for supertux files.
          (Wu, Zhenyu)

Reference: https://github.com/SuperTux/supertux/wiki/S-Expression

closes: vim/vim#14356

4ff83b904e

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
c24dcb1bea vim-patch:9.1.0234: filetype: support for Intel HEX files is lacking
Problem:  filetype: support for Intel HEX files is lacking
Solution: Add more file extensions that are typical for Intel HEX files
          (Wu, Zhenyu)

Reference: https://en.wikipedia.org/wiki/Intel_HEX

closes: vim/vim#14355

e523dd9803

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
b8858dddbf Merge pull request #28080 from echasnovski/intro-buf-change
fix(intro): link showing intro to state at start
2024-04-01 08:02:42 +08:00
6b9a808d13 vim-patch:18d730d7b572
runtime(compilers): ensure compiler! sets global options (vim/vim#14336)

Previously some options were only set locally by
&l:makeprg/errorformat

This suffices for :compiler (without a trailing bang)
but falls short for :compiler! that sets &g:makeprg/errorformat as
well

Also apply kind suggestions by @dkearns and @lifepillar

18d730d7b5

omit context.vim (vim9script only)

Co-authored-by: Enno <Konfekt@users.noreply.github.com>
2024-04-01 00:48:30 +02:00
1570cfb638 test(core/job_spec): skip exit test if "sleep" command missing (#28137) 2024-04-01 06:48:14 +08:00
c4221df7b5 vim-patch:9.1.0232: Conceal test fails when rightleft feature is disabled (#28134)
Problem:  Conceal test fails when rightleft feature is disabled.
Solution: Skip test if rightleft feature is missing (Julio B).

closes: vim/vim#14342

5df961a1bc

Co-authored-by: Julio B <julio.bacel@gmail.com>
2024-04-01 06:12:47 +08:00
b08667d4f0 vim-patch:9.1.0231: Filetype may be undetected when SwapExists sets ft in other buf (#28136)
Problem:  Filetype may be undetected when a SwapExists autocommand sets
          filetype in another buffer.
Solution: Make filetype detection state buffer-specific.  Also fix a
          similar problem for 'modified' (zeertzjq).

closes: vim/vim#14344

5bf6c2117f
2024-04-01 06:12:11 +08:00
e005b8d2eb vim-patch:9.1.0230: TextChanged autocommand not triggered under some circumstances (#28135)
Problem:  TextChanged autocommand not triggered under some circumstances
          (Sergey Vlasov)
Solution: Trigger TextChanged when TextChangedI has not been triggered

fixes: vim/vim#14332
closes: vim/vim#14339

8603270293

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-01 05:39:52 +08:00
9b9dab622a vim-patch:807fff135d52
runtime(pamconf): add support for Debian specific @includes

fixes: vim/vim#14335

807fff135d

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-03-31 23:05:38 +02:00
20dd60f13c vim-patch:cbb92b5ceb6a
runtime(sshconfig,sshdconfig): update syntax (vim/vim#14351)

* fix case insensitivity of Host and Hostname keys
* improve regexps
* add keywords

cbb92b5ceb

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2024-03-31 23:05:20 +02:00
01691c5447 fix(lsp): abort callHierarchy on no result (#28102)
The `callHierarchy` function should warn the user when
`textDocument/prepareCallHierarchy` didn't resolve an entity and
return, rather than calling the `callHierarchy/{incoming,outgoing}Calls`
method with an empty object - which is encoded as an empty list (which
doesn't respect language server specification for the
`callHierarchy/incomingCalls` call).
2024-03-31 20:43:34 +02:00
b25753381c fix(api): set script context when using nvim_set_hl (#28123) 2024-03-31 20:21:47 +08:00
e1ff2c51ca feat(lua): pass keys before mapping to vim.on_key() callback (#28098)
Keys before mapping (i.e. typed keys) are passed as the second argument.
2024-03-31 11:20:05 +08:00
12240600f5 Merge pull request #28114 from echasnovski/builtin-hl-grey-gray
fix(highlight): add `Nvim{Light,Dark}Gray{1,2,3,4}` colors
2024-03-30 21:41:08 +08:00
66925f14de fix(highlight): consistently spell "Goldenrod" 2024-03-30 15:18:35 +02:00
837f268093 fix(highlight): add Nvim{Light,Dark}Gray{1,2,3,4} colors 2024-03-30 14:31:46 +02:00
77d3526a3d fix: explain that user should run nvim with -V1 to see more information
It's not obvious for users how to figure out where a mapping is set from
only "Last set from Lua".
2024-03-30 12:32:47 +01:00
35239e977f test: use matches(...) instead of ok(string.find(...)) (#28111) 2024-03-30 09:29:21 +08:00
19d63563e1 fix(extmarks): splice earlier when opening new line (#28108)
Related #26364 #26499 #26501
Fix #28107
2024-03-30 08:05:36 +08:00
2424c3e696 fix: support UNC paths in vim.fs.normalize
Closes https://github.com/neovim/neovim/issues/27068.
2024-03-30 00:51:09 +01:00
38e38d1b40 fix(fs): allow backslash characters in unix paths
Backslashes are valid characters in unix style paths.

Fix the conversion of backslashes to forward slashes in several `vim.fs`
functions when not on Windows. On Windows, backslashes will still be converted
to forward slashes.
2024-03-29 17:23:01 +01:00
36acb2a8ec ci: use --break-system-packages on mac when installing pynvim
Python 3.12+ throws an error if you try to install a package in an
externally managed environment. Using `--break-system-packages` is not
recommended for personal use, but for CI it should be fine and is
probably the most straightforward solution.
2024-03-29 17:11:29 +01:00
8424c64498 docs: document setting g:clipboard to v:false (#28085) 2024-03-29 09:43:26 -05:00
74776dfb2a fix(terminal): fix duplicate recording with mouse click (#28103) 2024-03-29 22:29:10 +08:00
5a5d26b4ab test: skip flaky tests 2024-03-29 14:27:13 +01:00
3d554b755b test(normal): port legacy normal test for page scrolling (#28100) 2024-03-29 21:22:16 +08:00
f29c41d665 test: add a bit more testing for vim.on_key() (#28095)
Also:
- Don't use NUMBUFLEN as buffer length as its unrelated.
- Restore accidentally removed comment from last commit.
2024-03-29 18:37:07 +08:00
fc19ee01ac vim-patch:9.1.0227: Recording may still be wrong in Select mode (#28092)
Problem:  Recording may still be wrong in Select mode (after 8.2.3993).
Solution: Make sure a character isn't split between two buffer blocks.
          (zeertzjq)

closes: vim/vim#14326

ea95f1a5ad
2024-03-29 17:50:55 +08:00
d223a7cbd2 vim-patch:9.1.0228: Two unrelated things are tested by a single test (#28093)
Problem:  Two unrelated things are tested by a single test.
Solution: Split it into two, restoring the old Test_brace_single_line().
          Add missing cleanup to some tests.
          (zeertzjq)

closes: vim/vim#14323

ad493ef3ea
2024-03-29 17:49:25 +08:00
b61575ba70 fix(intro): clear intro if new buffer is shown in focused float 2024-03-29 11:44:49 +02:00
9530a23016 fix(intro): link showing intro to state at start
Problem: Current behavior of stateful intro message is too persistent.
  For example, it is still drawn if new empty buffer is shown in current
  window (either by explicitly setting it or after `tabnew`). Although
  the buffer is empty, the act of it being shown should be made visible.

Solution: Make intro message persist if all is true:
    - Current buffer is the same as it was just after start, i.e. empty
      nameless with initial handle (i.e. 1).
    - Current window is the same as it was just after start, i.e. single
      non-floating with initial handle.
2024-03-29 11:44:49 +02:00
b1615a35f0 Merge pull request #28081 from bfredl/viewport_margin
feature(ui): indicate margins for the area used by win_viewport
2024-03-29 08:35:08 +01:00
2e4e12756a feat(ui): indicate margins for the area used by win_viewport
Problem: using win_viewport for implementing smooth scrolling in an external
UI might run into problems when winbar or borders is used, as there is
no indication that the entire grid is not used for scrolled buffer text.

Solution: add `win_viewport_margins` event.
2024-03-29 08:15:28 +01:00
e2224a7933 test: print screen snapshot in desired format (#28088)
Problem:  Screen snapshot is printed in a way that still needs to be formatted.
Solution: Adjust the snapshot formatting (indentation, braces).
2024-03-29 07:39:49 +08:00
4e56f7f0be test: skip another flaky test on macOS (#28087) 2024-03-29 06:26:01 +08:00
00b7428b3b fix(tui): don't use DECRQSS in screen or tmux (#28086)
They behave strangely when receiving that.
2024-03-29 05:55:25 +08:00
0ebc4de0ff feat: allow opting in to builtin clipboard providers (#28083)
Setting `vim.g.clipboard = false` will use the builtin clipboard
providers.

Closes https://github.com/neovim/neovim/issues/27698.

Co-authored-by: Gregory Anders <greg@gpanders.com>
2024-03-28 15:17:08 -05:00
cff8c15977 test: skip flaky tests 2024-03-28 18:18:57 +01:00
dde2cc65fd Merge pull request #28044 from luukvbaal/vim-9.1.0211
vim-patch:9.1.{0211,0215}
2024-03-28 19:47:40 +08:00
346a639028 vim-patch:9.1.0220: Few typos in source and test files (#28076)
Problem:  Typos in code and tests.
Solution: Fix typos (zeertzjq).

closes: vim/vim#14321

c029c131ea
2024-03-28 19:03:27 +08:00
2f638c0ac6 vim-patch:9.1.0215: Half-page scrolling does not support smooth-scrolling
Problem:  Page-wise scrolling with Ctrl-D/Ctrl-U implements
          it's own logic to change the topline and cursor.
          More logic than necessary for scrolling with Ctrl-F/Ctrl-B
          was removed in patch 9.1.0211.
Solution: Re-use the logic from Ctrl-E/Ctrl-Y/Ctrl-F/Ctrl-B while
          staying backward compatible as much as possible.
          Restore some of the logic that determined how many lines will
          be scrolled (Luuk van Baal)

5a2e3ec9ac
2024-03-28 11:39:34 +01:00
08b8ccd733 vim-patch:9.1.0218: Unnecessary multiplications in backspace code (#28075)
Problem:  Unnecessary multiplications in backspace code, as
          "col / ts * ts" is the same as "col - col % ts".
Solution: Change "col / ts * ts" to "col - col % ts".  Adjust the loop
          and the comments ins_bs() to be easier to understand.  Update
          tests to reset 'smarttab' properly.
          (zeertzjq)

closes: vim/vim#14308

8ede7a0694
2024-03-28 18:20:38 +08:00
6364fc617d vim-patch:9.1.0217: regexp: verymagic cannot match before/after a mark (#28074)
Problem:  regexp: verymagic cannot match before/after a mark
Solution: Correctly check for the very magic check (Julio B)

Fix regexp parser for \v%>'m and \v%<'m
Currently \v%'m works fine, but it is unable to match before or after
the position of mark m.

closes: vim/vim#14309

46fa3c7e27

Co-authored-by: Julio B <julio.bacel@gmail.com>
2024-03-28 18:15:41 +08:00
c804d7968b vim-patch:982e191b38b4 (#28073)
runtime(vim): Update base-syntax, match empty blob and :abclear modifiers (vim/vim#14318)

- Match empty blob literals.
- Match modifier arguments to :abclear commands.

982e191b38

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-03-28 18:08:05 +08:00
b499ccb2fa vim-patch:9.1.0214: Duplicate condition in win_lbr_chartabsize() (#28072)
Problem:  Duplicate condition in win_lbr_chartabsize().
Solution: Remove the duplicate condition, as it's already checked above.
          (zeertzjq)

closes: vim/vim#14320

5532d3b3f0
2024-03-28 18:00:14 +08:00
070b0b4572 vim-patch:9.1.0213: CI: MS-Windows fails in test_winfixbuf (#28071)
Problem:  CI: MS-Windows fails in test_winfixbuf
          (after v9.1.208)
Solution: Instead of skipping the test, write the file
          so it exists on disk, to verify that MS-Windows
          short filename expansion is successful.
          (Sean Dewar)

related: vim/vim#14286

aed6554b46

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2024-03-28 17:53:15 +08:00
67596c42eb vim-patch:9.1.0216: Error on exit with EXITFREE and 'winfixbuf' (#28070)
Problem:  Error on exit with EXITFREE and 'winfixbuf'.
Solution: Handle DT_FREE before checking for 'winfixbuf'.
          (zeertzjq)

closes: vim/vim#14314

620e85265c
2024-03-28 17:52:06 +08:00
2dea0ea820 vim-patch:b2e1fee72c45
runtime(haskell): allow TODO keywords in comments

closes: vim/vim#14319

b2e1fee72c

Co-authored-by: Enrico Maria De Angelis <enricomaria.dean6elis@gmail.com>
2024-03-28 10:41:42 +01:00
4147302f4b vim-patch:9.1.0211: page-wise scrolling does not support smooth-scrolling
Problem:  Page-wise scrolling with Ctrl-F/Ctrl-B implements
          it's own logic to change the topline and cursor.
          In doing so, skipcol is not handled properly for
          'smoothscroll', and virtual lines.
Solution: Re-use the logic from Ctrl-E/Ctrl-Y while staying
          backward compatible as much as possible.

b9f5b95b7b
2024-03-28 10:18:09 +01:00
19b443251f vim-patch:677cd956810e
runtime(debcontrol): add Static-Built-Using field (vim/vim#14306)

677cd95681

Co-authored-by: Guilherme Puida <guilherme@puida.xyz>
2024-03-28 10:15:47 +01:00
a0cbf1d8d5 fix(plines): cursor position with 'showbreak' and resized grid (#28067) 2024-03-28 14:12:54 +08:00
981301d11f build(terminfo): include user capabilities in comments (#28066)
Add -x flag to infocmp, so that comments match the content.
2024-03-28 10:23:07 +08:00
a89ce89742 docs: fix typos (#27868)
Co-authored-by: ite-usagi <77563904+ite-usagi@users.noreply.github.com>
Co-authored-by: v-sim <56476039+v-sim@users.noreply.github.com>
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Quico Augustijn <quico.public@gmail.com>
Co-authored-by: nhld <nahnera@gmail.com>
Co-authored-by: francisco souza <108725+fsouza@users.noreply.github.com>
2024-03-28 09:32:32 +08:00
4ee9e58056 feat(tui): query extended underline support using DECRQSS (#28052) 2024-03-28 07:39:36 +08:00
7168000b53 refactor(options): require enable_if = false iff no variable (#28050)
This makes grepping for unsupported options easier.
2024-03-28 06:02:49 +08:00
997bef54aa Merge pull request #28057 from bfredl/nosethl_2
refactor(tests): use global defaults instead of set_default_attr_ids (2)
2024-03-27 22:25:28 +01:00
1bfe6fdceb ci: add workflow_dispatch event to testing workflows
This allows us to easily test the release branch if needed.
2024-03-27 16:37:59 +01:00
443ea1b00d test(old): skip flaky test (#28060) 2024-03-27 22:07:54 +08:00
1fcf84d46a vim-patch:9.1.0196: filetype: support for gnuplot files is lacking (#27972)
Problem:  filetype: support for gnuplot files is lacking
Solution: Also detect *.gnuplot files
          (RobbiZ98)

closes: vim/vim#14243

3a6bd0c5c7

Co-authored-by: RobbiZ98 <113035863+RobbiZ98@users.noreply.github.com>
2024-03-27 19:46:31 +08:00
b556bd1a53 refactor(tests): use global defaults instead of set_default_attr_ids (2) 2024-03-27 12:32:53 +01:00
8774dad176 vim-patch:9.1.0212: CI: MS-Windows fails in test_winfixbuf (#28056)
Problem:  CI: MS-Windows fails in test_winfixbuf
          (after v9.1.208)
Solution: Skip Ms-Windows for now, fix style

related: vim/vim#14286

79b2867ce3

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-03-27 18:46:23 +08:00
7d97150084 fix(treesitter): return correct match table in iter_captures() 2024-03-27 10:39:46 +00:00
c4e1930851 Merge pull request #28025 from luukvbaal/introfloat
fix(intro): still show intro message with floating window
2024-03-27 11:10:13 +01:00
21360523cd fix(intro): still show intro message with floating window
Stop drawing the intro only after a split is opened.
2024-03-27 10:28:59 +01:00
63f7b1f31e refactor(options): swap immutable and hidden option property names
Ref: https://github.com/neovim/neovim/pull/28018#issuecomment-2021622120
2024-03-27 09:27:16 +00:00
635fa2c51c Merge pull request #28046 from bfredl/nosethl_1
refactor(tests): use new global defaults instead of set_default_attr_ids
2024-03-27 09:53:16 +01:00
61e25b7200 vim-patch:9.1.0208: winfixbuf does not allow to re-edit current buffer (#28054)
Problem:  winfixbuf does not allow to re-edit current buffer
          (Tim Pope, after v9.1.0147)
Solution: Explicitly allow :e even when 'winfixbuf' is set,
          since it just re-loads the current buffer
          (Colin Kennedy)

fixes: vim/vim#14237
closes: vim/vim#14286

65e580bd56
2024-03-27 16:22:33 +08:00
00e9c69551 test(tui_spec): fix flaky test for isolated "stop paste" (#28053)
In rare cases there may be multiple chunks of phase 2 because of timing.
2024-03-27 11:22:20 +08:00
bf7c7adb40 refactor(tui): reorder functions for query and response (#28051)
- Group functions for key encoding together.
- Move the handle_modereport() branch before the handle_unknown_csi()
  branch to match the order of the corresponding functions, but don't
  move handle_term_response() yet, as that will be subject to further
  changes (e.g. for #26744).
2024-03-27 11:10:28 +08:00
fc6d713dd8 feat(diagnostic): add support for many namespaces filtering in GetOpts (#28045) 2024-03-26 19:08:54 -05:00
77458e613b vim-patch:9.1.0207: No autocommand when writing session file (#28048)
Problem:  No autocommand when writing session file
Solution: Add SessionWritePost autocommand
          (Colin Kennedy)

fixes: vim/vim#14242
closes: vim/vim#14288

e5f2280381

Co-authored-by: Colin Kennedy <colinvfx@gmail.com>
2024-03-27 05:41:41 +08:00
de87197fdc refactor(options): make immutable and hidden options distinct
Problem: Currently, the `immutable` property of options can be applied for options that are hidden and options whose value simply can't be changed. Which is problematic when attempting to convert an option like `'maxcombine'` into an immutable option, because trying to `:set` an immutable option currently gives an error, which is only desired behavior for hidden options, not options that are actually immutable.

Solution: Separate the `immutable` property into two distinct `hidden` and `immutable` properties. Change all options with the `immutable` property to use the `hidden` property instead. Also add `p_mco` as an `immutable` option, as its value cannot be changed, and the underlying variable is not used anywhere.
2024-03-26 20:56:42 +00:00
d3771e68a2 vim-patch:63833bb0217f
runtime(json5): add basic indent support (vim/vim#14298)

63833bb021

Co-authored-by: Rocco Mao <dapeng.mao@qq.com>
2024-03-26 21:48:41 +01:00
3587377cda vim-patch:63d68c2c218e
runtime(java): Update java[CR]_JavaLang type lists (vim/vim#14297)

- Add to the list of java.lang runtime exceptions two new
  types: MatchException (Pattern Matching for _switch_) and
  WrongThreadException (Virtual Threads).
- "Demote" Compiler (removed in JDK 21) from the list of
  java.lang class types to a new list javaLangDeprecated.

References:
https://bugs.openjdk.org/browse/JDK-8205129
https://bugs.openjdk.org/browse/JDK-8282274
https://bugs.openjdk.org/browse/JDK-8284161

63d68c2c21

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-03-26 21:37:50 +01:00
35f2bb05a5 refactor(tests): use new global defaults instead of set_default_attr_ids
This will be done in batches.
2024-03-26 21:28:05 +01:00
0c0be09eab test(lsp): fix flaky basic_finish test again (#28041)
Problem:
LSP basic_finish test modified in #27899 is flaky again after #28030.

Solution:
Run on_setup() immediately after setup using a before_init callback.
2024-03-26 21:11:32 +08:00
3f3c7299a1 docs: remove remaining mentions of hkmap (#28038) 2024-03-26 18:30:17 +08:00
a142670360 feat(tui): support undercurl in WezTerm (#28037)
Also fix some typos in windows.ti while at it.

Close #21699
2024-03-26 14:25:01 +08:00
d6f406db45 fix(filetype): don't use fnamemodify() with :e for extension (#27976)
Use pattern matching instead, as fnamemodify() with :e produces an empty
string when the file name only has an extension, leading to differences
in behavior from Vim.

Related #16955 #27972
2024-03-26 13:31:37 +08:00
00e71d3da3 refactor(lsp): simplify client tracking
- Remove:
    - uninitialized_clients
    - active_clients
    - all_buffer_active_clients
- Add:
    - all_clients

- Use `lsp.get_clients()` to get buffer clients.
2024-03-25 22:21:08 +00:00
7e38630874 vim-patch:9.1.0204: Backspace inserts spaces with virtual text and 'smarttab' (#28032)
Problem:  Backspace inserts spaces with virtual text and 'smarttab'.
Solution: Ignore virtual text and wrapping when backspacing.
          (zeertzjq)

related: neovim/neovim#28005
closes: vim/vim#14296

0185c77014

Co-authored-by: VanaIgr <vanaigranov@gmail.com>
2024-03-26 05:42:56 +08:00
14839c5d18 fix(edit): backspace adds extra spaces for inline virtual text (#28005)
Problem:  Backspace adds extra spaces for inline virtual text.
Solution: Ignore virtual text and wrapping when backspacing.
2024-03-26 05:12:56 +08:00
a7bbda121d fix(test): typing 2024-03-25 21:09:57 +00:00
3fd8292aaf vim-patch:ab01adf7c65b
runtime(doc): Update options.txt

closes: vim/vim#14295

ab01adf7c6

Co-authored-by: Song-Tianxiang <149415622+Song-Tianxiang@users.noreply.github.com>
2024-03-25 22:07:17 +01:00
fb4e2dbbeb vim-patch:9.1.0205: Cannot use modifiers before :-Ntabmove (#28031)
Problem:  Cannot use modifiers before :-Ntabmove.
Solution: Check backwards from the command instead of checking from the
          start of the command line. Slightly adjust docs to make them
          more consistent (zeertzjq).

closes: vim/vim#14289

076faac537
2024-03-26 05:04:57 +08:00
31c4cb2347 vim-patch:8e59a7ba8877
runtime(java): Recognise the inline kind of the {@return} tag (vim/vim#14284)

Also:

- Refine comment matching (javaComment{Error\ and,Start}).
- Continue rewriting regexps (prefer atom grouping with
  non-capturing parens; factor out common prefixes in
  alternations).
- Allow for relative paths with the _file_ attribute of
  {@snippet}.
- Anticipate HTML in the @see tags.
- Match the nullary method parens in javaDocSeeTagParam.
- Improve the boundary patterns for summary sentences of
  documentation.

> This sentence ends at ... or at the first tag (as defined
> below).

There are Java documentation tags (@) and there are HTML
tags (<?>) (with Markdown looming large; see JEP 467).  With
block tags, e.g. @param, @return, @see, we begin another
documentation "sentence" whether or not the author has
terminated the summary sentence with a period; with
.<!-- -->, we may follow abbreviations, enumerations,
initials, (but instead consider @literal or &nbsp;) _within_
the summary sentence.  On the other hand, inline tags, e.g.
@code, @link, @literal, should not terminate the summary
sentence.

References:
https://bugs.openjdk.org/browse/JDK-8075778
https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html#firstsentence
https://docs.oracle.com/en/java/javase/21/docs/specs/javadoc/doc-comment-spec.html

8e59a7ba88

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-03-25 21:39:46 +01:00
934f38682a Revert "refactor(lsp): simplify client tracking"
This reverts commit 3f238b39cf.
2024-03-25 20:16:42 +00:00
2bcf88d354 ci: use the same logic to determine build type for all releases 2024-03-25 19:42:17 +01:00
3f238b39cf refactor(lsp): simplify client tracking
- Remove:
    - uninitialized_clients
    - active_clients
    - all_buffer_active_clients
- Add:
    - all_clients

- Use `lsp.get_clients()` to get buffer clients.
2024-03-25 18:02:38 +00:00
31a15fb2a1 vim-patch:3e72bf10a0a2
runtime(java): Recognise the {@snippet} documentation tag (vim/vim#14271)

Remember that ‘code fragments are typically Java source
code, but they may also be fragments of properties files,
source code in other languages, or plain text.’  Therefore,
with these changes, markup tags are highlighted in the Java
source files (as external snippets) and in the {@snippet}
tags.

Also:

- Improve matching of the multi-line {@code} documentation
  tag with any contained balanced braces.
- Recognise the {@literal} documentation tag.
- Highlight stray blanks in comments.

Related to an enhancement proposal for PCRE-like callouts
discussed at https://github.com/vim/vim/issues/11217.

References:
https://openjdk.org/jeps/413
https://docs.oracle.com/en/java/javase/21/docs/specs/javadoc/doc-comment-spec.html

3e72bf10a0

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-03-25 14:18:52 +01:00
829080d8c3 Merge pull request #28006 from wookayin/ts/refactor-tests
test(treesitter): refactor parser_spec, and separate query_spec
2024-03-25 08:06:08 -05:00
7dd6fd422b refactor(backup): remove duplicate os_copy_xattr() (#28020)
The first os_copy_xattr() is inside #ifdef UNIX, while the second isn't,
so the first one isn't actually needed.
2024-03-25 14:39:00 +08:00
02d00cf3ee fix(backup): E1509 when writing extended attr to symlink (#28014)
Problem:  E1509 when writing extended attributes to a symlink.
Solution: Copy the file before copying extended attributes.

On Fedora, the attribute being set is "security.selinux". For normal,
non-symlink files this attribute doesn't show up and that's why calling
os_copy_xattr() doesn't break in that case.
2024-03-25 07:45:47 +08:00
665d5d3969 vim-patch:4b715bdaf4ca
runtime(netrw): Fix typo in netrw#NetWrite (vim/vim#14283)

Fix typo in netrw#NetWrite (http) error message call.

4b715bdaf4

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-03-24 23:00:43 +01:00
036f86feac ci: provide separate macos releases for intel and arm
This will immensely reduce the complexity required to support both
architectures, reduce overall lines of code and unblock follow-up
simplifications.
2024-03-24 20:58:30 +01:00
ca239ecd07 test(treesitter): separate out query-related tests into query_spec
Move test cases that are more about treesitter query API rather than
parser API or LanguageTree out of "treesitter/parser_spec", and collect
them in another test suite "treesitter/query_spec".
2024-03-24 11:11:34 -04:00
011585f35f vim-patch:6f438199c92b
runtime(compiler): update errorformat for dot and neato compiler (vim/vim#14257)

* add errorformat for dot compiler
* add errorformat for neato compiler

6f438199c9

Co-authored-by: Enno <Konfekt@users.noreply.github.com>
2024-03-24 11:05:04 +01:00
ed910604ca vim-patch:d3c0ff5d5a90
runtime(termdebug): allow multibyte characters as breakpoint signs (vim/vim#14274)

Allow multibyte characters as termdebug signs using slice() function

d3c0ff5d5a

Co-authored-by: Mihai Ciuraru <mihai.ciuraru@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-03-24 10:32:07 +01:00
921aa52b8f test(treesitter): improve the style of treesitter/parser_spec
General refactoring, including:

- Improve whitespace and indentation
- Prefix captures with `@`
- Add more comments on `iter_capture()` tests
- Move `test_query` up closer to the fixture source string

No behavioral changes are made.
2024-03-23 23:57:41 -04:00
d3e51603bc ci(windows): optionally test windows with ASAN
Add the label `ci:windows-asan` to enable it.
2024-03-23 23:19:29 +01:00
ca6dbf3558 fix(vim.iter): use correct cmp function when truncating tail in take (#27998) 2024-03-23 16:46:54 -05:00
3d9c028a4c Merge pull request #27980 from bfredl/noignore
refactor(tests): all screen tests should use highlights
2024-03-23 20:01:21 +01:00
0c59771e31 refactor(tests): all screen tests should use highlights
This is the first installment of a multi-PR series significantly
refactoring how highlights are being specified.

The end goal is to have a base set of 20 ish most common highlights,
and then specific files only need to add more groups to that as needed.

As a complicating factor, we also want to migrate to the new default
color scheme eventually. But by sharing a base set, that future PR
will hopefully be a lot smaller since a lot of tests will be migrated
just simply by updating the base set in place.

As a first step, fix the anti-pattern than Screen defaults to ignoring
highlights. Highlights are integral part of the screen state, not
something "extra" which we only test "sometimes". For now, we still
allow opt-out via the intentionally ugly

  screen._default_attr_ids = nil

The end goal is to get rid of all of these eventually (which will be
easier as part of the color scheme migration)
2024-03-23 13:44:35 +01:00
2c1e8f7e96 build: use GIT_REPOSITORY for local URLs
`GIT_REPOSITORY` will cause cmake to rebuild if local dependency
changes, which isn't the case for `URL`.

Also document how to test a different commits of a dependency.
2024-03-23 13:36:12 +01:00
881f5e5917 vim-patch:9.1.0199: Not enough tests for the slice() function (#27991)
Problem:  Not enough tests for the slice() function.
Solution: Test with multibyte chars, and in both Legacy and Vim9 script.
          Update docs to be clearer about how it treats composing chars.
          (zeertzjq)

closes: vim/vim#14275

ad38769030
2024-03-23 16:33:53 +08:00
2955c921ce fix(filetype): use unexpanded file name (#27931)
When the edited file is a symlink, the unexpanded file name is needed to
to achieve the same behavior as the autocommand pattern matching in Vim.
Neither args.file nor args.match are guaranteed to be unexpanded, so use
bufname() instead.
2024-03-23 11:46:23 +08:00
a629888427 Merge pull request #27987 from zeertzjq/vim-8.2.2318
vim-patch:8.2.{2318,2605}
2024-03-23 08:26:57 +08:00
d443b438f6 vim-patch:8.2.2605: Vim9: string index and slice does not include composing chars
Problem:    Vim9: string index and slice does not include composing chars.
Solution:   Include composing characters. (issue vim/vim#6563)

0289a093a4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-03-23 08:10:17 +08:00
e4a23b6e0b vim-patch:8.2.2318: Vim9: string and list index work differently
Problem:    Vim9: string and list index work differently.
Solution:   Make string index work like list index. (closes vim/vim#7643)

e7525c5520

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-03-23 08:07:05 +08:00
a44ac26c75 vim-patch:76d62985c1ff (#27985)
runtime(vim): Update base-syntax, remove old unused syntax groups. (vim/vim#14146)

Remove old unused syntax groups.

- vimRegion, vimPattern and vimKeyword removed in Vim 5.3.
- vimAuSyntax, vimAutoCmdOpt, vimAutoSet and vimStatement removed in 5.6.

The following were linked in :hi commands but never defined with :syn
and, most likely, never used:
 - vimHLMod introduced in 5.0.
 - vimKeycode and vimKeycodeError introduced in 5.4.
 - vimElseif introduced in 5.6.
 - vimFold introduced in 6.4.
 - vimOperStar (and vimoperStar) introduced in 9.0.

76d62985c1

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-03-23 06:43:25 +08:00
849d82b80b fix(lsp): handle stale bufnr on LspRequest autocmd trigger (#27981)
continuation of https://github.com/neovim/neovim/pull/24013
2024-03-22 17:46:01 +01:00
dc110cba3c Merge pull request #26970 from famiu/refactor/options/set_option_direct
refactor(options): remove `set_string_option_direct()`
2024-03-22 09:14:42 +08:00
15c6909bb1 vim-patch:35e6f4ca27c8 (#27973)
runtime(vim): Update base-syntax, improve function definition highlighting (vim/vim#14203)

Improve function definition highlighting.

- Match bang and function modifiers - abort etc.
- Only match valid scope modifiers.
- Match listing commands.
- Don't match ex commands in function names.
- Split function syntax groups into :func and :def subgroups.
- Match Vim9-script parameter and return types.
- Limit legacy-script and Vim9-script comments to :func and :def
  definitions, respectively.

35e6f4ca27

Omit the vimFunctionError change as it's a whitespace-only change and
will likely be superseded by later patches.

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-03-22 07:31:43 +08:00
50b2499306 Merge pull request #27971 from zeertzjq/vim-9.1.0192
vim-patch:9.1.{0192,0195}: drop: don't rewind when editing the same file
2024-03-22 06:28:55 +08:00
dabc44d15c vim-patch:9.1.0195: memleak with ex_drop, NULL dereference
Problem:  memleak with ex_drop(), NULL dereference
          (zeertzjq)
Solution: revert back to ex_rewind(), use curbuf instead of buf

fixes: vim/vim#14246
closes: vim/vim#14251

85a769d466

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-03-22 06:04:37 +08:00
271879dd49 vim-patch:9.1.0192: drop: don't rewind when editing the same file
Problem:  :drop tries to :rewind the argumentlist, which results in E37
          (after v9.1.0046)
Solution: instead of calling ex_rewind(), call open_buffer() only when
          re-using the initial empty buffer

fixes: vim/vim#14219
closes: vim/vim#14220

978178823b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-03-22 06:04:37 +08:00
774455dc37 vim-patch:9.1.0194: gcc complains about uninitialized var (#27970)
Problem:  gcc complains about uninitialized var
          (Tony Mechelynck)
Solution: initialize to NULL

9eb236f455

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-03-22 06:04:11 +08:00
2289ecd22e Merge pull request #27969 from famiu/refactor/misc/xctz
refactor(misc): use MSVC compiler builtin for `xctz()`
2024-03-21 21:29:11 +01:00
1dde678757 refactor(misc): use MSVC compiler builtin for xctz()
Problem: `xctz()` uses a fallback algorithm for MSVC, even though a compiler builtin exists.

Solution: Make `xctz()` use the compiler builtin for MSVC compiler.
2024-03-22 01:43:53 +06:00
563a369a1b Merge pull request #27961 from bfredl/rpccrash
fix(rpc): do not crash when no input is consumed
2024-03-21 17:09:06 +01:00
8921d56053 fix(rpc): do not crash when no input is consumed
fixes #23781

Co-authored-by: glacambre <code@lacamb.re>
2024-03-21 15:52:28 +01:00
58cc66ee1f test(options): add test for 'modified' 2024-03-21 19:40:13 +06:00
2214f9c19d refactor(options): remove set_string_option_direct()
Problem: `set_string_option_direct()` contains a separate codepath specifically for setting string options. Not only is that unnecessary code duplication, but it's also limited to only string options.

Solution: Replace `set_string_option_direct()` with `set_option_direct()` which calls `set_option()` under the hood. This reduces code duplication and allows directly setting an option of any type.
2024-03-21 15:41:14 +06:00
5aa8c02a9d refactor(options): add direct flag to set_option() 2024-03-21 15:41:14 +06:00
10ab135adf refactor(options): restructure set_option 2024-03-21 15:21:01 +06:00
734848dc1a feat(colorscheme): add semantic tokens modifiers to builtin color scheme 2024-03-21 09:01:37 +01:00
45032a941d docs(lsp): describe semantic tokens highlight groups with more details
Problem: Description of highlight groups for LSP semantic tokens can be
  more up to date and useful.
  Right now it misses several actually defined highlight groups and
  presents information about Vim highlight groups they are linked to.
  This is both outdated (they link to tree-sitter `@` groups now) and
  redundant (users can see this information with `:Inspect` over the
  group name itself).

Solution: Synchronize the list of groups with specification and provide
  actionable descriptions.
2024-03-21 09:01:37 +01:00
c1c6c1ee12 vim-patch:9.1.0190: complete_info() returns wrong order of items (#27955)
Problem:  complete_info() returns wrong order of items
          (after v9.0.2018)
Solution: Revert Patch v9.0.2018
          (Girish Palya)

bug fix: complete_info() gives wrong results

1) complete_info() reverses list of items during <c-p>
2) 'selected' item index is wrong during <c-p>
3) number of items returnd can be wrong

Solution:
- Decouple 'cp_number' from 'selected' index since they need not be
  correlated
- Do not iterate the list backwards
- Add targeted tests

Regression introduced by 69fb5afb3b
Following are unnecessary commits to patch problems from above:
fef6630166
daef8c7437

All the tests from above commits are retained though.

fixes: vim/vim#14204
closes: vim/vim#14241

8950bf7f8b

Remove EMPTY_IF_NULL() as it has been unnecessary since #12673.

Co-authored-by: Girish Palya <girishji@gmail.com>
2024-03-21 07:50:12 +08:00
cfc9fcc91f vim-patch:2708c0b5854f
runtime(deb822sources): Add minimal ftplugin (vim/vim#14240)

Set comment related options and avoid automatic line wrapping.

2708c0b585

Co-authored-by: James McCoy <jamessan@jamessan.com>
2024-03-20 22:01:40 +01:00
c72d877c33 fix(cmdline): wrong 'incsearch' highlighting after :redraw (#27947)
Problem:  Calling :redraw from a timer callback clears 'incsearch' highlighting.
Solution: Re-apply 'incsearch' highlighting if the screen was updated.
2024-03-20 21:59:04 +08:00
7549845e8d Merge #27930 nvim_create_buf fixes 2024-03-20 06:15:38 -07:00
47388614cb refactor(treesitter): handle coverity warnings better 2024-03-20 12:22:54 +00:00
0f85aeb478 fix(treesitter): treecursor regression
- Also address some coverity warnings

Fixes #27942
2024-03-20 10:56:16 +00:00
9765efb40f test(ui/messages_spec): unskip msg_puts_printf test on Unix CI (#27941)
It no longer fails on Unix CI.
2024-03-20 08:02:50 +08:00
37db3d97ea vim-patch:ec21bafc135a (#27939)
runtime(vim): Update base-syntax, disallow '.' at start of menu item names (vim/vim#14232)

Disallow '.' at the start of a menu item name.

This is the menu path separator character and should be escaped with a
'\' in this case.

Partially fixes vim/vim#14230.  "popup" is still incorrectly matched as the Ex
command.

ec21bafc13

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-03-20 07:04:31 +08:00
4694ce6877 vim-patch:9.1.0188: filetype: no support for Vento files (#27935)
Problem:  Vento files are not recognized.
Solution: Recognize *.vto files as filetype "vento" (wrapperup)

Vento is a templating engine https://vento.js.org/

closes: vim/vim#14229

9f26e5a9bc

Co-authored-by: wrapperup <wrapperup4@gmail.com>
2024-03-20 05:31:44 +08:00
e39d9636af build(deps): bump vimdoc parser to v2.5.1 2024-03-19 20:44:05 +01:00
597d4c63bd refactor(treesitter): reorder functions 2024-03-19 18:40:08 +00:00
aca6c93002 refactor(treesitter): simplify argument checks for userdata 2024-03-19 16:16:54 +00:00
6091df6b7a fix(api): nvim_create_buf assert fails if autocmds set &swapfile
Problem: assertion failure in nvim_create_buf if buflist_new autocommands open
a swapfile when "scratch" is set.

Solution: block autocommands when setting up the buffer; fire them later
instead.

Note that, unlike buflist_new, I don't check if autocommands aborted script
processing; the buffer is already created and configured at that point, so might
as well return the handle anyway.

Rather than repeat try_{start,end} and {un}block_autocmds for each relevant
operation, just do it at the start and near the end. This means that, if
TermResponse fires from unblock_autocmds for whatever reason, it can see the
buffer in an already configured state if we didn't bail due to an error (plus
it's probably a bit cleaner this way).
2024-03-19 16:13:52 +00:00
d5c23d72a5 fix(api): nvim_create_buf leaks memory if buffer is loaded early
Problem: memory leak in nvim_create_buf if buflist_new autocommands load the
new buffer early.

Solution: do not open a memfile in that case.
2024-03-19 15:43:08 +00:00
aca2048bcd refactor(treesitter): redesign query iterating
Problem:

  `TSNode:_rawquery()` is complicated, has known issues and the Lua and
  C code is awkwardly coupled (see logic with `active`).

Solution:

  - Add `TSQueryCursor` and `TSQueryMatch` bindings.
  - Replace `TSNode:_rawquery()` with `TSQueryCursor:next_capture()` and `TSQueryCursor:next_match()`
  - Do more stuff in Lua
  - API for `Query:iter_captures()` and `Query:iter_matches()` remains the same.
  - `treesitter.c` no longer contains any logic related to predicates.
  - Add `match_limit` option to `iter_matches()`. Default is still 256.
2024-03-19 14:24:59 +00:00
16a416cb3c fix(terminal): don't pass incomplete UTF-8 sequence to libvterm (#27922) 2024-03-19 16:56:51 +08:00
c30ebb17f6 fix(treesitter): document more standard highlight groups
Problem: Not all standard treesitter groups are documented.

Solution: Document them all (without relying on fallback); add default
link for new `*.builtin` groups to `Special` and `@keyword.type` to
`Structure`. Remove `@markup.environment.*` which only made sense for
LaTeX.
2024-03-19 09:41:16 +01:00
5e875ae8d0 feat(treesitter): update Markdown parsers and queries to v0.2.1 2024-03-19 09:41:16 +01:00
ff6092b4ee feat(treesitter): update Bash parser and queries to v0.21.0 2024-03-19 09:41:16 +01:00
8a3385dde7 feat(treesitter): update Python parser and queries to v0.21.0 2024-03-19 09:41:16 +01:00
1384bebd5a feat(treesitter): update query parser to v0.2.0 2024-03-19 09:41:16 +01:00
987dff6713 feat(treesitter): update Vimdoc parser and queries to v2.4.0 2024-03-19 09:41:16 +01:00
20dcbaaaf8 feat(treesitter): update Vim parser and queries to v0.4.0 2024-03-19 09:41:16 +01:00
aca4ad430b feat(treesitter): update Lua parser and queries to v0.1.0 2024-03-19 09:41:16 +01:00
8dda630ae9 feat(treesitter): update C parser and queries to v0.21.0 2024-03-19 09:41:16 +01:00
ac99a0810e build(deps): bump tree-sitter to v0.22.2
release notes:
* https://github.com/tree-sitter/tree-sitter/releases/tag/v0.22.0
* https://github.com/tree-sitter/tree-sitter/releases/tag/v0.22.1
* https://github.com/tree-sitter/tree-sitter/releases/tag/v0.22.2
2024-03-19 09:41:16 +01:00
187ae67735 build: introduce variable DEPS_IGNORE_SHA for skipping dependency hash check
This will reduce friction as developers no longer need to provide a hash
when testing out different commits.

To skip the hash check, set `DEPS_IGNORE_SHA` to `TRUE` in
`cmake.deps/CMakeLists.txt`.
2024-03-19 08:52:03 +01:00
d744876723 test(terminal/cursor_spec): unskip tests that pass on Windows (#27924)
Also:
- Make indent of test cases consistent.
- Unskip TUI rapid resize test with ASAN as reflow is now disabled.
2024-03-19 15:42:55 +08:00
400ef8aaa0 test(terminal/buffer_spec): fix incorrect tests (#27923)
The first describe() block enters terminal mode in before_each(), so
feed_command() at the start of a test case writes it to the terminal
instead of executing it.
2024-03-19 12:44:14 +08:00
79af4e7e73 vim-patch:78c189837ae6 (#27920)
runtime(doc): Recover some missed commas and periods in starting.txt

Also:

- Insert some missing words;
- Strive for consistency with capitalisation of words;
- Improve shell alias examples.

The gvim words were left alone for now, but they deserve to
be treated like proper names, GVim or GUI Vim, unless these
refer to executable filenames (on *nix systems).

closes: vim/vim#14194

78c189837a

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-03-19 06:55:30 +08:00
b5e3df37a4 vim-patch:9530fe4f3a69 (#27919)
runtime(vim): Update base-syntax, improve :highlight command (vim/vim#14228)

Improve :highlight command highlighting

- Use the same highlight groups for "default link" with and without
  bang.
- Match some common line-continuation use.
- Match :hi clear variants.
- Highlight color-name values.

Resync vim.vim and generator/vim.vim.base.

9530fe4f3a

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-03-19 06:38:30 +08:00
5c9033024f vim-patch:9.1.0187: filetype: no support for Dafny files (#27918)
Problem:  Dafny files are not recognized.
Solution: Recognize *.dfy files as filetype "dafny" (zeertzjq).

Ref: https://dafny.org/
Ref: https://github.com/mlr-msft/vim-loves-dafny

closes: vim/vim#14226

4e334d0443

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-03-18 22:47:51 +01:00
920ef1fd71 vim-patch:ef21bcaab145
runtime(rust): Respect no_plugin_maps and no_rust_maps globals (vim/vim#14221)

ef21bcaab1

Co-authored-by: MyyPo <110892040+MyyPo@users.noreply.github.com>
2024-03-18 22:01:33 +01:00
e3bd04f2af fix(pager): handle consecutive newlines properly (#27913) 2024-03-18 22:25:55 +08:00
5de0482d1a test(lsp): fix flaky basic_finish test (#27899)
Problem:
As mentioned in #23002 on_setup and on_init are run concurrently.
However, in basic_finish tests on_setup must attach the client before
on_init finishes.  The other basic_finish test isn't flaky because it
makes an RPC request in on_init.

Solution:
Don't use on_setup in basic_finish tests.
2024-03-18 19:49:31 +08:00
e34c23b701 fix(tutor): set a value for ":syntax iskeyword" (#27833)
Problem: "NOTE"s, inline Vim script code, and links ending in digits may not be
highlighted correctly within the :Tutor.

Solution: set an explicit value for ":syntax iskeyword" that includes digits. Do
it after ":syntax include"s, so the included syntax/sh.vim doesn't mess with the
value.

Increase screen test width so all text within the conclusion section is visible.

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2024-03-18 11:19:20 +00:00
66945e11b3 refactor(messages): remove condition that is always true (#27909)
After #25470 the `s` pointer is advanced before calling store_sb_text()
when a newline character is found, and store_sb_text() sets `sb_str` to
`s`, so it's not possible for `s == sb_str + 1` and `*sb_str == '\n'` to
be satisfied at the same time.
2024-03-18 19:01:01 +08:00
a1bab03945 docs(build): update rhel/fedora build prerequisite (#27875) 2024-03-18 10:03:44 +01:00
f0bd895995 vim-patch:3d46de703cf6
runtime(go): `goPackageComment` highlighting too broad

Previously this would highlight any comment before a line starting
`package`, for example

    var (
      // This comment would be highlighted as a goPackageComment
      packages []string
    )

The package clause is only valid when followed by a space[1], so include
this restriction

This is upstreaming a change from `go-vim`[2]

[1] https://go.dev/ref/spec#Package_clause
[2] d1c36cc417

3d46de703c

Co-authored-by: Matthew Hughes <matthewhughes934@gmail.com>
2024-03-18 15:49:08 +08:00
9d315fb8b7 vim-patch:9.1.0186: cursor pos wrong on mouse click after eol with 'rl', 've' and conceal (#27903)
Problem:  Wrong cursor position when clicking after end of line with
          'rightleft', 'virtualedit' and conceal.
Solution: Set values in ScreenCols[] also with SLF_RIGHTLEFT.  Also fix
          off-by-one cursor position with 'colorcolumn' (zeertzjq).

closes: vim/vim#14218

deb2204bff
2024-03-18 10:35:41 +08:00
eabf9de1dc fix(messages): allow more prompt in headless mode with UI (#27905)
Problem:  More prompt is not shown in headless mode even if there is a
          UI attached.
Solution: Don't skip more prompt when there is a UI active.
2024-03-18 10:34:27 +08:00
3b29b39e6d fix(treesitter): revert to using iter_captures in highlighter
Fixes #27895
2024-03-17 20:37:15 +00:00
77a9f3395b fix(lsp): create codelens request parameters for each buffer (#27699) 2024-03-17 21:04:59 +01:00
08986bb597 test: combining TermCursorNC with CursorLine/CursorColumn (#27898) 2024-03-17 18:09:29 +08:00
091eb4c8c7 fix(mouse): click after eol with conceal and virtual text (#27897)
Problem:  Wrong cursor position when clicking after end of line with
          'virtualedit', conceal and virtual text.
Solution: Always fill linebuf_vcol[] for the columns to clear.
2024-03-17 17:54:18 +08:00
54db75e995 refactor(drawline): integrate terminal hl with eol loop (#27893)
There is no test for using 'cursorline' in Normal mode in a terminal
buffer, so add a test and fix 'cursorcolumn' remaining when entering
Terminal mode.

Also move synIDattr() tests to ui/highlight_spec.lua.
2024-03-17 17:24:03 +08:00
c52dfb6e84 fix(normal): don't check conceal when pressing 'r' (#27892)
Problem:  Cursor line is unconcealed when pressing 'r' in Normal mode
          when 'concealcursor' contains 'n' but not 'i'.
Solution: Don't check conceal when pressing 'r' in Normal mode.

Vim doesn't have this problem because it doesn't call redrawWinline() in
conceal_check_cursor_line() and instead sets a global variable.
2024-03-17 09:44:10 +08:00
d114dbe9f7 vim-patch:9.1.0184: Cursor pos wrong when clicking with conceal and wrap (#27890)
Problem:  Cursor position wrong when clicking with conceal and wrap.
Solution: Use the virtual column of the last char for ScreenCols[] in
          boguscols.  Remove use of MAXCOL in ScreenCols[].  Rename
          third argument of wlv_screen_line() to "clear_end" as that's
          clearer what it does (zeertzjq).

related: 14192
closes: vim/vim#14200

d0c1b7723f

Rename win_put_linebuf() to wlv_put_linebuf().
2024-03-17 07:26:39 +08:00
34b57508a7 fix(drawline): check filler_todo in place of removed draw_state (#27889)
The only place it matters is the conceal wcol check, but it can avoid
unnecessary computations at other places.
2024-03-17 05:43:14 +08:00
14e4b6bbd8 refactor(lua): type annotations 2024-03-16 19:26:10 +00:00
924a7ef8bb ci: don't assign reviewers for "api" and "ui" labels
The labels as they're currently defined are too broad to meaningfully
add specific reviewers for them.
2024-03-16 15:11:26 +01:00
bf24298fea ci: simplify concurrency string
`github.ref` is now defined for both pull requests and pushes, meaning
that it can be used to simplify the concurrency group.
`cancel-in-progress` is set to true only if the trigger is a pull
request, as we don't want master runs to cancel each other out.
2024-03-16 15:00:09 +01:00
5da0d513b9 ci: update clang version to 18
This fixes the false TSAN errors in CI.
2024-03-16 14:40:39 +01:00
542c910a1d fix(lsp): add missing LSP semantic token highlight links
Added the following LSP semantic token types to be linked to highlight
groups by default:

* @lsp.type.event
* @lsp.type.keyword
* @lsp.type.modifier
* @lsp.type.number
* @lsp.type.operator
* @lsp.type.regexp
* @lsp.type.string
2024-03-16 20:37:56 +08:00
ee89ba1d75 vim-patch:9.1.0182: Can define function with invalid name inside 'formatexpr' (#27883)
Problem:  Can define function with invalid name inside 'formatexpr'.
Solution: Use goto instead of checking for did_emsg later.
          (zeertzjq)

closes: vim/vim#14209

6a04bf5ee5
2024-03-16 17:26:14 +08:00
c0daea3afd vim-patch:9.1.0183: Wrong display or screenpos() result when toggling diff mode (#27882)
Problem:  Wrong display or screenpos() result when toggling diff mode.
Solution: Reset w_skipcol when disabling 'wrap'.  Reset w_leftcol when
          enabling 'wrap' (zeertzjq).

fixes: vim/vim#14210
closes: vim/vim#14211

9e7f1fc2f1
2024-03-16 17:10:20 +08:00
ead3a1bd7a vim-patch:8.2.3782: Vim9: no error if a function shadows a script variable (#27881)
Problem:    Vim9: no error if a function shadows a script variable.
Solution:   Check the function doesn't shadow a variable. (closes vim/vim#9310)

052ff291d7

Omit EVAL_VAR_NO_FUNC: Vim9 script only.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-03-16 17:05:59 +08:00
848e64322a vim-patch:989faa4fce65 (#27880)
runtime(doc): make :h tag-! more consistent (vim/vim#14208)

- Use "on" and "off" for 'winfixbuf' option values.
- Retab the table.

989faa4fce
2024-03-16 16:38:40 +08:00
9c2fdfe6e7 Merge pull request #27877 from bfredl/pseudorandom
fix(intro): redrawing intro exposing pseudo-randomness
2024-03-16 09:32:52 +01:00
d1a30221fc fix(intro): redrawing intro exposing pseudo-randomness
problem:  redrawing intro exposes pseudo-randomness
solution: remove pseudo-randomness
2024-03-16 08:40:45 +01:00
c0549b9c47 Merge pull request #27871 from bfredl/ui_flush_fix
fix(ui): edge case around flushing in grid_line
2024-03-16 08:36:37 +01:00
4447cefa48 fix(l10n): update Japanese translations (#27856) 2024-03-16 14:50:52 +08:00
59aadf33ef fix(man): pass modifiers also to :tag (#27878)
There aren't really many modifiers that take an effect on :tag (except
maybe :confirm, :unsilent, :verbose), but pass them for consistency.
2024-03-16 09:56:58 +08:00
25e7299707 feat(man): allow opening pages in current window (#27861)
With :hide modifier, open page in current window.
2024-03-16 09:00:25 +08:00
102a72a21e Merge pull request #27873 from zeertzjq/vim-61887b3d6fd8
vim-patch: Update Vim syntax
2024-03-16 04:32:44 +08:00
b82d755109 vim-patch:b4b3d7de2413
runtime(vim): Update base-syntax, revert last change to vimUserFunc (vim/vim#14202)

Fix highlighting of ":echo (expr)" (broken in commit 61887b3) by
re-enabling the original fix for vim/vim#9987.

Addresses https://github.com/vim/vim/pull/14199#issuecomment-1999732062.

This will be fixed more generally when there is context-sensitive
matching for commands and functions.

b4b3d7de24

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-03-16 04:09:35 +08:00
b958b5ee4f vim-patch:61887b3d6fd8
runtime(vim): Update base-syntax, improve :echo and :execute highlighting (vim/vim#14199)

Improve :echo and :execute highlighting.

- Add better line-continuation support for both commands.
- Improve the :execute command's expression argument matching.
- Remove the fix for issue vim/vim#9987 as this is now handled by correctly
  matching the parens in :echo (...) as operator parens.

61887b3d6f

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-03-15 21:49:17 +08:00
b7779c5146 Merge pull request #27867 from bfredl/intro_multigrid
fix(ui): startup intro message should be visible with ext_multigrid
2024-03-15 13:27:58 +01:00
e0707d3529 fix(ui): fix edge case around flushing
ui_flush_buf() doesn't know about `lenpos` so `remote_ui_raw_line`
needs to always handle it before flushing
2024-03-15 12:07:04 +01:00
f1c9228bba Merge pull request #27858 from luukvbaal/nvim_set_cursor
fix(ui): issues controlling cursor position with ext_cmdline
2024-03-15 10:02:26 +01:00
a8522f02e9 fix(ui): startup intro message should be visible with ext_multigrid
As this message is literally drawn on top of the EOB area of the first
window, the simple solution is to just draw the message on top of the
grid of the first window.

We still want #24764 (msg_intro event) but now only for ext_messages.
2024-03-15 09:48:31 +01:00
8350839a87 Merge pull request #27674 from glepnir/snippet_indent
fix(snippet): correct indent with newline
2024-03-15 09:32:03 +01:00
d41b8d4758 fix(ui): ext_cmdline should not move cursor to curwin
Problem:  The ext_cmdline cursor position on the screen seems to rely on
          an implicit assumption that the event listener implements a
          cmdline window that is made the current window which is
          problematic (e.g. breaks 'incsearch' in the actual current
          window).
Solution: Remove this assumption and allow nvim_win_set_cursor() to move
          the cursor on the screen to a non-current window (previous
          commit).
2024-03-15 09:15:56 +01:00
c971f538ab fix(api): update grid cursor in nvim_win_set_cursor()
Problem:  Cursor position set by nvim_win_set_cursor() is not reflected
          on the screen when followed by a blocking call like getchar().
Solution: Immediately update the cursor position on the grid.
2024-03-15 09:15:50 +01:00
062c0245e3 refactor: remove unused "coloff" argument of win_put_linebuf() (#27866)
It isn't really used, and is always passed 0.
Also rename "start_col" to "startcol" for consistency with "endcol".
2024-03-15 14:45:58 +08:00
d326e04860 vim-patch:9.1.0181: no overflow check for string formatting (#27863)
Problem:  no overflow check for string formatting
Solution: Check message formatting function for overflow.
          (Chris van Willegen)

closes: vim/vim#13799

c35fc03dbd

Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
2024-03-15 08:05:59 +08:00
60491466f9 vim-patch:9.1.0180: Cursor pos wrong when double-width chars are concealed (#27862)
Problem:  Cursor pos wrong when double-width chars are concealed.
Solution: Advance one more virtual column for a double-width char.
          Run some tests with both 'wrap' and 'nowrap' (zeertzjq).

closes: vim/vim#14197

010e1539d6
2024-03-15 06:56:45 +08:00
ca7dd33fa7 fix(highlight): don't show CursorColumn on current line (#27848)
Problem:
CursorColumn highlight behavior is inconsistent with 'virtualedit' set:
- If cursor is on the text, CursorColumn is not shown.
- If cursor is after end of line, CursorColumn is shown.

Solution:
Don't shown CursorColumn on current line if cursor is after end of line.

Vim doesn't have this problem because in most cases it uses the code
path for drawing buffer text when CursorColumn highlight is needed.
2024-03-15 05:54:22 +08:00
4de4f13eb3 Merge pull request #27852 from bfredl/persistent_intro
fix(intro): make intro explicitly stateful
2024-03-14 20:00:07 +01:00
0570a19c8a fix(intro): make intro explicitly stateful
Instead of randomly disappearing because some random event might have
caused mid_start or bot_scroll_start to randomly take a low value, treat
intro message as a _first class stateful_ thing.

This means that intro message will kept being _redrawn_ as long as we
are in the state it should be shown. This also includes screen resizes.
you will not lose the intro message because there was a delay in
detecting terminal features.
2024-03-14 14:39:08 +01:00
a6b6d036b1 refactor(drawline): rename vcol_off to vcol_off_co (#27857)
It is clearing that it's for conceal and matches the change from Vim
patch 9.0.1325.
Also correct some comments related to fix_for_boguscols().
2024-03-14 19:33:14 +08:00
cdd0788c70 Merge pull request #27854 from bfredl/boogalo_lines
fix(api): fix set_lines viewport adjustment, but this time good
2024-03-14 12:24:33 +01:00
120c4ec855 fix(terminal): disable reflow again
reverts c855eee919

This setting introduces constant CI failures on macos
(see https://github.com/neovim/neovim/issues/23762).
2024-03-14 19:22:16 +08:00
fc2a56fe61 fix(api): fix set_lines viewport adjustment, but this time good
fixes #27720
2024-03-14 10:56:24 +01:00
8955cef0c6 Merge pull request #27851 from zeertzjq/vim-760f664213de
vim-patch: reverts mswin.vim changes
2024-03-14 15:31:21 +08:00
2aa84ce210 vim-patch:45da32964d6e
runtime(mswin): still another clipboard_working test

Commit 760f664213dea9a300454992ba1589f4601d622f missed to revert back
another test for `if has('clipboard_working')`

So change the remaining check around the inoremap <c-v> mappings.

fixes vim/vim#14195

45da32964d

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-03-14 15:04:31 +08:00
ff972b88db vim-patch:760f664213de
runtime(mswin): revert back the check for clipboard_working support

Commit d9ebd46bd090c598adc82e6 changed the condition to
check if the clipboard is available from:
```
has('clipboard')
```
to
```
has('clipboard_working')
```
Assuming that is the more accurate test because even when clipboard
support is enabled at compile time it may not be actually working (e.g.
if no X11 environment is available, or when working on a remote server).

However it seems that condition does not evaluate to true, when the GUI
has not been started up yet (and there was no X11 Connection yet possible).

So let's just revert back the check to `has('clipboard')`, since that
has been proven to be working well enough.

related: vim/vim#13809

760f664213

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-03-14 15:03:47 +08:00
00c4962cd2 refactor(treesitter): move some logic into functions 2024-03-14 06:55:19 +00:00
12faaf40f4 fix(treesitter): highlight injections properly
`on_line_impl` doesn't highlight single lines, so using pattern indexes
to offset priority doesn't work.
2024-03-14 06:55:19 +00:00
274e414c94 Merge pull request #27850 from zeertzjq/vim-9.1.0172
vim-patch:9.1.{0172,0177}: more code can use ml_get_buf_len()
2024-03-14 13:35:04 +08:00
61b48e91b9 vim-patch:9.1.0177: Coverity reports dead code
Problem:  Coverity reports dead code.
Solution: Remove the dead code. Also fix a mistake in ml_get_pos_len()
          and update some comments (zeertzjq).

closes: vim/vim#14189

8c55d60658
2024-03-14 13:09:57 +08:00
090d1fd0b8 vim-patch:9.1.0172: More code can use ml_get_buf_len() instead of STRLEN()
Problem:  More code can use ml_get_buf_len() instead of STRLEN().
Solution: Change more STRLEN() calls to ml_get_buf_len().  Also do not
          set ml_line_textlen in ml_replace_len() if "has_props" is set,
          because "len_arg" also includes the size of text properties in
          that case. (zeertzjq)

closes: vim/vim#14183

94b7c3233e
2024-03-14 13:09:54 +08:00
3502aa63f0 vim-patch:8.2.4950: text properties position wrong after shifting text (#27849)
Problem:    Text properties position wrong after shifting text.
Solution:   Adjust the text properties when shifting a block of text.
            (closes vim/vim#10418)

4b93674159

Most of the patch is already merged. Add an assertion in place of "added".

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-03-14 12:40:17 +08:00
b501a2354f Merge pull request #27847 from zeertzjq/vim-9.1.0174
vim-patch:9.1.{0174,0176}: conceal fixes
2024-03-14 07:10:51 +08:00
2af1dc0116 vim-patch:9.1.0176: Cursor column wrong with 'virtualedit' and conceal
Problem:  Cursor column wrong with 'virtualedit' and conceal.
Solution: Correct cursor column at end of line if never reached.
          (zeertzjq)

closes: vim/vim#14190

253ff4dece
2024-03-14 06:55:10 +08:00
9599e5d28d vim-patch:9.1.0174: 'cursorline' and 'wincolor' hl missing with conceal and wrap
Problem:  'cursorline' and 'wincolor' highlight missing with concealed and
          wrapped lines.
Solution: Apply 'cursorline' and 'wincolor' highlight to boguscols.
          (zeertzjq)

Since 'cursorline' and 'wincolor' highlight apply after the end of the
line, it is more consistent to have them also apply to boguscols.

Assigning MAXCOL to values in ScreenCols[] make mouse click behave the
same with 'cursorline' and 'nocursorline', but such behavior may be
incorrect, as it puts the cursor on the next screen line.  That may be
fixed in a future PR.

closes: vim/vim#14192

21b0a3df8c
2024-03-14 06:55:08 +08:00
b17be231a6 vim-patch:9.1.0178: E1513 might be confusing (#27846)
Problem:  E1513 might be confusing
          (Christoph Thoma)
Solution: reword error message, fix test to not
          depend on the actual message

fixes: vim/vim#14189

0a32b8854b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-03-14 06:44:50 +08:00
bbb68e2a03 vim-patch:9.1.0175: wrong window positions with 'winfix{width,height}' (#27845)
Problem:  winframe functions incorrectly recompute window positions if
          the altframe wasn't adjacent to the closed frame, which is
          possible if adjacent windows had 'winfix{width,height}' set.

Solution: recompute for windows within the parent of the altframe and
          closed frame. Skip this (as before) if the altframe was
          top/left, but only if adjacent to the closed frame, as
          positions won't change in that case. Also correct the return
          value documentation for win_screenpos. (Sean Dewar)

The issue revealed itself after removing the win_comp_pos call below
winframe_restore in win_splitmove. Similarly, wrong positions could result from
windows closed in other tabpages, as win_free_mem uses winframe_remove (at least
until it is entered later, where enter_tabpage calls win_comp_pos).

NOTE: As win_comp_pos handles only curtab, it's possible via other means for
positions in non-current tabpages to be wrong (e.g: after changing 'laststatus',
'showtabline', etc.). Given enter_tabpage recomputes it, maybe it's intentional
as an optimization? Should probably be documented in win_screenpos then, but I
won't address that here.

closes: vim/vim#14191

Nvim: don't reuse "wp" for "topleft" in winframe_remove, so the change
integrates better with the call to winframe_find_altwin before it.

5866bc3a0f
2024-03-13 22:06:39 +00:00
2a8cef6bd4 Merge pull request #27815 from bfredl/setlines_scroll
fix(api/buffer): fix handling of viewport of non-current buffer
2024-03-13 07:46:11 +01:00
08fc1ebbaa fix(api/buffer): fix handling of viewport of non-current buffer
A lot of functions in move.c only worked for curwin, alternatively
took a `wp` arg but still only work if that happens to be curwin.

Refactor those that are needed for update_topline(wp) to work
for any window.

fixes #27723
fixes #27720
2024-03-13 07:19:59 +01:00
d5488633f6 fix(drawline): initialize linebuf_attr to 0 instead of -1 (#27840)
This also obviates the end-of-line loop when there is virtual text.
2024-03-13 11:36:41 +08:00
93c93a0e36 refactor: remove "once" argument of loop_uv_run() (#27841)
It is always set to true when used, and makes the code a bit confusing.
2024-03-13 11:27:04 +08:00
9f59415243 Merge pull request #27839 from seandewar/vim-9.1.0169
vim-patch:9.1.{0169,0170,0171,9a660d2883f9}
2024-03-12 23:05:09 +00:00
c048beef6c vim-patch:9a660d2883f9
runtime(doc): add reference to matchbufline() at :h search()

related: vim/vim#14173

9a660d2883

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-03-12 21:42:47 +00:00
6bbb02d9ba vim-patch:9.1.0171: Small split-move related improvements
Problem:  small improvements can be made to split-move related
          functions.
Solution: apply them (Sean Dewar):

Some of these changes were already applied to Nvim.
Here are the ones which were missing:

- Improve some doc comments (frame_flatten should still work for non-current
  tabpages, despite the topframe check, which looks benign, though I'm unsure if
  it's still needed; see vim/vim#2467).

- f_win_splitmove should check_split_disallowed on wp, not targetwin, as that's
  what win_splitmove checks (though it's probably unnecessary to check
  b_locked_split at all; see vim/vim#14109, which I hope to get around to
  finishing at some point).

- Apply the winframe_restore comment changes, and remove win_comp_pos from after
  winframe_restore in win_splitmove, as it shouldn't be necessary (no need to
  remove it from nvim_win_set_config too, as it was already omitted).
  Move win_append after winframe_restore in win_splitmove to match Vim.

closes: vim/vim#14185

5cac1a9bee
2024-03-12 21:38:39 +00:00
ca7b603d02 vim-patch:9.1.0170: Re-allow curwin == prevwin, but document it instead
Problem:  more places exist where curwin == prevwin, and it may even be
          expected in some cases.
Solution: revert v9.1.0001, but document that it's possible instead.
          (Sean Dewar)

I've had a change of heart for the following reasons:

- A quick 'n dirty [GitHub code search](https://github.com/search?q=%2F%28winnr%5C%28%5C%29%5Cs*%3D%3D%5Cs*winnr%5C%28%5B%27%22%5D%23%5B%27%22%5D%5C%29%7Cwinnr%5C%28%5B%27%22%5D%23%5B%27%22%5D%5C%29%5Cs*%3D%3D%5Cs*winnr%5C%28%5C%29%29%2F&type=code)
  reveals some cases where it's expected in the wild.

  Particularly, it made me aware `winnr() == winnr('#')` is possible when curwin
  is changed temporarily during the evaluation of a &statusline expression item
  (`%{...}`), and is used to show something different on the statusline
  belonging to the previous window; that behaviour wasn't changed in v9.1.0001,
  but it means curwin == prevwin makes sense in some cases.

- The definition and call sites of back_to_prevwin imply some expectation that
  prevwin == wp (== curwin) is possible, as it's used to skip entering the
  prevwin in that case.

- Prior to v9.1.0001, `:wincmd p` would not beep in the case that was patched in
  v9.1.0001, but now does. That resulted in vim/vim#14047 being opened, as it affected
  the CtrlP plugin.

  I find it odd that `:wincmd p` had cases where it wouldn't beep despite doing
  nothing, but it may be preferable to keep things that way (or instead also
  beep if curwin == prevwin, if that's preferred).

- After more digging, I found cases in win_free_mem, enter_tabpage,
  aucmd_restbuf and qf_open_new_cwindow where curwin == prevwin is possible
  (many of them from autocommands). Others probably exist too, especially in
  places where curwin is changed temporarily.

fixes: vim/vim#14047
closes: vim/vim#14186

d64801e913
2024-03-12 21:14:40 +00:00
dc7ccd6bca fix(treesitter): use 0 as initial value for computing maximum (#27837)
Using -1 as the initial value can cause the pattern offset to become
negative, which in turn results in a negative subpriority, which fails
validation in nvim_buf_set_extmark.
2024-03-12 16:13:40 -05:00
29d0ed577c vim-patch:9.1.0169: current window number returned by tabpagewinnr may be outdated
Problem:  current window number returned by tabpagewinnr may be outdated
          when called from win_execute for the original tabpage.
Solution: update the original tabpage's tp_curwin in switch_win; use
          {un}use_tabpage instead. Don't do it in restore_win to ensure
          tp_curwin of the temporarily visited tabpage is unchanged from
          switch_win visiting it, as before. (Sean Dewar)

Maybe restore_win should only restore tp_curwin if
`curtab == switchwin->sw_curtab`, in case the user changed tabpages from within
win_execute, but not doing that is consistent with the old behaviour.

related: vim/vim#14186

e101028a5c
2024-03-12 21:05:54 +00:00
119390e7ce refactor: avoid copying before vim_strup() if possible (#27830)
Current uses of vim_strup() calls memcpy()/strcpy() before calling vim_strup().
This results in 2 * strlen(string) operations.

We can trivially convert to lowercase while copying the string instead.
2024-03-13 04:34:59 +08:00
dd0fc73bbe Merge pull request #27808 from jamessan/gen_cflags-cleanup
Cleanup construction of command-lines for header generation
2024-03-12 14:00:29 -04:00
cb46f6e467 feat(treesitter): support URLs (#27132)
Tree-sitter queries can add URLs to a capture using the `#set!`
directive, e.g.

  (inline_link
    (link_text) @text.reference
    (link_destination) @text.uri
    (#set! @text.reference "url" @text.uri))

The pattern above is included by default in the `markdown_inline`
highlight query so that users with supporting terminals will see
hyperlinks. For now, this creates a hyperlink for *all* Markdown URLs of
the pattern [link text](link url), even if `link url` does not contain
a valid protocol (e.g. if `link url` is a path to a file). We may wish to
change this in the future to only linkify when the URL has a valid
protocol scheme, but for now we delegate handling this to the terminal
emulator.

In order to support directives which reference other nodes, the
highlighter must be updated to use `iter_matches` rather than
`iter_captures`. The former provides the `match` table which maps
capture IDs to nodes. However, this has its own challenges:

- `iter_matches` does not guarantee the order in which patterns are
  iterated matches the order in the query file. So we must enforce
  ordering manually using "subpriorities" (#27131). The pattern index of
  each match dictates the extmark's subpriority.
- When injections are used, the highlighter contains multiple trees. The
  pattern indices of each tree must be offset relative to the maximum
  pattern index from all previous trees to ensure that extmarks appear
  in the correct order.
- The `iter_captures` implementation currently has a bug where the
  "match" table is only returned for the first capture within a pattern
  (see #27274). This bug means that `#set!` directives in a query
  apply only to the first capture within a pattern. Unfortunately, many
  queries in the wild have come to depend on this behavior.
  `iter_matches` does not share this flaw, so switching to
  `iter_matches` exposed bugs in existing highlight queries. These
  queries have been updated in this repo, but may still need to be
  updated by users. The `#set!` directive applies to the _entire_ query
  pattern when used without a capture argument. To make `#set!`
  apply only to a single capture, the capture must be given as an
  argument.
2024-03-12 09:32:17 -05:00
41fb98d6fa fix: move fswatch linux check inside of vim.schedule (#27824)
Fixes issue reported in the original PR:
https://github.com/neovim/neovim/pull/27810

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
2024-03-12 15:15:55 +08:00
3bd84317fb refactor: avoid quadratic behavior in backslash_halve() (#27827)
The original implementation has a worst-case of O(n^2). Every time
rem_backslash() is true, it calculates the length of the rest of the
string, and shift the rest of it to the left; backslash_halve_save()
copies the original string before doing backslash_halve().

The new implementation is O(n). It will find the first character where
rem_backslash() is true (it will do nothing if it's always false), and
shift the characters in-place; backslash_halve_save() avoids copying the
original string before doing backslash_halve().
2024-03-12 14:35:53 +08:00
a74e869ffa docs: small fixes (#27364)
Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com>
Co-authored-by: Ynda Jas <yndajas@gmail.com>
Co-authored-by: Owen Hines <TheOdd@users.noreply.github.com>
Co-authored-by: Wanten <41904684+WantenMN@users.noreply.github.com>
Co-authored-by: lukasvrenner <118417051+lukasvrenner@users.noreply.github.com>
Co-authored-by: cuinix <915115094@qq.com>
2024-03-12 13:51:53 +08:00
ac8cd5368d refactor: use ml_get_buf_len() in API code (#27825) 2024-03-12 10:44:53 +08:00
b02a4d8ac3 vim-patch:9.1.0168: too many STRLEN() calls (#27823)
Problem:  too many STRLEN() calls
Solution: Make use of ml_get_len() calls instead
          (John Marriott)

closes: vim/vim#14123

bfcc895482

Co-authored-by: John Marriott <basilisk@internode.on.net>
2024-03-12 07:20:22 +08:00
59e3bcfb00 vim-patch:5cd86c6cff94 (#27822)
runtime(vim): Update base-syntax, improve number matching (vim/vim#14175)

- Limit blob literals to an even number of hexadecimal digits and
  correctly located dots.
- Match octal numbers.

The current version unsuccessfully attempts to match a leading '-' as
part of the float literal.  It's actually parsed as part of the literal
for all numbers but the syntax file hasn't matched it like that for a
long time and highlights negative numbers as UNARY-MINUS NUMBER.  This
will be fixed when better expression matching is implemented.

5cd86c6cff

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-03-12 07:20:04 +08:00
e20e5ecf0a vim-patch:9.1.0167: Changing buffer in another window causes it to show matchparen (#27820)
Problem:  Changing buffer in another window using win_execute() causes
          it to show matchparen (after 9.0.0969).
Solution: Delay highlighting with SafeState in BufWinEnter.
          (zeertzjq)

closes: vim/vim#14177

49ffb6b428
2024-03-12 07:19:47 +08:00
6481da3015 vim-patch:9.1.0166: Internal error with blockwise getregion() in another buffer (#27819)
Problem:  Internal error with blockwise getregion() in another buffer
Solution: Also change curwin->w_buffer when changing curbuf (zeertzjq)

closes: vim/vim#14179

5406eb8722
2024-03-12 07:19:30 +08:00
cf156377e8 vim-patch:8.2.4944: text properties are wrong after "cc" (#27821)
Problem:    Text properties are wrong after "cc". (Axel Forsman)
Solution:   Pass the deleted byte count to inserted_bytes(). (closes vim/vim#10412,
            closes vim/vim#7737, closes vim/vim#5763)

d0b1a09f44

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-03-12 06:56:06 +08:00
9cc755ad6a vim-patch:0049a495c8d4 (#27817)
runtime(doc): improve 'winfixbuf' docs (vim/vim#14180)

- Make it not sound like a buffer option.
- "!" is called a modifier, not an option.

0049a495c8
2024-03-12 05:39:21 +08:00
205cf0d296 Merge pull request #27812 from luukvbaal/cmdheight
feat(ui): allow non-zero 'cmdheight' with ext_messages
2024-03-11 19:44:18 +01:00
1da0f3494e test: correct order of arguments to eq() (#27816) 2024-03-11 22:23:14 +08:00
0f20b7d803 docs: adjust fswatch overflow message to mention docs with info
- Add :h fswatch-limitations that notifies user about default inotify
  limitations on linux and how to adjust them
- Check for Event queue overflow message from fswatch and refer user to
  new documentation

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
2024-03-11 14:05:26 +00:00
cdbc3e3f3e fix(editorconfig): syntax error regression 2024-03-11 10:06:57 +00:00
f879a65455 build(deps): bump luajit to HEAD - d06beb048 2024-03-11 16:45:20 +08:00
b72931e704 feat(ui): allow non-zero 'cmdheight' with ext_messages
Problem:  Arbitrary restriction on 'cmdheight' with ext_messages.
          The 'cmdheight'-area may be desirable for the replacing
          cmdline.
Solution: Allow non-zero 'cmdheight' with ext_messages.
2024-03-11 07:13:48 +01:00
3814750d37 Merge pull request #27738 from ColinKennedy/vim-9.1.0147
vim-patch:9.1.{0147,0149,0150,0152,0156},58f1e5c0893a: 'winfixbuf'
2024-03-11 12:05:01 +08:00
3b3511c4d9 vim-patch:9.1.0156: Make 'wfb' failing to split still report E1513
Problem:  may not be clear why failing to split causes an ":Xdo" command
          to abort if 'wfb' is set.
Solution: do not return immediately if win_split fails, so E1513 is
          still given. Expect both errors in the test. Also fix tests to
          pass CI.
          (Sean Dewar)

closes: vim/vim#14152

769eb2d0c3

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2024-03-11 11:42:03 +08:00
d71791a11a vim-patch:9.1.0152: Coverity complains about ignoring return value
Problem:  Coverity complains about ignoring return value of win_split()
          (after v9.1.150)
Solution: Check if win_split() failed, add winfixbuf.res to Makefile

af7ae81600

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-03-11 11:38:15 +08:00
5931f2bc4a vim-patch:9.1.0150: Several minor 'winfixbuf' issues
Problem:  several minor 'winfixbuf' issues exist, mostly relating to the
          quickfix list
Solution: address them and adjust tests. Retab and reflow a few things too.
          (Sean Dewar)

Things touched include:

- Replace the semsgs with gettext'd emsgs.

- Handle window switching in ex_listdo properly, so curbuf and curwin
  are kept in-sync and trigger autocommands; handle those properly.

- Don't change the list entry index in qf_jump_edit_buffer if we fail
  due to 'wfb' (achieved by returning FAIL; QF_ABORT should only be used
  if the list was changed).

- Make qf_jump_edit_buffer actually switch to prevwin when using `:cXX`
  commands **outside** of the list window if 'wfb' is set in curwin.
  Handle autocommands properly in case they mess with the list.

  NOTE: previously, it seemed to split if 'wfb' was set, but do nothing
  and fail if prevwin is *valid*. This behaviour seemed strange, and maybe
  unintentional? Now it aligns more with what's described for the `:cXX`
  commands in the original PR description when used outside a list window,
  I think.

- In both functions, only consider prevwin if 'wfb' isn't set for it;
  fallback to splitting otherwise.

- Use win_split to split. Not sure if there was a specific reason for
  using ex_splitview. win_split is simpler and respects modifiers like
  :vertical that may have been used. Plus, its return value can be checked
  for setting opened_window in qf code (technically win_split_ins autocmds
  could immediately close it or change windows, in which the qf code might
  close some other window on failure; it's already the case elsewhere,
  though).

closes: vim/vim#14142

4bb505e28c

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2024-03-11 11:38:15 +08:00
e8bc23db62 vim-patch:9.1.0149: null pointer member access when accessing 'winfixbuf' property
Problem:  qf_goto_win_with_qfl_file may check if prevwin has 'winfixbuf'
          set without checking if it's valid first.
Solution: Reverse the condition. Add a test, a modeline, and a missing
          CheckFeature. (Searn Dewar)

closes: vim/vim#14140

5131f224da

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2024-03-11 11:38:15 +08:00
141182d6c6 vim-patch:9.1.0147: Cannot keep a buffer focused in a window
Problem:  Cannot keep a buffer focused in a window
          (Amit Levy)
Solution: Add the 'winfixbuf' window-local option
          (Colin Kennedy)

fixes:  vim/vim#6445
closes: vim/vim#13903

2157035637

N/A patch:
vim-patch:58f1e5c0893a
2024-03-11 11:38:13 +08:00
118fd8367c fix: deduplicate gen_cflags
Since many of the targets have common include paths, `gen_cflags`
accumulates a lot of duplicate flags.
2024-03-10 20:02:32 -04:00
74b2f6c3d9 fix: ignore non-existent properties during header generation
`get_target_property(<var> ...)` sets `<var>` to `<var>-NOTFOUND` if the
property doesn't exist for the given target.  Detect this situation to
avoid adding various `-Dprop-NOTFOUND` and `-Iprop-NOTFOUND` to the
command-line when generating the headers.
2024-03-10 19:58:35 -04:00
a09ddd7ce5 docs(editorconfig): move to source 2024-03-10 23:20:44 +00:00
09a919f313 docs: more accurate typing for vim.tbl_extend 2024-03-10 23:20:26 +00:00
47942db307 vim-patch:675cbfb47f03 (#27806)
runtime(doc): Update Markdown syntax, add missing configs

fixes: vim/vim#14168

675cbfb47f

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-03-11 06:41:53 +08:00
92d4dbbd8c vim-patch:9.1.0164: Internal error when passing invalid position to getregion() (#27805)
Problem:  Internal error or crash when passing invalid position to
          getregion().
Solution: Give an error for invalid position (zeertzjq).

closes: vim/vim#14172

26dd09ad5e
2024-03-11 06:21:32 +08:00
06fcf71bd0 fix(fswatch): --latency is locale dependent 2024-03-10 19:50:32 +00:00
b465ede2c7 vim-patch:9.1.0138: too many STRLEN calls when getting a memline (#27799)
Problem:  too many STRLEN calls when getting a memline
Solution: Optimize calls to STRLEN(), add a few functions in memline.c
          that return the byte length instead of relying on STRLEN()
          (John Marriott)

closes: vim/vim#14052

02d7a6c6cf

Cherry-pick line break changes from patch 8.1.0226.
Cherry-pick ml_line_len from patch 8.1.0579.
Cherry-pick test_comments.vim change from patch 9.1.0153.

Co-authored-by: John Marriott <basilisk@internode.on.net>
2024-03-10 17:08:00 +08:00
a441bdc936 vim-patch:9.1.0162: problem with writing extended attributes on failure (#27800)
Problem:  problem with writing extended attributes on failure
Solution: Change return type to ssize_t and check listxattr's return
          value correctly on failure (Paul Tagliamonte)

The existing logic will return when the listxattr call returns with the
errno set to ENOTSUP (or a size of 0 bytes), without checking to see if
listxattr actually failed. listxattr can fail with at least E2BIG,
ENOTSUP, ERANGE, or anything that `stat(2)` can fail with (in my case;
ENOENT from stat).

The returned size is stored to a size_t, but the return type is a
ssize_t. On failure, listxattr returns -1, which will get translated to
size_t's MAX. If the listxattr call failed with anything other than
ENOTSUP, this triggers a request for size_t MAX bytes.

This means that, if the listxattr call fails with anything other than
ENOTSUP on save, vim will error with

`E342: Out of memory!  (allocating 18446744073709551615 bytes)`

(keen observers will note 18446744073709551615 is 0xffffffffffffffff)

In reality, this is likely masking a different (usually filesystem?)
error -- but at least it's an error being pushed to the user now, and we
don't try to allocate size_t MAX bytes.

I've opted to change the type that we store listxattr to from size_t to
ssize_t, to match listxattr(2)'s signature, and to check for the -1
return value. Additionally, I've removed the errno check -- if we get a
listxattr failure for any reason, we may as well bail without trying;
it's not like we can even recover.

closes: vim/vim#14169

14759ded57

Co-authored-by: Paul R. Tagliamonte <paultag@gmail.com>
2024-03-10 16:58:01 +08:00
8797429a7a Merge pull request #27798 from zeertzjq/vim-62b26040eb4b
vim-patch: update Vim syntax
2024-03-10 11:30:24 +08:00
b5f870cf12 vim-patch:5d67aef3060d
runtime(vim): Update base-syntax, improve :map highlighting (vim/vim#14141)

Improve :map command highlighting.

- Fix multiline RHS matching, allow continued lines and comments.
- Allow ^V-escaped whitespace in LHS.
- Handle map-bar properly and allow trailing commands.

Fixes issue vim/vim#12672.

5d67aef306

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-03-10 10:39:43 +08:00
84b6ae82c7 vim-patch:62b26040eb4b
runtime(vim): Update base-syntax, improve :menu{,translate} highlighting (vim/vim#14162)

Improve :menu and :menutranslate highlighting.

- Match args to :menutranslation and :popup.
- Only highlight special notation in {rhs} of :menu, like :map.
- Allow line continuations in {rhs} of :menu and between {english} and
  {mylang} of :menutranslation, matching common usage.
- Bug fixes.

62b26040eb

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-03-10 10:39:43 +08:00
3c66e285cc vim-patch:a2c65809dafe
runtime(java): Recognise string templates (vim/vim#14150)

As this is encouraged in the referenced JEPs, "to visually
distinguish a string template from a string literal, and
a text block template from a text block", the default
colours for java\%[Debug]StrTempl are made distinct from
java\%[Debug]String.

According to §3.2 Lexical Translations (JLS, c. 1996 or any
more recent version), line terminators, white space, and
comments are discarded before tokens are accepted. Since
a template expression comprises a template processor, a dot,
and a template, it may be visually appealing to break up
its head across a few lines whenever its tail already spans
multiple lines.  Curiously, no allowance for it is made in
the distributed tests for OpenJDK 21; the proposed regexp
patterns take in consideration a line terminator and white
space after a dot.

References:
https://openjdk.org/jeps/430 (Preview)
https://openjdk.org/jeps/459 (Second Preview)
https://openjdk.org/jeps/465

a2c65809da

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-03-10 10:36:26 +08:00
6052b346f1 revert: "fix(window): :close crash with autocmd, floats and tabpage" (#27796)
This reverts PR #27793.

On second thought, this solution may still crash, because it can leave a
window with a NULL buffer if there are autocommand windows or if closing
a floating window fails. It also makes close_last_window_tabpage() more
complicated, so revert it.
2024-03-10 10:33:10 +08:00
9bd4a28079 fix(window): :close crash if WinClosed from float closes window (#27794)
Problem:  :close crash if WinClosed from float closes window.
Solution: Check if window has already been closed.
2024-03-10 08:37:16 +08:00
731e7f51ee fix(window): :close crash with autocmd, floats and tabpage (#27793)
Problem:  :close crash with autocmd, floats and tabpage.
Solution: Close floating windows in one more case.
2024-03-10 07:55:04 +08:00
448cf10c47 vim-patch:9.1.0159: Crash in WinClosed after BufUnload closes other windows (#27792)
Problem:  Crash in WinClosed after BufUnload closes other windows
Solution: Don't trigger WinClosed if the buffer is NULL (zeertzjq)

Now win_close_othertab() doesn't trigger any autocommands if the buffer
is NULL, so remove the autocmd blocking above (which was added not long
ago in patch v9.0.0550) for consistency.

Also remove an unreachable close_last_window_tabpage() above:
- It is only reached if only_one_window() returns TRUE and last_window()
  returns FALSE.
- If only_one_window() returns TRUE, there is only one tabpage.
- If there is only one tabpage and last_window() returns FALSE, the
  one_window() in last_window() must return FALSE, and the ONE_WINDOW
  in close_last_window_tabpage() must also be FALSE.
- So close_last_window_tabpage() doesn't do anything and returns FALSE.

Then the curtab != prev_curtab check also doesn't make much sense, and
the only_one_window() can be replaced with a check for popup and a call
to last_window() since this is a stricter check than only_one_window().

closes: vim/vim#14166

b2ec0da080
2024-03-10 07:03:36 +08:00
241c161299 vim-patch:9.1.0161: expand() removes slash after env variable that ends with colon (#27791)
Problem:  expand() removes a slash after an environment variable that
          ends with a colon on Windows.
Solution: Check the correct char for a colon (zeertzjq)

closes: vim/vim#14161

Note: Vim still removes the path-separator at the end, if another path separator
follows directly after it, e.g. on:

```
    echo $FOO='/usr/'
    echo expand('$FOO/bar') == '/usr/bar'
```

see:

,----[ misc1.c:1630 ]
|   // if var[] ends in a path separator and tail[] starts
|   // with it, skip a character
|   if (after_pathsep(dst, dst + c)
| #if defined(BACKSLASH_IN_FILENAME) || defined(AMIGA)
| 	  && (dst == save_dst || dst[-1] != ':')
| #endif
| 	  && vim_ispathsep(*tail))
|       ++tail;
`----

13a014452a

Cherry-pick test_expand.vim change from patch 9.0.1257.
2024-03-10 06:47:09 +08:00
b596732831 Merge pull request #27330 from seandewar/win_set_config-fixes
fix(api): various window-related function fixes

This is a big one!
2024-03-09 22:32:20 +00:00
c3d22d32ee vim-patch:8.2.3862: crash on exit with EXITFREE and using win_execute()
Problem:    Crash on exit with EXITFREE and using win_execute().
Solution:   Also save and restore tp_topframe. (issue vim/vim#9374)

dab17a0689

Couldn't repro the crash in the test, but I only care about this patch so
switch_win sets topframe properly for win_split_ins in nvim_open_win and
nvim_win_set_config.
Add a test using nvim_win_call and :wincmd, as I couldn't repro the issue via
nvim_open_win or nvim_win_set_config (though it's clear they're affected by this
patch).

That said, at that point, could just use {un}use_tabpage inside switch_win
instead, which also updates tp_curwin (though maybe continue to not set it in
restore_win). That would also fix possible inconsistent behaviour such as:

:call win_execute(w, "let curwin_nr1 = tabpagewinnr(1)")
:let curwin_nr2 = tabpagewinnr(1)

Where it's possible for curwin_nr1 != curwin_nr2 if these commands are run from
the 1st tabpage, but window "w" is in the 2nd (as the 1st tabpage's tp_curwin
may still be invalid). I'll probably PR a fix for that later in Vim.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-03-09 21:58:30 +00:00
b52d15853e fix(api): win_set_config set tp_curwin of win moved from other tabpage
Problem: nvim_win_set_config does not update the tp_curwin of win's original
tabpage when moving it to another.

Solution: update it if win was the tp_curwin. Add a test.
2024-03-09 18:00:30 +00:00
ade1b12f49 docs: support inline markdown
- Tags are now created with `[tag]()`
- References are now created with `[tag]`
- Code spans are no longer wrapped
2024-03-09 11:21:55 +00:00
0e28493914 vim-patch:8.2.3915: illegal memory access when completing with invalid bytes (#27491)
Problem:    illegal memory access when completing with invalid bytes.
Solution:   Avoid going over the end of the completion text.

vim/vim@4b28ba3

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-03-09 19:21:31 +08:00
9eda2f2495 Merge pull request #27764 from glepnir/grid_null
fix: set full_screen when in ex_mode
2024-03-09 11:52:42 +01:00
b21d960119 fix(startup): set full_screen when in ex_mode
Problem Description: In ex_mode, the default_grid.chars are not allocated, and subsequently,
the w_grid.target in curwin is not allocated to default_grid in update_screen. This leads to
a null pointer crash when the completion function is executed in ex_mode.

Solution: Set full_screen when in ex_mode to ensure that default_grid is allocated.
2024-03-09 18:20:59 +08:00
649dd00fe2 feat!: remove deprecated functions 2024-03-09 10:54:24 +01:00
33dfb5a383 fix(window): :close may cause Nvim to quit with autocmd and float
Problem:  :close may cause Nvim to quit if an autocommand triggered when
          closing the buffer closes all other non-floating windows and
          there are floating windows.
Solution: Correct the check for the only non-floating window.
2024-03-09 13:38:32 +08:00
6416c6bc94 test(old): remove Test_floatwin_splitmove()
Its corresponding test in Vim is in test_popupwin.win, so having it in
the middle of test_window_cmd.vim is strange, and it is now covered by
tests in ui/float_spec.lua anyway.
2024-03-09 12:27:20 +08:00
54022a2946 fix(api): win_set_config update statuslines after removing splits
Problem: nvim_win_set_config does not update statuslines after removing a split.

Solution: call last_status.

Didn't realize this was missing in the original nvim_win_set_config for splits
PR.

As it can only be done for the current tabpage, do it if win_tp == curtab;
enter_tabpage will eventually call last_status anyway when the user enters
another tabpage.
2024-03-09 01:00:33 +00:00
e7c262f555 fix(api): patch some cmdwin/textlock holes
Problem: there are new ways to escape textlock or break the cmdwin in
nvim_win_set_config and nvim_tabpage_set_win.

Solution: fix them. Use win_goto to check it in nvim_tabpage_set_win and use the
try_start/end pattern like with similar functions such as nvim_set_current_win
(which uses the existing msg_list, if set).

Careful not to use `wp->handle` when printing the window ID in the error message
for nvim_tabpage_set_win, as win_goto autocommands may have freed the window.

On a related note, I have a feeling some API functions ought to be checking
curbuf_locked...
2024-03-08 23:24:06 +00:00
d942c2b943 fix(api): handle win_split_ins failure properly
Problem: nvim_win_set_config does not handle failure in win_split_ins properly
yet, which can cause all sorts of issues. Also nvim_open_win and
nvim_win_set_config do not set the error message to the one from win_split_ins.

Solution: handle failure by undoing winframe_remove, like in win_splitmove.
Make sure autocommands from switching to the altwin fire within a valid window,
and ensure they don't screw things up. Set the error message to that of
win_split_ins, if any.

Also change a few other small things, including:

- adjust win_append to take a tabpage_T * argument, which is more consistent
  with win_remove (and also allows us to undo a call to win_remove).

- allow winframe_restore to restore window positions. Useful if `wp` was in a
  different tabpage, as a call to win_comp_pos (which only works for the current
  tabpage) after winframe_restore should no longer be needed.

  Though enter_tabpage calls win_comp_pos anyway, this has the advantage of
  ensuring w_winrow/col remains accurate even before entering the tabpage
  (useful for stuff like win_screenpos, if used on a window in another tabpage).

  (This change should probably also be PR'd to Vim later, even though it doesn't
  use winframe_restore for a `wp` in a different tabpage yet).
2024-03-08 23:24:05 +00:00
832bc5c169 vim-patch:9.1.0130: [security]: UAF if win_split_ins autocommands delete "wp"
Problem:  heap-use-after-free in win_splitmove if Enter/Leave
          autocommands from win_split_ins immediately closes "wp".
Solution: check that "wp" is valid after win_split_ins.
          (Sean Dewar)

abf7030a5c
2024-03-08 23:24:05 +00:00
e3d4dfb6c3 vim-patch:9.1.0128: win_gotoid() may abort even when not switching a window
Problem:  win_gotoid() checks for textlock and other things when switching
          to a window that is already current (after v9.1.0119)
Solution: return early with success when attempting to switch to curwin
          (Sean Dewar)

2a65e73944
2024-03-08 23:24:05 +00:00
b2245307f2 vim-patch:9.1.0121: Infinite loop or signed overflow with 'smoothscroll'
Problem:  infinite loop in win_update with 'smoothscroll' set when
          window width is equal to textoff, or signed integer overflow
          if smaller.
Solution: don't revalidate wp->w_skipcol in that case, as no buffer text
          is being shown. (Sean Dewar)

02fcae02a9

Test_window_split_no_room changes were already cherry-picked earlier.
2024-03-08 23:24:05 +00:00
01b27410a3 vim-patch:9.1.0119: can move away from cmdwin using win_splitmove()
Problem:  can switch windows while textlocked via f_win_gotoid and
          f_win_splitmove (which also allows switching in the cmdwin).
Solution: Check text_or_buf_locked in f_win_splitmove()
          (Sean Dewar)

While at it, call text_or_buf_locked() in f_win_gotoid() instead of testing for
cmdwin_type() (which text_buf_locked() does and in addition will also verify
that the buffer is not locked).

f865895c87
2024-03-08 23:24:05 +00:00
1c6b693ec1 vim-patch:9.1.0118: Use different restoration strategy in win_splitmove
Problem:  saving and restoring all frames to split-move is overkill now
          that WinNewPre is not fired when split-moving.
Solution: defer the flattening of frames until win_split_ins begins
          reorganising them, and attempt to restore the layout by
          undoing our changes. (Sean Dewar)

704966c254

Adjust winframe_restore to account for Nvim's horizontal separators when the
global statusline is in use. Add a test.
2024-03-08 23:24:04 +00:00
24dfa47e4f vim-patch:partial:9.1.0117: Stop split-moving from firing WinNew and WinNewPre autocommands
Problem:  win_splitmove fires WinNewPre and possibly WinNew when moving
          windows, even though no new windows are created.
Solution: don't fire WinNew and WinNewPre when inserting an existing
          window, even if it isn't the current window. Improve the
          accuracy of related documentation. (Sean Dewar)

96cc4aef3d

Partial as WinNewPre has not been ported yet (it currently has problems anyway).
2024-03-08 23:24:04 +00:00
66f331fef7 vim-patch:9.1.0116: win_split_ins may not check available room
Problem:  win_split_ins has no check for E36 when moving an existing
          window
Solution: check for room and fix the issues in f_win_splitmove()
          (Sean Dewar)

0fd44a5ad8

Omit WSP_FORCE_ROOM, as it's not needed for Nvim's autocmd window, which is
floating. Shouldn't be difficult to port later if it's used for anything else.

Make win_splitmove continue working for turning floating windows into splits.
Move the logic for "unfloating" a float to win_split_ins; unlike splits, no
changes to the window layout are needed before calling it, as floats take no
room in the window layout and cannot affect the e_noroom check.

Add missing tp_curwin-fixing logic for turning external windows into splits, and
add a test.
NOTE: there are other issues with the way "tabpage independence" is implemented
for external windows; namely, some things assume that tp_curwin is indeed a
window within that tabpage, and as such, functions like tabpage_winnr and
nvim_tabpage_get_win currently don't always work for external windows (with the
latter aborting!)

Use last_status over frame_add_statusline, as Nvim's last_status already does
this for all windows in the current tabpage. Adjust restore_full_snapshot_rec to
handle this.
This "restore everything" approach is changed in a future commit anyway, so only
ensure it's robust enough to just pass tests.

Keep check_split_disallowed's current doc comment, as it's actually a bit more
accurate here. (I should probably PR Vim to use this one)

Allow f_win_splitmove to move a floating "wp" into a split; Nvim supports this.
Continue to disallow it from moving the autocommand window into a split (funnily
enough, the check wasn't reachable before, as moving a float was disallowed),
but now return -1 in that case (win_splitmove also returns FAIL for this, but
handling it in f_win_splitmove avoids us needing to switch windows first).

Cherry-pick Test_window_split_no_room fix from v9.1.0121.

Update nvim_win_set_config to handle win_split_ins failure in later commits.
2024-03-08 23:24:04 +00:00
a70eae57bd fix(api): make open_win block only enter/leave events if !enter && !noautocmd
Problem: nvim_open_win blocking all win_set_buf autocommands when !enter &&
!noautocmd is too aggressive.

Solution: temporarily block WinEnter/Leave and BufEnter/Leave events when
setting the buffer. Delegate the firing of BufWinEnter back to win_set_buf,
which also has the advantage of keeping the timing consistent (e.g: before the
epilogue in enter_buffer, which also handles restoring the cursor position if
autocommands didn't change it, among other things). Reword the documentation for
noautocmd a bit.

I pondered modifying do_buffer and callees to allow for BufEnter/Leave being
conditionally disabled, but it seems too invasive (and potentially error-prone,
especially if new code paths to BufEnter/Leave are added in the future).

Unfortunately, doing this has the drawback of blocking ALL such events for the
duration, which also means blocking unrelated such events; like if window
switching occurs in a ++nested autocmd fired by win_set_buf. If this turns out
to be a problem in practice, a different solution specialized for nvim_open_win
could be considered. :-)
2024-03-08 23:24:04 +00:00
b1577d371a fix(api): make win_set_config with "win" for splits need "split/vertical"
Problem: currently, for splits, nvim_win_set_config accepts win without any of
split or vertical set, which has little effect and seems error-prone.

Solution: require at least one of split or vertical to also be set for splits.

Also, update nvim_win_set_config docs, as it's no longer limited to just
floating and external windows.
2024-03-08 23:24:04 +00:00
5d58136ccc fix(api): make open_win/win_set_config check if splitting allowed
Problem: splitting is disallowed in some cases to prevent the window layout
changes while a window is closing, but it's not checked for.

Solution: check for this, and set the API error message directly.

(Also sneak in a change to tui.c that got lost from #27352; it's a char* buf,
and the memset is assuming one byte each anyway)
2024-03-08 23:24:03 +00:00
b1e24f240b fix(api): avoid open_win UAF if target buf deleted by autocmds
Problem: WinNew and win_enter autocommands can delete the target buffer to
switch to, causing a heap-use-after-free.

Solution: store a bufref to the buffer, check it before attempting to switch.
2024-03-08 23:24:03 +00:00
e55a502ed4 fix(api): open_win fire Buf* events when !enter && !noautocmd if entered early
Problem: if switch_win{_noblock} fails to restore the old curwin after WinNew
(e.g: it was closed), wp will become the new curwin, but win_set_buf enter
events would still be blocked if !enter && !noautocmd.

Solution: fire them, as we've actually entered the new window.

Note: there's a problem of switch_win{_noblock} failing to restore the old
curwin, leaving us in wp without triggering WinEnter/WinLeave, but this affects
all callers of switch_win{_noblock} anyways. (It's also not clear how WinLeave
can be called if the old curwin was closed already).
2024-03-08 23:24:00 +00:00
a873f33993 fix(api): open_win fire BufWinEnter for other buffer when !enter && !noautocmd
Problem: BufWinEnter is not fired when not entering a new window, even when a
different buffer is specified and buffer-related autocommands are unblocked
(!noautocmd).

Solution: fire it in the context of the new window and buffer. Do not do it if
the buffer is unchanged, like :{s}buffer.

Be wary of autocommands! For example, it's possible for nvim_win_set_config to
be used in an autocommand to move a window to a different tabpage (in contrast,
things like wincmd T actually create a *new* window, so it may not have been
possible before, meaning other parts of Nvim could assume windows can't do
this... I'd be especially cautious of logic that restores curwin and curtab
without checking if curwin is still valid in curtab, if any such logic exists).

Also, bail early from win_set_buf if setting the temp curwin fails; this
shouldn't be possible, as the callers check that wp is valid, but in case that's
not true, win_set_buf will no longer continue setting a buffer for the wrong
window.

Note that pum_create_float_preview also uses win_set_buf, but from a glance,
doesn't look like it properly checks for autocmds screwing things up (win_enter,
nvim_create_buf...). I haven't addressed that here.

Also adds some test coverage for nvim_open_win autocommands.

Closes #27121.
2024-03-08 23:23:55 +00:00
233649bc75 fix(api): win_set_config fires unnecessary autocmds
Problem: win_set_config should have the observable effect of moving an existing
window to another place, but instead fires autocommands as if a new window was
created and entered (and does not fire autocommands reflecting a "return" to the
original window).

Solution: do not fire win_enter-related autocommands when splitting the window,
but continue to fire them when entering the window that fills the new space when
moving a window to a different tabpage, as the new curwin changes.

Also, remove "++once" from the WinEnter autocmd in the other test, as omitting
it also crashed Nvim before this fix.
2024-03-08 22:37:32 +00:00
bcb70eeac4 fix(api): win_set_config autocmds crash when moving win to other tabpage
Problem: win_enter autocommands can close new_curwin, crashing if it was the
last window in its tabpage after removing win, or can close parent, crashing
when attempting to split it later.

Solution: remove win first, check that parent is valid after win_enter.

NOTE: This isn't actually quite right, as this means win is not in the window
list or even has a frame when triggering enter autocommands (so it's not
considered valid in the tabpage). This is addressed in later commits.
2024-03-08 22:37:31 +00:00
a69c720639 fix(fileio): fix off-by-one in rename_with_tmp (#27780)
`_FORTIFY_SOURCE` on Ubuntu caught this, resulting in:

    [OLDTEST] Running test_rename
    Failed: test_rename :: Nvim exited with non-zero code
    Job exited with code 134
    Screen (23 lines)
    ================================================================================
    "test_rename.vim" "test_rename.vim" 120L, 3623B
    Executing Test_rename_copy()
    Executing Test_rename_dir_to_dir()
    Executing Test_rename_fails()
    Error detected while processing command line..script /<<BUILDDIR>>/neovim-0.9.5/test/old/testdir/runtest.vim[437]..function RunTheTest[44]..Test_rename_fails:
    line   17:
    E730: using List as a String
    line   18:
    E976: using Blob as a String
    Executing Test_rename_file_ignore_case()*** buffer overflow detected ***: terminated

`snprintf`'s second parameter should be no greater than the number of
remaining bytes in the allocated object.  We can see that this was off
by one, because in the simple case where `tail == tempname` (for a file
in the current directory), `rename_with_tmp` was passing `MAXPATHL + 2`
for an object allocated with a size of only `MAXPATHL + 1`.

Introduced in 5f1a153831.
2024-03-09 05:49:06 +08:00
8ba552bd59 ci: allow skipping news workflow with a label
Setting the label `ci:skip-news` will skip the job. This is useful for
maintainers to indicate to contributors that a feature isn't big enough
to warrant a news entry, or for contributors who dislike red CI even if
there's nothing wrong.

Also change label `ci-s390x` to `ci:s390x`; this way it'll be easier to
see that `ci:` are a subcategory of labels that affect CI in some way.
2024-03-08 17:55:33 +01:00
6d680d9775 Merge pull request #27775 from bfredl/nouidata
refactor(ui): remove outdated UI vs UIData distinction
2024-03-08 10:04:04 +01:00
e534ec47db refactor(ui): remove outdated UI vs UIData distinction
Just some basic spring cleaning.

In the distant past, not all UI:s where remote UI:s. They still aren't,
but both of the "UI" and "UIData" structs are now only for remote UI:s.
Thus join them as "RemoteUI".
2024-03-08 09:23:28 +01:00
55c9e2c96e Merge pull request #27655 from bfredl/mpack_obj
refactor(msgpack): allow flushing buffer while packing msgpack
2024-03-08 08:57:09 +01:00
6a580b997b vim-patch:8.2.5077: various warnings from clang on MS-Windows (#27773)
Problem:    Various warnings from clang on MS-Windows.
Solution:   Avoid the warnings. (Yegappan Lakshmanan, closes vim/vim#10553)

a34b4460c2

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-03-08 13:56:27 +08:00
25124d3607 test(old): change back to using termopen() on Windows (#27772)
It no longer hangs on Windows CI.
2024-03-08 12:21:11 +08:00
970b60aa7c test(tohtml_spec): don't use hard-coded sleeping time (#27770)
Instead cause some changes to screen state and use screen:expect().
2024-03-08 10:24:46 +08:00
d0b3c87219 fix(process): avoid potential data race on exit (#27769)
On exit, pty_process_close() may be called after pty_process_finish1()
but before start_wait_eof_timer(), in which case the timer shouldn't be
started because pty_process_close() has already closed it.
2024-03-08 09:18:03 +08:00
dc2379b89b Merge pull request #27767 from zeertzjq/vim-9.1.0154
vim-patch:9.1.{0154,0158}: shm=F not respected when reloading buffer with 'autoread'
2024-03-08 07:21:14 +08:00
c38764182a vim-patch:9.1.0158: 'shortmess' "F" flag doesn't work properly with 'autoread'
Problem:  'shortmess' "F" flag doesn't work properly with 'autoread'
          (after 9.1.0154)
Solution: Hide the file info message instead of the warning dialog
          (zeertzjq)

closes: vim/vim#14159
closes: vim/vim#14158

8a01744c56
2024-03-08 07:04:39 +08:00
d741e5d162 vim-patch:9.1.0154: shm=F not respected when reloading buffer with 'autoread'
Problem:  shm=F not respected when reloading buffer with 'autoread'
Solution: Check SHM_FILEINFO in buf_check_timestamp()
          (Shougo Matsushita)

closes: vim/vim#14144

9db39b0ec9

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2024-03-08 06:53:37 +08:00
5f3579e6ea vim-patch:9.1.0157: Duplicate assignment in f_getregion() (#27766)
Problem:  Duplicate assignment in f_getregion().
Solution: Remove the duplicate assignment.  Also improve getregion()
          docs wording and fix an unrelated typo (zeertzjq)

closes: vim/vim#14154

0df8f93bda
2024-03-08 06:44:57 +08:00
3e569d440b fix(process): close handles and timer in pty_process_close() (#27760)
This should prevent use-after-free on exit on Windows.
2024-03-07 18:05:55 +08:00
04232a19cc fix(type): remove incorrect arguments from vim.rpc* 2024-03-07 09:38:50 +00:00
e52c25b761 feat(lua): deprecate vim.tbl_add_reverse_lookup 2024-03-07 10:24:34 +01:00
dc37c1550b refactor(msgpack): allow flushing buffer while packing msgpack
Before, we needed to always pack an entire msgpack_rpc Object to
a continous memory buffer before sending it out to a channel.
But this is generally wasteful. it is better to just flush
whatever is in the buffer and then continue packing to a new buffer.

This is also done for the UI event packer where there are some extra logic
to "finish" of an existing batch of nevents/ncalls. This doesn't really
stop us from flushing the buffer, just that we need to update the state
machine accordingly so the next call to prepare_call() always will
start with a new event (even though the buffer might contain overflow
data from a large event).
2024-03-07 09:39:46 +01:00
6525832a8c vim-patch:9.1.0155: can only get getregion() from current buffer (#27757)
Problem:  can only call getregion() for current buffer
Solution: Allow to retrieve selections from different buffers
          (Shougo Matsushita)

closes: vim/vim#14131

84bf6e658d

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2024-03-07 06:43:08 +08:00
ae5095cac9 fix(fs): use generics for better typing 2024-03-06 21:56:47 +00:00
0101bdaa1a docs(lsp): nits and typos in client.lua 2024-03-06 19:37:20 +00:00
191cca2566 fix(types): move type annotation for IterMod 2024-03-06 16:03:58 +00:00
85b13751a5 refactor(types): more fixes (2) 2024-03-06 16:03:33 +00:00
3c572a31a3 docs(treesitter): fix ambiguous parameter description about lang 2024-03-06 14:21:46 +01:00
3e016fa8d4 fix(lsp): actually send diagnostic-tags back to the server
Fixes #27318
2024-03-06 11:12:41 +00:00
8149bd089e feat(lsp): report fswatch errors
Resolves #27713

Co-authored-by: Tomasz N <przepompownia@users.noreply.github.com>
2024-03-06 10:57:21 +00:00
3d2aeec68d refactor(lua): more efficient vim.tbl_islist
No need to run a full iteration of the table. Simply return false when
the next key isn't what we expect.
2024-03-06 10:57:04 +00:00
ea44f74d84 refactor(types): more fixes 2024-03-06 10:45:22 +00:00
d72c9d1d19 vim-patch:63c39e4ef749
runtime(c): Recognize "__inline" (vim/vim#14145)

`__inline` is recognized by GCC, and may even be preferred, as MSVC does
not recognize `__inline__`.

63c39e4ef7

Co-authored-by: Wu Yongwei <wuyongwei@gmail.com>
2024-03-06 10:05:12 +01:00
a4290f462e docs(lua): improvements for LSP and Diagnostic 2024-03-05 13:36:46 +00:00
5b312cd5f6 fix(eval): make has('pythonx') work properly (#27739)
Problem:  has('pythonx') always returns 1.
Solution: Make it the same as has('python3').
2024-03-05 15:54:41 +08:00
0ffc926499 vim-patch:e5c9ba601573 (#27737)
runtime(vim): Update base-syntax, fix escaping :syn and :hi sub-groups (vim/vim#14137)

* runtime(vim): Update base-syntax, fix escaping :syn and :hi sub-groups

- Remove contained :syntax and :highlight sub-groups from the function
  body cluster.  These should only match in the respective commands.
- Remove vimSynLine syntax group from several clusters.  The definition
  of vimSynLine was removed in Vim 5.3.

* runtime(vim): Update syntax generator, use standard Last Change date format

The de facto standard date format is YYYY MMM DD.

e5c9ba6015

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-03-05 11:28:34 +08:00
9716020293 vim-patch:d9ebd46bd090
runtime(mswin): Use unnamed register when clipboard not working (vim/vim#13813)

* Use unnamed register while clipboard not exist
* Do not need to specify the unnamed register explicitly
fixes: vim/vim#13809

d9ebd46bd0

Co-authored-by: Shixian Li <34830785+znsoooo@users.noreply.github.com>
2024-03-04 23:03:09 +01:00
66c9f987e7 vim-patch:1bdc9435c1a1
runtime(sh): Update syntax file, fix issue vim/vim#962 (vim/vim#14138)

Allow the opening parenthesis of a multiline array assignment, within an
if statement, to appear at EOL.

Fixes issue vim/vim#962.

1bdc9435c1

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-03-04 23:03:09 +01:00
56734226af vim-patch:e84490311ba3
runtime(css): update syntax script

e84490311b

Co-authored-by: Jay Sitter <jay@jaysitter.com>
2024-03-04 23:03:09 +01:00
633bf61d3b fix(ui_client): check return value of channel_job_start (#27729)
Problem: null pointer member access in ui_client_start_server if
channel_job_start returns NULL.

Solution: check for it, return 0 in that case (which is already used to indicate
failure and is handled by main).

Happened on Linux when trying to run Nvim in an old gdbserver instance after having
rebuilt Nvim since. This gave E903 (the nvim binary was deleted, so " (deleted)" appears
as a suffix in the `v:progpath`, making it invalid), then ASAN complains due to the NPD;
instead it now then prints "Failed to start Nvim server!", as expected.
2024-03-04 13:15:04 +00:00
a8131aee9e fix(tohtml): replace hex escape with digit escape (#27728) 2024-03-04 19:08:23 +08:00
3df1211ebc docs(lua): clarify when vim.bo/vim.wo acts like :setlocal (#27708) 2024-03-04 07:33:09 +08:00
181b620580 Merge pull request #27724 from zeertzjq/vim-c4aef9a97b36
vim-patch:c4aef9a97b36,691aee8b0705
2024-03-04 07:05:30 +08:00
fc2be84e44 vim-patch:691aee8b0705
runtime(vim): Update base-syntax, fix issue vim/vim#14135 (vim/vim#14136)

Fix incorrect error highlighting for function calls in :command
definitions.  vimFunctionError should be restricted to :function header
lines.

fixes: vim/vim#14135

691aee8b07

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-03-04 06:44:54 +08:00
b86799a076 vim-patch:c4aef9a97b36
runtime(vim): Update base-syntax, improve :augroup highlighting (vim/vim#14125)

- Explicitly match the bang and group name in :aug! {name}.
- Allow any characters in a group name.
- Match default group switch marker, END.
- Match :aug without arguments (list command).

c4aef9a97b

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-03-04 06:40:31 +08:00
bf0c69e504 fix(eval): correct failure return value for readfile/blob (#27722)
Currently returns 0 on failure, but should return an empty list (or blob).

Regressed in the big blob port of '21 (#15211).
2024-03-03 22:33:28 +00:00
3971797be1 vim-patch:b3030b653bbd
runtime(java): Recognise text blocks (vim/vim#14128)

Also, accept as valid the space escape sequence `\s`.

Also, consistently use the claimed `javaDebug` prefix for
syntax group definitions kept under `g:java_highlight_debug`.

Since `javaStringError` is commented out for its generality,
let's comment out `javaDebugStringError`, its copy, as well.

References:
https://openjdk.org/jeps/378
https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.10.7

Closes vim/vim#10910.

b3030b653b

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-03-03 17:41:04 +01:00
da2130934b build: don't allow Xcode as generator
Xcode does not allow having multiple targets depend on a custom command.
This limitation severely hinders its usability and complying with it
would likely require extensive refactoring and boilerplate. It makes
more sense to simply refer users to use "Ninja" or "Unix Makefiles"
instead.
2024-03-03 12:46:39 +01:00
bf695b5ef4 vim-patch:e93afc2e6126
runtime(r,rhelp,rmd,rnoweb,rrst): Update ftplugin, browsefilter labels (vim/vim#14126)

Use the standard format for browsefilter labels:
  "File Description (*.ext1, *.ext2, *.ext3)"

e93afc2e61

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-03-03 10:38:58 +01:00
dbf6be296d fix(column): full redraw with 'stc, 'rnu' and inserted lines (#27712)
Problem:  Text is not redrawn with 'relativenumber' when only the 'statuscolumn' is redrawn after inserted lines.
Solution: Force a full redraw if statuscolumn width changed.
2024-03-03 08:40:46 +08:00
dc8c086c7e fix(lsp): directly rename the existing buffers when renaming (#27690)
Problem:
`vim.lsp.util.rename()` deletes the buffers that are affected by
renaming. This has undesireable side effects. For example, when renaming
a directory, all buffers under that directory are deleted and windows
displaying those buffers are closed. Also, buffer options may change
after renaming.

Solution:
Rename the buffers with :saveas.

An alternative approach is to record all the relevant states and restore
it after renaming, but that seems to be more complex. In fact, the older
version was attempting to restore the states but only partially and
incorrectly.
2024-03-02 15:21:53 +01:00
0d553c8347 Merge pull request #27687 from luukvbaal/floatpos
fix(float): allow floating window in cmdline area
2024-03-02 11:22:40 +01:00
39cc38a87b fix(lsp): defer writing error msgs (#27688)
Context:
Nvim catches errors from the user's `on_exit` and rpc handler callbacks
and prints the error message.

Problem:
Printing the error message uses Nvim api functions. But callbacks
mentioned above run in `:h lua-loop-callbacks` where most of `vim.api`
is not allowed, so Nvim itself raises error.

Solution:
`vim.schedule()` the error reporting when necessary.
2024-03-02 10:51:10 +01:00
ee4bbc3af2 build(deps): bump treesitter-vimdoc to v2.2.0
adds support for `{arg}?` optional arguments #27644
2024-03-02 10:24:01 +01:00
72e0ef2f46 vim-patch:100a665634a0
runtime(java): Improve the recognition of literals (vim/vim#14120)

* Emend the Unicode and octal escape sequence patterns;
* Accept the (repeated) underscore separators in all
  numerical literals;
* Recognise hexadecimal floating-point literals.

(The space escape sequence '\s' will be introduced along
with text blocks in another PR.)

References:
https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.3
https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.10.1
https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.10.2
https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.10.7

100a665634

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-03-02 10:06:26 +01:00
72e3d8c3f9 fix(deps): bump luv to 1.48.0-2
close #27678

Return a userdata wrapper around the uv_req_t to allow it to be garbage collected before the program exits.
Previously, the returned userdata held a reference to itself in the Lua registry, meaning it would never be able to be garbage collected until the process ended.

This reverts commit 0e4a895, which attempted a workaround for the same underlying problem, but introduced a use-after-free.

```
Application Specific Information:
abort() called

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	       0x18cde20dc __pthread_kill + 8
1   libsystem_pthread.dylib       	       0x18ce19cc0 pthread_kill + 288
2   libsystem_c.dylib             	       0x18cd25a40 abort + 180
3   libsystem_malloc.dylib        	       0x18cc3cb08 malloc_vreport + 908
4   libsystem_malloc.dylib        	       0x18cc403f4 malloc_report + 64
5   libsystem_malloc.dylib        	       0x18cc54ebc find_zone_and_free + 308
6   nvim                          	       0x100eb13b8 uv__fs_scandir_cleanup + 84
7   nvim                          	       0x100eb7e68 uv_fs_req_cleanup + 120
8   nvim                          	       0x100e03634 luv_fs_gc + 132
9   nvim                          	       0x100e42aec lj_BC_FUNCC + 44
10  nvim                          	       0x100e44cc8 gc_call_finalizer + 148 (lj_gc.c:521)
11  nvim                          	       0x100b7fdb4 nlua_push_Object + 320 (converter.c:781)
12  nvim                          	       0x100b7fc48 nlua_push_Dictionary + 332 (converter.c:722)
13  nvim                          	       0x100992228 nlua_api_nvim_get_mode + 160 (lua_api_c_bindings.generated.c:6379)
14  nvim                          	       0x100e42aec lj_BC_FUNCC + 44
15  nvim                          	       0x100e590b4 lua_pcall + 228 (lj_api.c:1150)
```
2024-03-02 09:38:34 +01:00
39928a7f24 Merge pull request #27347 from lewis6991/fswatch
feat(lsp): add fswatch watchfunc backend
2024-03-01 23:31:20 +00:00
a5fe8f59d9 docs: improve/add documentation of Lua types
- Added `@inlinedoc` so single use Lua types can be inlined into the
  functions docs. E.g.

  ```lua
  --- @class myopts
  --- @inlinedoc
  ---
  --- Documentation for some field
  --- @field somefield integer

  --- @param opts myOpts
  function foo(opts)
  end
  ```

  Will be rendered as

  ```
  foo(opts)

    Parameters:
      - {opts} (table) Object with the fields:
               - somefield (integer) Documentation
                 for some field
  ```

- Marked many classes with with `@nodoc` or `(private)`.
  We can eventually introduce these when we want to.
2024-03-01 23:02:18 +00:00
4ff3217bbd feat(lsp): add fswatch watchfunc backend
Problem:
  vim._watch.watchdirs has terrible performance.

Solution:
  - On linux use fswatch as a watcher backend if available.

  - Add File watcher section to health:vim.lsp. Warn if watchfunc is
    libuv-poll.
2024-03-01 23:00:20 +00:00
813dd36b72 fix(types): rename win_get_config return type to win_config
Follow-up to #27397
2024-03-02 06:59:32 +08:00
62d04f21d9 vim-patch:9.1.0146: v:echospace wrong with invalid value of 'showcmdloc' (#27697)
Problem:  v:echospace wrong after setting invalid value to 'showcmdloc'.
Solution: Only call comp_col() if value is valid.
          (zeertzjq)

closes: vim/vim#14119

c27fcf4857
2024-03-02 06:48:11 +08:00
1fe65b3457 vim-patch:87410ab3f556 (#27696)
runtime(doc): some improvements to getregion() docs (vim/vim#14122)

- Mention the default selection behavior
- Remove useless sentence
- Correct description about space padding

87410ab3f5
2024-03-02 06:42:39 +08:00
816b56f878 fix(lsp): cancel watchers when closing a client 2024-03-01 22:30:27 +00:00
bf1e098d97 refactor(watch): simplify filechanges processing 2024-03-01 22:30:27 +00:00
b87505e116 refactor(watch): general tidy up
- Rename watch.poll to watch.watchdirs
- Unify how include and exclude is applied
- Improve type hints
2024-03-01 22:30:27 +00:00
b413f5d048 fix(lsp): rename undofile when renaming (#27684)
Problem:
After `rename()`, the undo information for the renamed file(s) are lost.

Solution:
Rename the undofile as well.
2024-03-01 18:31:54 +01:00
884470124d fix(float): allow floating window in cmdline area
Problem:  Floats are arbitrarily positioned at 1 row above screen size.
Solution: Position at 1 row above 'cmdheight', only if window is hidden behind the message area.
2024-03-01 16:00:16 +01:00
a5ade3c63d fix(snippet): correct indent with newline
Problem: snippet newline use before line indent after expand.

Solution: it should level + 1.
2024-03-01 14:35:52 +08:00
5d4e1693cb vim-patch:9.1.0145: v:echospace not correct when 'showcmdloc' != last (#27682)
Problem:  the amount of available space (v:echospace) on the command
          line is not correct when showcmdloc is drawn into the
          statusline or tabline.
Solution: only add SHOWCMD_COLS to the shown command column when
          'showcmdloc' is set to last (Sam-programs)

closes: vim/vim#14108

062141b1a7

Co-authored-by: Sam-programs <130783534+Sam-programs@users.noreply.github.com>
2024-03-01 06:13:38 +08:00
57e5b9f4ea vim-patch:9.1.0144: getregion() needs more tests (#27681)
Problem:  getregion() needs more tests
Solution: Run the getregion() test in both the legacy and Vim9 contexts
          (Yegappan Lakshmanan)

closes: vim/vim#14114

4d55c54e30

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-03-01 06:09:20 +08:00
41f2cbe171 vim-patch:8fad5d58874e
runtime(doc,netrw): update "Last Change header", remove trailing whitespace

Update Last-Change Header for netrw and doc/indent.txt, fix a trailing
whitespace in indent.txt and make CI happy.

8fad5d5887

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-02-29 22:54:57 +01:00
c8299d15db vim-patch:b4eb3f1e4489
runtime(yaml): disable multiline_scalar detection by default

There have been many complaints about Yaml indenting too much, because
it considers values to be multi-line by default, which leads to
unintended indenting for (apparently most) users.

So let's hide this feature behind the new feature flag, keep it
simple and prefer single line value key pairs by default.

If you want the old behaviour, set the following value: >

  :let g:yaml_indent_multiline_scalar = 1

If not set, it will indent the same as the previous line.

closes vim/vim#13845

b4eb3f1e44

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-02-29 22:54:57 +01:00
bfcf5666cc vim-patch:56b7da3c051f
runtime(netrw): handle file/dir symlinks specifically in tree mode

fixes: vim/vim#2386
related: vim/vim#3609

56b7da3c05

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-02-29 22:54:57 +01:00
6ab0876f51 docs(eval): getline and indent function support string type
Problem: getline and indent function missing string type in param.

Solution: add string type in eval gen.
2024-02-29 13:30:25 +00:00
2c8f36a3b0 fix(lsp): use plain loop for non-list-like table of protocol values
Fixup for #27628

Closes #27669
2024-02-29 11:37:30 +01:00
86c3f284fc vim-patch:9ecf02cd5f5f
runtime(java): Recognise _when_ clauses in _switch_ blocks

Also:

- distinguish _yield_ when used as a contextual keyword from
  when used qualified as a method or a method reference (as
  can be seen in testdir/input/java_switch.java, variables
  and method declarations named _yield_ will be recognised
  as the namesake keyword--consider picking other names for
  variables, and defining g:java_highlight_functions to have
  method names painted; since _yield_ statements can have
  trailing parens, they must be recognised as statements,
  for only qualified _yield_ method calls are supported);

- recognise grouped _default_ _case_ labels;

- describe primitive types for _case_ labels (JLS, §14.11,
  §3.10.1);

- recognise some non-ASCII identifiers (see javaLambdaDef,
  javaUserLabel) (further improvement for better recognition
  of identifiers will be arranged in a separate PR).

Because the arrow '->' is used in two kinds of expressions,
lambda (abstractions) and _switch_, necessary changes were
made for the recognition of either (and further improvement
touching lambda expressions will be separately arranged).

Because 'default' is used for instance method declarations
in interfaces and in _switch_ labels, necessary changes were
made for the recognition of either (and further improvement
touching method declarations will be separately arranged).

Finally, it deemed appropriate to put 'yield' in the syntax
group of javaOperator rather than javaStatement, for its
member 'var' is also another contextual keyword (e.g., this
is valid syntax: "var var = var(test.var);").

References:
https://openjdk.org/jeps/361 (Switch Expressions)
https://openjdk.org/jeps/440 (Record Patterns)
https://openjdk.org/jeps/441 (Pattern Matching for switch)

Also, add a Java specific filetype plugin for the syntax
test, so that no soft-wrapping of long indented lines occur.

Otherwise the syntax scripts would miss a few lines during
scrolling and verification of the screen dumps.

closes: vim/vim#14105

9ecf02cd5f

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-02-29 09:53:09 +01:00
0eaae1bc05 vim-patch:9.1.0143: [security]: autocmd causes use-after-free in set_curbuf() (#27664)
Problem:  [security]: autocmd cause use-after-free in set_curbuf()
          (kawarimidoll)
Solution: check side-effect of BufLeave autocommand, when the number
          of windows changed, close windows containing buffers that will
          be wiped, if curbuf changed unexpectedly make sure b_nwindows
          is decremented otherwise it cannot be wiped

set_curbuf() already makes some efforts to ensure the BufLeave
autocommands do not cause issues.  However there are still 2 issues
that are not taken care of:

1) If a BufLeave autocommand opens a new window containing the same
buffer as that is going got be closed in close_buffer() a bit later,
we suddenly have another window open, containing a free'd buffer.  So we
must check if the number of windows changed and if it does (and the
current buffer is going to be wiped (according to the 'bufhidden'
setting), let's immediately close all windows containing the current
buffer using close_windows()

2) If a BufLeave autocommand changes our current buffer (displays it in
the current window), buf->b_nwindow will be incremented. As part of
set_curbuf() we will however enter another buffer soon, which means, the
newly created curbuf will have b_nwindows still have set, even so the
buffer is no longer displayed in a window. This causes later problems,
because it will no longer be possible to wipe such a buffer. So just
before entering the final buffer, check if the curbuf changed when
calling the BufLeave autocommand and if it does (and curbuf is still
valid), decrement curbuf->b_nwindows.

Both issues can be verified using the provided test (however the second
issue only because such an impacted buffer won't be wiped, causing
futher issues in later tests).

fixes: vim/vim#13839
closes: vim/vim#14104

55f8bba73b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-02-29 08:33:02 +08:00
f9e7c4c9c4 refactor(defaults): use getregion() for Visual mode gx (#27663)
Also make it work better on a multiline selection.
2024-02-29 08:21:13 +08:00
ce7c51a1a3 vim-patch:9.1.0142: getregion() can be improved (#27662)
Problem:  getregion() can be improved (after v9.1.120)
Solution: change getregion() implementation to use pos as lists and
          one optional {opt} dictionary (Shougo Matsushita)

Note: The following is a breaking change!

Currently, the getregion() function (included as of patch v9.1.120) takes
3 arguments: the first 2 arguments are strings, describing a position,
arg3 is the type string.

However, that is slightly inflexible, there is no way to specify
additional arguments. So let's instead change the function signature to:

getregion(pos1, pos2 [, {Dict}]) where both pos1 and pos2 are lists.
This is slightly cleaner, and gives us the flexibility to specify
additional arguments as key/value pairs to the optional Dict arg.

Now it supports the "type" key to specify the selection type
(characterwise, blockwise or linewise) and now in addition one can also
define the selection type, independently of what the 'selection' option
actually is.

Technically, this is a breaking change, but since the getregion()
Vimscript function is still quite new, this should be fine.

closes: vim/vim#14090

19b718828d

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2024-02-29 07:19:26 +08:00
e592657df8 vim-patch:9.1.0141: Put in Visual mode wrong if it replaces fold marker (#27661)
Problem:  Put in Visual mode wrong if it replaces fold marker.
Solution: Temporarily disable folding during put in Visual mode.
          (zeertzjq)

fixes: vim/vim#14097
closes: vim/vim#14100

4e141c66b9
2024-02-29 06:48:29 +08:00
f912030d4e docs(lpeg): remove double backticks from meta (#27659) 2024-02-29 06:14:49 +08:00
853f647da6 fix(lsp): handle reverse lookup in capabilities 2024-02-28 20:20:02 +00:00
d981670bc9 refactor(lsp): remove outdated comment 2024-02-28 20:20:02 +00:00
0246f1a897 fix(tohtml): set filetype of generated HTML to html
Problem: `:TOhtml` opens the generated HTML code in a split, meaning it
inherits the `help` filetype if a help buffer is to be converted.

Solution: Explicitly set the filetype to `html`.
2024-02-28 18:34:12 +00:00
aa62898ae3 fix(lsp): correct the error message's cmd on spawning (#27632) 2024-02-28 17:36:28 +01:00
7311958e12 fix(lsp): remove unnecessary file load/write when renaming (#27621)
Previously rename would unconditionally read the to-be-renamed file from the
disk and write it to the disk. This is redundant in some cases

If the file is not already loaded, it's not attached to lsp client, so nvim
doesn't need to care about this file.
If the file is loaded but has no change, it doesn't need to be written.
2024-02-28 17:32:25 +01:00
2f85bbe615 feat!: rewrite TOhtml in lua
Co-authored-by: wookayin <wookayin@gmail.com>
Co-authored-by: clason <c.clason@uni-graz.at>
Co-authored-by: Lewis Russell <me@lewisr.dev>
2024-02-28 16:26:00 +00:00
c538ec8522 Merge pull request #27643 from bfredl/metadata2
refactor(metadata): generate all metadata in lua
2024-02-28 11:32:25 +01:00
de5cf09cf9 refactor(metadata): generate all metadata in lua
Then we can just load metadata in C as a single msgpack blob. Which also
can be used directly as binarly data, instead of first unpacking all the
functions and ui_events metadata to immediately pack it again, which was
a bit of a silly walk (and one extra usecase of `msgpack_rpc_from_object`
which will get yak shaved in the next PR)
2024-02-28 11:00:38 +01:00
07b4b7524f vim-patch:e84d2d4432cd
runtime(sh): Update ftplugin, fix vim/vim#14101 (vim/vim#14102)

Add the 'b' flag to 'comments', so that the shebang line is not detected as comment.

Fixes vim/vim#14101.

e84d2d4432

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-02-28 10:56:58 +01:00
0190771713 fix(lua): remove uri fragment from file paths (#27647)
Problem: Some LSP servers return `textDocument/documentLink` responses
         containing file URIs with line/column numbers in the fragment.
         `vim.uri_to_fname` returns invalid file names for these URIs.

Solution: Remove the URI fragment from file URIs.
2024-02-28 10:50:53 +01:00
cb146cc4aa docs(lpeg): merge upstream changes 2024-02-28 09:22:09 +00:00
a7788c2e25 vim-patch:b1427b46f5fe (#27652)
runtime(vim): Update base-syntax, improve :echo highlighting (vim/vim#14103)

- Normalise behaviour of :echo commands and improve expression matching.
- Allow continued argument lines.
- Refine string interpolation groups.
- Remove duplicated :menu and :map generated commands that are handled
  specially later in the file.

b1427b46f5

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-02-28 07:57:18 +08:00
7e46ff791c vim-patch:9.1.0140: cursor on wrong row after 1 char 'below' virtual text when EOL is shown (#27651)
Problem:  The cursor screen row was incorrectly being calculated when the
          cursor follows a 1 character text_align 'below' virtual text line,
          resulting in the cursor being shown on the wrong line.
          This was caused by a cell size of 2 instead of 1 being used for the EOL
          character, which propagated to the calculation of space for putting the
          'below' virtual text on its own line. (rickhowe)
Solution: Fix the size used for the EOL character in calculating the
          cursor's screen position (Dylan Thacker-Smith)

fixes: vim/vim#11959
related: vim/vim#12028
closes: vim/vim#14096

da0c9137d1

Co-authored-by: Dylan Thacker-Smith <dylan.ah.smith@gmail.com>
2024-02-28 07:28:48 +08:00
63f9c2da9a feat(lsp): support completion itemDefaults 2024-02-27 16:50:51 +01:00
3d96e3f9f2 refactor(lsp): alias for CompletionResult 2024-02-27 16:50:51 +01:00
9beb40a4db feat(docs): replace lua2dox.lua
Problem:

The documentation flow (`gen_vimdoc.py`) has several issues:
- it's not very versatile
- depends on doxygen
- doesn't work well with Lua code as it requires an awkward filter script to convert it into pseudo-C.
- The intermediate XML files and filters makes it too much like a rube goldberg machine.

Solution:

Re-implement the flow using Lua, LPEG and treesitter.

- `gen_vimdoc.py` is now replaced with `gen_vimdoc.lua` and replicates a portion of the logic.
- `lua2dox.lua` is gone!
- No more XML files.
- Doxygen is now longer used and instead we now use:
  - LPEG for comment parsing (see `scripts/luacats_grammar.lua` and `scripts/cdoc_grammar.lua`).
  - LPEG for C parsing (see `scripts/cdoc_parser.lua`)
  - Lua patterns for Lua parsing (see `scripts/luacats_parser.lua`).
  - Treesitter for Markdown parsing (see `scripts/text_utils.lua`).
- The generated `runtime/doc/*.mpack` files have been removed.
   - `scripts/gen_eval_files.lua` now instead uses `scripts/cdoc_parser.lua` directly.
- Text wrapping is implemented in `scripts/text_utils.lua` and appears to produce more consistent results (the main contributer to the diff of this change).
2024-02-27 14:41:17 +00:00
7ad2e3c645 docs: fix type of setreg() argument {options} (#27631) 2024-02-27 19:53:49 +08:00
1a7c38caec vim-patch:c7ddc9b73543
runtime(debian): update Debian syntax files (#14098)

* debversions.vim: Move lunar to unsupported release
* debsources: Add word boundaries around keyword match patterns

c7ddc9b735

Co-authored-by: James McCoy <jamessan@jamessan.com>
Co-authored-by: James Addison <jay@jp-hosting.net>
2024-02-27 10:31:11 +01:00
c6c19c3b2d build(deps): bump luv to 1.48.0-1 2024-02-27 10:31:02 +01:00
a4b4442524 vim-patch:2c51e15b66a4 (#27637)
runtime(vim): Update syntax file, improve :substitute matching (vim/vim#14093)

- Differentiate between :substitute and substitute(), fixes vim/vim#13883.
- Match all allowed :substitute delimiters.
- Remove leading context from :substitute matches.

2c51e15b66

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-02-27 06:22:57 +08:00
0d75324e3b vim-patch:9.1.0137: <Del> in cmdline mode doesn't delete composing chars (#27636)
Problem:  <Del> in cmdline mode doesn't delete composing chars
Solution: Use mb_head_off() and mb_ptr2len() (zeertzjq)

closes: vim/vim#14095

ff2b79d239
2024-02-27 06:09:06 +08:00
2ce3a9efa7 Merge pull request #27635 from bfredl/nomsgvalid
refactor(msgpack): remove undead unpacker code in helpers
2024-02-26 20:28:59 +01:00
a8e4ee2f2b fix(defaults): validate 'channel' before responding to OSC request (#27594)
Validate the channel number before responding to an OSC 10/11 request.
When used with nvim_open_term, the channel number is unset (since there
is no process on the other side of the PTY).
2024-02-26 11:33:16 -06:00
cdcdc10411 refactor(msgpack): remove dead unpacker code in helpers
Unpacker code now lives in unpacker.c
This was part of the old unpacker which I forgor to remove.
2024-02-26 14:47:47 +01:00
7038fdeee2 Merge pull request #27599 from bfredl/nofilealloc
refactor(fileio): remove API shell layer encouraging unnecessary allocations
2024-02-26 14:43:42 +01:00
ad5a155b1f fix(mbyte): fix bugs in utf_cp_*_off() functions
Problems:
- Illegal bytes after valid UTF-8 char cause utf_cp_*_off() to fail.
- When stream isn't NUL-terminated, utf_cp_*_off() may go over the end.
Solution: Don't go over end of the char of end of the string.
2024-02-26 18:12:55 +08:00
8b4e269156 test(terminal/buffer_spec): re-skip bang test on Windows 2024-02-26 10:11:59 +08:00
268066e014 fix(process): start pty process eof timer on main thread (#27625) 2024-02-26 09:47:49 +08:00
185752614d refactor(types): fix miscellaneous type warnings 2024-02-25 22:08:11 +00:00
7447b035ca refactor(shada): devirtualize writer
writer is only ever used with FileDescriptor. We already have separate
code paths for serializing shada data into memory, see
shada_encode_regs() and friends
2024-02-25 11:20:06 +01:00
77e928fd3e refactor(fileio): remove API shell layer encouraging unnecessary allocations
Functions like file_open_new() and file_open_fd_new() which just is a
wrapper around the real functions but with an extra xmalloc/xfree around
is an anti-pattern. If the caller really needs to allocate a
FileDescriptor as a heap object, it can do that directly.

FileDescriptor by itself is pretty much a pointer, or rather two:
the OS fd index and a pointer to a buffer. So most of the time an extra
pointer layer is just wasteful.

In the case of scriptin[curscript] in getchar.c, curscript used
to mean in practice:

N+1 open scripts           when curscript>0
zero or one open scripts   when curscript==0

Which means scriptin[0] had to be compared to NULL to disambiguate the
curscript=0 case.

Instead, use curscript==-1 to mean that are no script,
then all pointer comparisons dissappear and we can just use an array of
structs without extra pointers.
2024-02-25 11:20:06 +01:00
0fcbda5987 fix(lsp): add snippet regression test (#27618) 2024-02-25 11:05:37 +01:00
c651a0f643 vim-patch:partial:d086b8f646a6 (#27623)
runtime(doc): fix inconsistent indent (vim/vim#14089)

d086b8f646
2024-02-25 16:38:34 +08:00
b72dc2d8ad test: don't use minimal timeout for "intermediate" flag (#27620)
With "intermediate" flag, only using minimal timeout is too short and
may lead to failures.
Also remove the fallback timeout in screen:expect_unchanged(), as having
a different fallback timeout than screen:expect() is confusing.
2024-02-25 13:35:24 +08:00
2e1f5055ac fix(lsp): add assertion for explicit bufnr in apply_text_edits (#27614)
Assert that the buffer number passed to apply_text_edits is fully
resolved (not 0 or null). Pass the known buffer number to
apply_text_edits from lsp.formatexpr().
2024-02-24 19:21:57 -06:00
c2ddef30e7 docs: fix several misleading and superfluous wordings (#27609) 2024-02-25 08:45:34 +08:00
52fe3741aa vim-patch:374e26aba2e5 (#27617)
runtime(doc): clarify ':set[l] {option}<' behaviour

closes: vim/vim#14062

374e26aba2

Co-authored-by: Matt Ellis <m.t.ellis@gmail.com>
2024-02-25 08:19:43 +08:00
091e374c7f vim-patch:9.1.0135: Insufficient testing for 'delcombine' (#27616)
Problem:  Insufficient testing for 'delcombine'.
Solution: Add test for both Normal and Insert modes without Arabic.
          (zeertzjq)

closes: vim/vim#14086

cd3a13e774
2024-02-25 07:48:54 +08:00
71384129f7 build: download libiconv and gettext from deps repository
Downloading it from https://ftp.gnu.org/pub/gnu/ has started to become
unreliable and we can therefore no longer rely on it.
2024-02-24 17:45:52 +01:00
8addd27504 fix(lsp): when renaming directory, check path prefix of buffer names (#27603)
For example, when renaming /path/to/dir, buffers like
fern://drawer/file:///path/to/dir, /path/to/dir123 should not be
matched.
2024-02-24 16:47:34 +01:00
04f723f1a5 vim-patch:9.1.0131: buffer-completion may not always find all matches (#27610)
Problem:  buffer-completion code too complicated and does not always
          find all matches (irisjae)
Solution: do not try to anchor pattern to beginning of line or
          directory-separator, always return all matches

Note: we are considering the non-fuzzy buffer-matching here.

Currently, the buffer-completion code makes 2 attempts to match a
pattern against the list of available patterns. First try is to match
the pattern and anchor it to either the beginning of the file name or
at a directory-separator (// or \\).

When a match is found, Vim returns the matching buffers and does not try
to find a match anywhere within a buffer name. So if you have opened two
buffers like /tmp/Foobar.c and /tmp/MyFoobar.c using `:b Foo` will only
complete to the first filename, but not the second (the same happens
with `getcompletion('Foo', 'buffer')`).

It may make sense, that completion priorities buffer names at directory
boundaries, but it inconsistent, may cause confusion why a certain
buffer name is not completed when typing `:b Foo<C-D>` which returns
only a single file name and then pressing Enter (to switch to that
buffer), Vim will error with 'E93: More than one match for Foo').
Similar things may happen when wiping the /tmp/Foobar.c pattern and
afterwards the completion starts completing other buffers.

So let's simplify the code and always match the pattern anywhere in the
buffer name, do not try to favor matches at directory boundaries. This
is also simplifies the code a bit, we do not need to run over the list
of buffers several times, but only twice.

fixes vim/vim#13894
closes: vim/vim#14082

0dc0bff000

Cherry-pick test_cmdline.vim from patch 9.1.0019 as it already passes.

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-02-24 22:59:28 +08:00
a0394b648c docs(lsp): mark ClientConfig.init_options as optional
Followup to neovim/neovim#27443
2024-02-24 15:45:54 +01:00
febf481002 vim-patch:9.1.0132: "C" doesn't include composing chars with 'virtualedit' (#27605)
Problem:  using "C" and 've=all' set, doesn't include composing chars
          when changing a line, keeps the composing chars for whatever
          is typed afterwards.
Solution: Use mb_head_off() and mb_ptr2len() instead of mb_tail_off().
          (zeertzjq)

closes: vim/vim#14083

048761bcd4
2024-02-24 22:04:52 +08:00
63c9e0c4ae build(deps): bump lua-compat-5.3 to v0.13
* Convert lua_pushlstring from a macro to a function
* strerror_r is not available on mingw
* Support getting io.popen results on file:close() on PUC-Rio Lua 5.1
* Fix missing closing parenthesis in preprocessor macro
* fix detection of LUA_USE_WINDOWS define

Also switch to new org
2024-02-24 15:04:20 +01:00
9ea8a77b04 vim-patch:9.1.0129: Fix truncation of text_wrap 'wrap' virt text after EOL list char (#27600)
Problem:  Virtual text with text_wrap 'wrap' was effectively being
          truncated by a break conditional on the EOL list character
          being added to the screen line. (BigPeet)
Solution: Remove the condition that was leading to the early break and
          instead fix a similar but incorrectly written outer condition
          that checks if there is more to add at the end of the screen
          line. (Dylan Thacker-Smith)

Also, related:
- update comment in win_line()
- remove no longer necessary at_end_str variable in win_line()

fixes: vim/vim#12725
closes: vim/vim#14079

f548ae7b63

Co-authored-by: Dylan Thacker-Smith <dylan.ah.smith@gmail.com>
2024-02-24 20:16:39 +08:00
90f6d999b1 refactor(lsp): remove redundant code (#27601)
* use builtin function
* buffer:// was removed in 236c20795e.
2024-02-24 13:14:12 +01:00
9418381ccc vim-patch:a35235e824bb (#27598)
runtime(doc) Update help text for matchbufline() and matchstrlist()

closes: vim/vim#14080

a35235e824

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-02-24 17:55:32 +08:00
acb13c7ac7 Merge pull request #27562 from bfredl/envalloc
perf(os/env): os_getenv() allocation when there is no env var set
2024-02-24 09:57:33 +01:00
c5990f2cdc perf(os/env): os_getenv() allocation when there is no env var set
os_getenv("FOO") caches the result when $FOO is set to something
non-empty. However, when $FOO was not set, every new call to
os_getenv("FOO") would allocate a temporary scratch buffer to
immediately throw away.

This has an huge impact e.g. on logging which depends on potentially
non-set env vars.
2024-02-24 09:30:21 +01:00
15f7ac6a04 docs(lsp): remove obsolete didChangeConfiguration explanation (#27595)
Rendered obsolete by c6d747e6a5.
2024-02-24 07:19:33 +01:00
99288ecc77 fix(terminal): block input when there is pending TermRequest (#27589) 2024-02-24 05:12:30 +08:00
cb5ae22eab Merge pull request #27590 from bfredl/signcolfix
fix(marktree): do not count certain marks twice when checking for overlap
2024-02-23 13:37:11 +01:00
b97d5038f1 fix(marktree): some marks counted twice when checking for overlap
fixes #27046
2024-02-23 11:41:09 +01:00
7e008799a8 vim-patch:315cd1fbcbba
runtime(spec): Recognize SourceLicense tag name in RPM spec syntax (#14046)

rpm-4.19.0 added a new SourceLicense tag. It is used at the same place
as License tag.

This patch adds the new tag name into a Vim syntax file to be
highligted the same way as the License tag. Note that it has to be
defined in the syntax file before Source\d* regexp. Otherwise it's not
recognized by Vim.

315cd1fbcb

Co-authored-by: Petr Pisar <ppisar@redhat.com>
2024-02-23 09:31:30 +01:00
eb4783fb6c refactor(defaults): use getregion() for default * and # mappings 2024-02-23 08:12:46 +08:00
df1795cd6b vim-patch:1624970d321c (#27582)
runtime(vim): Update base-syntax, fix :unabbrev highlighting (vim/vim#14077)

Fixes issue vim/vim#7876

1624970d32

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-02-23 07:13:33 +08:00
564fd1cc51 Merge pull request #27578 from zeertzjq/vim-9.1.0120
vim-patch:9.1.{0120,0126,0127): add getregion() function
2024-02-23 06:57:07 +08:00
1f75184b5c vim-patch:9.1.0127: Naming a non-pointer variable "oap" is strange
Problem:  Naming a non-pointer variable "oap" is strange.
Solution: Rename it to "oa". Also prevent using freed memory in case of
          memory allocation failure. (zeertzjq)

closes: vim/vim#14075

5e3674b42d
2024-02-23 06:39:34 +08:00
06df895e71 vim-patch:9.1.0126: Internal error when using upper-case mark in getregion()
Problem:  Internal error when passing mark in another buffer to
          getregion().
Solution: Don't allow marks in another buffer (zeertzjq)

closes: vim/vim#14076

Internal error when passing mark in another buffer to getregion()

421b597470
2024-02-23 06:39:05 +08:00
20e4001eee vim-patch:9.1.0120: hard to get visual region using Vim script
Problem:  hard to get visual region using Vim script
Solution: Add getregion() Vim script function
          (Shougo Matsushita, Jakub Łuczyński)

closes: vim/vim#13998
closes: vim/vim#11579

3f905ab3c4

Cherry-pick changes from patch 9.1.0122, with :echom instead of :echow.

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Co-authored-by: Jakub Łuczyński <doubleloop@o2.pl>
2024-02-23 06:39:03 +08:00
bb15fa0356 feat(treesitter): add folding for InspectTree (#27518)
As the InspectTree buffer is now a valid tree-sitter query tree, we can
use the bundled fold queries to have folding for the tree.
2024-02-22 14:58:59 -06:00
85cb0b0ddc fix(defaults): make terminal autoclose not block other events (#27581)
Problem: When terminal is autocloses, it blocks other events, like
  `BufEnter`.

Solution: Use `nested = true`.
2024-02-22 13:54:21 -06:00
0760d98680 vim-patch:20d61e1b94e5
runtime(java): add syntax support for Java switch expressions (#9124)

20d61e1b94

Co-authored-by: Nick Hanley <nicholasjhanley@gmail.com>
2024-02-22 16:27:56 +01:00
eef2aedff6 fix(defaults): remove tmux background detection passthrough (#27571)
There is now a new tmux 3.4 release that queries background color from
the parent terminal if background is not set in tmux, so removing the
passthrough still works when background is not set in tmux, and fixes
the incorrect detection when background is set in tmux.
2024-02-22 21:15:56 +08:00
741a6684e0 docs(builtin): show tag at first line with multiple signatures (#27577)
Problem:
When a function has multiple signatures, putting its tag at the last one
may make one think that's its only signature.

Solution:
When a function has multiple signatures, put its tag at the first one.
2024-02-22 19:39:58 +08:00
42f8ada59d build(deps): bump luv to v1.48.0-0
* fix: Use os_uname() to check for Linux by @cryptomilk in #686
    * docs: typo in a table field name by @Bilal2453 in #689
    * docs: most new_handle methods won't return fail by @Bilal2453 in #683
    * test-tty: Don't depend on stdin/stdout handle type by @squeek502 in #688
    * Bump/libuv by @zhaozg in #690
    * Annotate .gitmodules with branch and tag by @creationix in #693
2024-02-22 10:07:04 +01:00
bba4834ede vim-patch:e8f6af609178
runtime(tmux): Update tmux syntax (#14065)

e8f6af6091

Co-authored-by: Eric Pruitt <eric.pruitt@gmail.com>
2024-02-22 09:50:35 +01:00
e2e63bd045 fix(lua): make highlight.on_yank use win-local highlight (#27349)
Currently, highlight.on_yank() does buffer-local highlighting, this PR
makes it window scoped.

Also fix the problem that when yanking in a buffer, moving to another
buffer, and yanking before the original buffer highlight disappears, the
original buffer highlight won't disappear on timeout.
2024-02-22 16:39:32 +08:00
4ec5c58846 refactor(terminal): rename confusing variable name "rv" (#27573)
Now that terminal_open() no longer returns a value, the variable name
"rv" is confusing, and "term" makes more sense anyway.
2024-02-22 13:18:52 +08:00
711a2f5ff6 fix(api): don't leak memory with nvim_win_get_ns (#27570) 2024-02-22 09:13:07 +08:00
2137edbd4f fix(extmarks): redraw properly with scoped inline virt_text (#27569) 2024-02-22 09:05:52 +08:00
d9e6a442f2 build(deps): bump tree-sitter to v0.21.0 2024-02-21 23:10:25 +01:00
8ab9966939 test(treesitter): fix obsolete predicates 2024-02-21 23:10:25 +01:00
ba0370b1d7 Merge pull request #27361 from altermo/buf-win-local-extmarks
feat(extmark): window scoped namespace
2024-02-21 19:21:13 +01:00
1c032ad703 feat(extmark): window scoped extmark
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-02-21 16:11:50 +01:00
6d8bbfe19d docs: remove mention of foreground/background/special keys in nvim_set_hl (#27558)
To align the output of `nvim_get_hl` with its documentation -- which
points to `nvim_set_hl`, remove mentions of the keys `foreground`,
`background` and `special`.

The long keys are are still supported (via fallback checks inside
`dict2hlattrs`), but the `fg`, `bg` and `sp` keys are preferenced.
2024-02-21 21:25:08 +08:00
ac0e8323dc fix(lsp): add parentheses to generated union array types (#27560) 2024-02-21 12:31:56 +01:00
09651342e7 Merge pull request #27552 from bfredl/apialloc
refactor(api): make freeing of return-value opt-in instead of opt out.
2024-02-21 12:30:28 +01:00
4fb1739e6f build: fix uncrustify 2024-02-21 11:58:28 +01:00
3cc54586be refactor(api): make freeing of return-value opt-in instead of opt out
As only a few API functions make use of explicit freeing of the return
value, make it opt-in instead. The arena is always present under the
hood, so `Arena *arena` arg now doesn't mean anything other than getting
access to this arena. Also it is in principle possible to return an
allocated value while still using the arena as scratch space for other
stuff (unlikely, but there no reason to not allow it).
2024-02-21 11:58:28 +01:00
9bb046d1be vim-patch:f9ca139e3aa1 (#27554)
runtime(misc): announce adoption of various runtime files

f9ca139e3a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-02-21 06:30:18 +08:00
f25c0c1eb9 vim-patch:ef387c062bb1 (#27553)
runtime(filetype): Modula-2 files with priority not detected (vim/vim#14055)

Problem:  Modula-2 files with a specified priority are not detected.
Solution: Match the priority syntax in module header lines when
          performing heuristic content detection.

Disable the :defcompile debug line.  This was accidentally left enabled
in commit 68a8947.

ef387c062b

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-02-21 06:29:53 +08:00
5e4a5f1aaa fix(vim.ui.open): use explorer.exe instead of wslview #26947
Problem:
`vim.ui.open` uses `wslview`, which is slow and require a package from external PPA:
https://wslutiliti.es/wslu/install.html#ubuntu

Solution:
Use `explorer.exe` instead. WSL supports it by default:
https://learn.microsoft.com/en-us/windows/wsl/filesystems#view-your-current-directory-in-windows-file-explorer
2024-02-20 09:14:50 -08:00
eb1e8c12e2 Merge pull request #27541 from bfredl/exprarena
refactor(api): use an arena for nvim_parse_expression
2024-02-20 13:11:18 +01:00
ddda5e0a48 feat(help): hide filename of "gO" outline using conceal #27547
Help outlines, invoked by `gO`, displays the help section titles in the
location list window. This feature is implemented by setting the buffer
lines after opening the window, but this implementation breaks the
assumption that the quickfix window texts are consistently constructed
by the quickfix list items. I think we can use the conceal feature here.
Using conceal here improves interoperability between quickfix plugins,
and also simplifies the outline implementation.

Originally reported at https://github.com/itchyny/vim-qfedit/issues/12
2024-02-20 03:57:13 -08:00
a0790558c3 fix(extmarks): priority order of inline and non-inline virt_text (#27532) 2024-02-20 19:53:49 +08:00
acd9b54f08 refactor(api): use an arena for nvim_parse_expression 2024-02-20 12:31:11 +01:00
69bdcc6823 Merge pull request #27536 from bfredl/bufferarena
refactor(api): reduce temporary allocations when replacing lines
2024-02-20 12:19:47 +01:00
f2c73e9ee2 refactor(api): reduce temporary allocations when replacing lines
The way ml_replace_buf is implemented makes it unfriendly for
being used in a loop: every call allocates a scratch buffer for putting
the line into the "dirty" state. This then immediately needs to be freed
as the next ml_replace_buf and/or ml_append_buf call will flush that buffer.

It's better to later pay the price of allocating the scratch buffer only if
the line is being immediately edited (likely when using the API to only
change one line) with an extra memcpy, than allocating that buffer
multiple times every time the API is called.

Of course, a separate xmalloc/xfree cycle for each time the dirty line
changes is unwanted to begin with. But fixing that is a later refactor.
2024-02-20 11:24:15 +01:00
8952a89db5 Merge pull request #27534 from bfredl/userarena
refactor(api): next PR to make use of the arena
2024-02-19 21:21:05 +01:00
8fdc84d0aa build: disable conversion warnings for GCC
GCC seems chronically incapable of producing correct and relevant
conversion warnings, and will therefore need to be silenced.
2024-02-19 20:41:44 +01:00
404707c760 refactor(api): use arena for nvim_put and nvim_paste 2024-02-19 13:48:39 +01:00
d14eefaee9 refactor(api): use arena when listing objects 2024-02-19 13:48:39 +01:00
abb8dcd889 refactor(api): use arena for runtime and client info 2024-02-19 13:48:39 +01:00
1d95abc66b refactor(api): use an arena for user commands 2024-02-19 13:44:45 +01:00
cc15ba212c refactor(lsp): typings for protocol constants 2024-02-19 11:23:35 +00:00
a9f578b7a5 docs: improve 'tabline' click label docs (#27529) 2024-02-19 11:22:00 +08:00
fa131de9ad feat(tabline): middle mouse button now closes tab (#27522) 2024-02-19 10:49:33 +08:00
8f1f2a1d9f vim-patch:9.1.0115: Using freed memory with full tag stack and user data (#27525)
Problem:  Using freed memory with full tag stack and user data
          (Konstantin Khlebnikov)
Solution: Clear the user data pointer of the newest entry.
          (zeertzjq, Konstantin Khlebnikov)

fixes: neovim/neovim#27498
closes: vim/vim#14053

c86bff1771

Cherry-pick Test_tag_stack() changes from patch 9.0.0767.

Co-authored-by: Konstantin Khlebnikov <koct9i@gmail.com>
2024-02-19 06:53:13 +08:00
1c520053a9 Merge pull request #27520 from bfredl/metaarena
refactor(api): use arena for metadata; msgpack_rpc_to_object delenda est
2024-02-18 18:32:46 +01:00
bbf6d4a4bc refactor(api): use arena for metadata; msgpack_rpc_to_object delenda est
Note: kSDItemHeader is something is _written_ by nvim in the shada file
to identify it for debugging purposes outside of nvim. But this data wasn't ever used by
neovim after reading the file back, So I removed the parsing of it for now.
2024-02-18 18:09:56 +01:00
93c911e52f Merge pull request #27511 from bfredl/maparena
refactor(api): use arena for mappings, autocmd, channel info
2024-02-18 18:04:28 +01:00
97531be1f7 refactor(api): use arena for autocmds 2024-02-18 13:38:19 +01:00
d94adff48b ci(labeler_issue): split on word boundaries
Splitting it on word boundaries rather than only spaces allows for better
detection. The issue labeler previously didn't catch titles such as
`treesitter: noisy "Invalid node type" error`.

Co-authored-by: casswedson <casswedson@users.noreply.github.com>
2024-02-18 12:29:07 +01:00
b8c34efe33 fix(eval): skip over v:lua properly (#27517)
Problem:  Error when parsing v:lua in a ternary expression.
Solution: Set rettv->v_type for v:lua even if not evaluating.
2024-02-18 19:11:44 +08:00
796df966f3 fix(options): don't update curswant for 'winhl' or 'winbl' (#27515) 2024-02-18 18:11:20 +08:00
146333ca12 refactor(api): use arena for channel info and terminal info 2024-02-18 10:36:07 +01:00
eb8a3e0575 vim-patch:9.1.0114: Setting some options may change curswant (#27514)
Problem:  Setting some options changes curswant unnecessarily.
Solution: Add a P_HLONLY flag that prevents changing curswant.
          (zeertzjq)

closes: vim/vim#14044

fcaed6a70f
2024-02-18 17:20:49 +08:00
f25fcc68a3 refactor(api): use an arena for mappings 2024-02-18 10:15:27 +01:00
b12d193b4a Merge pull request #27481 from bfredl/meta_revise
fix(decorations): crash with revised mark with changed decoration flags
2024-02-17 18:42:47 +01:00
2accf24805 fix(decorations): crash with revised mark with changed decoration flags
fixes #27211
2024-02-17 18:22:35 +01:00
01c15a30c0 ci(release): run universal_macos build on M1 (#27505)
Run the release workflow on macos-14 to use faster M1 runners.

Lock the deployment target to the oldest supported version (11.0,
due to libuv support) instead of relying on the host OS version.
2024-02-17 13:35:47 +01:00
bf830a53f5 ci: test on macOS M1 (#27276)
Problem: No test coverage on ARM.

Solution: Add `macos-14` tests, which now run on M1. Skip unit tests as these don't work on M1, see #26145. Also test universal build on M1.

Note: `macos-14` will be `macos-latest` in Q2 2024, so we'll want to switch these to keep Intel and unittest coverage on macos (while GH still offers Intel runners).
2024-02-17 13:12:39 +01:00
ea0737c838 ci(test.yml): explicitly set build type (#27503)
Explicitly set the build type for both deps and Nvim. They are already
explicitly set on Windows to RelWithDebInfo. Now also explicitly set
them to Debug on POSIX.
2024-02-17 18:35:25 +08:00
848fc8ede8 test: more tests for nvim_eval_statusline "fillchar" (#27502) 2024-02-17 08:45:35 +08:00
5fd1bac65e fix(api): don't use stl 'fillchar' for "use_statuscol_lnum" (#27501)
Problem:  nvim_eval_statusline() uses "stl" from 'fillchars' with "use_statuscol_lnum".
Solution: Reorder "fillchar" else chain.
2024-02-17 07:44:31 +08:00
478273a423 fix: fix iter_matches call in query linter (#27496) 2024-02-16 14:00:19 -06:00
a75ef40f4c build: set deps default build type to Release (#27495)
Debugging dependencies is rare so a Debug build type is usually not
needed. In cases where it _is_ needed it is easy to rebuild in Debug
mode. But since Release builds are more common, it makes more sense as a
default.

For Neovim itself we stick with a Debug build as a default, since
rebuilding and debugging is done _much_ more frequently than with
dependencies (which we _mostly_ expect to "just work").

Also remove the CMAKE_BUILD_TYPE variable in the Makefile, since this is
set by default in CMake.
2024-02-16 11:56:52 -06:00
bd5008de07 fix(treesitter): correctly handle query quantifiers (#24738)
Query patterns can contain quantifiers (e.g. (foo)+ @bar), so a single
capture can map to multiple nodes. The iter_matches API can not handle
this situation because the match table incorrectly maps capture indices
to a single node instead of to an array of nodes.

The match table should be updated to map capture indices to an array of
nodes. However, this is a massively breaking change, so must be done
with a proper deprecation period.

`iter_matches`, `add_predicate` and `add_directive` must opt-in to the
correct behavior for backward compatibility. This is done with a new
"all" option. This option will become the default and removed after the
0.10 release.

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
Co-authored-by: MDeiml <matthias@deiml.net>
Co-authored-by: Gregory Anders <greg@gpanders.com>
2024-02-16 11:54:47 -06:00
1ba3500abd docs(tutor): include https urls where applicable (#27461)
Problem:  URLs in :Tutor use "http" instead of "https".
Solution: Update URLs with a valid "https" equivalent.
2024-02-16 20:54:32 +08:00
d040b7341e build(vim-patch.sh): don't add vim/vim to issue of another repo (#27493) 2024-02-16 20:19:26 +08:00
47eb57a4d6 Merge pull request #27464 from zeertzjq/vim-9b53c052d58f
vim-patch: update Vim syntax
2024-02-16 19:27:50 +08:00
615b48aca6 fix(runtime): add more Nvim-only highlight groups to Vim syntax 2024-02-16 19:06:10 +08:00
608f238bc6 vim-patch:1633de8c35fd
runtime(vim): Update base-syntax, remove unused vimString region

These were included with the initial release of the syntax file for Vim
5 and were probably intended to allow for syn-region start/skip/end
patterns with a '!' or '+' delimiter.  However, these cases are
currently handled by the vimSynRegPat group.

The removed patterns never match anywhere in the distributed runtime
files and it is believed that this is generally true.

closes: vim/vim#14035

1633de8c35

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-02-16 19:06:10 +08:00
18dfe175e7 vim-patch:fe6d5b0ae47e
runtime(vim): Update base-syntax, fix :behave highlighting

closes: vim/vim#14036

fe6d5b0ae4

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-02-16 19:06:10 +08:00
7751ff7394 vim-patch:5c3855bcab42
runtime(vim): update Vim Syntax generator

- Add missing "Last Change:" line.
- The date on this line in vim.vim is updated by update_date.vim at
  Make time. (I made a mistake in the file path)
- Remove unnecessary "b:loaded_syntax_vim_ex".
- Remove "Base File Date:" line in vim.vim.base
- Add Doug Kearns as Maintainer

closes: vim/vim#14031

5c3855bcab

Co-authored-by: h-east <h.east.727@gmail.com>
2024-02-16 19:06:10 +08:00
2a6c7d0ccc vim-patch:9b53c052d58f
runtime(vim): include Vim Syntax generator

fixes: vim/vim#13939
closes: vim/vim#14021
related: vim-jp/syntax-vim-ex#28

9b53c052d5

Omit the generator as it cannot be used for Nvim.
Keep vimHLGroup and vimOnlyHLGroup separate.

N/A patch:
vim-patch:b418a51933bb

Co-authored-by: h-east <h.east.727@gmail.com>
2024-02-16 19:05:57 +08:00
5de14b7206 vim-patch:ceed36873e92
runtime(vim): accept dot in completionList for Vim9 syntax (vim/vim#13832)

if you have autoloaded command complete function in vim9script, it shouldn't be highlighted as Error:

```
import autoload "share.vim"
command! -range=% -nargs=? -complete=custom,share.Complete Share share.Paste(<q-args>, <line1>, <line2>)
```

`share.Complete` is a valid complete function.

ceed36873e

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-02-16 19:05:50 +08:00
422b090e0c vim-patch:79230f027a25
runtime(less): update "Last Change:" header

Commit 103f1dfb7df350650a5d7caadb0364bd79e9d25b forgot to update the
"Last Change:" header. So update it now.

79230f027a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-02-16 08:57:45 +01:00
a1d977d8eb vim-patch:103f1dfb7df3
runtime(less): reset readonly setting when disabling less mode

While at it, also do the unmap only if a specific key has been mapped.
There are some keys that are only selectively mapped and it would cause
an error if we are trying to unmap such a key (e.g. z when your
foldmethod is not manual).

fixes: vim/vim#14040

103f1dfb7d

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-02-16 08:57:45 +01:00
51ea753747 fix(genvimvim): generate prefixed boolean options properly (#27487) 2024-02-16 13:27:42 +08:00
55a4aa41bb docs: document breaking change for nvim_create_autocmd callback (#27484)
https://github.com/neovim/neovim/pull/27428 changed the semantics of
callbacks passed to nvim_create_autocmd such that any truthy value will
delete the autocommand (rather than just the literal boolean value
`true`). Update the documentation accordingly and add an entry to
`news.txt`.

The behavior is now consistent between nvim_create_autocmd and
nvim_buf_attach.
2024-02-15 19:56:58 -06:00
04dfa2eea9 Merge pull request #27485 from zeertzjq/vim-9.1.0112
vim-patch:9.1.{0112,0113}
2024-02-16 07:34:02 +08:00
163add40b8 vim-patch:9.1.0113: duplicate code when cleaning undo stack
Problem:  duplicate code when cleaning undo stack
Solution: refactor undo cleanup into a single public function

related: vim/vim#13928

9071ed8107

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-02-16 07:18:06 +08:00
c1fa8789c1 vim-patch:9.1.0112: Remove undo information, when cleaning quickfix buffer
Problem:  When the quickfix buffer has been modified an autocommand
          may invalidate the undo stack (kawarimidoll)
Solution: When clearing the quickfix buffer, also wipe the undo stack

fixes: vim/vim#13905
closes: vim/vim#13928

f0d3d4a426

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-02-16 07:18:06 +08:00
d60eeacae4 build(deps): bump tree-sitter-c to v0.20.8
* fix: allow function definitions to contain preproc attributes

Also update URLs for parsers transferred to tree-sitter-grammars
2024-02-15 17:21:42 +01:00
35f453f65d fix: type warnings in shared.lua 2024-02-15 11:32:50 +00:00
c6f7419420 Merge pull request #27460 from bfredl/merarena
refactor(eval): use arena when converting typvals to Object
2024-02-15 11:10:45 +01:00
d60412b18e refactor(eval): use arena when converting typvals to Object
Note: this contains two _temporary_ changes which can be reverted
once the Arena vs no-Arena distinction in API wrappers has been removed.
Both nlua_push_Object and object_to_vim_take_luaref() has been changed
to take the object argument as a pointer. This is not going to be
necessary once these are only used with arena (or not at all) allocated
Objects.

The object_to_vim() variant which leaves luaref untouched might need to
stay for a little longer.
2024-02-15 10:42:06 +01:00
0a51e7626a vim-patch:9.1.0111: filetype: no support for bats files
The '*.bats' file type is for Bash Automated Testing System (BATS)
scripts. BATS scripts are Bash with a special '@test' extension but they
otherwise work with Vim's bash filetype.

See https://github.com/bats-core/bats-core

closes: vim/vim#14039

d00fb4b3a2

Co-authored-by: Brandon Maier <brandon.maier@collins.com>
2024-02-15 10:01:16 +01:00
d0599b0ed9 vim-patch:9.1.0110: filetype: add 'Config.in' filetype detection
The 'Config.in' file type is for Buildroot configuration files.
Buildroot Config.in files use the same Kconfig backend as the Linux
kernel's Kconfig files.

Buildroot also has other filename variants that follow "Config.in.*",
they are used to distinguish multiple Config.in files in the same
directory.

See https://buildroot.org/downloads/manual/manual.html#_literal_config_in_literal_file

closes: vim/vim#14038

5f20f050ef

Co-authored-by: Brandon Maier <brandon.maier@collins.com>
2024-02-15 10:01:16 +01:00
7ed75d410a vim-patch:9.1.0109: filetype: no support for its files
Problem:  filetype: no support for its files
Solution: Add detection for *.its files as dts file type
          (Brandon Maier)

The '*.its' file type is for U-Boot Flattened Image Trees (FIT) which
use the flattened devicetree format.

See https://github.com/u-boot/u-boot/blob/master/doc/usage/fit/source_file_format.rst#terminology

closes: vim/vim#14037

cf1d65e060

Co-authored-by: Brandon Maier <brandon.maier@collins.com>
2024-02-15 10:01:16 +01:00
4f07ad7786 vim-patch:9.1.0108: filetype: no support for dtso files
Problem:  filetype: no support for dtso files
Solution: Add detection for *.dtso files as dts file type
          (Markus Schneider-Pargmann)

*.dtso files are devicetree overlay files which have the same syntax as dts or dtsi files.

closes: vim/vim#14026

b1700fb33f

Co-authored-by: Markus Schneider-Pargmann <msp@baylibre.com>
2024-02-15 10:01:16 +01:00
989312ed84 vim-patch:1da0e8581671
runtime(asciidoc): include basic ftplugin

closes: vim/vim#13873

1da0e85816

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2024-02-15 10:00:59 +01:00
b76a01055f Merge pull request #27474 from zeertzjq/vim-9.1.0068
vim-patch:9.1.{0068,0106}: Visual highlighting can be improved
2024-02-15 11:17:21 +08:00
31b3c62845 vim-patch:9.1.0106: Visual highlight hard to read with 'termguicolors'
Problem:  Visual highlight hard to read with 'termguicolors'
          (Maxim Kim)
Solution: Set Visual GUI foreground to black (with background=light)
          and lightgrey (with background=dark)
          (Maxim Kim)

fixes: vim/vim#14024
closes: vim/vim#14025

34e4a05d02

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-02-15 10:50:29 +08:00
440ce0d246 vim-patch:9.1.0068: Visual highlighting can still be improved
Problem:  Visual highlighting can still be improved
Solution: Update Visual highlighting for 8 color terminals,
          use uniform grey highlighting for dark and light bg
          (Maxim Kim)

Update terminal Visual

1. Use `ctermbg=Grey ctermfg=Black` for both dark and light

This uniforms Visual highlighting between default dark and light colors
And should work for vim usually detecting light background for terminals
with black/dark background colors.

Previously used `ctermfg=White` leaks `cterm=bold` if available colors
are less than 16.

2. Use `term=reverse cterm=reverse ctermbg=NONE ctermfg=NONE`
   for terminals reporting less than 8 colors available

If the terminal has less than 8 colors, grey just doesn't work right

closes: vim/vim#13940

59bafc8171

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-02-15 07:49:23 +08:00
d09957e0a0 fix(lsp): rename: load and list new buffer if attached to window (#27408) 2024-02-14 21:11:29 +01:00
a376d979bd fix(extmarks): redraw line on adding/removing conceal (#27463) 2024-02-14 07:51:04 +08:00
b2f7a3aaad vim-patch:9.1.0105: Style: typos found (#27462)
Problem:  Style: typos found
Solution: correct them
          (zeertzjq)

closes: vim/vim#14023

e71022082d
2024-02-14 06:39:47 +08:00
9f8c96240d refactor(lsp): resolve the config-client entanglement
Previously the LSP-Client object contained some fields that are also
in the client config, but for a lot of other fields, the config was used
directly making the two objects vaguely entangled with either not having
a clear role.

Now the config object is treated purely as config (read-only) from the
client, and any fields the client needs from the config are now copied
in as additional fields.

This means:
- the config object is no longet normalised and is left as the user
  provided it.
- the client only reads the config on creation of the client and all
  other implementations now read the clients version of the fields.

In addition, internal support for multiple callbacks has been added to
the client so the client tracking logic (done in lua.lsp) can be done
more robustly instead of wrapping the user callbacks which may error.
2024-02-13 14:49:20 +00:00
ce5a9bfe7e Merge pull request #27428 from bfredl/luarena
refactor(lua): use Arena when converting from lua stack to API args
2024-02-13 12:14:53 +01:00
1a3a8d903e refactor(lua): use a keyset for vim.diff opts parsing 2024-02-13 11:54:44 +01:00
0353dd3029 refactor(lua): use Arena when converting from lua stack to API args
and for return value of nlua_exec/nlua_call_ref, as this uses
the same family of functions.

NB: the handling of luaref:s is a bit of a mess.
add api_luarefs_free_XX functions as a stop-gap as refactoring
luarefs is a can of worms for another PR:s.

as a minor feature/bug-fix, nvim_buf_call and nvim_win_call now preserves
arbitrary return values.
2024-02-13 11:54:44 +01:00
89135cff03 fix(loader): remove cyclic dependency on vim.fs (when --luamod-dev)
Problem: Loading `vim.fs` via the `vim.loader` Lua package loader will
result in a stack overflow due to a cyclic dependency. This may happen
when the `vim.fs` module isn't byte-compiled, i.e. when `--luamod-dev`
is used (#27413).

Solution: `vim.loader` depends on `vim.fs`. Therefore `vim.fs` should
be loaded in advance.
2024-02-13 10:29:22 +00:00
309c36d3c9 docs(builtin): fix lua types for vim.fn.sign_getplaced
Per :help sign_getplaced():

- Parameter {dict}: lnum also accepts integer as well as string
- Return value: item has field bufnr, not buf
2024-02-13 08:22:32 +00:00
1c7b0b9d5f docs: stricter bufname and bufnr types (#27454) 2024-02-13 12:15:27 +08:00
4860cc5bdc vim-patch:9.1.0101: upper-case of German sharp s should be U+1E9E (#27449)
Problem:  upper-case of ß should be U+1E9E (CAPITAL LETTER SHARP S)
          (fenuks)
Solution: Make gU, ~ and g~ convert the U+00DF LATIN SMALL LETTER SHARP S (ß)
          to U+1E9E LATIN CAPITAL LETTER SHARP S (ẞ), update tests
          (glepnir)

This is part of Unicode 5.1.0 from April 2008, so should be fairly safe
to use now and since 2017 is part of the German standard orthography,
according to Wikipedia:
https://en.wikipedia.org/wiki/Capital_%E1%BA%9E#cite_note-auto-12

There is however one exception: UnicodeData.txt for U+00DF
LATIN SMALL LETTER SHARP S does NOT define U+1E9E LATIN CAPITAL LETTER
SHARP S as its upper case version. Therefore, toupper() won't be able
to convert from lower sharp s to upper case sharp s (the other way
around however works, since U+00DF is considered the lower case
character of U+1E9E and therefore tolower() works correctly for the
upper case version).

fixes: vim/vim#5573
closes: vim/vim#14018

bd1232a1fa

Co-authored-by: glepnir <glephunter@gmail.com>
2024-02-13 07:38:12 +08:00
86458dde0e vim-patch:9.1.0103: 'breakindentopt' "min" not correct with 'signcolumn' (#27451)
Problem:  'breakindentopt' "min" works incorrectly with 'signcolumn'.
Solution: Use win_col_off() and win_col_off2().
          (zeertzjq)

closes: vim/vim#14014

f0a9d65e0a
2024-02-13 07:33:24 +08:00
2493fd020d vim-patch:9.1.0102: settabvar() may change the last accessed tabpage (#27450)
Problem:  settabvar() may change the last accessed tabpage.
Solution: Save and restore lastused_tabpage.
          (zeertzjq)

closes: vim/vim#14017

b47fbb4083
2024-02-13 07:27:27 +08:00
94085cfce8 perf(redraw): reduce redraw with undo and extmarks or 'spell' (#27442)
vim-patch:9.1.0100: Redrawing can be improved with undo and 'spell'

Problem:  When undoing with 'spell', redrawWinline() is called after
          changed_lines(), while later win_update() sets redraw type to
          UPD_NOT_VALID, even though w_redraw_top and w_redraw_bot are
          still valid.
Solution: Only set redraw type to UPD_NOT_VALID when inserting/deleting
          lines after parts of window has pending redraw, i.e., when
          changed_lines() is called after redrawWinline().
          (zeertzjq)

closes: vim/vim#14019

f2d90a3511
2024-02-13 06:56:19 +08:00
984f7a9fd3 vim-patch:9.0.0245: mechanism to prevent recursive screen updating is incomplete (#27448)
Problem:    Mechanism to prevent recursive screen updating is incomplete.
Solution:   Add "redraw_not_allowed" and set it in build_stl_str_hl().
            (issue vim/vim#10952)

471c0fa3ee

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-02-13 06:30:35 +08:00
84b6ade415 Merge pull request #27439 from bfredl/nofreeallmem
fix(exitfree): don't use ex commands to close windows in free_all_mem()
2024-02-12 16:50:38 +01:00
0185152802 refactor(tests): get channel id via nvim_get_chan_info #27441
Minor "best practices" nudge.
2024-02-12 05:50:39 -08:00
210ec3b7a9 Merge pull request #27348 from fredizzimo/fsundvik/fix-ext-hlstate
fix: crashes with large msgpack messages
2024-02-12 14:33:34 +01:00
2d9e063a63 fix(extmarks): redraw pre-undo position (#27437)
Problem:
Virtual text not redrawn properly after undo moves its extmark.

Solution:
Redraw the moved extmark's pre-undo position.
2024-02-12 21:24:28 +08:00
597ecf7516 fix(lsp): re-add client.commands and mark private 2024-02-12 13:18:23 +01:00
6c168c0f4d docs: correct on_key docs (#27429) 2024-02-12 20:03:53 +08:00
f1dd75c2af fix(exitfree): don't use ex commands to close windows in free_all_mem()
Attempting to manipulate the window layout via ex commands is not safe
here. It is also redundant: `win_free_all()` can free multiple windows
by itself perfectly fine.
2024-02-12 12:20:12 +01:00
917172dd96 fix(lsp): semantic token defer loading
Fixes #27424
2024-02-12 09:31:48 +00:00
4682f158a0 vim-patch:9.1.0098: CompleteChanged not triggered when new leader added without matches (#27436)
Problem:  CompleteChanged not triggered when new leader added causing
          no matching item in the completion menu
Solution: When completion is active but no items matched still trigger
          CompleteChanged event
          (glepnir)

closes: vim/vim#13982

0d3c0a66a3

Fix #15077
2024-02-12 14:57:13 +08:00
929e1b7f1c perf(extmarks): avoid unnecessary invalidations for virt_text (#27435)
Invalidation of most w_valid flags isn't needed when adding or removing
virtual text below cursor.
2024-02-12 13:02:27 +08:00
950a0ac61c vim-patch:b614b284ee06 (#27433)
runtime(vim): Update syntax file (vim/vim#14009)

- allow comments after :highight commands
- match the bang in a :highlight[!] command
- highlight the bang in :map[!], :menu[!] and :unlet[!] with vimOper
  like all other commands

b614b284ee

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-02-12 06:56:48 +08:00
5a4e0b837f fix(column): use a single path for sign sorting (#27431)
Problem:  #25826 added a (duplicate) sign comparison function, which was
modified and strayed from the original in #27418.
Solution: Merge the two functions and add a display test that actually
tests for this order in addition to the legacy tests.
2024-02-12 06:41:44 +08:00
9605cfe06c vim-patch:9.1.0097: 'breakindent' behaves inconsistently with 'list' and splits (#27432)
Problem:  'breakindent' behaves inconsistently with 'list' and splits.
Solution: Use 'listchars' from the correct window and handle caching
          properly. Move cheaper comparisons to the top.
          (zeertzjq)

closes: vim/vim#14008

efabd7c8d4
2024-02-12 06:34:16 +08:00
3faedb0509 refactor(indent): refactor computing of a string's indent size (#27252)
The `get_indent_str_vtab()` function currently calls `tabstop_padding()`
every time a tab is encountered (unless tabstops aren't used).
`tabstop_padding()` either does a division by 'tabstop' If 'vartabstop'
is not set, or iterates through the 'vartabstop' list to find current
tab width. 

Since the virtual column only increases, we can keep track of where the
next tabstop would be, and update this information once it was reached.

`get_indent_str_vtab()` also depends on 'listchars' "tab" value from the
current window, even though it may be called for a line from the same
buffer in a different window. In most cases, it is called with tabstops
enabled (last argument was `false`), so I split the function into one
that uses tabstops and the other that doesn't.

I removed `get_indent_str()` since I couldn't find any calls to it.
2024-02-12 04:17:15 +08:00
46390635cd vim-patch:6d91227267a5
runtime(gpg): Mark dangerous use-embedded-filename with WarningMsg

The syntax highlighter is likely to encourage people to use the listed
commands.

But `use-embedded-filename` is a dangerous option that can cause GnuPG
to write arbitrary data to arbitrary files whenever GnuPG encounters
malicious data.

GnuPG upstream explicitly warns against using this option:

https://dev.gnupg.org/T4500
https://dev.gnupg.org/T6972

However, since this is a valid option, we cannot just drop it from the
syntax script. Instead, let's mark it with the WarningMsg highlighting
to make it obvious, that this option is different (and should not be
used for security reasons).

closes: vim/vim#13961

6d91227267

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2024-02-11 20:09:43 +01:00
ed1b66bd99 refactor(lsp): move more code to client.lua
The dispatchers used by the RPC client should be defined in the client,
so they have been moved there. Due to this, it also made sense to move
all code related to client configuration and the creation of the RPC
client there too.

Now vim.lsp.start_client is significantly simplified and now mostly
contains logic for tracking open clients.

- Renamed client.new -> client.start
2024-02-11 12:37:20 +00:00
8e86193502 Merge pull request #27420 from MariaSolOs/warning-anxiety
refactor(lsp): fix type annotations and add shared diagnostic helper
2024-02-11 11:42:21 +00:00
d48f75e42e Merge pull request #27414 from bfredl/arenalines
refactor(api): use an arena for nvim_buf_get_lines and buffer updates
2024-02-11 12:00:55 +01:00
930d6e38d4 refactor(api): use an arena for nvim_buf_get_lines and buffer updates
Refactor some earlier "temporary Array" code in buffer_updates.c to use
the modern style of MAXSIZE_TEMP_ARRAY and ADD_C
2024-02-11 11:37:55 +01:00
ca258db156 fix(messages): clear new lines when increasing 'cmdheight' (#27421) 2024-02-11 18:12:56 +08:00
eac7e3fc6c refactor(lsp): add vim.lsp.sync.Range type 2024-02-10 20:05:47 -08:00
5a6868c888 refactor(lsp): add shared diagnostic handler 2024-02-10 20:05:47 -08:00
c73d67d283 refactor(lsp): add type annotations 2024-02-10 20:05:47 -08:00
170c890dca feat(shortmess): "q" flag fully hides recording message (#27415)
When "q" is set in 'shortmess' it now fully hides the "recording @a" message
when you are recording a macro instead of just shortening to "recording". This
removes duplication when using reg_recording() in the statusline.

Related #19193
2024-02-11 07:39:39 +08:00
f1f8fa850f refactor: rename w_float_config to w_config #27419
Follows up on rename of `FloatConfig` to `WinConfig` in #27397.
2024-02-10 13:06:01 -08:00
320eec496c Merge pull request #27253 from MariaSolOs/codelens-refresh
feat(lsp): add opts to vim.lsp.codelens.refresh
2024-02-10 21:48:45 +01:00
470c450fd2 Merge pull request #27418 from zeertzjq/vim-9.1.0089
vim-patch:9.1.{0089,0093}: qsort() comparison function fixes
2024-02-10 22:19:51 +08:00
00e785b17f refactor: don't use subtraction in qsort() comparison functions 2024-02-10 21:55:57 +08:00
f3982ad3f3 vim-patch:9.1.0093: Still a qsort() comparison function that returns result of subtraction
Problem:  Still a qsort() comparison function fuzzy_match_item_compare()
          that returns result of subtraction (after 9.1.0089).
Solution: Use an explicit comparison instead of subtraction.
          (zeertzjq)

closes: vim/vim#14004

77078276bf
2024-02-10 21:55:54 +08:00
5bbb733a1b vim-patch:9.1.0089: qsort() comparison functions should be transitive
Problem:  qsort() comparison functions should be transitive
Solution: Do not subtract values, but rather use explicit comparisons

Improve qsort() comparison functions

There has been a recent report on qsort() causing out-of-bounds read &
write in glibc for non transitive comparison functions
https://www.qualys.com/2024/01/30/qsort.txt

Even so the bug is in glibc's implementation of the qsort() algorithm,
it's bad style to just use substraction for the comparison functions,
which may cause overflow issues and as hinted at in OpenBSD's manual
page for qsort(): "It is almost always an error to use subtraction to
compute the return value of the comparison function."

So check the qsort() comparison functions and change them to be safe.

closes: vim/vim#13980

e06e437665

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-02-10 21:55:51 +08:00
71429c90ee build(deps): bump tree-sitter-bash to v0.20.5 2024-02-10 14:49:09 +01:00
e15dfb5f79 refactor: reduce some globals #27406 2024-02-10 05:00:17 -08:00
607606e3bb Merge pull request #27398 from bfredl/arena2
refactor(api): use arena for more stuff
2024-02-10 12:07:37 +01:00
4948fa42ef test(ui/mouse_spec): make sure click is processed (#27412) 2024-02-10 12:57:40 +08:00
7ab003ec79 vim-patch:9.1.0087: Restoring lastused_tabpage too early in do_arg_all() (#27411)
Problem:  Restore lastused_tabpage too early in do_arg_all() function it
          will change later in the function.
Solution: Restore lastused_tabpage a bit later, when being done with
          tabpages (glepnir)

closes: vim/vim#13992

2975a54f28
2024-02-10 12:21:31 +08:00
ba23d109ba test: add test for scroll wheel at right-click menu (#27409) 2024-02-10 11:54:26 +08:00
dcb11c1091 build(clint): don't allow INIT() in non-header files (#27407) 2024-02-10 11:11:30 +08:00
8e739af064 fix(startup): multiprocess startuptime #26790
Problem:
Since 2448816956, the --startuptime report shows
two blocks of data. The TUI process and its embedded nvim process write to the
file concurrently, which may interleave the two startup sequences into the same
timeline.

Solution:
Report each process as a separate section in the same file.
1. Each process buffers the full report.
2. After startup is finished, the buffer is flushed (appended) to the file.

Fix #23036
Sample report:

    --- Startup times for process: Primary/TUI ---

    times in msec
     clock   self+sourced   self:  sourced script
     clock   elapsed:              other lines

    000.006  000.006: --- NVIM STARTING ---
    000.428  000.422: event init
    000.728  000.301: early init
    ...
    005.880  000.713: init highlight
    005.882  000.002: --- NVIM STARTED ---

    --- Startup times for process: Embedded ---

    times in msec
     clock   self+sourced   self:  sourced script
     clock   elapsed:              other lines

    000.006  000.006: --- NVIM STARTING ---
    000.409  000.403: event init
    000.557  000.148: early init
    000.633  000.077: locale set
    ...
    014.383  000.430: first screen update
    014.387  000.003: --- NVIM STARTED ---
2024-02-09 14:56:52 -08:00
3f419d84fb vim-patch:9.1.0088: TextChanged not triggered for :norm! commands (#27405)
Problem:  TextChanged not triggered for :norm! commands
          (machakann, after v9.0.2031)
Solution: Only reset curbuf->b_last_changedtick if TextChangedI
          was triggered in insert mode (and not blocked)

Note: for unknown reasons, the test fails on Windows (but seems to work
fine when running interactively)

fixes: vim/vim#13967
closes: vim/vim#13984

c9e79e5284

Cherry-pick test_autocmd.vim change from patch 8.2.4149.

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-02-10 06:53:26 +08:00
0d4d3e4325 vim-patch:9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak' (#27404)
Problem:  Visual hl wrong when it ends before multibyte 'showbreak'.
          (lacygoil)
Solution: Use vcol_sbr instead of adding n_extra.
          (zeertzjq)

fixes: vim/vim#11272
closes: vim/vim#13996

df23d7f4bd

Bug doesn't apply to Nvim.
2024-02-10 06:53:10 +08:00
2d0e29614b refactor(api): use arena for nvim_get_option_info() 2024-02-09 19:30:35 +01:00
2d8d35f838 refactor(api): use arena for nvim_parse_cmd() 2024-02-09 18:24:40 +01:00
4cd43933d3 refactor(api): use arena for hlstate inspection 2024-02-09 18:24:31 +01:00
e9510211f0 refactor(api): use arena for nvim_list_uis() 2024-02-09 18:24:21 +01:00
44ec4b5b18 refactor: rename FloatConfig to WinConfig #27397
`FloatConfig` is no longer used only for floats, so the name is counterintuitive.

Followup to #25550
2024-02-09 08:17:10 -08:00
e0e5b7f0ba refactor(api): make cstr_as_string accept "const char*"
In the context a String inside an Object/Dictionary etc is consumed,
it is considered to be read-only.
2024-02-09 15:11:21 +01:00
4788abf2da build: stop installing parser.h from treesitter 2024-02-09 12:08:25 +01:00
0fe86f7e24 feat(lsp): add opts paramater to vim.lsp.codelens.refresh 2024-02-08 20:24:40 -08:00
32b49448b2 feat(tutor): add Japanese tutor #27268
Add Japanese Tutor
2024-02-08 14:43:18 -08:00
f0e61e6d92 fix(lsp): rename fails on missing parent directory #27291
Problem:
If a rename results in a path that has missing parent directory(s), it
will fail.

Solution:
Do a recursive mkdir before attempting the rename.
2024-02-08 13:06:54 -08:00
52b6a9a93b Merge pull request #27391 from bfredl/arenarock
refactor(api): refactor more api functions to use arena return
2024-02-08 18:54:00 +01:00
451bc50d40 feat(lsp): deprecate severity_limit
Problem:
  `vim.lsp.diagnostic.on_diagnostic` accepts an undocumented severity_limit
  option which is widely used.

Solution:
  Deprecate it in favour of `{min = severity}` used in `vim.diagnostic`.
  Since this is undocumented, the schedule for removal is accelerated to
  0.11.
2024-02-08 16:58:49 +00:00
5c36701228 docs(install): add more Linux install instructions #27350 2024-02-08 06:55:53 -08:00
2f6d5588f3 Revert "fixup! add benchmark"
This reverts commit b0bff57a3b.
2024-02-08 14:55:09 +00:00
b0bff57a3b fixup! add benchmark 2024-02-08 14:54:36 +00:00
af5beac1bd refactor(api): refactor more api functions to use arena return
Currently having two separate memory strategies for API return values is
a bit unnecessary, and mostly a consequence of converting the hot spot
cases which needed it first. But there is really no downside to using
arena everywhere (which implies also directly using strings which are
allocated earlier or even statically, without copy).

There only restriction is we need to know the size of arrays in advance,
but this info can often be passed on from some earlier stage if it is
missing.

This collects some "small" cases. The more complex stuff will get a PR
each.
2024-02-08 14:40:34 +01:00
d0e9e36a78 refactor(treesitter): {start,stop} are optional in Query:iter_* methods
Document that the `start` and `stop` parameters in
`Query:iter_captures()` and `Query:iter_matches()` are optional.

The tree-sitter lib has been bumped up to 0.20.9, so we also no longer
need "Requires treesitter >= 0.20.9".
2024-02-08 12:42:19 +00:00
800134ea5e refactor(treesitter): typing for Query, TSQuery, and TSQueryInfo
- `TSQuery`: userdata object for parsed query.

- `vim.treesitter.Query`: renamed from `Query`.
  - Add a new field `lang`.

- `TSQueryInfo`:
  - Move to `vim/treesitter/_meta.lua`, because C code owns it.
  - Correct typing for `patterns`, should be a map from `integer`
    (pattern_id) to `(integer|string)[][]` (list of predicates or
    directives).

- `vim.treesitter.QueryInfo` is added.
  - This currently has the same structure as `TSQueryInfo` (exported
    from C code).
  - Document the fields (see `TSQuery:inspect`).

- Add typing for `vim._ts_parse_query()`.
2024-02-08 12:40:16 +00:00
8b21fe83da Merge pull request #27388 from zeertzjq/vim-9.1.0082
vim-patch:9.1.{0082,0083}: redrawing can be improved
2024-02-08 19:37:41 +08:00
da3facb7ee vim-patch:9.1.0083: Redrawing can be improved when deleting lines with 'number'
Problem:  Redrawing can be improved when inserting/deleting lines with 'number'.
Solution: Only redraw the number column of lines below changed lines.
          Add a test as this wasn't previously tested.
          (zeertzjq)

closes: vim/vim#13985

ae07ebc04b
2024-02-08 19:20:07 +08:00
1c2b9e8dd8 vim-patch:9.1.0082: Redrawing can be improved when deleting lines with 'cursorline'
Problem:  Redrawing can be improved when deleting lines with 'cursorline'.
Solution: Use smarter invalidation and adjustment.  Remove unnecessary
          UPD_VALID as it is already set at the top of the loop.  Make
          the test for vim/vim#4862 fail without the fix.
          (zeertzjq)

closes: vim/vim#13986

7ce34c9a94
2024-02-08 19:20:07 +08:00
1f9da3d083 refactor(lsp): tidy up logging 2024-02-08 11:11:46 +00:00
2a7c4aca42 vim-patch:b8170143c8f8 (#27387)
runtime(doc): further improve docs about List/Blob += operator

closes: vim/vim#13990

b8170143c8
2024-02-08 19:07:31 +08:00
b162adbb7c feat(api): pass 0 to nvim_get_chan_info for current channel (#27321)
Getting current channel info was kind of annoying via RPC. Two
functions had to be called:
1. `nvim_get_api_info` which returns `[channel_id, meta_data]`.
  - This results in `channel_id = api.nvim_get_api_info()[0]`.
  - Here the meta_data is sent but never used.
2. Finally call `nvim_get_chan_info(channel_id)`.

This commit reduces the need for `nvim_get_api_info` as passing 0
returns current channel info.
2024-02-08 18:59:31 +08:00
3f2d543ee8 Merge pull request #27284 from bfredl/unkeydict
refactor(api): use keydict and arena for more api return values
2024-02-08 11:43:27 +01:00
ca2635adf9 refactor(generators): style of generating and generated lua dispatch code 2024-02-08 11:14:01 +01:00
f9d81c43d2 refactor(api): use keydict and arena for more api return values
Implement api_keydict_to_dict as the complement to api_dict_to_keydict

Fix a conversion error when nvim_get_win_config gets called from lua,
where Float values "x" and "y" didn't get converted to lua numbers.
2024-02-08 11:14:01 +01:00
02cc84b4d9 build(deps): bump libuv to v1.48.0 2024-02-08 10:19:50 +01:00
24d26b4cd1 Merge pull request #27379 from zeertzjq/vim-9.1.0080
vim-patch:partial:9.1.0080,c9c2e2d2ff44
2024-02-08 08:50:42 +08:00
ceed5739e0 vim-patch:c9c2e2d2ff44
runtime(doc): Clarify list-concatenation a bit more

Make doc list-concatenation more clear as for += and extend().

1. describe `+=` for list-concatenation more accurately
2. add `extend()` example for list-concatenation
3. Fix CI errors for missing helptags reference |+=|

closes: vim/vim#13983

c9c2e2d2ff

Co-authored-by: qeatzy <qeatzy@users.noreply.github.com>
2024-02-08 08:09:01 +08:00
d75022d205 vim-patch:partial:9.1.0080: unexpected error for modifying final list using +=
Problem:  unexpected error for modifying final list using += operator
          (Ernie Rael)
Solution: Allow List value modification of a final variable using +=
          operator
          (Yegappan Lakshmanan)

fixes: vim/vim#13745
fixes: vim/vim#13959
closes: vim/vim#13962

1af35631f8

Only port eval.txt changes.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-02-08 08:08:18 +08:00
70a0049296 fix(runtime): source c ftplugins in correct order (#27377) 2024-02-08 07:42:16 +08:00
5785c32f11 fix(lsp): set fallback client name properly 2024-02-08 07:34:38 +08:00
59cf827f99 refactor(lsp): move client code to a regular Lua class
Problem:
  The LSP client code is implemented as a complicated closure-class
  (class defined in a single function).

Solution:
  Move LSP client code to a more conventional Lua class and move to a
  separate file.
2024-02-07 19:48:37 +00:00
cca8a78ea2 perf: improve utf_char2cells() performance (#27353)
`utf_char2cells()` calls `utf_printable()` twice (sometimes indirectly,
through `vim_isprintc()`) for characters >= 128. The function can be
refactored to call to it only once.

`utf_printable()` uses binary search on ranges of unprintable characters
to determine if a given character is printable. Since there are only 9
ranges, and the first range contains only one character, binary search
can be replaced with SSE2 SIMD comparisons that check 8 ranges at a
time, and the first range is checked separately. SSE2 is enabled by
default in GCC, Clang and MSVC for x86-64.

Add 3-byte utf-8 to screenpos_spec benchmarks.
2024-02-07 15:03:45 +08:00
6725565258 fix(event-loop): process input before events (#27358)
Problem:
When nvim_input is followed immediately by non-fast events on RPC, both
events and input are available after the polling done by the os_inchar()
in state_enter(), but state_enter() then chooses to process events even
if input is available, which is inconsistent with state_handle_k_event()
that stops processing events once input is available.

Solution:
Also check for available input after the os_inchar() in state_enter().
2024-02-07 12:11:22 +08:00
c0b99bb1de feat(treesitter): show root nodes in :InspectTree (#26944)
Co-authored-by: altermo <>
Co-authored-by: Jongwook Choi <wookayin@gmail.com>
2024-02-06 14:51:53 -06:00
c4417ae70c fix(doc): prevent doxygen confusion 2024-02-06 15:29:01 +00:00
0db6946b39 fix(column): handle w_redr_statuscol at end filler lines (#27365)
There doesn't seem to be an easy solution that doesn't involve a goto.
Also remove duplicate assignment in win_line().
2024-02-06 23:01:44 +08:00
7f4627fe48 ci(release): bump mac runner version to macos-12 2024-02-06 14:57:19 +01:00
3be2536ca0 fix(lsp): send back diagnostic tags to the server
Fixes: #27318
2024-02-06 12:35:31 +00:00
7fa84f32e7 vim-patch:9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines (#27363)
Problem:  LineNrAbove and LineNrBelow background wrong on wrapped lines.
Solution: Update number column also for wrapped part of a line.
          (zeertzjq)

closes: vim/vim#13974

ebfd856cfd

Cherry-pick test_number.vim changes from patch 9.0.0626.
2024-02-06 20:18:23 +08:00
63b810c9d8 docs: small fixes (#27213)
Co-authored-by: Matthieu Coudron <886074+teto@users.noreply.github.com>
2024-02-06 19:30:02 +08:00
9a761019da vim-patch:f7f33e3719c8
runtime(dosbatch): improve '::' comment highlighting

Added a syntax region for command blocks so that the highlighting of
`::` comments in them can be controlled.  The `dosbatch_colons_comment`
variable now controls if all `::` comments in a code block are
highlighted as comments or errors.  A `::` comment at the end of a
command block is always highlighted as an error.

This re-enables the highlighting of `::` comments in `.bat` files as
requested in vim/vim#13666, while allowing control of highlighting them in
command blocks requested in vim/vim#11778 and first attempted in vim/vim#11980.

related: vim/vim#11980
fixes: vim/vim#13666

f7f33e3719

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Mike Williams <mikew@globalgraphics.com>
2024-02-06 11:42:15 +01:00
a945a31e76 vim-patch:9.1.0077: Unnecessary call to redraw_for_cursorline() in nv_mousescroll() (#27359)
Problem:  The call to redraw_for_cursorline() in nv_mousescroll() is
          unnecessary because redraw_for_cursorline() only sets redraw
          type to UPD_VALID, and all code paths in do_mousescroll()
          already set redraw type to at least UPD_VALID.
Solution: Remove call to redraw_for_cursorline() in nv_mousescroll().
          (zeertzjq)

closes: vim/vim#13979

3f1b5312e0
2024-02-06 18:05:06 +08:00
d6fac187f1 test(tui_spec): prevent race between nvim_input and nvim_paste (#27356) 2024-02-06 14:05:49 +08:00
f6042d5c30 test: add test for 'foldcolumn' with cmdwin (#27355) 2024-02-06 11:44:53 +08:00
a090d43d61 fix: splitting of big UI messages
Determine the needed buffer space first, instead of trying to revert the
effect of prepare_call if message does not fit. The previous code did
not revert the full state, which caused corrupted messages to be sent.
So, rather than trying to fix all of that, with fragile and hard to read
code as a result, the code is now much more simple, although slightly
slower.
2024-02-06 03:16:30 +02:00
b3bda2f043 fix(tui): space_buf overflow when clearing screen (#27352)
Problem: `tui->space_buf` may be smaller than the width of the TUI or widest
grid, causing an overflow when calling `tui_grid_clear` if `print_spaces` is
called from `clear_region` (clears the TUI's screen since #23428).

Solution: resize `space_buf` to be wide enough to fit the TUI or widest grid.

Didn't bother shrinking the allocation if the max widths decrease.
2024-02-06 01:13:35 +00:00
d6483793e1 fix: buffer overrun in lmpack_session_receive
The offset was not taken into account when calculating the remaining buffer size.
2024-02-06 01:07:54 +02:00
abfcdd9bf4 Merge pull request #27295 from wookayin/feat/inspecttree
feat(treesitter): use 0-based indexing to show ranges in `:InspectTree`
2024-02-05 15:59:25 -06:00
f4a3c32631 test(treesitter): add test cases for inspect_tree
Co-authored-by: altermo <107814000+altermo@users.noreply.github.com>
2024-02-05 16:23:22 -05:00
a478bf936b feat(treesitter): use 0-based indexing to show ranges in :InspectTree
Problem:

- `:InspectTree` was showing node ranges in 1-based indexing, i.e., in
  vim cursor position (lnum, col). However, treesitter API adopts
  0-based indexing to represent ranges (Range4). This can often be
  confusing for developers and plugin authors when debugging code
  written with treesiter APIs.

Solution:

- Change to 0-based indexing from 1-based indexing to show node ranges
  in `:InspectTree`.

- Note: To make things not complicated, we do not provide an option or
  keymap to configure which indexing mode to use.
2024-02-05 16:23:22 -05:00
0e9a33572d fix(lsp): handle adjacent snippet tabstops 2024-02-05 15:03:46 +00:00
cbb7632aa0 test: add more hlstate tests 2024-02-05 16:24:21 +02:00
43661a0abf Merge pull request #27328 from wookayin/fix/lsp-tagfunc 2024-02-05 10:35:25 +00:00
d184933cdc fix(redraw): update Visual selection properly with splits (#27343) 2024-02-05 15:34:17 +08:00
35ffe58ea4 fix(inccommand): update topline after moving cursor (#27341) 2024-02-05 12:13:21 +08:00
18e62c1bdb perf(redraw): only redraw Visual area when cursor has moved (#27340) 2024-02-05 11:08:52 +08:00
1ed6b9cd2c build(deps): bump luajit to HEAD - 0d313b243 2024-02-04 20:58:14 +01:00
6c8387067d fix(treesitter): inspect-tree remember opts on buf change 2024-02-04 15:53:29 +00:00
1d5f86f694 vim-patch:9.1.0076: luau config file not detected
Problem:  luau config file not detected
          (lopy)
Solution: Detect it as jsonc
          (lopy)

fixes: vim/vim#13960
closes: vim/vim#13970

de7f5bde6c

Co-authored-by: lopy <70210066+lopi-py@users.noreply.github.com>
2024-02-04 11:14:40 +01:00
21df0cdb88 vim-patch:9.1.0075: insert completion not correct when adding new leader (#27332)
Problem:  insert completion not correct when adding new leader
Solution: Reset compl_curr_match to compl_shown_match
          (glepnir)

closes: vim/vim#13957

cbb46b4398
2024-02-04 11:12:31 +08:00
cd3399f6bd vim-patch:7c5aeaffa2be (#27327)
runtime(vim): Update syntax file (vim/vim#13969)

Improve string interpolation highlighting.

Use the vimSep group to highlight interpolation braces as vimOperParen
has no highlighting of its own and employs vimSep via matchgroup.

Add vimNumber to the interpolation group's contained list.

7c5aeaffa2

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-02-04 07:09:54 +08:00
c8055c4a8d Merge pull request #27326 from zeertzjq/vim-9.1.0073
vim-patch:9.1.{0073,0074}
2024-02-04 07:05:03 +08:00
b92b9be85d test(lsp): add test cases for vim.lsp.tagfunc
Problem: There is no test case for vim.lsp.tagfunc; so CI was unable to
catch the infinite loop bug (#27325).

Solution: Add test cases for vim.lsp.tagfunc().
2024-02-03 18:01:12 -05:00
f487e5af01 fix(lsp): fix infinite loop on vim.lsp.tagfunc
Problem: vim.lsp.tagfunc() causes an infinite loop.

This is a bug happened while introducing deferred loading.

Solution: Rename the private module to `vim.lsp._tagfunc`.
2024-02-03 17:47:56 -05:00
80d7e7e5bf vim-patch:9.1.0074: did_set_breakat() should be in optionstr.c
Problem:  did_set_breakat() should be in optionstr.c as 'breakat' is a
          string option.
Solution: Move did_set_breakat() to optionstr.c.
          (zeertzjq)

closes: vim/vim#13958

eac3fdcfa0
2024-02-04 06:46:15 +08:00
60701f4fff vim-patch:9.1.0073: Looping over modifier_keys_table unnecessarily
Problem:  Looping over modifier_keys_table[] unnecessarily with only
          MOD_MASK_ALT or MOD_MASK_CMD, as modifier_keys_table[] only
          contains MOD_MASK_SHIFT and MOD_MASK_CTRL, and the loop won't
          do anything.
Solution: Remove MOD_MASK_ALT and MOD_MASK_CMD from the condition.
          (zeertzjq)

closes: vim/vim#13963

0c989e4a3a
2024-02-04 06:46:09 +08:00
c559ab0ae6 feat: update unicode tables (#27317) 2024-02-04 06:28:51 +08:00
2e982f1aad refactor: create function for deferred loading
The benefit of this is that users only pay for what they use. If e.g.
only `vim.lsp.buf_get_clients()` is called then they don't need to load
all modules under `vim.lsp` which could lead to significant startuptime
saving.

Also `vim.lsp.module` is a bit nicer to user compared to
`require("vim.lsp.module")`.

This isn't used for some nested modules such as `filetype` as it breaks
tests with error messages such as "attempt to index field 'detect'".
It's not entirely certain the reason for this, but it is likely it is
due to filetype being precompiled which would imply deferred loading
isn't needed for performance reasons.
2024-02-03 16:53:41 +01:00
51702e0aea refactor(strcase_save): optimize memory allocation (#27319)
Problem: Double xmalloc usage led to excess memory allocations.
Solution: Switch to xrealloc to adjust memory as needed, minimizing allocations.
2024-02-03 15:29:05 +08:00
6709f7f8f1 fix(keycodes): simplify S- properly when D- is present (#27316) 2024-02-03 11:05:38 +08:00
9ab9cde2ca vim-patch:partial:9.0.1196: code is indented more than necessary (#27315)
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes vim/vim#11813)

e857598896

Skip list_alloc_with_items().

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-02-03 10:22:11 +08:00
1f40b4e222 vim-patch:9.0.1105: code is indented too much (#27314)
Problem:    Code is indented too much.
Solution:   Use an early return. (Yegappan Lakshmanan, closes vim/vim#11756)

87c1cbbe98

Omit free_eval_tofree_later(): Vim9 script only.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-02-03 09:42:04 +08:00
be1d09c427 fix(drawline): missing NUL termination when drawing TAB (#27307) 2024-02-02 22:31:57 +08:00
fffc0e942d test(old): correct path to .valgrind.supp (#27306) 2024-02-02 22:24:37 +08:00
9b7cf4f0be fix(vim.system): don't process non-fast events during wait() (#27300)
Problem:
Processing non-fast events during SystemObj:wait() may cause two pieces
of code to interfere with each other, and is different from jobwait().

Solution:
Don't process non-fast events during SystemObj:wait().
2024-02-02 21:52:01 +08:00
e98decf9a6 feat(quickfix): support -q - to read 'errorfile' from stdin (#27303)
Note that this only works when stdin is a pipe.
2024-02-02 21:17:37 +08:00
1bf645918e vim-patch:9204f39580bd
runtime(fortran): update syntax (vim/vim#13953)

* runtime (Fortran) update syntax
* runtime (Fortran) small fix

9204f39580

Co-authored-by: Ajit-Thakkar <142174202+Ajit-Thakkar@users.noreply.github.com>
2024-02-02 08:59:49 +01:00
4a1ad676ce feat(ex_cmds): no error on :lua with {range} and {code} (#27290)
Problem:  Erroring when both {range} and {code} are supplied to
          :lua is inconvenient and may break mappings.
Solution: Don't error, ignore {range} and execute {code} when both
          are supplied.
2024-02-02 13:14:10 +08:00
1405e5c8c1 refactor(runtime): remove nvimMap and nvimUnmap syntax groups (#27298)
They are no longer needed as they are covered by vimMap and vimUnmap.
Also fix some other mistakes and missing changes.
2024-02-02 10:45:15 +08:00
302fa5f7db Merge pull request #27297 from zeertzjq/vim-e3e3934bb182
vim-patch:69866449ddb2,e3e3934bb182
2024-02-02 07:09:56 +08:00
11acbd6df4 vim-patch:e3e3934bb182
runtime(vim): Update syntax file (vim/vim#13948)

Improve string escape sequence and special key matching.

e3e3934bb1

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-02-02 06:46:11 +08:00
882d5fa558 vim-patch:69866449ddb2
runtime(vim): Improve keymap file highlighting (vim/vim#13550)

- Match :loadkeymap to EOF as a region and contain only allowed items.
- Add highlighting for <Char- notation.
- add basic syntax highlighting tests

69866449dd

N/A patches:
vim-patch:35928ee8f80ea721e92bb856c8ecde2cced46bb9
vim-patch:b5352931b354eb67eb7d223cc09c98dcf1b547b6

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-02-02 06:45:06 +08:00
05fd70f19b Merge pull request #27122 from luukvbaal/signcol
fix(column): clear "b_signcols" before moving saved marks
2024-02-01 18:52:12 +01:00
4c91194611 build: various fixes
- Consistently use the variable CMAKE_BUILD_TYPE to select build type.
- Remove broken `doc_html` target.
- Remove swap files created by oldtest when cleaning.
- Only rerun `lintdoc` if any documentation files has changed.
2024-02-01 12:06:55 +01:00
cc197d04fc refactor(api): remove some unnecessary HAS_KEY() (#27283)
Since keydicts are already zero-initialized, HAS_KEY() isn't needed if
the zero-initialized value can satisfy some other condition.
2024-02-01 18:05:06 +08:00
0da18ae5ce vim-patch:c46c21b4ca47
runtime(netrw): fixing remote file removal via ssh (vim/vim#13942)

Make pattern, which retrieves the path component from e.g.
`scp://user@host//opt/program/file.ext` non-greedy.

c46c21b4ca

Co-authored-by: MiguelBarro <45819833+MiguelBarro@users.noreply.github.com>
2024-02-01 10:04:32 +01:00
e0961aaa5a vim-patch:83f627ff42a3
runtime(racket): add missing space to b:undo_indent var (vim/vim#13945)

This copies commit 2a4862a (fixup! indent: only reset some options when
has vim9, 2024-01-31) from https://github.com/benknoble/vim-racket and
fixes 26b0176a9 (runtime(racket): undo some indent options only when
vim9script is available (vim/vim#13935), 2024-01-30).

83f627ff42

Co-authored-by: D. Ben Knoble <ben.knoble+github@gmail.com>
2024-02-01 10:04:32 +01:00
20f97af417 build(deps): bump luajit to HEAD - 9cc2e42b1 2024-02-01 09:31:36 +01:00
6bba4beced feat(api): make nvim_open_win support non-floating windows (#25550)
Adds support to `nvim_open_win` and `nvim_win_set_config` for creating
and manipulating split (non-floating) windows.
2024-02-01 11:43:35 +08:00
8fa67fdae5 vim-patch:8.2.0085: dead code in builtin functions (#27281)
Problem:    Dead code in builtin functions.
Solution:   Clean up the code.

3d8a513b46

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-02-01 09:39:48 +08:00
68c1b1c45a vim-patch:8.2.0117: crash when using gettabwinvar() with invalid arguments (#27280)
Problem:    Crash when using gettabwinvar() with invalid arguments. (Yilin
            Yang)
Solution:   Use "curtab" if "tp" is NULL. (closes vim/vim#5475)

ee93b737aa

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-02-01 09:26:19 +08:00
0a8e66898d build: update builtin terminfo (#27272)
- Update to ncurses 6.4.20230520
- Disable smglp and smgrp for vtpcon and conemu
- Add xterm+sl to vtpcon, fix #26880
2024-01-31 21:45:30 +08:00
f4b3636f24 vim-patch:bdb9d9afba97
runtime(netrw): Use :exec norm! <leftmouse> before :call mapping in netrw (vim/vim#12180)

fixes: vim/vim#12143

bdb9d9afba

Co-authored-by: user202729 <25191436+user202729@users.noreply.github.com>
2024-01-31 09:55:08 +01:00
6e8e3a2a3a vim-patch:26b0176a98f8
runtime(racket): undo some indent options only when vim9script is available (vim/vim#13935)

This copies commit 64edf95 (indent: only reset some options when has
vim9, 2024-01-30) from https://github.com/benknoble/vim-racket.

26b0176a98

Co-authored-by: D. Ben Knoble <ben.knoble+github@gmail.com>
2024-01-31 09:55:08 +01:00
9f15a18fa5 fix(statusline): missing offset when showing 'keymap' (#27270) 2024-01-31 08:48:52 +08:00
4ffc20c951 fix(lua): avoid internal error when :luado deletes lines (#27262) 2024-01-30 08:09:25 +08:00
a2070ba877 vim-patch:9.1.0065: Segfault with CompleteChanged autocommand (#27261)
Problem:  Segfault with CompleteChanged autocommand
          (markonm )
Solution: Test match->cp_prev for being NULL before accessing it

closes: vim/vim#13929

fef6630166

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-30 07:34:37 +08:00
be5cf33836 fix(gen_help_html): type warnings, spell_ignore_files #27254
- Add type annotations, fix most of the type warnings.
- Fix a minor bug on `spell_ignore_files`: nil error when an invalid
  spelling is found but the file is not ignored.
2024-01-29 11:02:10 -08:00
a060c13f55 Merge #27246 from justinmk/health 2024-01-29 09:43:49 -08:00
758504ec73 docs: document special labels used in CI 2024-01-29 13:46:04 +01:00
4f788f78f8 vim-patch:9.1.0061: UX of visual highlighting can be improved (#27256)
Problem:  UX of visual highlighting can be improved
Solution: Improve readibility of visual highlighting,
          by setting better foreground and background
          colors

The default visual highlighting currently is nice in that it overlays
the actual syntax highlighting by using a separate distinct background
color.

However, this can cause hard to read text, because the contrast
between the actual syntax element and the background color is way too
low. That is an issue, that has been bothering colorschemes authors for
quite some time so much, that they are defining the Visual highlighting
group to use a separate foreground and background color, so that the
syntax highlighting vanishes, but the text remains readable (ref:
vim/colorschemesvim/vim#250)

So this is an attempt to perform the same fix for the default Visual
highlighting and just use a default foreground and background color
instead of using reverse.

I also removed the hard-coded changes to the Visual highlighting in
init_highlight. It's not quite clear to me, why those were there and not
added directly to the highlighting_init_<dark|light> struct.

closes: vim/vim#13663
related: vim/colorschemes#250

e6d8b4662d

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-29 18:39:57 +08:00
ca9f6f5694 feat(api): add nvim_tabpage_set_win (#27222)
Allows setting the current window of a non-current tabpage
without switching tabpages.
2024-01-29 15:18:33 +08:00
5e5b004da4 vim-patch:cf8695d48cdd
runtime(vim): Highlight string interpolation

closes: vim/vim#13923

cf8695d48c

Co-authored-by: thinca <thinca@gmail.com>
2024-01-29 11:25:35 +08:00
7db83d47b2 vim-patch:21ce159e0561
runtime(vim): Update syntax and ftplugin files (vim/vim#13924)

Improve matching of line-continuations and interspersed comments.

These are now also matched in multiline syntax command patterns,
dictionary literals, and parenthesised expressions and argument lists.

21ce159e05

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-01-29 11:25:35 +08:00
d62b3fa623 vim-patch:c79646dfb101
runtime(vim): Update syntax file (vim/vim#13671)

Support multiline :syntax commands.

Match :syn-cchar option in :syn-{keyword,region}.

c79646dfb1

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-01-29 11:25:35 +08:00
f1e51528d2 vim-patch:71b6d3397649
Update runtime files

71b6d33976

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-01-29 11:25:35 +08:00
15e77a56b7 feat(extmarks): subpriorities (relative to declaration order) (#27131)
The "priority" field of extmarks can be used to set priorities of
extmarks which dictates which highlight group a range will actually have
when there are multiple extmarks applied. However, when multiple
extmarks have the same priority, the only way to enforce an actual
priority is through the order in which the extmarks are set.

It is not always possible or desirable to set extmarks in a specific
order, however, so we add a new "subpriority" field that explicitly
enforces the ordering of extmarks that have the same priority.

For now this will be used only to enforce priority of treesitter
highlights. A single node in a treesitter tree may match multiple
captures, in which case that node will have multiple extmarks set. The
order in which captures are returned from the treesitter API is not
_necessarily_ in the same order they are defined in a query file, so we
use the new subpriority field to force that ordering.

For now subpriorites are not documented and are not meant to be used by
external code, and it only applies to ephemeral extmarks. We indicate
the "private" nature of subpriorities by prefixing the field name with
an "_".
2024-01-28 21:13:58 -06:00
af6537bc66 fix(jumplist): Ctrl+o, Ctrl+i weird behavior when deleting buffers #25461
Problem:
- Navigation is not always symmetric: pressing Ctrl+o n times followed
  by Ctrl+i n times does not always gets me back to where I started.
- Invalid buffers are not skipped by Ctrl+i/o, I have to press Ctrl+i/o
  multiple times to get to the next/previous buffer.

Solution:
- Remove all entries of a buffer from the jump list when deleting it.
- Don't add a new entry to the jump list if the next buffer to be
  displayed is already in the jump list.

Closes #25365
2024-01-28 19:08:51 -08:00
eee52d3427 refactor(lsp): client_hints typo #27250 2024-01-28 18:38:36 -08:00
d6f7fa14c5 refactor(window.c): add a few more assertions (#27249) 2024-01-29 10:05:33 +08:00
5b1b765610 docs: enforce "treesitter" spelling #27110
It's the "tree-sitter" project, but "treesitter" in our code and docs.
2024-01-28 17:53:14 -08:00
b0e85010fe test: more tests for nvim_tabpage_get_win (#27248) 2024-01-29 08:32:24 +08:00
ba7a52dedc vim-patch:9.1.0060: Recorded register cannot be translated using keytrans() (#27247)
Problem:  Recorded register cannot be translated using keytrans() when
          it involves character search (iddqd505)
Solution: Record a K_IGNORE instead of a K_NOP (zeertzjq)

related: vim/vim#13916
closes: vim/vim#13925

bf321806bf
2024-01-29 07:27:15 +08:00
56ae85a33c docs: .git-blame-ignore-revs #26397 2024-01-28 15:03:10 -08:00
e39b6d0c52 fix(health): "attempt to concatenate nil"
Problem:
If `neovim` module is not installed, python and ruby healthchecks fail:

    - ERROR Failed to run healthcheck for "provider.python" plugin. Exception:
      .../runtime/lua/provider/python/health.lua:348: attempt to concatenate local 'pyname' (a nil value)
    - ERROR Failed to run healthcheck for "provider.ruby" plugin. Exception:
      .../runtime/lua/provider/ruby/health.lua:25: attempt to index local 'host' (a nil value)

Solution:
Check for non-nil.
2024-01-28 23:56:06 +01:00
50cd5ed360 fix(health): check more "old" files 2024-01-28 23:56:03 +01:00
4ddd999f65 docs: update FAQ URLs #27236 2024-01-28 14:53:05 -08:00
095f731af0 docs: include backtrace for bug-crash #27065
Github Issue template:

- Add pointers to |dev-tools-backtrace|.
- Add pointers to CONTRIBUTING.md (Reporting Problems), which includes
  additional helpful instructions for issue reporting.
- Search existing issues: include label `bug-crash` as well as `bug`.

CONTRIBUTING.md:

- Fix broken link on "stacktrace" after moving to help from wiki.
2024-01-28 14:26:13 -08:00
01e82eba20 build(docs): separate lint job to validate vimdoc #27227
Summary: Separate the lint job (`make lintdoc`) to validate runtime/doc,
it is no longer as a part of functionaltest (help_spec).

Build (cmake) and CI:

- `make lintdoc`: validate vimdoc files and test-generate HTML docs.
  CI will run this as a part of the "docs" workflow.

- `scripts/lintdoc.lua` is added as an entry point (executable script)
  for validating vimdoc files.

scripts/gen_help_html.lua:

- Move the tests for validating docs and generating HTMLs from
  `help_spec.lua` to `gen_help_html`. Added:
  - `gen_help_html.run_validate()`.
  - `gen_help_html.test_gen()`.

- Do not hard-code `help_dir` to `build/runtime/doc`, but resolve from
  `$VIMRUNTIME`. Therefore, the `make lintdoc` job will check doc files
  on `./runtime/doc`, not on `./build/runtime/doc`.

- Add type annotations for gen_help_html.
2024-01-28 14:22:39 -08:00
47cd532bf1 docs: explain why TUI is reinitialized on resume (#27177) 2024-01-28 08:38:59 -06:00
1bc7e18aa8 test(lua/snippet_spec): wait for completion menu (#27243)
This fixes the flakiness caused by typing a completion menu key when the
completion menu hasn't showed up.
2024-01-28 22:01:25 +08:00
6d86a6fe44 test(tui): add & improve tests for terminal queries (#27219)
Problems:

1. The test case for querying truecolor support did not check which
   capabilities were queried
2. The test case for querying truecolor support checked `&termguicolors`
   in the Nvim test runner, not the child Nvim in the the embedded
   terminal
3. The test case for querying truecolor support did not actually respond
   to the XTGETTCAP requests. `'termguicolors'` is still enabled even
   without responding to this query because libvterm understands and
   responds to the DECRQSS request, but it is still good to respond to
   the query explicitly instead of depending on hidden libvterm behavior
4. No test case exists at all for OSC 52

Solution:

Fix all of the problems listed above.
2024-01-28 07:37:57 -06:00
a757195a60 Merge pull request #24704 from seandewar/cmdwin-madness
vim-patch:9.1.{0047,0048,0049}: fun cmdwin fixes
2024-01-28 13:03:56 +00:00
d85f180f26 vim-patch:9.1.0049: Make "[Command Line]" a special buffer name
Problem:  E95 is possible if a buffer called "[Command Line]" already
          exists when opening the cmdwin. This can also happen if the
          cmdwin's buffer could not be deleted when closing.

Solution: Un-name the cmdwin buffer, and give it a special name instead,
          similar to what's done for quickfix buffers and for unnamed
          prompt and scratch buffers. As a result, BufFilePre/Post are
          no longer fired when opening the cmdwin. Add a "command" key
          to the dictionary returned by getbufinfo() to differentiate
          the cmdwin buffer instead. (Sean Dewar)

Cherry-pick test_normal changes from v9.0.0954.

1fb4103206
2024-01-28 12:29:42 +00:00
7bb0dd08db vim-patch:9.1.0048: Abort opening cmdwin if autocmds screw things up
Problem:  Autocmds triggered from opening the cmdwin (in win_split and
          do_ecmd) can cause issues such as E199, as the current checks
          are insufficient.

Solution: Commands executed from the cmdwin apply to the old curwin/buf,
          so they should be kept in a "suspended" state; abort if
          they've changed. Also abort if cmdwin/buf was tampered with,
          and check that curwin is correct. Try to clean up the cmdwin
          buffer (only if hidden and non-current to simplify things; the
          same approach is used when closing cmdwin normally), and add a
          beep. (Sean Dewar)

Rename the old Test_cmdwin_interrupted() like in the patch (can be moved to
test_cmdwin.vim when v9.0.0027 is ported).
Move the error message to `e_active_window_or_buffer_changed_or_deleted`.

43b395ec2e
2024-01-28 12:29:42 +00:00
cf140fb25b vim-patch:9.1.0047: issues with temp curwin/buf while cmdwin is open
Problem:  Things that temporarily change/restore curwin/buf (e.g:
          win_execute, some autocmds) may break assumptions that
          curwin/buf is the cmdwin when "cmdwin_type != 0", causing
          issues.

Solution: Expose the cmdwin's real win/buf and check that instead. Also
          try to ensure these variables are NULL if "cmdwin_type == 0",
          allowing them to be used directly in most cases without
          checking cmdwin_type. (Sean Dewar)

Reset and save `cmdwin_old_curwin` in a similar fashion.
Apply suitable changes for API functions and add Lua tests.

988f74311c
2024-01-28 12:29:26 +00:00
74e695d227 Merge pull request #27221 from BugLight/fix-coverity-found-bugs
Fix bugs found by coverity
2024-01-28 13:33:38 +08:00
9d48266bed fix(coverity/471380): null dereference in get_local_additions()
strrchr returns null pointer if '.' is not present in file name. Notice
that filenames are filtered to match "doc/*.??[tx]" pattern earlier so
we shouldn't expect null pointer here. However later in code strrchr
return value is checked so it seems better and more consistent to do the
same here too.
2024-01-27 23:00:24 +04:00
2cd76a758b docs(lua): update ":{range}lua" docs + error message #27231
- `:lua (no file)` is misleading because `:lua` never takes a file arg,
  unlike `:source`.
- Update various related docs.
2024-01-27 10:40:30 -08:00
17b298b7c8 vim-patch:0cc6108fea21
runtime(ant): Update syntax file (vim/vim#13926)

Remove invalid display option from syn-keyword commands.

Take over maintenance of this file.

0cc6108fea

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-01-27 19:38:05 +01:00
5ca330859c fix(decor): check decor kind before accessing union field (#27205)
The data.sh.url field is valid only when item.kind is
kDecorKindHighlight. The `if` block just before this line already does
that check (as well as checking `active`) so move the access of
`data.sh.url` into that block.
2024-01-27 08:26:01 -06:00
b50fdcba4a fix(column): clear "b_signcols" before moving saved marks
Problem:  Marks moved by undo may be lost to "b_signcols.count".
Solution: Count signs for each undo object separately instead of
          once for the entire undo.
2024-01-27 13:07:11 +01:00
e35ae6fbc2 vim-patch:772f8f542513
runtime(hurl): add hurl filetype plugin(vim/vim#13921)

772f8f5425

Co-authored-by: Melker Ulander <melker.ulander@pm.me>
2024-01-27 12:02:59 +01:00
bf9e92c81c fix(events): check for WinResized/WinScrolled in terminal mode (#27226) 2024-01-27 15:18:41 +08:00
7367838359 fix(api): limit depth of nvim_cmd (#27225) 2024-01-27 14:03:44 +08:00
38bb0e1da8 test(tui_spec): get &background from child session directly (#27224) 2024-01-27 12:42:32 +08:00
c2433589dc feat(ex_cmds): ranged :lua #27167
:{range}lua executes the specified lines in the current buffer as
Lua code, regardless of its extension or 'filetype'.

Close #27103
2024-01-26 17:00:50 -08:00
0892c080d1 revert: "feat(treesitter): add foldtext with treesitter highlighting"
This reverts commit 9ce1623 in favor of #20750.
2024-01-27 08:38:56 +08:00
6f49ed58c3 fix(coverity/348240): memory leak in put_view() 2024-01-26 23:36:48 +04:00
a9df0c5ce6 fix(osc52): do not use 'vim.iter' (#27218)
Problem: Using 'vim.iter' loads it during startup.

Solution: Do not use 'vim.iter'.
2024-01-26 12:06:13 -06:00
28d1640dd6 feat: improve return type annotations for vim.api.* 2024-01-26 15:07:25 +00:00
65b1fd00a7 fix(extmarks): do not remove decor from invalid old marks 2024-01-26 15:06:25 +00:00
eca72def1f fix(colorscheme): typo 2024-01-26 15:26:50 +01:00
7421a4d8b5 ci: update notes.md
Change the link to point to INSTALL.md.

The contents were moved in https://github.com/neovim/neovim/pull/26533
2024-01-26 14:54:57 +01:00
b7e3003106 vim-patch:046a0f75d025
runtime(mail): fix vim/vim#13913 (vim/vim#13917)

switch to the DFA engine for the emoji collaction range

046a0f75d0

Co-authored-by: gi1242 <gi1242+github@gmail.com>
Co-authored-by: GI <gi1242+vim@gmail.com>
2024-01-26 08:51:13 +01:00
226466a469 vim-patch:9.1.0058: Cannot map Super Keys in GTK UI (#27204)
Problem:  Cannot map Super Keys in GTK UI
          (Casey Tucker)
Solution: Enable Super Key mappings in GTK using <D-Key>
          (Casey Tucker)

As a developer who works in both Mac and Linux using the same keyboard,
it can be frustrating having to remember different key combinations or
having to rely on system utilities to remap keys.

This change allows `<D-z>` `<D-x>` `<D-c>` `<D-v>` etc. to be recognized
by the `map` commands, along with the `<D-S-...>` shifted variants.

```vimrc
if has('gui_gtk')
	nnoremap  <D-z>    u
	nnoremap  <D-S-Z>  <C-r>
	vnoremap  <D-x>    "+d
	vnoremap  <D-c>    "+y
	cnoremap  <D-v>    <C-R>+
	inoremap  <D-v>    <C-o>"+gP
	nnoremap  <D-v>    "+P
	vnoremap  <D-v>    "-d"+P
	nnoremap  <D-s>    :w<CR>
	inoremap  <D-s>    <C-o>:w<CR>
	nnoremap  <D-w>    :q<CR>
	nnoremap  <D-q>    :qa<CR>
	nnoremap  <D-t>    :tabe<CR>
	nnoremap  <D-S-T>  :vs#<CR><C-w>T
	nnoremap  <D-a>    ggVG
	vnoremap  <D-a>    <ESC>ggVG
	inoremap  <D-a>    <ESC>ggVG
	nnoremap  <D-f>    /
	nnoremap  <D-g>    n
	nnoremap  <D-S-G>  N
	vnoremap  <D-x>    "+x
endif
```

closes: vim/vim#12698

92e90a1e10

Co-authored-by: Casey Tucker <dctucker@hotmail.com>
2024-01-26 11:04:54 +08:00
6116495e6e Merge pull request #27201 from zeertzjq/vim-9.1.0054
vim-patch:9.1.{0054,0056}
2024-01-26 07:37:04 +08:00
c5a7df79a7 vim-patch:9.1.0056: wrong number of trailing spaces inserted after blockwise put
Problem:  Incorrect number of trailing spaces inserted for multibyte
	  characters when pasting a blockwise register in blockwise visual
          mode (VanaIgr)
Solution: Skip over trailing UTF-8 bytes when computing the number of trailing
          spaces (VanaIgr)

When pasting in blockwise visual mode, and the register type is <CTRL-V>, Vim
aligns the text after the replaced area by inserting spaces after pasted
lines that are shorter than the longest line. When a shorter line contains
multibyte characters, each trailing UTF-8 byte's width is counted in addition
to the width of the character itself. Each trailing byte counts as being 4
cells wide (since it would be displayed as <xx>).

closes: vim/vim#13909

6638ec8afa

Co-authored-by: VanaIgr <vanaigranov@gmail.com>
2024-01-26 07:06:48 +08:00
52d8741c78 vim-patch:9.1.0054: 'linebreak' may still apply to leading whitespace
Problem:  'linebreak' may still apply to leading whitespace
          (VanaIgr)
Solution: Compare pointers instead of virtual columns.
          (zeertzjq)

related: #27180
closes: vim/vim#13915

703f9bc943

Co-authored-by: VanaIgr <vanaigranov@gmail.com>
2024-01-26 07:06:43 +08:00
83b51b36aa fixup: raise TS min version 2024-01-25 23:39:25 +01:00
35a147fa77 build(deps): bump tree-sitter to v0.20.9 2024-01-25 23:39:25 +01:00
89a9745a1a vim-patch:9.1.0055: formatting long lines is slow (#27199)
Problem:  formatting long lines is slow
          (kawaii-Code)
Solution: optimize gq (internal_format) for long
          lines (kawaii-Code)

Implemented two workarounds that significantly reduce
the amount of pointless calls. Ideally the algorithm
would be rewritten not to be n^2, but it's too complicated
with too many corner cases.

closes: vim/vim#13914

78019df645

Co-authored-by: kawaii-Code <nia.personal.0@gmail.com>
2024-01-26 06:26:02 +08:00
1e0996b572 feat(colorscheme): update treesitter groups
Problem: Currently default color scheme defines most of treesitter
  highlight groups. This might be an issue for users defining their own
  color scheme as it breaks the "fallback property" for some of groups.

Solution: Define less default treesitter groups; just enough for default
  color scheme to be useful. That is:
    - All first level groups (`@character`, `@string`, etc.).
    - All `@xxx.builtin` groups as a most common subgroup.
    - Some special cases (links/URLs, `@diff.xxx`, etc.).
2024-01-25 20:09:24 +01:00
d4bd6b1eaa fix(colorscheme): use explicit normal foreground in syntax groups
Problem: Some core syntax highlight groups are cleared with intention to
  always be shown without additional highlighting. This doesn't always
  work as intended, especially with fallback mechanism of @-groups.
  Example: `Statement`/`Keyword` group shown in help code blocks
  (`@markup.raw`) is shown as bold (from `Statement`) cyan (from
  `@markup.raw`) instead of bold grey.

Solution: Explicitly use normal grey foreground in syntax groups where
  it was previously implicitly assumed.
2024-01-25 20:09:24 +01:00
3ab6f60dc8 fix(runtime): update 'vim' color scheme to use new tree-sitter groups 2024-01-25 18:19:15 +01:00
e8aec1ecc5 build(deps): bump tree-sitter-bash to v0.20.4 2024-01-25 17:58:36 +01:00
a9653a02aa build(deps): bump luajit to HEAD - 343ce0eda 2024-01-25 16:59:02 +01:00
4e59422e1d refactor: IWYU (#27186) 2024-01-25 07:57:21 +08:00
76a659eb77 docs: various fixes (#27063)
Co-authored-by: lmenou <menl94629@gmail.com>
Co-authored-by: altermo <107814000+altermo@users.noreply.github.com>
Co-authored-by: VanaIgr <vanaigranov@gmail.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
2024-01-25 07:34:18 +08:00
6ea6b3fee2 feat(ui): add support for OSC 8 hyperlinks (#27109)
Extmarks can contain URLs which can then be drawn in any supporting UI.
In the TUI, for example, URLs are "drawn" by emitting the OSC 8 control
sequence to the TTY. On terminals which support the OSC 8 sequence this
will create clickable hyperlinks.

URLs are treated as inline highlights in the decoration subsystem, so
are included in the `DecorSignHighlight` structure. However, unlike
other inline highlights they use allocated memory which must be freed,
so they set the `ext` flag in `DecorInline` so that their lifetimes are
managed along with other allocated memory like virtual text.

The decoration subsystem then adds the URLs as a new highlight
attribute. The highlight subsystem maintains a set of unique URLs to
avoid duplicating allocations for the same string. To attach a URL to an
existing highlight attribute we call `hl_add_url` which finds the URL in
the set (allocating and adding it if it does not exist) and sets the
`url` highlight attribute to the index of the URL in the set (using an
index helps keep the size of the `HlAttrs` struct small).

This has the potential to lead to an increase in highlight attributes
if a URL is used over a range that contains many different highlight
attributes, because now each existing attribute must be combined with
the URL. In practice, however, URLs typically span a range containing a
single highlight (e.g. link text in Markdown), so this is likely just a
pathological edge case.

When a new highlight attribute is defined with a URL it is copied to all
attached UIs with the `hl_attr_define` UI event. The TUI manages its own
set of URLs (just like the highlight subsystem) to minimize allocations.
The TUI keeps track of which URL is "active" for the cell it is
printing. If no URL is active and a cell containing a URL is printed,
the opening OSC 8 sequence is emitted and that URL becomes the actively
tracked URL. If the cursor is moved while in the middle of a URL span,
we emit the terminating OSC sequence to prevent the hyperlink from
spanning multiple lines.

This does not support nested hyperlinks, but that is a rare (and,
frankly, bizarre) use case. If a valid use case for nested hyperlinks
ever presents itself we can address that issue then.
2024-01-24 16:36:25 -06:00
f7bda77f9e vim-patch:a262d3f41bc5
runtime(netrw): Don't change global options (vim/vim#13910)

Originally reported at: https://github.com/vim-jp/issues/issues/1428
'isk' was unintentionally changed by netrw, regression
introduced in Commit: 71badf9547e8f89571b9a095183671cbb333d528

a262d3f41b

Co-authored-by: K.Takata <kentkt@csc.jp>
2024-01-24 23:23:23 +01:00
964dd93266 vim-patch:e1ddc2d5875d
runtime(fortran): update syntax and documentation (vim/vim#13912)

* runtime (doc): update Fortran section
* runtime(syntax): Complete support for Fortran 2023.
   Minor improvements.

e1ddc2d587

Co-authored-by: Ajit-Thakkar <142174202+Ajit-Thakkar@users.noreply.github.com>
2024-01-24 23:23:23 +01:00
b280d57db9 refactor: rewrite ruby provider in lua 2024-01-24 19:26:53 +01:00
ae3eed53d6 build: various build improvements
- remove "ran-" prefix from touch files as it's redundant since the
  they're already in the directory named `touches`.
- Include `contrib` when formatting with `make formatlua`.
- Use TARGET_FILE generator expression instead of assuming the
  executable location.
- reuse logic that determines whether to use lua or luajit.
- add translations to the `nvim` target.

Makefile improvements:
- rename variable `CMAKE_PRG` to `CMAKE` to make it more consistent with
  the builtin `MAKE` variable.
- stop propagating flags to generator. Users should use cmake for
  non-standard use cases.
- remove `+` prefix from targets. If the user for whatever reason wants
  to dry-run a target then they should be able to.
2024-01-24 12:41:09 +01:00
32849d5667 fix(treesitter): avoid # of nil in _query_linter 2024-01-24 11:03:54 +00:00
576db141be refactor: rewrite perl provider in lua 2024-01-24 11:55:28 +01:00
8c044f0862 fix(spell): always accept ':' as filename char in 'spellfile' (#27172)
Follow-up to #25236
2024-01-24 18:13:39 +08:00
0c1119ac75 vim-patch:ca0e9823a1df
runtime(c): Highlight user defined functions

closes: vim/vim#13763

ca0e9823a1

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2024-01-24 11:05:25 +01:00
9808a781d3 vim-patch:9c5b90db035b
runtime(vim): Update syntax file (vim/vim#13906)

Highlight :2match and :3match and add these to :help ex-cmd-index.

9c5b90db03

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-01-24 11:05:25 +01:00
f4acacdb53 vim-patch:50dbe16cd818
runtime(qml): Use shiftwidth() in indent plugin (vim/vim#13908)

Fixes vim/vim#13907

50dbe16cd8

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-01-24 11:05:25 +01:00
6916533a52 vim-patch:36e2c0f29332
runtime(mail): updated syntax file

36e2c0f293

Co-authored-by: GI <gi1242@gmail.com>
2024-01-24 11:05:25 +01:00
913469ff21 docs(treesitter): add more examples, and improve consistency
Docs for treesitter would benefit from including more real-world and
practical examples of queries and usages, rather than hypothetical ones
(e.g. names such as "foo", "bar"). Improved examples should be more
user-friendly and clear to understand.

In addition, align the capture names in some examples with the actual
ones being used in the built-in query files or in the nvim-treesitter
plugin, e.g.:

- `@parameter` -> `@variable.parameter`
- `@comment.doc.java` -> `@comment.documentation.java`
- etc.
2024-01-24 11:04:16 +01:00
617d1b28d6 fix(treesitter): prefix treesitter types with vim 2024-01-24 10:01:56 +00:00
c8a27bae3f fix(options): use a union for def_val (#27169)
Problem:
APIs get wrong boolean option default values on big-endian platforms.

Solution:
Use a union for def_val.
Cannot use OptVal or OptValData yet as it needs to have the same types
as option variables.
2024-01-24 12:27:38 +08:00
65bfa86efe vim-patch:9.1.0046: :drop does not re-use empty buffer (#27165)
Problem:  :drop does not re-use empty buffer
          (Rocco Mao)
Solution: Make :drop re-use an empty buffer
          (Rocco Mao)

fixes: vim/vim#13851
closes: vim/vim#13881

f96dc8d07f

Co-authored-by: Rocco Mao <dapeng.mao@qq.com>
2024-01-24 07:29:33 +08:00
6cbfe45454 vim-patch:e13b665a6e2a (#27163)
runtime(doc): change "VIsual mode" to "Visual mode" in :h SafeState (vim/vim#13901)

"Visual mode" is used everywhere else in the help when not referring to
something in the source code.

e13b665a6e
2024-01-24 06:07:42 +08:00
fcd9905291 fix(sign): avoid deleting from sign map while looping over it (#27158) 2024-01-24 05:51:18 +08:00
932c7eb019 build(deps): bump luajit to HEAD - f2336c48f 2024-01-23 22:38:18 +01:00
8b23653695 fix(colorscheme): link LSP semantic tokens to treesitter groups 2024-01-23 16:59:57 +01:00
0054c18500 test: typing for screen.lua
Very rough buts resolves most diagnostic errors and should provide
some useful hovers.
2024-01-23 11:45:17 +00:00
89ffdebd20 fix(diagnostic): fix typing on field |diagnostic-severity|
Problem: vim.diagnostic.{underline,float,virtual_text...}.severity
will have a type warning on list-like or table (min-max) inputs,
e.g. `vim.diagnostic.config { float = { severity = { min = INFO } } }`.

Solution: Correct the typing as documented in |diagnostic-severity|.
2024-01-23 11:43:57 +00:00
d9946006c9 Merge pull request #27147 from bfredl/crash2
fix(extmark): another "step out" case
2024-01-23 11:56:16 +01:00
79a558277b fix(extmark): fix crash when stepping out from internal node 2024-01-23 11:39:37 +01:00
26143d7a5c fix(treesitter): update @markup default links
* use `Special` as default for `@markup.*`, especially `@markup.raw` and
  `@markup.math` (`@markup` itself is never used)
* use `Structure` for `@markup.environment`
* highlight all of `@markup.link` as Underlined (otherwise concealed
  links are invisible)
2024-01-23 11:38:52 +01:00
d3fa8adea9 Merge pull request #27145 from bfredl/crash_meta
fix(extmarks): crash with sign after many marks
2024-01-23 09:38:52 +01:00
54225bdb02 fix(extmarks): crash with sign after many marks
fixes #27137
2024-01-23 09:24:36 +01:00
dc466f9a63 vim-patch:9.1.0043: ml_get: invalid lnum when :s replaces visual selection (#27140)
Problem:  ml_get: invalid lnum when :s replaces visual selection
          (@ropery)
Solution: substitute may decrement the number of lines in a buffer,
          so validate, that the bottom lines of the visual selection
          stays within the max buffer line

fixes: vim/vim#13890
closes: vim/vim#13892

7c71db3a58

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-23 06:51:10 +08:00
a7eb1e6004 build(deps): bump luajit to HEAD - 3ca0a8071 2024-01-22 23:47:46 +01:00
46aa1936e4 vim-patch:add31baedaf0
runtime(sh): Add handling for ksh93 shared-state comsubs and mksh valsubs (vim/vim#13884)

This commit adds support for ksh93 shared-state command
substitutions (syntax: ${ command; }) and mksh's value
substitutions (syntax: ${|command;}) in the sh syntax script.

Also add a syntax test for ksh subshares with dumps included
to make sure it doesn't regress.

fixes: vim/vim#9514

add31baeda

Co-authored-by: Johnothan King <johnothanking@protonmail.com>
2024-01-22 23:40:50 +01:00
c7da55a835 vim-patch:3b2c27415d7d
runtime(chuck): include ChucK syntax file (vim/vim#13895)

3b2c27415d

Co-authored-by: Andrea C from The App <3269984+gacallea@users.noreply.github.com>
Co-authored-by: gacallea <gacallea@users.noreply.github.com>
2024-01-22 23:40:50 +01:00
e2553c3d5d vim-patch:ea9a93e5b098
runtime(go): update Go syntax file (vim/vim#13896)

Update the Go syntax file with some recent changes made to vim-go.

ea9a93e5b0

Co-authored-by: Billie Cleek <bhcleek@users.noreply.github.com>
2024-01-22 23:40:50 +01:00
eb5d15e383 refactor: rewrite python provider in lua 2024-01-22 22:36:40 +01:00
13d50c3b13 fix(column): clear "b_signcols" when marktree is cleared 2024-01-22 20:39:24 +00:00
51f783f2fa Merge pull request #27011 from bfredl/metatree
perf(extmarks): add metadata for efficient filtering of special decorations
2024-01-22 21:05:12 +01:00
9af2be292d perf(extmarks): add metadata for efficient filtering of special decorations
This expands on the global "don't pay for what you don't use" rules for
these special extmark decorations:

- inline virtual text, which needs to be processed in plines.c when we
  calculate the size of text on screen
- virtual lines, which are needed when calculating "filler" lines
- signs, with text and/or highlights, both of which needs to be
  processed for the entire line already at the beginning of a line.

This adds a count to each node of the marktree, for how many special
marks of each kind can be found in the subtree for this node. This makes
it possible to quickly skip over these extra checks, when working in
regions of the buffer not containing these kind of marks, instead of
before where this could just be skipped if the entire _buffer_
didn't contain such marks.
2024-01-22 19:03:32 +01:00
012cfced9b build(deps): bump tree-sitter-c to v0.2.7 2024-01-22 17:58:33 +01:00
cb6320e13f docs(options): remove misleading sentence (#27129)
Setting 'verbose' to 1 doesn't cause Nvim to produce messages. It adds
more information to existing messages, which is documented above.
2024-01-22 22:54:45 +08:00
b4da4783f9 build: make genappimage.sh work with existing CMAKE_INSTALL_PREFIX
Using CMAKE_INSTALL_PREFIX is unreliable as it's a cache variable,
meaning the users previous value will be used if not supplied. Instead,
use the `--prefix` flag which is guaranteed to always work.
2024-01-22 12:38:27 +01:00
1233ac467d feat(fold): transparent foldtext
'foldtext' can be set to an empty string to disable and render the
line with:
  - extmark highlight
  - syntax highlighting
  - search highlighting
  - no line wrapping
  - spelling
  - conceal
  - inline virtual text
  - respects `fillchars:fold`

Currently normal virtual text is not displayed


Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-01-22 10:13:35 +00:00
21b36c7d7f Merge pull request #27076 from glepnir/extmark_hlgroup
refactor(api): use hl id directly in nvim_buf_set_extmark
2024-01-22 09:10:34 +01:00
12d123959f fix(eval): properly support checking v:lua function in exists() (#27124) 2024-01-22 16:04:50 +08:00
d66ed4ea46 refactor(api): give "hl_group" more accurate _meta type
These can either be number or string in lua, so we can specify this
directly as "number|string".
2024-01-22 08:51:54 +01:00
e68decab03 refactor: use "csarg" for CharsizeArg variables (#27123) 2024-01-22 10:39:37 +08:00
8c6de9147c Merge pull request #26813 from VanaIgr/screen-pos-speedup
perf: make screen size and position calculations more efficient

N/A patches for version.c:
vim-patch:9.1.0037: Calling get_breakindent_win() repeatedly when computing virtcol
vim-patch:9.1.0038: Unnecessary loop in getvcol()
2024-01-22 10:00:11 +08:00
fd08de4b85 docs(news): expand the list of performance improvements
When computing on-screen size or position, the size 'breakindent' and 'showbreak' is now cached,
and checks for whether a faster character size function can be used are performed only once at the start.
Multibyte characters are not decodes multiple times anymore, and character decoding functions are more efficient.
Additionally, the amount of trailing spaces for pasted blockwise text is now calculated correctly for multibyte characters.
Internal lisp formatting now doesn't erroneously use inline virtual text from a different line.
2024-01-22 09:05:01 +08:00
cdf848a314 perf: reuse fast character size calculation algorithm from getvcol() 2024-01-22 09:04:45 +08:00
b5653984e5 perf: don't decode utf8 character multiple times in getvcol()
The optimized virtual column calculation loop in getvcol()
was decoding the current character twice: once in ptr2cells()
and the second time in utfc_ptr2len(). For combining charcters, they were
decoded up to 2 times in utfc_ptr2len(). Additionally, the function used to
decode the character could be further optimised.
2024-01-22 09:04:42 +08:00
a25aeee856 test(core/channel_spec): fix lint failure 2024-01-22 08:15:13 +08:00
18d62d129f test(core/channels_spec): fix variable name 2024-01-22 08:02:21 +08:00
4d4092ac9e fix(rpc): assertion failure due to invalid msgpack input
Problem:
  rbuffer_consumed assertion fails if Unpacker fails to parse msgpack,
  because it doesn't consume bytes on errors

Solution:
  Call rbuffer_consumed_compact only if Unpacker isn't closed
2024-01-21 23:42:58 +00:00
f8310beeed build: create BINARY_LIB_DIR directory before adding parser
cmake -E copy_directory behaves differently depending on if the
directory in question exists or not. Always create it to ensure it
behaves consistently.
2024-01-22 00:30:27 +01:00
215244f749 fix(extmarks): missing "spell" and "conceal" in details (#27116) 2024-01-22 06:25:06 +08:00
3f188bc533 build: fix parser installation location
Cmake's `install()` functions like rsync where a trailing slash changes
whether the directory or its contents will be copies.
2024-01-21 15:19:25 +01:00
fa4b02fa67 feat(vim.version): add vim.version.le and vim.version.ge
- Problem: One cannot easily write something like, for example:
    `version_current >= {0, 10, 0}`; writing like
    `not vim.version.lt(version_current, {0, 10, 0})` is verbose.

- Solution: add {`le`,`ge`} in addition to {`lt`,`gt`}.

- Also improve typing on the operator methods: allow `string` as well.

- Update the example in `vim.version.range()` docs: `ge` in place of
  `gt` better matches the semantics of `range:has`.
2024-01-21 11:41:50 +01:00
8df7978fe3 vim-patch:9.1.0042: Missing test for Chuck Filetype
Problem:  Missing test for Chuck filetype
          after commit 27a4632af6753
          (Christian Clason)
Solution: Add a filetype test

c1884c94c5

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-21 11:10:53 +01:00
c75af76b71 vim-patch:27a4632af675
runtime(filetype): detect *.ck files as Chuck filetype (vim/vim#13888)

closes vim/vim#13886

27a4632af6

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-21 11:10:53 +01:00
f5dc453109 feat(treesitter)!: new standard capture names
Problem: Sharing queries with upstream and Helix is difficult due to
different capture names.

Solution: Define and document a new set of standard captures that
matches tree-sitter "standard captures" (where defined) and is closer to
Helix' Atom-style nested groups.

This is a breaking change for colorschemes that defined highlights based
on the old captures. On the other hand, the default colorscheme now
defines links for all standard captures (not just those used in bundled
queries), improving the out-of-the-box experience.
2024-01-21 10:41:18 +01:00
646fdf1073 refactor(api): use hl id directly in nvim_buf_set_extmark 2024-01-20 21:31:11 +08:00
fa9a85ae46 fix(lsp): clean up duplicate and unused meta type annotations 2024-01-20 14:02:16 +01:00
f936a962d0 build: create separate targets for nvim with and without runtime files
This distinction is important for correct dependency management, as the
nvim binary is used to create some runtime files. The nvim binary (and
the target to build it) is thus called `nvim_bin` and the target to
build all of nvim (binary+runtime) is called `nvim`.
2024-01-20 12:59:27 +01:00
ed103cde28 ci: bump cache action to version 4 2024-01-20 12:49:43 +01:00
98a4ed0a11 feat(api): support getting abbreviations (#26868) 2024-01-20 08:08:44 +08:00
d3a8e9217f feat(ui): add chdir UI event (#27093)
When an embedded Nvim instance changes its current directory a "chdir"
UI event is emitted. Attached UIs can use this information however they
wish. In the TUI it is used to synchronize the cwd of the TUI process
with the cwd of the embedded Nvim process.
2024-01-19 14:51:10 -06:00
5a8fe0769c fix(vim.deprecate): show deprecation warning in devel versions as well
Problem:

On devel(nightly) versions, deprecation warnings for hard-deprecated
features are not being displayed. E.g.,
  - to be removed in: 0.11
  - hard-deprecation since 0.10
  - soft-deprecation since 0.9

then 0.10-nightly (0.10.0-dev) versions as well as 0.10.0 (stable)
should display the deprecation warning message.

Solution:

Improve the code and logic on `vim.deprecate()`, and improve
test cases with mocked `vim.version()`.
2024-01-19 12:00:47 +00:00
9707363b09 refactor(lua): refactored glob 2024-01-19 11:54:04 +00:00
0b36cbbafd Merge pull request #27061 from luukvbaal/extmark
fix(extmarks): do not remove invalid marks from decor upon deletion
2024-01-19 10:49:13 +01:00
96d0f4a2d7 docs(INSTALL.md): remove update-alternatives instructions (#27060)
There are various other ways people can mimic the old commands, and
plenty of people that have never heard of the old commands.
This increases the consistency of the whole document by restricting it
to the scope to installation of Nvim and its CLI commands.
2024-01-19 16:34:51 +08:00
2f2f12122f perf: remove loop for computing last position in getvcol()
The function computed the start of the multibyte character and iterated
until the current character reached this position. The loop at the start of the function
handed the case where the index passed to the function was past the end of the line.
This loop can be removed if the function instead compares the next position against
the end position end exits the loop if it is greater than the end position.
2024-01-18 21:30:48 -06:00
a9c551e5e3 perf: cache breakindent/showbreak width in win_lbr_chartabsize
breakindent was recomputed on every call to win_lbr_charbabsize() when the character
is past the end of the first row of a wrapped line. Even though the function for computing
breakindent cached the last result, reusing the cached value required strcmp of the cached line with the given line.
2024-01-18 21:30:47 -06:00
77c3d66be9 test: add screenpos() benchmarks 2024-01-18 21:30:47 -06:00
ba9f86a9ce fix(inccommand): improve preview buffer number handling (#27087) 2024-01-19 11:04:01 +08:00
18334a4a0c refactor(extmarks): remove unused new pos from ExtmarkSavePos 2024-01-18 19:54:45 +01:00
78b000c74d Merge pull request #27079 from lewis6991/winline_rfc
refactor(drawline): more win_line() improvements
2024-01-18 16:33:00 +00:00
7be20acf25 refactor(drawline): get_rightmost_vcol() 2024-01-18 16:12:57 +00:00
1c54cadba5 refactor(drawline): add more consts 2024-01-18 16:12:54 +00:00
2645c9d576 docs(extmarks): add undocumented "details" array fields 2024-01-18 17:06:47 +01:00
44f27c8f23 refactor(drawline): localise more variables in win_line() 2024-01-18 14:47:37 +00:00
674f2513d4 fix(treesitter): validate language alias for injections
Problem: Parsed language annotations can be random garbage so
`nvim_get_runtime_file` throws an error.

Solution: Validate that `alias` is a valid language name before trying
to find a parser for it.
2024-01-18 15:46:08 +01:00
4706b9c2e9 refactor(drawline): more win_line() improvements
`win_line()` previously used a conspicuous `ptrdiff_t v` variable in many different
places for different reasons. The change encapsulates those uses and
introduces local variables in each with a reduced scope.

Also add `const` to some fields in winlinevars_T.
2024-01-18 14:33:05 +00:00
ab3a7fc3e3 docs(vim.iter): correct bool to boolean (#27018) 2024-01-18 07:01:57 -06:00
95cbedaa17 docs: various #25289
Co-authored-by: Jongwook Choi <wookayin@gmail.com>
Co-authored-by: Oliver Marriott <hello@omarriott.com>
Co-authored-by: Benoit de Chezelles <bew@users.noreply.github.com>
Co-authored-by: Jongwook Choi <wookayin@gmail.com>
2024-01-18 00:14:48 -08:00
11e8e14628 vim-patch:46d67d22b9ba
runtime(swayconfig): add focus_follows_mouse and smart_qaps syntax keywords

See:
0aceff7469/sway/sway.5.scd (L680)
`focus_follows_mouse yes|no|always`
0aceff7469/sway/sway.5.scd (L770)

closes: vim/vim#13797

46d67d22b9

Co-authored-by: James Eapen <james.eapen@vai.org>
2024-01-18 08:42:00 +01:00
9b0b3cdc7a vim-patch:a39af0290496
runtime(i3config): remove always from `focus_follows_mouse`

The always option does not exist in i3, only sway.

From https://i3wm.org/docs/userguide.html:
`focus_follows_mouse yes|no`

Version number incremented by 2 because the last commit did not
increment the version.

a39af02904

Co-authored-by: James Eapen <james.eapen@vai.org>
2024-01-18 08:42:00 +01:00
223a6afd8f vim-patch:6e5a6c9965f6
runtime(netrw): minor changes to fix move cmd on windows (vim/vim#13823)

6e5a6c9965

Co-authored-by: MiguelBarro <45819833+MiguelBarro@users.noreply.github.com>
2024-01-18 08:42:00 +01:00
06aebfa998 vim-patch:9.0.1437: test fails with different error number (#27074)
Problem:    Test fails with different error number.
Solution:   Adjust the expected error.

3cdd799951

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-01-18 12:17:51 +08:00
5b31447811 fix(drawline): update prev_ptr after getting syntax attrs (#27072) 2024-01-18 07:27:00 +08:00
8a07ca6c4b vim-patch:9.1.0040: issue with prompt buffer and hidden buffer (#27071)
Problem:  Modifying a hidden buffer still interferes with prompt buffer
          mode changes.
Solution: Save and restore b_prompt_insert.
          (zeertzjq)

closes: vim/vim#13875

Modifying hidden buffer still interferes with prompt buffer mode changes

f267847017
2024-01-18 07:23:48 +08:00
780dd88b68 vim-patch:9.1.0039: too vague errors for 'listchars'/'fillchars' (#27070)
Problem:  too vague errors for 'listchars'/'fillchars'
Solution: Include the field name in error message.
          (zeertzjq)

related: #27050
closes: vim/vim#13877

6a8d2e1634

Co-authored-by: Cole Frankenhoff <cole.nhf@gmail.com>
2024-01-18 07:14:12 +08:00
437d35dbf7 fix(extmarks): do not remove invalid marks from decor upon deletion 2024-01-17 23:17:04 +01:00
5aa14e1231 fix(lua): return after assert returns assert message (#27064) 2024-01-17 13:34:25 -06:00
f5d59340a6 vim-patch:9b03d3e75b42 (#27059)
Translate the Vim9 script Godot files to legacy.

`<scriptcmd>` is not ported yet, so replace it with `<Cmd>` and `<SID>`.
If it's ported, `<scriptcmd>call s:` can be used instead.

Includes changes from:

vim-patch:0daafaa7d99e (was partial, but is now pretty much fully ported)
vim-patch:9712ff1288f9

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-01-17 14:47:40 +00:00
e855a80c72 Merge pull request #27024 from lewis6991/test_followup
test: big cleanup followup + typing
2024-01-17 13:46:55 +00:00
d88814ef68 fix(column): remove sign from line it was previously on with undo 2024-01-17 13:39:42 +00:00
4615d46f93 build(deps): bump tree-sitter-vimdoc to v2.1.0
Add support for `(note)`.
2024-01-17 13:07:55 +01:00
f871fee8b6 fix(column): pass kFalse when initializing "b_signcols.count"
Problem:  Wrong "clear" argument passed to buf_signcols_count_range
          when initializing "b_signcols.count" for the first time.
Solution: Pass kFalse so that the "nested" counter is not incorrectly
          decremented.
2024-01-17 10:17:11 +00:00
14b7ffcf89 feat: add __call typing for vim.inspect() 2024-01-17 10:11:32 +00:00
587490217e test: fix mkdir() 2024-01-17 10:10:17 +00:00
13b83a3ea2 test: move format_{string,luav} to a separate module 2024-01-17 10:10:17 +00:00
b92318d67c test: improve helpers.argss_to_cmd() 2024-01-17 10:10:17 +00:00
c9240daf73 test: fix helpers.relpath()
Missing 3rd argument to string.gsub()
2024-01-17 10:10:17 +00:00
d735567fda test: simplify helpers.sysname() 2024-01-17 10:10:17 +00:00
26835d8d9c test: add type annotations 2024-01-17 10:10:17 +00:00
5a16d08a63 test: remove unused functions
Removed:
  - `helpers.fixtbl()`
  - `helpers.fixtbl_rec()`
  - `helpers.updated()`
  - `helpers.hasenv()`
  - `helpers.is_arch()`
  - `helpers.isfile()`
2024-01-17 10:10:17 +00:00
96ad7e0a4a test: refactor Paths 2024-01-17 10:10:17 +00:00
b990a1f286 test: remove test.deprecated 2024-01-17 10:10:17 +00:00
b536e0ba37 test: big cleanup followup
Followup to 07a7c0ec
2024-01-17 10:10:17 +00:00
b3e5587b7f docs: various fixes (#26929)
Co-authored-by: Patrick Bollinger <owner@pjbollinger.com>
Co-authored-by: vilo1839 <139687192+vilo1839@users.noreply.github.com>
2024-01-17 14:01:39 +08:00
2fce95ec43 vim-patch:9.1.0033: Insert mode not stopped if closing prompt buffer modifies hidden buffer (#27051)
Problem:  Insert mode not stopped if an autocommand modifies a hidden
          buffer while closing a prompt buffer.
Solution: Don't set b_prompt_insert if stop_insert_mode is already set.
          (zeertzjq)

closes: vim/vim#13872

96958366ad
2024-01-17 08:18:52 +08:00
da541c0af1 vim-patch:9.1.0035: i_CTRL-] triggers InsertCharPre (#27049)
* vim-patch:9.1.0035: i_CTRL-] triggers InsertCharPre

Problem:  i_CTRL-] triggers InsertCharPre
Solution: Return if CTRL-] is received. InsertCharPre
          is supposed to be only used for chars to be inserted
          but i_CTRL-] triggers expansion and is not inserted
          into the buffer (altermo)

closes: vim/vim#13853
closes: vim/vim#13864

7d711fe209
2024-01-17 07:35:32 +08:00
aa5819f5a5 vim-patch:211211052d04 (#27048)
runtime(odin): include ftplugin, syntax and indent script (vim/vim#13867)

211211052d

Translate the files from Vim9 script to legacy Vim script. Notably:

- Prefer case-matching comparisons where needed.
- Save and restore `&cpo`.
- Make the functions script-local. (Pretty easy to use these in expr options now
  since Vim 9.0 anyways)

Add a note after the header for each file stating that they're manually
translated.

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-01-16 23:08:41 +00:00
3973a5e405 refactor(lsp): deprecate vim.lsp.util.lookup_section
This function is used only in the `workspace/configuration` handler,
and does not warrant a public API because of its confusing return types.

The only caller `vim.lsp.handlers["workspace.configuration"]` is also
refactored to use `vim.tbl_get()` instead.
2024-01-16 20:14:17 +00:00
8f02ae82e2 test: use integers for API Buffer/Window/Tabpage EXT types 2024-01-16 19:11:49 +00:00
91dc04a5e1 vim-patch:9.1.0013: Modula2 filetype support lacking (#27020)
Problem:  Modula2 filetype support lacking
Solution: Improve the Modula-2 runtime support, add additional modula2
          dialects, add compiler plugin, update syntax highlighting,
          include syntax tests, update Makefiles (Doug Kearns)

closes: vim/vim#6796
closes: vim/vim#8115

68a8947069

- Luaify the detection script:

  - Split the `(*!m2foo*)` and `(*!m2foo+bar*)` detection into two Lua patterns,
    as Lua capture groups cannot be used with `?` and friends (as they only work
    on character classes).

  - Use `vim.api.nvim_buf_call()` (ew) to call `modula2#SetDialect()` to ensure
    `b:modula2` is set for the given bufnr.

- Skip the syntax screendump tests. (A shame as they test some of the detection
  from `(*!m2foo+bar*)` tags, but I tested this locally and it seems to work)

- Port the synmenu.vim changes from Vim9 script. (Also tested this locally)

- (And also add the missing comma for `b:browsefilter` from earlier.)

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-01-16 17:45:57 +00:00
fd2ed024c1 Merge pull request #26938 from luukvbaal/relnum
fix(column): redraw 'statuscolumn' on wrapped lines with 'relativenumber'
2024-01-16 13:08:47 +01:00
463cb28a22 docs(column): 'statuscolumn' redraw interaction with 'relativenumber' 2024-01-16 12:14:00 +01:00
c6864b0d14 fix(column): redraw 'statuscolumn' on wrapped lines with 'relativenumber'
Problem:  The 'statuscolumn' is not redrawn on the wrapped part of a
          line when moving the cursor with 'relativenumber' set.
Solution: Redraw the 'statuscolumn' for the entire line height in the
          "col_rows" win_line() code path.
2024-01-16 12:13:36 +01:00
50284d07b6 fix(diagnostic): typing 2024-01-16 09:33:10 +00:00
91ba9d0bf4 build(deps): bump tree-sitter to HEAD - 660481dbf 2024-01-16 09:58:02 +01:00
3fef24aa01 vim-patch:ef79c5783782
runtime(fortran): update fortran syntax (vim/vim#13870)

Support most remaining features of Fortran 2018/2023
Small improvements to folding etc,
Code cleanup: use \? instead of mix of \= and \?

ef79c57837

Co-authored-by: Ajit-Thakkar <142174202+Ajit-Thakkar@users.noreply.github.com>
2024-01-16 09:18:02 +01:00
6a4c4fa198 ci: stale bot should close the issue with "not planned"
Problem: When the stable bot automatically closes an issue, the issue
will be marked as "closed as completed". It'd be better to mark the
as "closed as not planned".

Solution: Use `state_reason: "not_planned"` from the issues REST API.

References (REST API):
https://docs.github.com/en/rest/issues/issues?apiVersion=2022-11-28#update-an-issue
2024-01-16 08:59:43 +01:00
70d47a1776 version.c: update (#27036)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2024-01-16 14:33:10 +08:00
92672a161c docs(builtin): remove signatures of undocumented functions (#27039)
Having an empty signature causes an empty line in generated docs,  so
remove it.

Also change ">" to ">vim" in foreach() docs.
2024-01-16 12:07:35 +08:00
46a7c1b319 vim-patch:partial:9.1.0027: Vim is missing a foreach() func (#27037)
Problem:  Vim is missing a foreach() func
Solution: Implement foreach({expr1}, {expr2}) function,
          which applies {expr2} for each item in {expr1}
          without changing it (Ernie Rael)

closes: vim/vim#12166

e79e207760

Partial port as this doesn't handle non-materialized range() lists.

vim-patch:c92b8bed1fa6

runtime(help): delete duplicate help tag E741 (vim/vim#13861)

c92b8bed1f

Co-authored-by: Ernie Rael <errael@raelity.com>
2024-01-16 11:30:35 +08:00
267e90f31d fix(edit): don't go to Terminal mode when stopping Insert mode (#27033) 2024-01-16 10:42:09 +08:00
a34451982f vim-patch:8.1.1968: crash when using nested map() (#27029)
Problem:    Crash when using nested map().
Solution:   Clear the pointer in prepare_vimvar(). (Ozaki Kiichi,
            closes vim/vim#4890, closes vim/vim#4891)

27da7de7c5

Cherry-pick Test_filter_map_nested() from patch 8.1.1964.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-01-16 09:32:57 +08:00
73e1942abe vim-patch:9.1.0009: Cannot easily get the list of matches (#27028)
Problem:  Cannot easily get the list of matches
Solution: Add the matchstrlist() and matchbufline() Vim script
          functions (Yegappan Lakshmanan)

closes: vim/vim#13766

Omit CHECK_LIST_MATERIALIZE(): it populates a List with numbers only,
and there is a check for strings below.

f93b1c881a

vim-patch:eb3475df0d92

runtime(doc): Replace non-breaking space with normal space (vim/vim#13868)

eb3475df0d

Co-authored-by: Yegappan Lakshmanan <4298407+yegappan@users.noreply.github.com>
2024-01-16 08:00:08 +08:00
ae48d965d7 fix(coverity/477623,477624): guard null pointer dereference in kv_concat_len (#27022)
Coverity warns about a possible null pointer dereference in the `memcpy`
call in `kv_concat_len`. The `memcpy` follows `kv_ensure_space` which
(re)allocates the `items` pointer if the vector's capacity is not large
enough to contain all of the items being appended. The only way `items`
would be NULL at this point is if `capacity` were mistakenly set to some
large number without `items` ever having being set in the first place.
This should not happen when using the kvec API so if this condition is
ever false it is a bug, which the `assert` will catch.
2024-01-15 14:25:57 -06:00
7589336120 feat(terminal): respond to OSC background and foreground request (#17197)
The motivation for this update is Issue #15365, where background=light
is not properly set for Nvim running from an Nvim :terminal. This can be
encountered when e.g., opening a terminal to make git commits, which
opens EDITOR=nvim in the nested terminal.

Under the implementation of this commit, the OSC response always
indicates a black or white foreground/background. While this may not
reflect the actual foreground/background color, it permits 'background'
to be retained for a nested Nvim instance running in the terminal
emulator. The behaviour matches Vim.
2024-01-15 10:12:07 -06:00
9c202b9392 fix(grid): handle clearing half a double-width char (#27023) 2024-01-15 23:45:11 +08:00
7ed6966023 vim-patch:93197fde0f1d
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"

Problem:  The "*.*" browsefilter pattern only matches all files on
	  Windows (Daryl Lee)
Solution: Use "*" to filter on all platforms but keep "*.*" as the label
	  text on Windows. (Fixes vim/vim#12685, Doug Kearns)

The *.* browsefilter pattern used to match "All Files" on Windows is a
legacy of the DOS 8.3 filename wildcard matching algorithm.  For reasons
of backward compatibility this still works on Windows to match all
files, even those without an extension.

However, this pattern only matches filenames containing a dot on other
platforms.  This often makes files without an extension difficult to
access from the file dialog, e.g., "Makefile"

On Windows it is still standard practice to use "*.*" for the filter
label so ftplugins should use "All Files (*.*)" on Windows and "All
Files (*)" on other platforms.  This matches Vim's default browsefilter
values.

This commit also normalises the browsefilter conditional test to check
for the Win32 and GTK GUI features and an unset b:browsefilter.

closes: vim/vim#12759

93197fde0f

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-01-15 11:40:44 +01:00
fa836cb98b docs(vvars): fix wrong lua types in vim.v variables
- cmdarg: string[] -> string
- shell_error: string -> int
- stderr: string -> int

- Add types for: cmdbang, errors, exception, false, true
2024-01-15 09:39:27 +00:00
967c7abde3 fix(column): keep track of number of lines with number of signs
Problem:  Some edge cases to the old (pre-#26406) and current "b_signcols"
          structure result in an incorrectly sized "auto" 'signcolumn'.
Solution: * Implement a simpler 'signcolumn' validation strategy by immediately
            counting the number of signs in a range upon sign insertion and
            deletion. Decrease in performance here but there is a clear path
            forward to decreasing this performance hit by moving signs to a
            dedicated marktree, or by adding meta-data to the existing
            marktree which may be queried more efficiently?
          * Also replace "max_count" and keep track of the number of lines with
            a certain number of signs. This makes it so that it is no longer
            necessary to scan the entire buffer when the maximum number of signs
            decreases. This likely makes the commit a net increase in performance.
          * To ensure correctness we also have re-initialize the count for an
            edited region that spans multiple lines. Such an edit may move the
            signs within it. Thus we count and decrement before splicing the
            marktree and count and increment after.
2024-01-15 09:37:53 +00:00
4d91604c88 docs: add lua typing for vim.NIL 2024-01-15 08:45:30 +00:00
965dbd0e01 ci(s390x): enable CI_BUILD 2024-01-14 23:16:40 +01:00
310fb2efc3 build: disable conversion warnings for older GCC versions
The conversion warnings from GCC versions 10 and less give too many
false positives and should be disabled.
2024-01-14 15:55:38 +01:00
e5ff71fbbf docs(builtin): overload functions with union return types 2024-01-14 14:06:35 +00:00
a7df0415ab fix(lua2dox): filter out the entire ---@alias block
Problem: Any preceding luadocs block that define alias types with
`@alias` magic would be prepended to the documentation of functions
that follow, despite the "blank line" separator. For example:

```
--- @alias some.type.between.functions
--- Blah blah long documentation for alias
--- | "foo" # foo
--- | "bar" # bar

--- The documentation that should appear in vimdoc.
function M.function_to_include_in_doc()
  ...
end
```

then the vimdoc generated for `function_to_include_in_doc` would include
the text from the alias block (e.g., "Blah blah ... for alias").

Solution:

- refactor: Lua2DoxFilter should maintain its own internal state
  `generics`, rather than carrying it as a parameter to local helper
  functions.

- Add another boolean state `boolean_state` which represents whether
  to ignore the current docstring block (magic lines). This flag will
  be reset as soon as the block is end.

Note: As expected, there is no change at all in the current docs
generated, because we have been working around and writing luadoc
comments so that such erroneous docstring resulting from preceding
`@alias` blocks won't appear.
2024-01-14 14:04:08 +00:00
2cdea852e8 docs: auto-generate docs for vim.lpeg and vim.re
- Add section `VIM.LPEG` and `VIM.RE` to docs/lua.txt.

- Add `_meta/re.lua` which adds luadoc and type annotations, for the
  vendored `vim.re` package.

- Fix minor style issues on `_meta/lpeg.lua` luadoc for better vimdocs
  generation.

- Fix a bug on `gen_vimdoc` where non-helptags in verbatim code blocks
  were parsed as helptags, affecting code examples on `vim.lpeg.Cf`,
  etc.

- Also move the `vim.regex` section below so that it can be located
  closer to `vim.lpeg` and `vim.re`.
2024-01-14 11:08:33 +00:00
ce4ea638c7 fix(lsp): fix incorrect typing and doc for vim.lsp.rpc
Typings introduced in #26032 and #26552 have a few conflicts, so we
merge and clean them up. We also fix some incorrect type annotation in
the `vim.lsp.rpc` package. See the associated PR for more details.

Summary:

- vim.rpc.Dispatchers -> vim.lsp.rpc.Dispatchers
- vim.lsp.rpc.Error -> lsp.ResponseError
- Revise docs
2024-01-14 09:02:45 +01:00
92c59c39c3 fix(ops.c): remove duplicate u_save_cursor() 2024-01-14 08:47:57 +08:00
2bdd8fad4c docs(builtin): fix mapset() signature (#27008) 2024-01-14 08:44:16 +08:00
0c850add3e fix(colorscheme): default statusline groups usability #26921
Problem: Current values of `StatusLine` and `StatusLineNC` are currently
  designed to be visually distinctive while being not intrusive.
  However, the compromise was more shifted towards "not intrusive".
  After the feedback, statusline highlight groups should be designed to:
  - Make current window clearly noticeable. Meaning `StatusLine` and
    `StatusLineNC` should obviously differ.
  - Make non-current windows clearly separable. Meaning `StatusLineNC`
    and `Normal`/`NormalNC` should obviously differ.

Solution:
  - Update `StatusLineNC` to have more visible background.
  - Update `StatusLine` to be inverted variant of `StatusLineNC`.
  - Update `WinBar` and `WinBarNC` to not link to `StatusLine` and
    `StatusLineNC` because it makes two goals harder to achieve.
  - Update `TabLine` to link to `StatusLineNC` instead of `StatusLine`
    to not be very visually intrusive.
2024-01-13 16:35:37 -08:00
bab5e7fe17 Merge pull request #26869 from luukvbaal/decor
refactor: minor decor refactors
2024-01-13 18:10:53 +01:00
4f544b3119 refactor(marktree): unpaired marktree_get_alt() returns itself
Avoids checking for invalid mark at callsite.
2024-01-13 17:15:19 +01:00
e6ddceda31 refactor(decorations): more conservative redraw range
Problem:  Decor range is being redrawn unconditionally, negating the
          more conservative line redrawing that follows.
Solution: Get rid of unconditional redraw_buf_range_later() call.
2024-01-13 17:15:04 +01:00
2dc439c672 Merge pull request #26734 from bfredl/splitaroo
fix(buffer_updates): correct buffer updates when splitting empty line
2024-01-13 10:59:46 +01:00
e5d9b15044 fix(buffer_updates): correct buffer updates when splitting empty line
fixes #11591
2024-01-13 10:39:32 +01:00
89b0f5ac5a vim-patch:9.1.0022: Coverity complains about improper use of negative value (#27001)
Problem:  Coverity complains about improper use of negative value
Solution: Add a condition to validate that keytyped is larger or equal
          to 0

Apparently patch 9.1.0006 made it more explicit for Coverity, that the
TOLOWER_LOC() macros do not handle negative values properly. However,
that condition has always been there even before that, so add a
condition to verify that keytyped is indeed at least 0

closes: vim/vim#13824

49471963fe

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-13 13:23:42 +08:00
786089013d Merge pull request #26911 from zeertzjq/vim-8.2.3439
vim-patch:8.2.3439,9.1.{0015,0021}
2024-01-13 08:47:18 +08:00
64a50d08c4 vim-patch:9.1.0021: i_CTRL-R- doesn't work for multibyte chars in Replace mode
Problem:  i_CTRL-R- doesn't work for multibyte chars in Replace mode,
          Coverity complains missing return value for u_save_cursor()
Solution: Use mb_charlen() and del_chars() instead, handle failure mode
          for u_save_cursor() correctly (@zeertzjq)

closes: vim/vim#13846

424ec1f235
2024-01-13 08:31:01 +08:00
2783b6b0a4 vim-patch:9.1.0015: i_CTRL-R- no longer works in replace mode
Problem:  i_CTRL-R- no longer works in replace mode
Solution: delete characters in replace mode before putting, add a test,
          add a bit warning into the documentation, that i_CTRL-R-P/O
          is not supported in Replace mode for now

fixes: vim/vim#13792
closes: vim/vim#13816

5d5cbb2b9a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-13 08:29:47 +08:00
4142b8cd2c vim-patch:8.2.3439: deleted lines go to wrong yank register
Problem:    Deleted lines go to wrong yank register.
Solution:   Reset y_append when not calling get_yank_register(). (Christian
            Brabandt, closes vim/vim#8872)

78eb9cce91

Nvim has removed y_append static variable and already works as expected.

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-13 08:29:47 +08:00
c8f696f2b0 vim-patch:9.1.0025: A few typos in tests and justify.vim
Problem:  A few typos in tests and justify.vim
Solution: fix them

closes: vim/vim#13848

dc4c37b9d5

Co-authored-by: dundargoc <gocdundar@gmail.com>
2024-01-12 22:24:52 +01:00
e32af31ee8 fix(flake): clang-tools moved to nativeBuildInputs (#26955)
* fix(flake): clang-tools moved to nativeBuildInputs

Buildtime binaries should go in `nativeBuildInputs`
Before `clang-tools` version was overwriten breaking the Lsp.

Relevant issues:
https://github.com/NixOS/nixpkgs/issues/76486

* remove cmake, available in the nixpkgs derivation
2024-01-12 21:12:43 +01:00
07a7c0ec99 Merge pull request #26994 from lewis6991/vimhelpers
test: big cleanup
2024-01-12 19:40:58 +00:00
795f896a57 test: rename (meths, funcs) -> (api, fn) 2024-01-12 18:59:14 +00:00
7f249936a9 vim-patch:2357765304e4
runtime(netrw): Decode multibyte percent-encoding filename correctly (vim/vim#13842)

Use `printf("%c")` instead of `nr2char()` to handle '%xx' as a byte.

Close vim/vim#13787

2357765304

Co-authored-by: K.Takata <kentkt@csc.jp>
2024-01-12 19:45:15 +01:00
4f81f506f9 test: normalise nvim bridge functions
- remove helpers.cur*meths
- remove helpers.nvim
2024-01-12 17:53:27 +00:00
c30f2e3182 test: typing for helpers.meths 2024-01-12 13:01:06 +00:00
061a0d5a48 vim-patch:5f4cc8ea65e8
runtime(colorschemes): Add initial support for Added/Removed/Changed highlight groups (vim/vim#13830)

For some of the colorschemes where diffAdded and diffRemoved were explicitly set up.

5f4cc8ea65

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-01-12 13:52:26 +01:00
f46ae13685 vim-patch:9.1.0016: default diff highlighting is too noisy
Problem:  default diff highlighting is too noisy
Solution: Link diff highlighting groups to new
          Added/Removed/Changed, revert previous change
          (Romain Lafourcade)

Remove diff* links added in vim/vim#13776 and doc added in commit b1392be

The links added in vim/vim#13776 are way too noisy for the contexts in which
the `diff` syntax is applied (git commits, patches, etc.).

This commit:

- removes those links
- adds new default highlighting groups Added, Changed and
  Removed
- links the diff highlighting groups to those new defaults
- removes the doc changes
- adjusts the syntax_completion test for those newly added group
  names

Note: Changes to the default color schemes will be handled separately,
by adding links to those newly created Added/Removed/Changed
highlighting groups.

related: vim/vim#13776
closes vim/vim#13825

124371c5a1

Co-authored-by: Romain Lafourcade <romain.lafourcade@razorfish.fr>
2024-01-12 13:52:26 +01:00
284e0ad26d test: use vim.mpack and vim.uv directly 2024-01-12 12:04:20 +00:00
56a2ec5c79 test: use vim.inspect directly 2024-01-12 12:04:20 +00:00
7a259d01ae test: remove helpers.sleep() 2024-01-12 12:04:19 +00:00
d33e1da9b7 test: do not inject vim module into global helpers 2024-01-12 12:04:18 +00:00
3bcf8e5622 vim-patch:9.1.0011: regexp cannot match combining chars in collection (#26992)
Problem:  regexp cannot match combining chars in collection
Solution: Check for combining characters in regex collections for the
          NFA and BT Regex Engine

Also, while at it, make debug mode work again.

fixes vim/vim#10286
closes: vim/vim#12871

d2cc51f9a1

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-12 14:09:10 +08:00
1813661a61 refactor(IWYU): fix headers
Remove `export` pramgas from defs headers as it causes IWYU to believe
that the definitions from the defs headers comes from main header, which
is not what we really want.
2024-01-11 21:37:23 +01:00
1514982484 Merge pull request #26961 from bfredl/drawend
refactor(screen): simplify grid_clear() and win_draw_end()
2024-01-11 21:20:28 +01:00
478b1af511 refactor(screen): simplify grid_clear() and win_draw_end()
grid_put_linebuf() used grid_clear() internally to handle clearing the
left part of a rightleft line. By reimplementing that internally, we
can instead use grid_put_linebuf() as the implementation of
grid_clear(), which in the end is a net reduction of code as grid_fill()
is used for nothing else.

win_draw_end: Implement "draw_margin" on a per-row basis which closer reflects how
terminals work. Also use the magic mirror for 'rightleft'
2024-01-11 19:53:21 +01:00
2f9ee9b6cf fix(doc): improve doc generation of types using lpeg
Added a lpeg grammar for LuaCATS and use it in lua2dox.lua
2024-01-11 16:24:12 +00:00
JD
a767c046f4 feat(vim.iter): add Iter:flatten (#26786)
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Jongwook Choi <wookayin@gmail.com>
2024-01-10 20:57:51 -06:00
a7550a20e0 fix(pum): handle right-click menu repositioning with multigrid (#26975) 2024-01-10 12:56:43 +08:00
fa17a5ab49 fix(terminal): use terminal buffer for TermRequest autocommand (#26974) 2024-01-09 21:31:37 -06:00
63a17322dd fix(health): improve python executable check error handling (#26954)
Credit to @wookayin for the fix.
2024-01-10 07:05:44 +08:00
c67efe3a9c fix(health): correctly expand and resolve PYENV_ROOT (#26953) 2024-01-10 06:28:18 +08:00
595f684c5b vim-patch:71d0ba07a33a
runtime(netrw): Sync with netrw 174b (vim/vim#13836)

* Import netrw v174b
* Revert unwanted changes
* Fix indent
* Revert some changes
* Update tags
* Break long line

71d0ba07a3

Co-authored-by: K.Takata <kentkt@csc.jp>
2024-01-09 23:22:48 +01:00
10f36af84d refactor(options): remove OPT_FREE (#26963)
Problem: `OPT_FREE` macro doesn't seem to do anything as `P_ALLOCED`
already handles allocations.

Solution: Remove `OPT_FREE`.
2024-01-10 06:15:22 +08:00
501cf32357 vim-patch:3a5b3df7764d (#26956)
runtime(tar): fix a few problems with the tar plugin

From: vim/vim#138331:
  - Updating .tar.zst files was broken. Fixes vim/vim#12639.
  - Extracting files from .tar.zst / .tzs files was also broken and
    works now.
From: vim/vim#12637:
  - Fixes variable assignment and typo
From: vim/vim#8109:
  - Rename .tzs to the more standard .tzst

fixes: vim/vim#12639
fixes: vim/vim#8105
closes: vim/vim#8109
closes: vim/vim#12637
closes: vim/vim#13831

3a5b3df776

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Martin Rys <martin@rys.pw>
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Co-authored-by: Carlo Teubner <carlo@cteubner.net>
2024-01-10 06:03:09 +08:00
beca827212 feat(terminal): trigger TermRequest autocommand events (#22159)
This commit implements a new TermRequest autocommand event and has Neovim
emit this event when children of terminal buffers emit an OSC or DCS sequence
libvterm does not handle.

The TermRequest autocommand event has additional data in the
v:termrequest variable.

Co-authored-by: Gregory Anders <greg@gpanders.com>
2024-01-09 08:27:56 -06:00
f40df63bdc fix(docs): make lines not overflow in vim docs
Problem: Some lines in the generated vim doc are overflowing, not
correctly wrapped at 78 characters. This happens when docs body contains
several consecutive 'inline' elements generated by doxygen.

Solution: Take into account the current column offset of the last line,
and prepend some padding before doc_wrap().
2024-01-09 13:33:18 +00:00
d54156ed08 fix(extmarks): blending space shouldn't overwrite wide char (#26960) 2024-01-09 19:16:44 +08:00
b2c92eebc0 refactor(drawline): remove unused save_extra argument (#26959) 2024-01-09 14:52:05 +08:00
ee3d4f6b90 fix(extmarks): handle overwriting right half of wide char (#26951) 2024-01-09 05:37:08 +08:00
c4acbb87ba Merge pull request #26872 from bfredl/fillschar
refactor(options): use schar_T for fillchars and listchars
2024-01-08 18:25:52 +01:00
aeb053907d refactor(options): use schar_T representation for fillchars and listchars
A bit big, but practically it was a lot simpler to change over all
fillchars and all listchars at once, to not need to maintain two
parallel implementations.

This is mostly an internal refactor, but it also removes an arbitrary
limitation: that 'fillchars' and 'listchars' values can only be
single-codepoint characters. Now any character which fits into a single
screen cell can be used.
2024-01-08 14:37:55 +01:00
fbe40caa7c docs(treesitter): improve 'no parser' error message for InspectTree
Improve error messages for `:InspectTree`, when no parsers are available
for the current buffer and filetype. We can show more informative and
helpful error message for users (e.g., which lang was searched for):

```
 ... No parser available for the given buffer:
+... no parser for 'custom_ft' language, see :help treesitter-parsers
```

Also improve the relevant docs for *treesitter-parsers*.
2024-01-08 09:27:03 +00:00
367e52cc79 fix(tui): use buflen to calculate remaining buffer size (#26942)
buf is a pointer argument, not a local char array, so sizeof(buf) is just the size of a pointer type on the platform.  This is always an incorrect value, but on 32-bit platforms it actually has an impact, since sizeof(buf) is just 4 and causes the buffer to get truncated.
2024-01-07 12:25:25 -05:00
8df3742378 fix(defaults): use augroup for default autocommands (#26933) 2024-01-06 18:08:29 -06:00
9a2c98087b fix(highlight): update IncSearch to link to CurSearch
Problem: `IncSearch` is currently linked to `Search` which makes it not
  usable for its purpose of showing current match with 'incsearch' and
  confirming matches after `:s///c`.

Solution: Link it to `CurSearch`.
2024-01-06 17:42:02 +01:00
9ee8ce2eb8 Merge pull request #26913 from jamessan/execl-fix
fix(test/tui_spec): pass the expected NULL-sentinel to execl()
2024-01-06 09:23:47 -05:00
8861ad83fd fix(test/tui_spec): pass the expected NULL-sentinel to execl()
Since execl() is a variadic function, it requries a NULL-terminal to
indicate the end of its argument list, c.f. exec(3)

> The first argument, by convention, should point to the filename
> associated with the file being executed.  The list of arguments *must*
> be terminated by a null pointer

This fixes the failure seen on aarch64 and i386, due to garbage data
being considered part of the variadic arguments.
2024-01-06 06:57:31 -05:00
099bd35a7d docs(luvref): update to version bump 2024-01-06 12:02:27 +01:00
2eb74bff0e build(deps): bump luv to 1.47.0-0 2024-01-06 12:02:27 +01:00
28c183b38c vim-patch:9.1.0014: incorrect use of W_WINROW in edit.c (#26910)
Problem:  incorrect use of W_WINROW in edit.c
Solution: compare against curwin->w_height instead

Remove incorrect use of W_WINROW

In structs.h it is mentioned that w_wrow is relative to w_winrow, so
using W_WINROW doesn't make sense when comparing with window height.

This change won't lead to any observable behavior change:

The condition intends to check if there are 'scrolloff' lines between
the current cursor when the bottom of the window. When W_WINROW(curwin)
is added to curwin->w_height - 1 - get_scrolloff_value(), the condition
is instead satisfied when the cursor is on some screen line below that
position. However,
- If 'scrolloff' is smaller than half the window height, this condition
  can only be satisfied when W_WINROW(curwin) == 0. And if it is not
  satisfied, update_topline() does the actual scrolling.
- If 'scrolloff' is larger than half the window height, update_topline()
  will put the cursor at the center of the window soon afterwards
  anyway, because set_topline() now unsets VALID_TOPLINE flag starting
  from 7db7bb45b0.

To put it in another way, 7db7bb45b0
makes the update_topline() just below correct the mistakes made in this
block, so this incorrect use of W_WINROW() no longer affects observable
behavior.

closes: vim/vim#12331

b1ed7ec9f7
2024-01-06 06:49:21 +08:00
a18b4af759 Merge pull request #26909 from zeertzjq/vim-9.1.0007
vim-patch:9.1.{0007,0012}: can select empty inner text blocks
2024-01-06 06:45:11 +08:00
14918118e8 vim-patch:9.1.0012: regression with empty inner blocks introduced
Problem:  regression with empty inner blocks introduced
          (after v9.1.0007)
Solution: Set correct cursor position, Check for visual mode
          being active (Maxim Kim)

relates: vim/vim#13514
closes: vim/vim#13819

3779516988

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-01-06 06:25:37 +08:00
f38f86b1ad vim-patch:9.1.0007: can select empty inner text blocks
Problem:  can select empty inner text blocks
          (laurentalacoque)
Solution: make selecting empty inner text blocks an error

textobjects: Make selecting inner empty blocks an error

fixes: vim/vim#13514
closes: vim/vim#13523

ad4d7f446d

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-06 06:24:02 +08:00
52e6059415 fix(test): call separate_arguments() correctly to honor $BUSTED_ARGS (#26905)
separate_arguments() doesn't operate in place on a variable.  It expects
a string argument to parse and stores the results in the specified
variable.
2024-01-05 14:07:34 -05:00
583c1de175 refactor: move structs from regexp_defs.h to regexp.c (#26899)
These structs are only used in other source files as pointers and their
fields aren't accessed in other source files.
2024-01-05 22:26:07 +08:00
c509f4907b fix(column): fill 'statuscolumn' clickdefs with evaluated width (#26891) 2024-01-05 21:34:54 +08:00
e09adfdcff fix(terminal): check if mouse on statusline/tabline/winbar/vsep (#26892) 2024-01-05 10:59:52 +08:00
dab5844082 vim-patch:9.1.0010: Keymap completion is not available (#26888)
Problem:  Keymap completion is not available
Solution: Add keymap completion (Doug Kearns)

Add keymap completion to the 'keymap' option, user commands and builtin
completion functions.

closes: vim/vim#13692

81642d9d6f

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-01-05 08:23:51 +08:00
88eb0ad149 fix(health): fix tmux RGB capability detection (#26886)
tmux indicates its RGB support via setrgbb and setrgbf. In modern tmux
code, Tc and RGB just set setrgbb and setrgbf, so we can just check for
them.

Link: 7eb496c00c
2024-01-04 15:51:52 -06:00
6635ec113f Merge pull request #26791 from wookayin/gendoc
refactor(gen_vimdoc): general refactoring on vimdoc generation
2024-01-04 12:03:12 +00:00
fa61e0c047 refactor(column): define and use maximum 'statuscolumn' width
Problem:  The maximum 'statuscolumn' width and grow behavior is undocumented.
Solution: Define, use and document the maximum 'statuscolumn' width and grow behavior.
2024-01-04 11:52:37 +00:00
444f37fe51 fix(decorations): incompletely displayed line should also get decorations 2024-01-04 11:37:00 +00:00
dc48a98f9a fix(decorations): validate botline for on_win
Problem:
Many decoration providers (treesitter injection highlighting, semantic
token highlighting, inlay hint) rely on the correctness of the `botline`
argument of `on_win` callback. However, `botline` can be smaller than
the actual line number of the last displayed line if some lines are
folded. In such cases, some decorations will be missing in the lines not
covered by `botline`.

Solution:
Validate `botline` when invoking `on_win`.

NOTE:
It seems that the old code was deliberately avoiding this presumably due
to performance reasons. However, I haven't experienced noticeable lag
after this change, and I believe the cost of botline computation would
be much smaller than the cost of decoration providers.
2024-01-04 11:37:00 +00:00
9b90657376 vim-patch:d94ca966ca6d
runtime(fortran): syntax and documentation updates (vim/vim#13811)

closes: vim/vim#13802

d94ca966ca

Co-authored-by: Ajit-Thakkar <142174202+Ajit-Thakkar@users.noreply.github.com>
2024-01-04 12:13:49 +01:00
166b4284c8 vim-patch:b1392bee701d
runtime(doc): document that the diff filetype uses Diff hl groups

related: vim/vim#13776

b1392bee70

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-04 12:13:49 +01:00
39ea076f2f vim-patch:80beeef0c6a4
runtime(vim): Add support for <ScriptCmd> syntax (vim/vim#10686)

Adding `<ScriptCmd>` to list of angle-bracket notation syntax, just like `<Cmd>`

`<Cmd>` is already highlighted.
```vim
nnoremap <leader>o <Cmd>Oldfiles()<CR>
```

`<ScriptCmd>` is not.

80beeef0c6

Co-authored-by: dezza <402927+dezza@users.noreply.github.com>
2024-01-04 12:13:49 +01:00
8a6317e70a vim-patch:d4634a26cdcd
runtime(vim): Add support for `syntax foldlevel` command (vim/vim#6182)

d4634a26cd

Co-authored-by: Brad King <brad.king@kitware.com>
2024-01-04 12:13:49 +01:00
bdfea2a891 vim-patch:9.1.0001: when closing window, wincmd p may fail
Avoid `prevwin == curwin` when closing `curwin`

Problem:  When closing the current window (or when moving it to a tabpage), the
          previous window may refer to the new current window
          (`winnr() == winnr('#')`) if that window is selected as the
          new current window.

Solution: Set `prevwin = NULL` when switching away from an invalid `curwin` and
          the target window was the `prevwin`.
          (Sean Dewar)

related: vim/vim#4537
closes: vim/vim#13762

bf44b69d1f

Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
2024-01-03 23:09:55 +01:00
5dbf6ab9b1 vim-patch:9.1.0004: reloading colorscheme when not changing 'background' (#26877)
Problem:  reloading colorscheme when not changing 'background'
Solution: Check, if the background option value actually changed,
          if not, return early.

Only reload colorscheme when bg is changed

Currently the highlight groups are re-initialized and the colorscheme
(if any) is reloaded anytime 'background' is set, even if it is not
changed. This is unnecessary, because if the value was not changed then
there is no need to change highlight groups or do anything with the
colorscheme. Instead, only reload the colorscheme if the value of
'background' was actually changed.

closes: vim/vim#13700

83ad2726ff

Co-authored-by: Gregory Anders <greg@gpanders.com>
2024-01-04 05:45:26 +08:00
12cdee7245 vim-patch:9.1.0002: a closing fold expr, may start a new fold (#26876)
Problem:  a closing fold expression may unexpectedly start a new fold
          when it should end a fold
          (reported by Shota Nozaki)
Solution: if a fold hasn't started yet, do not immediately
          start a new fold with level 1
          (Shota Nozaki)

fixes: vim/vim#12768
closes: vim/vim#13748

0689b87059

Co-authored-by: Shota Nozaki <emonkak@gmail.com>
2024-01-04 05:36:38 +08:00
3734519e3b feat(lua): add noref to deepcopy
Problem:

Currently `deepcopy` hashes every single tables it copies so it can be
reused. For tables of mostly unique items that are non recursive, this
hashing is unnecessarily expensive

Solution:

Port the `noref` argument from Vimscripts `deepcopy()`.

The below benchmark demonstrates the results for two extreme cases of
tables of different sizes. One table that uses the same table lots of
times and one with all unique tables.

| test                 | `noref=false` (ms) | `noref=true` (ms) |
| -------------------- | ------------------ | ----------------- |
| unique tables (50)   | 6.59               | 2.62              |
| shared tables (50)   | 3.24               | 6.40              |
| unique tables (2000) | 23381.48           | 2884.53           |
| shared tables (2000) | 3505.54            | 14038.80          |

The results are basically the inverse of each other where `noref` is
much more performance on tables with unique fields, and `not noref` is
more performant on tables that reuse fields.
2024-01-03 19:17:52 +00:00
a064ed6229 Merge #26398 lintlua for test/ dir 2024-01-03 03:05:22 -08:00
04f2f864e2 refactor: format test/* 2024-01-03 02:09:29 +01:00
59d117ec99 build: enable lintlua for test/ dir
Problem:
Not all Lua code is checked by stylua. Automating code-style is an
important mechanism for reducing time spent on accidental
(non-essential) complexity.

Solution:
- Enable stylua for entire `test/` directory.
- Exclude these high-churn files until this issue is resolved: https://github.com/JohnnyMorganz/StyLua/issues/829
  ```
  test/functional/ui/decorations_spec.lua  | 3560 ++++++++++++++++++++++++++++++++++++----------------
  test/functional/ui/float_spec.lua        | 5826 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------
  test/functional/ui/multigrid_spec.lua    | 1349 ++++++++++++++------
  ```
- Make surgical changes to these files (or add `stylua: ignore` in some
  small scopes) to improve the result:
  ```
  test/functional/vimscript/msgpack_functions_spec.lua | 1414 +++++++++++++++------
  test/functional/api/buffer_spec.lua                  | 1389 +++++++++++----------
  test/functional/api/vim_spec.lua                     | 2740 +++++++++++++++++++++++-----------------
  ```
- These "high churn" files are NOT excluded because the changes are
  largely an improvement:
  ```
  test/functional/plugin/lsp_spec.lua      | 2198 ++++++++++++++++++---------------
  test/functional/plugin/shada_spec.lua    | 4078 +++++++++++++++++++++++++++++++++++-------------------------
  test/functional/ui/cmdline_spec.lua      | 1199 +++++++++++-------
  test/functional/ui/popupmenu_spec.lua    | 1267 +++++++++++--------
  test/functional/ui/messages_spec.lua     | 1643 +++++++++++++++---------
  ```
- TODO: how to check "all directories"? With `GLOB_DIRS *` and `/.deps/` (or
  `.deps/`) in `.styluaignore`, Lua code in `.deps/` is still checked...
2024-01-03 02:09:28 +01:00
ee21273634 Merge pull request #26860 from sus-domesticus/fix/clangd
fix/clangd (check size of array before applying qsort on it; set block pointer to null in case map is empty)
2024-01-03 06:57:23 +08:00
cdd8017469 fix(clangd): set block pointer to null in case map is empty 2024-01-03 00:00:37 +02:00
1027ccac6d fix(clangd): check size of array before applying qsort on it 2024-01-02 23:38:10 +02:00
b3eda5e73f docs: small fixes
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
Co-authored-by: HiPhish <hiphish@posteo.de>
Co-authored-by: JD Rudie <rudiejd@miamioh.edu>
2024-01-02 22:00:06 +01:00
735aa4c4c8 refactor: remove redundant struct names
A struct can be anonymous if only its typedef is used.
2024-01-02 21:59:12 +01:00
3f35c69b23 refactor(api): redundant ml_mfp check #26059
buf_ensure_loaded already checks `(buf->b_ml.ml_mfp != NULL)`. #25823

TODO:
- #10070 #13201 All buffer-related API functions except
  `nvim_buf_is_loaded` (and `nvim_buf_is_valid`?) should always call
  `buf_ensure_loaded`. Because the _common case_ is that plugins expect
  the buffer to "just work"—and for the uncomon, performance-sensitive
  case, the script can check `nvim_buf_is_loaded` to avoid implicitly
  loading a buffer.
- Update documentation to clarify the above semantics.
2024-01-02 12:33:41 -08:00
91d76ac941 docs(lsp): add supports_method to vim.lsp.client docs (#26852) 2024-01-02 18:52:29 +01:00
765729a145 fix(gen_vimdoc): INCLUDE_DEPRECATED not generating docs for deprecateds
Since some point INCLUDE_DEPRECATED stopped working as it is usually
turned off when generating an actual vimdoc. This commit fixes this
hidden feature back again (used for devel purposes only).
2024-01-02 11:35:34 -05:00
f74f52a1a5 refactor(gen_vimdoc): refactor section and defgroup doc generation
Problem: main() has too much logic implemented there, too difficult to
read.

Solution: Do more OOP, introduce `Section` dataclass that stores
information about a "section", with documentation and concrete examples
about what each field and variable would mean. Extract all the lines for
rendering a section into `section.render()` pulled out of `main()`.
2024-01-02 11:32:35 -05:00
4e9298ecdf refactor(gen_vimdoc): generate function doc from metadata, not from xml
Problem:

For function definitions to be included in the vimdoc (formatted) and
to be exported as mpack data (unformatted), we had two internal
representations of the same function/API metadata in duplicate;
one is FunctionDoc (which was previously a dict), and the other is
doxygen XML DOM from which vimdoc (functions sections) was generated.

Solution:

We should have a single path and unified data representation
(i.e. FunctionDoc) that contains all the metadata and information about
function APIs, from which both of mpack export and vimdoc are generated.
I.e., vimdocs are no longer generated directly from doxygen XML nodes,
but generated via:

  (XML DOM Nodes) ------------> FunctionDoc ------> mpack (unformatted)
                   Recursive     Internal     |
                   Formatting    Metadata     +---> vimdoc (formatted)

This refactoring eliminates the hacky and ugly use of `fmt_vimhelp` in
`fmt_node_as_vimhelp()` and all other helper functions! This way,
`fmt_node_as_vimhelp()` can simplified as it no longer needs to handle
generating of function docs, which needs to be done only in the topmost
level of recursion.
2024-01-02 11:32:32 -05:00
67f5332344 fix(docs): clean up non-docstring comments for vimdoc gen
These non-docstring comments can be included into doxygen's brief
description and then appear in the succeeding function documentation.
2024-01-02 11:16:48 -05:00
1a31d4cf2b refactor(gen_vimdoc): use typing for function API vimdoc generation 2024-01-02 11:15:36 -05:00
5e2d4b3c4d refactor(gen_vimdoc): use stronger typing for CONFIG, avoid dict 2024-01-02 11:15:31 -05:00
5dc0bdfe98 docs(glob): add glob module (#26853) 2024-01-02 14:32:43 +01:00
2bf68df289 vim-patch:10b4f75d4c03 (#26846)
runtime(dist/ft): improve filetype detection for *.v (V/Verilog/Coq)

Patch provided by Dan Alt

closes: vim/vim#13793

10b4f75d4c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-02 19:06:43 +08:00
e98bef259a vim-patch:34d15155fc45
runtime(menu): regenerate synmenu

34d15155fc

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-02 11:43:18 +01:00
b8df4b2dff vim-patch:b16fc9805535
runtime(sh): Update sh syntax and add local keyword for bash (vim/vim#13806)

add `local` in shStatement

b16fc98055

Co-authored-by: Lucien Grondin <grondilu@yahoo.fr>
2024-01-02 11:43:18 +01:00
99f1530a4f vim-patch:d08059ab48b8
runtime(ruby): Update ftplugin and omni-complete (vim/vim#13805)

d08059ab48

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-01-02 11:43:18 +01:00
3299797150 fix(drawline): consider position in linebuf for foldcolumn (#26803) 2024-01-02 17:59:23 +08:00
e0112aa1d2 refactor(lsp): fix remaining luals warnings in lsp.rpc 2024-01-02 10:49:14 +01:00
3f788e73b3 feat(lsp): support connect via named pipes/unix domain sockets (#26032)
Closes https://github.com/neovim/neovim/issues/26031

Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2024-01-02 10:08:36 +01:00
4ee656e4f3 feature(diagnostic): add vim.diagnostic.count() (#26807)
feat(diagnostic): add `vim.diagnostic.count()`

Problem: Getting diagnostic count based on the output of
  `vim.diagnostic.get()` might become costly as number of diagnostic
  entries grows. This is because it returns a copy of diagnostic cache
  entries (so as to not allow users to change them in place).
  Getting information about diagnostic count is frequently used in
  statusline, so it is important to be as fast as reasonbly possible.

Solution: Add `vim.diagnostic.count()` which computes severity
  counts without making copies.
2024-01-01 15:03:50 -06:00
164f1ea06d refactor(health): refactor provider healthchecks
* Prefer pure Lua functions over vim.fn
* Split up provider healthchecks into separate modules to help manage
  complexity
2024-01-01 20:12:37 +01:00
b49d4e18a6 refactor: remove redundant NOLINT comments 2024-01-01 19:57:44 +01:00
f69658bc35 feat(treesitter): highlight Lua files by default (#26824) 2024-01-01 15:37:07 +01:00
bcd111bd12 ci: write the correct cherry-picked commit id when backporting
Problem: Commits backport-merged to release branches are cherry-picked
from the original commits in the PR from a fork repository, NOT the
actual commit that are merged to neovim/neovim (HEAD). Therefore the
commit reference in the commit message `cherry picked from commit ...`
usually refers to a commit that does NOT exist in the repository,
given that our preferred way of merging PR (rebasing, squashing, etc.)
would rewrite commits.

Solution: Turn on new feature 'detect_merge_method' of backport-action
workflow.
2024-01-01 15:17:56 +01:00
7d17ab5b6f fix(l10n): update Ukrainian translations (#26819) 2024-01-01 12:22:11 +01:00
3faace1995 docs: clarify on_bytes arguments
based on extmark_splice doc
2024-01-01 12:20:19 +01:00
7cb29a572b build: ensure make clean doesn't remove source files
Adding a file to `OUTPUT` in `add_custom_command` marks that file as
`GENERATED` in cmake, and will thus be removed when running the `clean`
target. As cmake doesn't have a good way to mark that certain files
should not be removed, we instead "lie" to it by omitting the files we
want to keep from `OUTPUT`. This hack only works as long as there aren't
any other files that depend on the generated files we want to keep,
which currently seems to be the case. If this assumption changes in the
future, then we need to separate the parts that are generated and the
parts that are not as to prevent an infinite dependency chain.
2024-01-01 11:04:41 +01:00
6fa0f303d7 fix(builtin): parameter mismatch between winsaveview and winrestview 2023-12-31 14:10:53 +00:00
6f6abd8c02 refactor(tui): remove code that is no longer necessary 2023-12-31 04:56:35 +08:00
b4ef913400 Handle mouse buttons 6/7 (often used for horizontal scrolling) 2023-12-31 04:56:35 +08:00
ffe96c6c1c Ignore key_mouse unless it is exactly \e[M because some terminfos relate to different encoding modes (thanks Ninji) 2023-12-31 04:56:35 +08:00
b9cf388045 test(functional): remove faulty pending check
Problem: `functional/vimscript/api_functions_spec` skips a test if the
runtime files are not generated, but this check was broken in a
refactor.

Solution: Since runtime files are now generated for all test targets, do
not skip this test.
2023-12-30 18:09:16 +01:00
d51b615747 refactor: fix luals warnings 2023-12-30 17:40:53 +01:00
bf0be0f63e build: various improvements
- Use `#pragma once` for `cmake.config/config.h.in`
- Remove unused variable `CACHED_GENERATED_DIR`
- Reorganize and sort variables
- Introduce `STYLUA_DIRS` variable to ensure the `formatlua` and
  `lintlua-stylua` operates on the same files.
- Adjust variable scope to avoid using hacky directory properties.
- Add more necessary runtime files as test dependencies
2023-12-30 14:22:25 +01:00
c89292fcb7 refactor: follow style guide 2023-12-30 12:45:38 +01:00
d634cd5b0b vim-patch:d96f25bd69c1
runtime(fortran): update syntax and documentation (vim/vim#13784)

* Update Fortran section of indent.txt
* Small addition to fortran syntax

* Update Fortran section of syntax.txt

* Runtime (Fortran)

Fix regression

* Combine two expressions

d96f25bd69

Co-authored-by: Ajit-Thakkar <142174202+Ajit-Thakkar@users.noreply.github.com>
2023-12-30 10:53:31 +01:00
dd00b6b442 refactor(drawline): remove maybe_wlv argument for foldcolumn (#26798)
Problem:  fill_foldcolumn() has an optional winlinevars_T argument.
Solution: Increment wlv->off at callsite.
2023-12-30 09:57:57 +08:00
c5e9acca64 Merge pull request #26758 from luukvbaal/drawline
refactor(drawline): avoid writing foldopen before writing foldclosed
2023-12-29 22:13:39 +01:00
9aed26079c ci: add workflow_dispatch to optional.yml workflow
This makes it convenient to test optional.yml on release branch.
2023-12-29 20:01:20 +01:00
fe2ca7eabf refactor(drawline): avoid writing foldopen before writing foldclosed 2023-12-29 13:27:26 +01:00
1ef60ea651 vim-patch:715a8058895f
runtime(cucumber): Updates to indent and syntax

715a805889

Co-authored-by: Tim Pope <code@tpope.net>
2023-12-29 00:54:09 +01:00
51c22b9321 vim-patch:244f01658f9c
runtime(markdown): Fix folding of code blocks

244f01658f

Co-authored-by: Tim Pope <code@tpope.net>
2023-12-29 00:54:09 +01:00
7709597a1d vim-patch:a907c9199216
runtime(sass): Provide sass_recommended_style option

a907c91992

Co-authored-by: Tim Pope <code@tpope.net>
2023-12-29 00:54:09 +01:00
419f038727 vim-patch:fda02d03c0cf
runtime(gitcommit): Updates to ftplugin and syntax

fda02d03c0

Co-authored-by: Tim Pope <code@tpope.net>
2023-12-29 00:54:09 +01:00
1d71e1d987 vim-patch:757714c0cba7
runtime(git): Make diffs foldable

757714c0cb

Co-authored-by: Tim Pope <code@tpope.net>
2023-12-29 00:54:09 +01:00
ffb97af887 vim-patch:48ddc6a6f86f
runtime(git): Add small ftplugin

48ddc6a6f8

Co-authored-by: Tim Pope <code@tpope.net>
2023-12-29 00:54:09 +01:00
aecbc3f832 vim-patch:9.0.2189: Wrong display with 'briopt=sbr' and 'nobreakindent' (#26785)
Problem:  Wrong display when 'breakindentopt' contains "sbr" and
          'showbreak' and 'nobreakindent' are set.
Solution: Always reset wlv->need_showbreak regardless of the values of
          'breakindent' and 'showbreak', as they aren't checked when
          setting wlv->need_showbreak (zeertzjq)

closes: vim/vim#13785

7e4f62a257
2023-12-29 06:44:14 +08:00
31d7007bf7 docs: convert BACKERS.md to backers.txt
There is no reason for this file to be in project root, which is crowded
as is. This also fits nicely part of the ongoing work towards gathering
as much of the documentation as possible into one place.
2023-12-28 22:41:01 +01:00
2b9d3869f8 fix(drawline): don't use temporary "v" variable when not needed (#26777) 2023-12-28 19:26:59 +08:00
53a3e6ac87 docs(eval): add parameter type for vim.fn.mode() (#26776) 2023-12-28 19:13:46 +08:00
320c77fa52 vim-patch:d1cea036467c
runtime(elixir): missing undo_ftplugin for indentkeys

fixup after vim/vim#13771

d1cea03646

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-12-28 10:42:09 +01:00
ecbfff7306 vim-patch:7e2741100737
runtime(elixir): fix indentation (vim/vim#13771)

7e27411007

Co-authored-by: George Guimarães <george.guimaraes@gmail.com>
2023-12-28 10:42:09 +01:00
44c7833193 vim-patch:a03647acc313
runtime(mermaid): Syntax fix (vim/vim#13774)

* runtime(mermaid): Fix arrow syntax
* runtime(mermaid): Disable syntax for identifier to avoid false match
* runtime(mermaid): Add some C++ type syntax highlight
* runtime(mermaid): Update last change time in header

a03647acc3

Co-authored-by: KSR-Yasuda <31273423+KSR-Yasuda@users.noreply.github.com>
2023-12-28 10:42:09 +01:00
aece3a7f5f vim-patch:00b470052b71
runtime(diff): Update default links (vim/vim#13776)

Problem: Current default links for `diffAdded`, `diffChanged`, and
              `diffRemoved` do not address the diff nature of the filetype.
Solution: Use `DiffAdd`, `DiffChange`, and `DiffDelete`.

closes: vim/vim#13759

00b470052b

Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
2023-12-28 10:42:09 +01:00
714b075197 docs: small fixes (#26651)
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: WillLillis <wlillis@umass.edu>
2023-12-28 10:28:48 +08:00
JD
46ceefb52b fix(clipboard): make getreg() accurate for clipboard registers (#26740)
Problem:  getreg("*") / getreg("+") disagree with :registers.
Solution: Avoid falling back to unnamed register if provider fails.
2023-12-28 09:57:13 +08:00
e0d998dbc8 vim-patch:65672ae1189e (#26767)
runtime(doc): clarify behaviour of ]m and ]M motions

In particular remove the sentence, that a missing '{'
(for ]m) or '}' (for ]M) after the cursor is an error, since
currently this is not treated as an error.

fixes: vim/vim#13777

65672ae118

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-12-28 08:48:03 +08:00
b3940cf8a1 vim-patch:9.0.2188: cursor wrong after { in single line buffer (#26766)
Problem:  cursor wrong after { in single line buffer
          (Edwin Chan)
Solution: do not place the cursor at the end for a single
          line buffer when moving backwards
          (Gary Johnson)

closes: vim/vim#13780
closes: vim/vim#13783

9e6549d2fb

Co-authored-by: Gary Johnson <garyjohn@spocom.com>
2023-12-28 08:12:20 +08:00
d82e105727 vim-patch:9.0.2187: Visual not drawn with 'breakindent' when line doesn't fit (#26765)
Problem:  Visual selection isn't drawn with 'breakindent' when the line
          doesn't fit in the window (Jaehwang Jung)
Solution: Adjust wlv->fromcol also for 'breakindent' (zeertzjq)

closes: vim/vim#13767
closes: vim/vim#13768

23627722d3
2023-12-28 07:47:22 +08:00
7f9fc2fbf0 refactor: remove unnecessary HAVE_PATHDEF macro 2023-12-27 12:04:54 +01:00
e0eb4188bf revert: "fix: correct versions in deprecation warnings"
This reverts commit 5cb906e91c.

They were intentionally fast-tracked.

- `parse_snippet()` because of limited scope, and given that it's kinda
  semi-broken (arbitrary formatting rules, not that useful for what it
  was used for)
- `extract_completion_items()` doesn't work if we want to add the LSP
  completionlist capability
- `text_document_completion_list_to_complete_items()` also doesn't work
  for completionlist
2023-12-27 11:09:51 +01:00
8492a84bfd vim-patch:9042bd8b09ba
runtime(r): Update R runtime files and docs (vim/vim#13757)

* Update R runtime files
- Fix indentation issue with ggplot().
- Setlocal autoindent in indent/r.vim.
- New syntax option: rmd_include_latex.
- Clear syn iskeyword to recognize _ as keyword.
- Document some options.
- remove the test has("patch-7.4.1142")
- Update changed date of doc files

9042bd8b09

Co-authored-by: Jakson Alves de Aquino <jalvesaq@gmail.com>
2023-12-27 10:55:29 +01:00
6c35fb421e fix(gen_lsp.lua): improve type name, and fix wrong type inheritance
Style improvements:

1. Anonymous classes derived from `StructureLiteralType` should have a
   better name. The class name can be also nested. Examples:

```diff
----@field serverInfo? anonym1
+---@field serverInfo? lsp._anonym1.serverInfo
```
```diff
----@field insertTextModeSupport? anonym26
+---@field insertTextModeSupport? lsp._anonym26.completionItem.insertTextModeSupport
```

2. Add one separate empty line before each `@field` definition. Without
   these, empty lines the doc can look confusing because descriptions
   also may contain empty lines. See `lsp.CompletionItem` for example:

```lua
---The kind of this completion item. Based of the kind
---an icon is chosen by the editor.
---@field kind? lsp.CompletionItemKind
---Tags for this completion item.
---
---@since 3.15.0
---@field tags? lsp.CompletionItemTag[]
```

   It might feel like "Tags for this completion item" belongs to `kind`,
   not `tags` due to the lack of separator blank lines. The following
   (after this commit) should look much better:

```diff
 ---The kind of this completion item. Based of the kind
 ---an icon is chosen by the editor.
 ---@field kind? lsp.CompletionItemKind
+---
 ---Tags for this completion item.
 ---
 ---@since 3.15.0
 ---@field tags? lsp.CompletionItemTag[]
```

3. Escape some LSP-specific annotations that can't be recognized by
   lua-ls. It'd be better to make them visible in LSP hover doc windows.

   Example: `@sample ...`.

Fixes:

1. A type may extend from more than one base types (as well as mixin
   types). Previously only the first base class was being considered,
   resulting incomplete base classes for `@class` definitions.

   Example: `InlayHintOptions` (should have both of `resolveProvider`
   and `workDoneProgress`, the latter is from `WorkDoneProgressOptions`)

```diff
----@class lsp.InlayHintOptions
+---@class lsp.InlayHintOptions: lsp.WorkDoneProgressOptions
```

2. Remove `<200b>` (zero-width space) unicode characters.

3. Add the missing newline at EOF.
2023-12-27 10:48:06 +01:00
2f43af6423 refactor(gen_lsp.lua): add typing for the LSP protocol JSON data model
Enhance readability and intellisense by incorporating type annotations.
Types are not very strict and may not encompass th entire LSP Protocol
metamodel; the scope is up to what's relevant for generating type
annotations for LSP (`_meta/protocol.lua`).

Based on the model schema:
https://raw.githubusercontent.com/microsoft/language-server-protocol/gh-pages/_specifications/lsp/3.18/metaModel/metaModel.schema.json

No behavioral changes (and hence no diff on _meta/protocol.lua) should
exist in this commit.
2023-12-27 10:48:06 +01:00
3767468b96 docs(gen_lsp.lua): re-generate vim.lsp._meta.protocol type annotations
The purpose of this commit is to make diff clean and easy to read; to
see the diff resulted from actual changes in gen_lsp.lua, not from the
updated LSP protocol JSON data.

Ran: `nvim -l scripts/gen_lsp.lua gen --methods`

Based on 3.18.0 (2023-12-23)
2023-12-27 10:48:06 +01:00
382ea4d402 fix(inccommand): don't preview in Ex mode (#26587) 2023-12-27 15:18:22 +08:00
c26dc1f77c feat(defaults): map Q and @x to repeat in Visual mode (#26495) 2023-12-27 07:26:18 +08:00
5cb906e91c fix: correct versions in deprecation warnings
The following functions should be removed in 0.12 according to the
deprecation strategy in MAINTAIN.md:

- vim.lsp.util.extract_completion_items()
- vim.lsp.util.parse_snippet()
- vim.lsp.util.text_document_completion_list_to_complete_items()
2023-12-27 00:05:36 +01:00
5f9d4d8afe refactor: use vim.deprecate on all deprecated functions 2023-12-27 00:05:36 +01:00
0f22ea400c ci: disable libintl on mac release
The releases doesn't work on intel mac as libintl isn't available on the system
by default. This makes `:language` not work for the shipped macos releases,
though the reduction in build system complexity most likely outweighs that.
2023-12-26 22:46:10 +01:00
0da50da6e2 ci: remove winget workflow
All releases that aren't directly maintained by us should live in the
`neovim/neovim-releases` repository to make it clear that neovim isn't
directly responsible for it and to correctly manage expectations that
it's provided on a best-effort case.

Closes https://github.com/neovim/neovim/issues/26717.
2023-12-26 21:48:20 +01:00
0009c337bc test: simplify vim.fs tests
The exec_lua wrapper is no longer necessary.
2023-12-26 13:22:43 +01:00
ec74538044 fix(column): correct width after truncated 'statuscolumn' error (#26737)
Problem:  Default number column has incorrect width after 'statuscolumn'
          is unset due to an error, but was also truncated.
Solution: Reverse 'statuscolumn' error and truncate return branches.
2023-12-26 09:07:58 +08:00
bbd5c6363c feat(extmarks): add virt_text_repeat_linebreak flag (#26625)
Problem:  Unable to predict which byte-offset to place virtual text to
          make it repeat visually in the wrapped part of a line.
Solution: Add a flag to nvim_buf_set_extmark() that causes virtual
          text to repeat in wrapped lines.
2023-12-26 07:16:03 +08:00
0a598c13b1 feat(vim.deprecate): only issue warning if neovim version is high enough
As specified by MAINTAIN.md, features should be soft deprecated at first
(meaning no warnings) to give people a chance to adjust. The problem
with this approach is that deprecating a feature becomes harder than
usual as during the soft deprecation period you need to remember not to
issue a warning, and during the hard deprecation period you need to
remember to start issuing a warning.

This behavior is only enforced if the `plugin` parameter is `nil` as
plugins may not want this specific behavior.
2023-12-25 21:20:09 +01:00
343436f97d Merge pull request #25528 from bfredl/nocpolisp
refactor(cpoptions): remove 'p'
2023-12-25 14:29:14 +01:00
e8acbc1ade refactor(cpoptions): remove 'p'
Deleting a cpo flag a day keeps the doctor away

We don't need two different ways to indent LISP code
2023-12-25 14:13:52 +01:00
ddc8dd187d refactor(drawline): reduce size of wlv.extra[] (#26733)
It's now only used for transchar_hex(), which only needs 11 bytes.
2023-12-25 18:57:55 +08:00
a42df11786 test(extmarks): improve tests for ui_watched (#26732) 2023-12-25 15:50:58 +08:00
2877672d70 feat(health): make :checkhealth support more split modifiers (#26731) 2023-12-25 10:21:13 +08:00
2ff2785c39 feat(health): checkhealth buffer can show in a split window (#26714)
:checkhealth now respects :vertical and :horizontal.
For example:
  :vertical checkhealth foo bar
will open the healthcheck buffer in a vertical split.
2023-12-25 08:30:56 +08:00
675522af18 build: remove clint checks and style text covered by uncrustify 2023-12-24 20:50:44 +01:00
ab2aad509d refactor: follow style guide 2023-12-24 12:36:59 +01:00
84f6216130 build(deps): bump luajit to HEAD - c525bcb90 2023-12-24 09:51:10 +01:00
7fa292c52d fix(treesitter): outdated highlight due to tree with outdated region
Problem:
A region managed by an injected parser may shrink after re-running the
injection query. If the updated region goes out of the range to be
parsed, then the corresponding tree will remain outdated, possibly
retaining the nodes that shouldn't exist anymore. This results in
outdated highlights.

Solution:
Re-parse an invalid tree if its region intersects the range to be
parsed.
2023-12-24 09:47:59 +01:00
0b66ab42c7 Merge pull request #26642 from famiu/refactor/options/misc
refactor(options): miscellanous refactors
2023-12-24 14:25:08 +08:00
4587912527 refactor(options): do bound checking in validate_num_option() 2023-12-24 11:22:26 +06:00
547ccc2681 refactor(options): remove side effects from check_num_option_bounds() 2023-12-24 11:22:25 +06:00
eae6727325 refactor: remove os_errmsg and os_msg functions
Instead replace them with fprintf and printf.
2023-12-23 14:00:09 +01:00
7121241e5c vim-patch:ea9964a36f94
Runtime(fortran): updates to indent, syntax and ftplugin (vim/vim#13752)

* runtime update fortran.vim

Add folding for newer features of Fortran

* Runtime Update fortran.vim

Add indent support for newer features of Fortran

* Runtime Update fortran.vim

Add newer features of Fortran to matchit patterns

ea9964a36f

Co-authored-by: Ajit-Thakkar <142174202+Ajit-Thakkar@users.noreply.github.com>
2023-12-23 12:41:10 +01:00
373eb7b799 vim-patch:ec97edcbb9f6
runtime(debcontrol): Add loong64 arch (vim/vim#13754)

ec97edcbb9

Co-authored-by: James McCoy <jamessan@jamessan.com>
Co-authored-by: zhangjialing@loongson.cn <zhangjialing@loongson.cn>
2023-12-23 12:41:10 +01:00
c16d5729b5 refactor: remove CPO_TO_CPO_FLAGS() (#26718)
Just pass p_cpo to replace_termcodes() directly.
This allows removing option_vars.h from keycodes.h, and also avoids the
mistake of passing 0 as cpo_flags.
2023-12-23 15:53:28 +08:00
3c667d3e0f fix(mappings): fix mapset() not replacing map with backslash (#26719) 2023-12-23 15:30:44 +08:00
8f72987837 refactor(options): use OptIndex for os_idx 2023-12-23 11:09:00 +06:00
4d98ec2fa4 refactor(options): move some functions from options.c to option.c 2023-12-23 11:09:00 +06:00
1d2af15a95 refactor(options): restructure functions related to key options 2023-12-23 11:09:00 +06:00
242261d4e7 refactor(IWYU): move evalarg_T to eval_defs.h (#26716) 2023-12-23 08:28:17 +08:00
0c3d2a7fd9 build(nix): update flake.lock (#26702)
updates nixpkgs version to reflect the removal of nvim-client in the build see https://github.com/NixOS/nixpkgs/pull/274865
2023-12-23 00:50:24 +01:00
e632396bab refactor(drawline): avoid storing info to draw 'statuscolumn' (#26712)
We no longer return to the main loop in win_line() to put column
characters on the screen. Simplify and sync statuscolumn drawing
logic with that of statusline.
2023-12-23 06:31:07 +08:00
2b0acacb3c fix(decor): allow adding providers during redraw
Fixes: #26652
2023-12-22 20:27:07 +00:00
031088fc0a fix(lsp): filetype matching to documentSelector in dynamic capabilities (#25425)
Use the get_language_id client option to resolve the filetype when
matching the document selector in a dynamic capability.


Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2023-12-22 15:03:13 +01:00
2151e781e4 Merge pull request #26709 from luukvbaal/drawstatuscol 2023-12-22 19:35:26 +08:00
35d98888bd refactor(drawline): simplify draw_statuscol() and remove draw_state references 2023-12-22 12:07:15 +01:00
d9d9d94343 Merge pull request #26528 from bfredl/nodrawstate
refactor(drawline): remove LineDrawState and wlv->saved_n_extra
2023-12-22 11:49:06 +01:00
92204b06e7 refactor(lsp): move glob parsing to util (#26519)
refactor(lsp): move glob parsing to vim.glob

Moving the logic for using vim.lpeg to create a match pattern from a
glob into `vim.glob`. There are several places in the LSP spec that
use globs, and it's very useful to have glob matching as a
generally-available utility.
2023-12-22 11:40:01 +01:00
db0ec84fb4 feat(lsp): add type annotations for lsp.util.locations_to_items (#26694)
Problem: luals reported many warnings
Solution: Add type annotations
2023-12-22 11:38:02 +01:00
19aba5916a docs(options): add codeblock annotations to options.lua (#26696)
Also consistently remove leading colons in examples

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-12-22 10:55:39 +01:00
66ac327db2 refactor(drawline): remove LineDrawState and wlv->saved_n_extra
We do not need an enum to keep track of what place in win_line() we
currently are at. We already have a variable which keeps track where
in the code we currently are (and thus what part of the line we are
currently rendering), it is called the _program counter_. When we need
non-linear or self-referential control-flow anyway for a laugh, we
have a mechanism for that, it is called _function calls_.

Do not "save" and "restore" the wlv->n_extra state every time the
columns are to be drawn. This sort of thing needs to go away. Instead of
setting the n_extra variables and then going to the outer while loop,
the text in the columns can be rendered by just simply putting the text
into the cells of the screen line, right away. Even in nvim this can be
tricky sometimes, luckily we can use function calls to abstract this
logic, which means that this handy data structure called the _call
stack_ is handling saving away state temporarily, and restoring it back
when we need it again.

Lastly, but not least, as we now have direct control how signs
are rendered, these can be stored as schar_T[2] and be directly
put on screen as such.
2023-12-22 10:54:28 +01:00
ba0fa4fa19 refactor(IWYU): add "private" pragma to more generated headers (#26706)
"export" only prevents IWYU from adding these headers if the headers
that export them are included, while "private" ensures that IWYU never
adds these headers.
2023-12-22 13:32:46 +08:00
089b934352 refactor(options): generate BV_ and WV_ constants (#26705) 2023-12-22 12:24:23 +08:00
6700127b30 vim-patch:9.0.2183: Maximum callback depth is not configurable (#26703)
Problem:  Maximum callback depth is not configurable.
Solution: Revert patch 9.0.2103.  Set 'maxfuncdepth' in test.

fixes: vim/vim#13732
closes: vim/vim#13736

fe583b1e59
2023-12-22 10:33:34 +08:00
2b3d1e1854 vim-patch:0630080bbd3e (#26704)
runtime(doc): reformat and align :h ft-c-syntax (vim/vim#13738)

0630080bbd

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-12-22 08:58:51 +08:00
2a173c0669 vim-patch:18ab6c3392ef
runtime(erlang): add support for matchit plugin (vim/vim#13713)

This commit updates the Erlang runtime files to be in sync with the
`vim-erlang-runtime` repository. In particular, it adds the following
commit (with some cleanup and simplification afterwards):
6ea8b85bc9

18ab6c3392

Co-authored-by: Csaba Hoch <csaba.hoch@gmail.com>
2023-12-22 01:07:50 +01:00
a24d818840 vim-patch:37468879977a
runtime(masm): add variants of opcodes (vim/vim#13734)

that can actually be generated by compilers

3746887997

Co-authored-by: Wu Yongwei <wuyongwei@gmail.com>
2023-12-22 01:07:50 +01:00
417148f7fd vim-patch:21064ebcd609
runtime(vim): Update syntax file (vim/vim#13739)

Match all ex commands after ":" and the "|" command separator.

Exceptions are not handled yet and :insert/:change/:append are still not
matched after the command separator bar.

21064ebcd6

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-12-22 01:07:50 +01:00
1a230d77fe vim-patch:cc944b145254
runtime(json5): Add TODO support to syntax script (vim/vim#13743)

cc944b1452

Co-authored-by: Danek Duvall <duvall@comfychair.org>
2023-12-22 01:07:50 +01:00
af93a74a0f refactor: run IWYU on entire repo
Reference: https://github.com/neovim/neovim/issues/6371.
2023-12-21 17:38:42 +01:00
ade42d531b fix(build): teach cmake about vvars 2023-12-21 15:23:28 +00:00
e8d3c4cccb feat: generate types and docs for v variables 2023-12-21 14:19:10 +00:00
a8935d97ac docs: move vim-variables to separate file 2023-12-21 14:19:10 +00:00
d431a4d410 fix(runtime): source old color scheme in bundled color schemes (#26641)
Problem:
Bundled color schemes use `:hi clear` and only define Vim's highlight
groups. This results into Nvim-specific highlight groups using
definitions from Nvim's default color scheme, which are not always
linked to a Vim's highlight group.

Solution:
Restore links to Vim's highlight groups which were present before Nvim's
default color scheme update.
2023-12-21 20:53:43 +08:00
2ded2e75f4 fix(column): avoid exceeding configured 'signcolumn' width 2023-12-21 10:57:01 +00:00
720a3518e3 refactor(runtime): rewrite 'vim' color scheme in Lua
Problem: Bundled 'vim' color scheme is written in Vimscript which
  implicitly assumes that the file is ported from Vim.
  This is not the case, at it is currently the Neovim's way of providing
  backward compatibility for color schemes.

Solution: Rewrite it in Lua to indicate that this runtime file comes
  from Neovim.
2023-12-21 11:06:39 +01:00
8533adb484 refactor(IWYU): move decor provider types to decoration_defs.h (#26692) 2023-12-21 16:50:05 +08:00
8c611f53fe fixup: 2023-12-21 15:32:30 +08:00
1045659097 fix(osc52): use nvim_chan_send() to stderr for copying (#26690)
The data to be written can be very long, so use nvim_chan_send() instead
of io.stdout:write() as the latter doesn't handle EAGAIN.

A difference of these two approaches is that nvim_chan_send() writes to
stderr, not stdout, so it won't work if client stderr is redirected.
2023-12-21 11:47:04 +08:00
342c7da4bd fix(channel): use os_write() instead of fwrite() for stderr (#26689)
This handles EAGAIN.

Related #26688
2023-12-21 10:39:10 +08:00
0c120307ca refactor: eliminate cyclic includes 2023-12-20 19:52:02 +01:00
cc6a257c8c docs: apply current colorscheme to default highlight groups
Problem: Not all default highlight groups show their actual colors.
Solution: Refactor `vimhelp.lua` and apply it to all relevant lists (UI
groups, syntax groups, treesitter groups, LSP groups, diagnostic groups).
2023-12-20 18:58:40 +01:00
db4b0aeb92 docs: remove section on constants in style guide
It is needlessly restrictive and specific without good reason.
2023-12-20 18:49:54 +01:00
095bd8d0f8 fix(buffer): do not filter help buffer
Problem: If a help buffer is opened without legacy syntax set (because
treesitter is enabled), Vim strips (some) markup. This means the syntax
engine fails to parse (some) syntax if treesitter highlighting is
disabled again.

Solution: Do not strip the help buffer of markup since (legacy or
treesitter) highlighting is always enabled in Nvim. Similarly, remove
redundant setting of filetype and give the function a more descriptive
name.
2023-12-20 17:44:31 +01:00
99d1e7da28 ci(release): create version tag after "stable" tag (#26671) 2023-12-20 21:53:30 +08:00
2498747add refactor(treesitter): cleanup highlighter
- Remove some unused fields
- Prefix classes with `vim.`
- Move around some functions so the query stuff is at the top.
- Improve type hints
- Rework how hl_cache is implemented
2023-12-20 11:55:25 +00:00
365e185606 docs: document header structure
Reference: https://github.com/neovim/neovim/issues/6371
2023-12-20 12:50:38 +01:00
184f842349 vim-patch:955652f6df9c (#26667)
runtime(doc): Update change.txt (vim/vim#13725)

Fix-up and clarify commit  e06f2b498ccca921f34a1bec4464f042a5a2cabd

955652f6df

Co-authored-by: K.Takata <kentkt@csc.jp>
2023-12-20 07:02:48 +08:00
2ed784f385 vim-patch:9.0.2179: no filetype detection for execline scripts
Problem:  no filetype detection for execline scripts
Solution: Add filetype detection for execline

as a prior to adding syntax support for execline (see
https://github.com/djpohly/vim-execline/issues/2), i went ahead and made
the filetype detection for execline scripts.

closes: vim/vim#13689

Signed-Off-By: Mazunki Hoksaas <rolferen@gmail.com>

63210c214a

Co-authored-by: Mazunki Hoksaas <rolferen@gmail.com>
2023-12-19 23:48:02 +01:00
18933fc47f vim-patch:fbd72d2d4725
runtime(netrw): prevent E11 on FocusGained autocommand (vim/vim#13718)

fbd72d2d47

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-12-19 23:44:20 +01:00
f7bc8bd4d1 vim-patch:379df7c1dbb2
runtime(8th): updated 8th syntax (vim/vim#13720)

* updated 8th.vim
* removed obsolete code

379df7c1db

Co-authored-by: ronaaron <ron@aaron-tech.com>
2023-12-19 23:44:20 +01:00
c95845f3df vim-patch:9.0.2177: Wrong cursor position when dragging out of window (#26661)
Problem:  Wrong cursor position when dragging out of window.
Solution: Don't use ScreenCols[] when mouse is not in current window.

closes: vim/vim#13717

ec14924368
2023-12-20 05:58:48 +08:00
a61d8b615c vim-patch:9.0.2178: reg_executing() wrong for :normal with range (#26660)
Problem:  reg_executing() returns wrong result in :normal with range
          when 'showcmd' is set (after 8.2.4705).
Solution: Reset "pending_end_reg_executing" when executing a register.

closes: vim/vim#13707

615202bd0e
2023-12-20 05:27:18 +08:00
49efdf8413 test: "diff" flag of 'fillchars' (#26657) 2023-12-19 22:46:38 +08:00
674a20ac47 test: sign on wrapped line with signcolumn=number (#26654) 2023-12-19 21:25:33 +08:00
0c22081f62 Merge pull request #26647 from jamessan/big-endian-timeout
ci(s390x): double TEST_TIMEOUT since tests are running via qemu
2023-12-19 06:30:13 -05:00
90a12d4a16 fix(treesitter): prepare highlight states for [s, ]s 2023-12-19 12:24:06 +01:00
7f6b775b45 refactor: use bool to represent boolean values 2023-12-19 11:43:21 +01:00
693aea0e9e docs: small fixes (#26448)
Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
Co-authored-by: Jordan Mandel <jordan.mandel@live.com>
2023-12-19 13:29:13 +08:00
3d8cd0c5d3 ci(s390x): run build & test as a non-root user 2023-12-18 21:43:00 -05:00
1cf51a07a6 fix(api): don't set coladd of mark (#26648) 2023-12-19 08:01:05 +08:00
1beef6cd21 ci(s390x): double TEST_TIMEOUT since tests are running via qemu 2023-12-18 17:46:25 -05:00
80f75d063d Merge pull request #26279 from agraven/x1-x2-mouse-api
feat(api): add forward and back mouse buttons
2023-12-18 21:47:06 +01:00
428edcde70 feat(api): add forward and back mouse buttons 2023-12-18 21:24:27 +01:00
3a4aa3fc58 refactor: soft-deprecate diagnostic signs configured with :sign-define (#26618)
Diagnostic signs should now be configured with vim.diagnostic.config(),
but "legacy" sign definitions should go through the standard deprecation
process to minimize the impact from breaking changes.
2023-12-18 11:04:44 -06:00
cd1b14f027 feat(termdebug): improve :Evaluate floating window (#26621)
Problem:
- The :Evaluate result window is not cleaned up when the cursor moves.
- This window is not focusable.

Solution:
Replace the old implementation from autozimu/LanguageClient-neovim with
vim.lsp.util.open_floating_preview and implement custom focusing logic.
Also remove g:termdebug_useFloatingHover option now that it's working
correctly.
2023-12-18 15:47:01 +00:00
6cb78e2d1c docs: add style rule regarding initialization
Specifically, specify that each initialization should be done on a
separate line.
2023-12-18 16:22:13 +01:00
8c173cec29 vim-patch:b42703a662e8
runtime(tmux): Update tmux syntax rules (vim/vim#13708)

b42703a662

Co-authored-by: Eric Pruitt <eric.pruitt@gmail.com>
2023-12-18 10:25:08 +01:00
8abae7c2e4 vim-patch:71cbe8e17a8c
runtime(fortan): update fortran syntax rules and doc notes

Update to the Fortran 2023 standard. Reorganize some code to reflect the
dropping of dialect support in the previous commit. Minor improvements.

closes: vim/vim#13712

71cbe8e17a

Co-authored-by: Ajit-Thakkar <142174202+Ajit-Thakkar@users.noreply.github.com>
2023-12-18 10:25:08 +01:00
7d279a09e0 fix(lua): handle array with holes in luaeval() (#26630) 2023-12-18 12:14:37 +08:00
d956bc6379 fix(options): setting 'scroll' with resized grid (#26628) 2023-12-18 10:15:23 +08:00
6abdc1ac1f refactor: split WIN_EXECUTE() into two functions (#26627) 2023-12-18 09:05:59 +08:00
e164f4c271 docs(diagnostic): add return value of vim.diagnostic.config() (#26615) 2023-12-17 18:11:47 -06:00
75b8f4c8cb test(core/job_spec): fix flakiness (#26623) 2023-12-18 07:09:32 +08:00
d82a586a9e refactor: move some anonymous enums back to non-defs headers (#26622)
It isn't really useful to put anonymous enums only used as arguments to
functions calls in _defs.h headers, as they will only be used by a file
that calls those functions, which requires including a non-defs header.

Also move os_msg() and os_errmsg() back to message.h, as on Windows they
are actual functions instead of macros.

Also remove gettext.h and globals.h from private/helpers.h.
2023-12-18 06:18:11 +08:00
69bc519b53 refactor: move non-symbols to defs.h headers 2023-12-17 19:03:18 +01:00
c0cb1e8e94 perf(treesitter): filter out trees outside the visible range early
Problem:
Treesitter highlighter's on_line was iterating all the parsed trees,
which can be quite a lot when injection is used. This may slow down
scrolling and cursor movement in big files with many comment injections
(e.g., lsp/_meta/protocol.lua).

Solution:
In on_win, collect trees inside the visible range, and use them in
on_line.

NOTE:
This optimization depends on the correctness of on_win's botline_guess
parameter (i.e., it's always greater than or equal to the line numbers
passed to on_line). The documentation does not guarantee this, but I
have never noticed a problem so far.
2023-12-17 15:40:59 +00:00
f0eb3ca916 build: eliminate semicolons from --version string
Refactor the --version string to remove semicolons. Although semicolons are
present in LINK_OPTIONS, they are not actually included during compilation.
2023-12-17 13:55:15 +01:00
5a2536de0c refactor(lsp): move changetracking to separate file (#26577)
* refactor(lsp): move changetracking to separate file

- Prefixed changetracking types with `vim.lsp.`

* fixup!: make _reset_timer a local function

* fixup!: remove @private annotations

* fixup!: changetracking.lua -> _changetracking.lua

* fixup! types

* fixup! add send_changes_for_group
2023-12-17 09:54:38 +00:00
8f08b1efbd refactor(options): use hashy for finding options (#26573)
Problem:
`findoption()` searches through the options[] table linearly for option
names, even though hashy can be used to generate a compile-time hash
table for it.

Solution:
Use hashy to generate a compile time hash table for finding options.
This also allows handling option aliases, so we don't need separate
options[] table entries for things like 'viminfo'.
2023-12-17 07:23:33 +08:00
2b1bc94b76 docs: simplify build instructions 2023-12-16 21:49:00 +01:00
404fdb0f36 build: cmake fixes
- add EXTERNALPROJECT_OPTIONS variable to main build
- use `REQUIRED` keyword for IWYU.
- remove check_c_compiler_flag checks when `ENABLE_COMPILER_SUGGESTIONS`
  is `ON`. If we explicitly enable it then we probably want it to give
  an error if it doesn't exist, rather than silently skip it.
- Move dependency interface libraries to their find module and use them
  as a pseudo-imported target.
- Remove BUSTED_OUTPUT_TYPE. It's not used and we can reintroduce it
  again if something similar is needed.
- Use LINK_OPTIONS intead of LINK_FLAGS when generating the `--version`
  output.
2023-12-16 21:06:28 +01:00
8fb7419d7c refactor: only reload colorscheme if &bg changed (#26598)
Currently, setting &bg at all re-initializes highlights and reloads
the active colorscheme, even if the actual value of &bg has not changed.
With https://github.com/neovim/neovim/pull/26595 this causes a
regression since &bg is set unconditionally based on the value detected
from the terminal.

Instead, only reload the colorscheme if the actual value of &bg has
changed.
2023-12-16 11:18:45 -06:00
7840760776 build: bump minimum cmake version to 3.13
The benefits are primarily being able to use FetchContent, which allows
for a more flexible dependency handling. Other various quality-of-life
features such as `-B` and `-S` flags are also included.

This also removes broken `--version` generation as it does not work for
version 3.10 and 3.11 due to the `JOIN` generator expression.

Reference: https://github.com/neovim/neovim/issues/24004
2023-12-16 17:17:24 +01:00
896b400bff build: fix universal mac builds
Cmake 3.28+ will fail if two projects download the same file to prevent
scheduling problems. This can be circumvented by downloading luajit to a
unique location for each target. This is theoretically non-optimal since
we need to download the same file three times for universal builds, but
universal builds are rare and the convenience of this method outweighs
setting up the dependencies optimally. This fixes the currently broken
release workflow for mac.

Closes https://github.com/neovim/neovim/issues/26526.
2023-12-16 16:47:22 +01:00
69f5f0e20e vim-patch:82f19734bfcb
runtime(doc): remove deprecation warning for gdefault

Deprecated can be misunderstood as being slated for removal; slightly
change wording to be clearer.

82f19734bf

Co-authored-by: dundargoc <gocdundar@gmail.com>
2023-12-16 15:57:22 +01:00
bf382df84f vim-patch:0f61943eb776
runtime(logtalk): Update Logtalk runtime files for the latest language spec (vim/vim#13697)

0f61943eb7

Co-authored-by: Paulo Moura <pmoura@logtalk.org>
2023-12-16 15:57:22 +01:00
ba613d63c4 vim-patch:5eb9cb53d619
runtime(racket): update Racket runtime files (vim/vim#13693)

This brings the included Racket runtime files to commit 43bfc87 (update
headers, 2023-12-15) of https://github.com/benknoble/vim-racket. Note
that not all files from that repository are included. (In particular,
the ftdetect script is omitted for now.)

5eb9cb53d6

Co-authored-by: D. Ben Knoble <ben.knoble+github@gmail.com>
2023-12-16 15:57:22 +01:00
6b8084a6be vim-patch:0378f07fbaee
runtime(colorschemes): Update colorschemes (vim/vim#13691)

Minor changes:

- Regenerated using colortemplate 2.2.3
- Removed reversed gui-cursor for some of the colorschemes (retrobox, wildcharm, lunaperche)
- Change MatchParen for some of colorschemes.

0378f07fba

Co-authored-by: Maxim Kim <habamax@gmail.com>
2023-12-16 15:43:26 +01:00
c18f3cfcdb fix(api): crash after nvim_win_set_config title/footer validation error (#26606) 2023-12-16 21:58:04 +08:00
574519d9d6 feat(highlight): tweak default color scheme
Problem: Updating default color scheme produced some feedback.

Solution: Address the feedback.

Outline of the changes:

- Colors `Grey1` and `Grey2` are made a little bit more extreme (dark -
  darker, light - lighter) to increase overall contrast.

- `gui` colors are treated as base with `cterm` colors falling back to
  using 0-15 colors which come from terminal emulator.

- Update highlight group definition to not include attribute definition
  if it is intended to staty uncolored.

- Tweak some specific highlight groups.

- Add a list of Neovim specific highlight groups which are now defined
  differently in a breaking way.

- Minor tweaks in several other places related to default color scheme.
2023-12-16 14:43:03 +01:00
19fed6bde1 vim-patch:9.0.2168: Moving tabpages on :drop may cause an endless loop (#26605)
Problem:  Moving tabpages on :drop may cause an endless loop
Solution: Disallow moving tabpages on :drop when cleaning up the arglist
          first

Moving tabpages during drop command may cause an endless loop

When executing a :tab drop command, Vim will close all windows not in
the argument list. This triggers various autocommands. If a user has
created an 'au Tabenter * :tabmove -' autocommand, this can cause Vim to
end up in an endless loop, when trying to iterate over all tabs (which
would trigger the tabmove autocommand, which will change the tpnext
pointer, etc).

So instead of blocking all autocommands before we actually try to edit
the given file, lets simply disallow to move tabpages around. Otherwise,
we may change the expected number of events triggered during a :drop
command, which users may rely on (there is actually a test, that expects
various TabLeave/TabEnter autocommands) and would therefore be a
backwards incompatible change.

Don't make this an error, as this could trigger several times during the
drop command, but silently ignore the :tabmove command in this case (and
it should in fact finally trigger successfully when loading the given
file in a new tab). So let's just be quiet here instead.

fixes:  vim/vim#13676
closes: vim/vim#13686

df12e39b8b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-12-16 21:30:08 +08:00
a6d5bedb7d vim-patch:9.0.1892: CI: no FreeBSD 14 support (#26604)
Problem:  CI: no FreeBSD 14 support
Solution: Drop support for FreeBSD 12, add FreeBSD 14

closes: vim/vim#13059

24a95f42b8

N/A patches cirrus:

vim-patch:8.2.4853: CI with FreeBSD is a bit outdated
vim-patch:8.2.4889: CI only tests with FreeBSD 12
vim-patch:9.0.0580: no CI running for MacOS on M1
vim-patch:9.0.0596: CI on Mac M1 has the channel feature disabled
vim-patch:9.0.0668: CI on Mac M1 only uses clang
vim-patch:9.0.0676: CI on Mac M1 with gcc actually uses clang
vim-patch:9.0.1024: CI doesn't use the latest FreeBSD version
vim-patch:9.0.1904: Cirrus-CI fails because we have used all credits
vim-patch:9.0.1912: Cirrus-CI running out of credits
vim-patch:9.0.1979: Cirrus CI disabled

N/A patches github actions:

vim-patch:ed37d9b3241a
vim-patch:8.2.3450: coveralls action fails
vim-patch:8.2.3488: issue template is not easy to use
vim-patch:8.2.3500: Github CI fails to install clang
vim-patch:8.2.3785: running CI on MacOS with gcc is not useful
vim-patch:4e30b5c3bc83
vim-patch:9a4ec5a62632
vim-patch:8.2.3821: ASAN test run fails
vim-patch:8.2.3827: huntr badge does not really fit in the list
vim-patch:8.2.3891: github CI: workflows may overlap
vim-patch:8.2.4061: codecov bash script is deprecated
vim-patch:8.2.4092: MacOS CI: unnecessarily doing "Install packages"
vim-patch:8.2.4096: Linux CI: unnecessarily installing packages
vim-patch:8.2.4222: MS-Windows: clumsy way to suppress progress on CI
vim-patch:8.2.4268: CI log output is long
vim-patch:8.2.4342: CI will soon switch to other windows version
vim-patch:8.2.4351: no coverage is measured on MS-Windows CI
vim-patch:8.2.4353: CI does not use the latest Lua and Python
vim-patch:8.2.4377: CI steps for Windows are a bit unorganized
vim-patch:8.2.4433: CI: cannot see interface versions for MS-Windows
vim-patch:8.2.4743: clang 14 is available on CI
vim-patch:8.2.4764: CI uses an older gcc version
vim-patch:8.2.4768: CI: codecov upload sometimes does not work
vim-patch:8.2.4816: still using older codecov app in some places of CI
vim-patch:8.2.4856: MinGW compiler complains about unknown escape sequence
vim-patch:8.2.4986: some github actions are outdated
vim-patch:8.2.5052: CI checkout step title is a bit cryptic
vim-patch:8.2.5086: CI runs on Windows 2019
vim-patch:8.2.5119: CI uses cache v2
vim-patch:9.0.0264: CI still runs on Ubuntu 18.04
vim-patch:9.0.0267: Coverity workflow still uses Ubuntu 18.04
vim-patch:9.0.0277: Coverity CI: update-alternatives not needed with Ubuntu 20.04
vim-patch:9.0.0302: CI for Coverity is bothered by deprecation warnings
vim-patch:9.0.0305: CI lists useless deprecation warnings
vim-patch:9.0.0401: CI uses older clang version
vim-patch:9.0.0536: CI: codecov action update available
vim-patch:9.0.0570: CI for Windows is still using codecov action 3.1.0
vim-patch:9.0.0573: outdated dependencies go unnoticed
vim-patch:9.0.0593: CI actions have too many permissions
vim-patch:9.0.0704: CI runs "tiny" and "small" builds, which are the same
vim-patch:9.0.0755: huge build on macos always fails on CI
vim-patch:9.0.0759: huge build on macos does not use Perl
vim-patch:9.0.0773: huge build on macos uses dynamic Perl
vim-patch:9.0.0847: CI: not totally clear what MS-Windows version is used
vim-patch:9.0.0937: forked repositories send out useless email
vim-patch:9.0.0941: CI failures in sound dummy
vim-patch:9.0.0946: CI: Error in Coverity flow is not reported
vim-patch:9.0.1071: Codecov action version is too specific
vim-patch:9.0.1114: CI does not use the latest Python version
vim-patch:9.0.1253: CI adds repository unnecessarily
vim-patch:9.0.1289: a newer version of clang can be used for CI
vim-patch:9.0.1384: setting HOMEBREW_NO_AUTO_UPDATE is not needed with version 4
vim-patch:9.0.1473: CI does not run sound tests
vim-patch:9.0.1474: CI runs with old version of Ubuntu and tools
vim-patch:9.0.1536: CI: sound dummy stopped working
vim-patch:9.0.1541: CI: sound dummy is disabled
vim-patch:9.0.1547: Coveralls workflow on CI is commented out
vim-patch:9.0.1548: CI: check in sound-dummy module may throw an error
vim-patch:9.0.1552: CI: sound-dummy module is not installed
vim-patch:9.0.1553: CI: using slightly outdated gcc version
vim-patch:9.0.1562: mixing package managers is not a good idea
vim-patch:9.0.1646: CI: codecov may take a very long time to run
vim-patch:8f5a8d8a8bdc
vim-patch:9.0.1713: Github CI fails to load snd-dummy kernel module
vim-patch:9.0.1733: CI: cannot cache linux-modules-extra
vim-patch:9.0.1736: Github Actions times out after 20 minutes
vim-patch:9.0.1748: CI: cannot label issues automatically
vim-patch:9.0.1751: CI: labeler configuration not found
vim-patch:9.0.1764: CI: label should not be set on all yml files
vim-patch:9180633e6892
vim-patch:9.0.1819: Github CI too complex
vim-patch:213c32318419
vim-patch:9.0.1903: CI fails because snd-dummy modules missing
vim-patch:9.0.1943: CI not run with clang-17
vim-patch:9.0.1954: CI: change netrw label in labeller bot
vim-patch:198734897ead
vim-patch:50f3ec2898a4
vim-patch:4b0018feca3a
vim-patch:cb5e7a2026d3
vim-patch:f1952d9fa8ef
vim-patch:9cc95aa0d8f5
vim-patch:a40e1687e757
vim-patch:c1c3b83816c8
vim-patch:1760331ae317
vim-patch:a02fe3480f8e

N/A patches build system:

vim-patch:8.2.0591: MS-Windows: should always support IPv6
vim-patch:8.2.3507: generating proto files may fail
vim-patch:8.2.3565: Makefile dependencies are outdated
vim-patch:8.2.3863: various build flags accidentally enabled
vim-patch:8.2.4130: MS-Windows: MSVC build may have libraries duplicated
vim-patch:8.2.4220: MS-Windows: some old compiler support remains
vim-patch:8.2.4244: MS-Windows: warning from MSVC on debug build
vim-patch:8.2.4271: MS-Windows: cannot build with Ruby 3.1.0
vim-patch:8.2.4284: old mac resources files are no longer used
vim-patch:8.2.4423: "make nvcmdidxs" fails
vim-patch:8.2.4491: MS-Windows makefile dependencies are outdated
vim-patch:8.2.4517: MS-Windows: cannot specify location of sodium library
vim-patch:8.2.4524: MS-Windows: cannot build with some sodium libraries
vim-patch:8.2.4596: installing tutor binary may fail
vim-patch:8.2.5031: cannot easily run the benchmarks
vim-patch:8.2.5090: MS-Windows: vim.def is no longer used
vim-patch:8.2.5101: MS-Windows with MinGW: $CC may be "cc" instead of "gcc"
vim-patch:8.2.5153: "make uninstall" does not remove colors/lists
vim-patch:8.2.5171: dependencies and proto files are outdated
vim-patch:9.0.0029: the bitmaps/vim.ico file is not in the distribution
vim-patch:9.0.0241: "make install" does not install shared syntax file
vim-patch:9.0.0242: "make install" still fails
vim-patch:9.0.0421: MS-Windows makefiles are inconsistently named
vim-patch:9.0.0477: missing dependency may cause crashes on incomplete build
vim-patch:9.0.0542: MSVC build still has support for 2012 edition
vim-patch:9.0.0588: MorphOS build is broken
vim-patch:9.0.0594: Makefile error message causes a shell error
vim-patch:9.0.0857: selecting MSVC 2017 does not set $PLATFORM
vim-patch:9.0.0879: unnecessary nesting in makefile
vim-patch:9.0.1342: MS-Windows: linking may fail with space in directory name
vim-patch:9.0.1486: parallel make might not work
vim-patch:9.0.1630: "make clean" at the toplevel fails
vim-patch:9.0.1681: Build Failure with Perl 5.38
vim-patch:9.0.1739: Leftover files in libvterm
vim-patch:9.0.1823: Autoconf 2.69 too old
vim-patch:9.0.1839: No Makefile rule to build cscope database
vim-patch:9.0.2028: confusing build dependencies

Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2023-12-16 21:12:31 +08:00
5ed55ff14c Merge pull request #24723 from glepnir/popup
feat(complete): completeopt support popup like vim
2023-12-16 12:41:05 +01:00
e38027ef69 feat(ui): completeopt support popup like vim 2023-12-16 18:59:59 +08:00
7e7da962de Merge pull request #26512 from famiu/refactor/options/type_flags
refactor(options): remove option type macros
2023-12-16 11:39:30 +01:00
7cae94e91e vim-patch:e06f2b498ccc
runtime(doc): fix typo in change.txt

e06f2b498c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-12-16 10:29:50 +01:00
f4f7e29469 refactor(defaults): always set options, even if value hasn't changed (#26595)
Comparing against the old value before setting matched the original
C implementation, but there is no reason to use this restriction. In
particular, this inhibits using OptionSet to determine when the option
was set. If users need to handle a case where the option _changed_, it
is easy to do so in an OptionSet autocommand using v:option_new and
v:option_old (and friends).
2023-12-15 16:35:55 -06:00
0d26d192d8 vim-patch:9a775b4a2ae6 (#26588)
runtime(netrw): escape curdir in BrowseUpDir (vim/vim#13681)

 fixes vim/vim#13678

9a775b4a2a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-12-16 05:28:57 +08:00
224b2ec202 Merge pull request #26579 from gpanders/defer-set-tgc
refactor(defaults): defer setting 'termguicolors' until after VimEnter
2023-12-15 09:23:12 -06:00
d82168e41c ci: bump actions/upload-artifact from 3 to 4
Uploads are significantly faster, upwards of 90% improvement in worst case
scenarios.
2023-12-15 13:53:14 +01:00
0463403030 ci: bump actions/download-artifact from 3 to 4
Notable changes:
- Downloads are significantly faster, upwards of 90% improvement in worst case
  scenarios.
- Artifacts can be downloaded from other workflow runs and repositories when
  supplied with a PAT.
2023-12-15 13:51:51 +01:00
34f008e247 vim-patch:3afc9f2556fa
runtime(cmake): sync runtime files with upstream (vim/vim#13597)

3afc9f2556

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2023-12-15 10:30:13 +01:00
65032e03e0 vim-patch:1c97b5c0c0b4
runtime(vim): Update syntax file, fix missing for highlight (vim/vim#13668)

Fix highlighting of :for command.  Link the vimFor syntax group to the
vimCommand highlight group.

Error introduced in commit f686921

1c97b5c0c0

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-12-15 10:30:13 +01:00
7e717805be vim-patch:b52e7ac7c61c
runtime(netrw): Fix `w:netrw_bannercnt` ref error with `netrw_fastbrowse=2` (vim/vim#13659)

* NetRW: Fix `w:netrw_bannercnt` ref error with `netrw_fastbrowse=2`
* NetRW: Fix wrong `w:netrw_bannercnt` setting

closes: vim/vim#13640

b52e7ac7c6

Co-authored-by: KSR-Yasuda <31273423+KSR-Yasuda@users.noreply.github.com>
2023-12-15 10:30:13 +01:00
02e8582230 vim-patch:5a68cdf14915
runtime(sbt): do not set b:did_ftplugin before sourcing scala ftplugin(vim/vim#13657)

The `b:did_ftplugin` guard was set and prevented us from actually sourcing `ftplugin/scala.vim`. Since the latter script also sets the guard properly, we can simply remove the guard here.

5a68cdf149

Co-authored-by: Karl Yngve Lervåg <karl.yngve@lervag.net>
2023-12-15 10:30:13 +01:00
745b74162c vim-patch:f6869212c9e1
runtime(vim): Update syntax file (vim/vim#13653)

Improve variable highlighting in :let, :unlet, :const and :for commands.

Match registers and local, global and terminal option variables.

f6869212c9

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-12-15 10:30:13 +01:00
f31f260f0c build: rework --version generation
Having a dynamically generated string is more maintainable than having
multiple files.

Also add linker flags and any potential LTO flags to the --version
output.
2023-12-15 00:19:38 +01:00
165e5ececc vim-patch:17dca3cb97cd (#26584)
runtime(doc): grammar & typo fixes

closes: vim/vim#13654

17dca3cb97

Co-authored-by: Dominique Pellé <dominique.pelle@tomtom.com>
2023-12-15 06:42:29 +08:00
046efa106e vim-patch:323dda1484d9 (#26583)
runtime(termdebug): add Tbreak command

closes: vim/vim#13656

323dda1484

Co-authored-by: iam28th <artyom28th@gmail.com>
2023-12-15 06:27:49 +08:00
b0e2643cb2 refactor(defaults): defer setting 'termguicolors' until after VimEnter
This ensures that any OptionSet autocommands will fire when the value is
changed.
2023-12-14 11:42:17 -06:00
ffeb31c2f9 fix(termcap): set 'nested' on TermResponse autocommand 2023-12-14 11:38:34 -06:00
ef38fdfdc6 refactor(diagnostic): use named namespaces (#26568)
Anonymous namespaces are more difficult to extend or hook into since
they do not appear in the output of nvim_get_namespaces(). Use named
namespaces instead.
2023-12-14 09:19:33 -06:00
ddcbc5c78a docs: add comment for OSC 11 tmux passthrough (#26566) 2023-12-14 08:38:26 -06:00
7db9992445 ci: bump github/codeql-action from 2 to 3
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)
2023-12-14 14:16:35 +01:00
97bea3163a feat(lsp): more annotations 2023-12-14 12:39:18 +00:00
3c2c022e5e refactor(options): remove option type macros
Problem: We have `P_(BOOL|NUM|STRING)` macros to represent an option's type, which is redundant because `OptValType` can already do that. The current implementation of option type flags is also too limited to allow adding multitype options in the future.

Solution: Remove `P_(BOOL|NUM|STRING)` and replace it with a new `type_flags` attribute in `vimoption_T`. Also do some groundwork for adding multitype options in the future.

Side-effects: Attempting to set an invalid keycode option (e.g. `set t_foo=123`) no longer gives an error.
2023-12-14 16:46:42 +06:00
320e9c1c21 fix(extmark): only invalidate unpaired marks on deleted rows
Problem:  Unpaired marks are invalidated if its column is deleted,
          which may just be a "placeholder" column, e.g. for signs.
Solution: Only remove unpaired marks if its entire row is deleted.
2023-12-14 08:55:00 +00:00
aa05133b0e test(nvim_open_term): don't resize after creating terminal (#26570)
This makes the screen states consistently have no EOB lines.
2023-12-14 16:41:08 +08:00
619407eb54 feat(nvim_open_term): convert LF => CRLF (#26384)
Problem:
Unlike termopen(), nvim_open_term() PTYs do not carriage-return the
cursor on newline ("\n") input.

    nvim --clean
    :let chan_id = nvim_open_term(1, {})
    :call chansend(chan_id, ["here", "are", "some", "lines"])

Actual behavior:

    here
        are
           some
               lines

Expected behaviour:

    here
    are
    some
    lines

Solution:
Add `force_crlf` option, and enable it by default.
2023-12-14 16:08:00 +08:00
36552adb39 ci: add gpanders as reviewer for defaults and tui labels (#26567) 2023-12-13 20:06:59 -06:00
846714ca3e fix(tui): don't use tui->params[] for 'termsync' (#26565)
Problem:  'termsync' overwrites the first parameter of a format string
           when UNIBI_OUT() encounters an overflow.
Solution: Don't use tui->params[] for 'termsync'.
2023-12-14 09:32:05 +08:00
5aa1ba3efe fix(defaults): background detection in tmux (#26557)
Wrap the query with passthrough sequence
2023-12-14 06:16:21 +08:00
1d63a057a6 docs: fix links 2023-12-13 20:31:16 +01:00
7908dc0d15 docs: move vim-patch wiki page to runtime documentation 2023-12-13 18:31:05 +01:00
fbd0f6658f docs: add installation and build guides from wiki to repo 2023-12-13 17:53:36 +01:00
c8223007d0 docs: add code-overview from wiki to src/nvim/README.md 2023-12-13 17:52:35 +01:00
ad6c4c2e9d Merge pull request #26555 from gpanders/diagnostic-sign-fixup
Diagnostic sign fixups
2023-12-13 10:38:16 -06:00
ef58ee48f4 docs: add wiki FAQ to the runtime documentation (#26539)
Problem: Wiki contents are not discoverable and hard to maintain.
Solution: Move FAQ to runtime docs.

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2023-12-13 17:31:39 +01:00
a3b3978474 feat(diagnostics): support numhl and linehl for diagnostic signs 2023-12-13 09:56:10 -06:00
39112c72dd docs(diagnostic): fix typo in example 2023-12-13 09:43:27 -06:00
29d5ff6ac4 fix(diagnostic): check for sign namespace instead of sign group 2023-12-13 09:30:13 -06:00
8122470f83 refactor(diagnostic): set sign by using extmark (#26193)
after sign implementation refactor by using extmark, we can use
`nvim_buf_set_extmark` to set diagnostic sign instead use `sign_define`
2023-12-13 08:19:53 -06:00
e527842211 fix(termcap): only call callback for requested capabilities (#26546)
If multiple XTGETTCAP requests are active at once (for example, for
requesting the Ms capability and truecolor capabilities), then the
TermResponse autocommand may fire for capabilities that were not
requested. Instead, make sure that the provided callback is only called
for capabilities that were actually requested.
2023-12-13 08:14:30 -06:00
d65c6a0baf vim-patch:9.0.2159: screenpos() may crash with neg. column (#26542)
Problem:  screenpos() may crash with neg. column
Solution: validate and correct column

closes: vim/vim#13669

ec54af4e26
2023-12-13 06:17:50 +08:00
69ffbb76c2 feat(iter): add Iter.take (#26525) 2023-12-12 14:27:24 -06:00
1907abb4c2 fix(stream): do not close handle if it is already closing (#26537)
uv_close asserts that a handle is not already closing. We can guard
against this assertion failure by manually checking the handle's closing
status ourselves.
2023-12-12 13:19:46 -06:00
2c96f1c4f0 docs: move minimum reproduction template from wiki to repo
Instead of a markdown file, just use a lua file instead that users can
use directly.
2023-12-12 18:32:45 +01:00
5ad5f034ca docs: inline wiki page Deps.md into MAINTAIN.md 2023-12-12 18:21:33 +01:00
5ad3ed40ec docs: inline wiki page Refactoring.md into MAINTAIN.md 2023-12-12 18:19:26 +01:00
b40170f7a3 fix(lua): memory leak when using invalid syntax with exists() (#26530) 2023-12-12 20:34:02 +08:00
1d4a5cd185 feat(eval): exists() function supports checking v:lua functions (#26485)
Problem:  Vimscript function exists() can't check v:lua functions.
Solution: Add support for v:lua functions to exists().
2023-12-12 19:06:22 +08:00
e69834744b Merge pull request #26486 from glepnir/fix_linebyte
fix(eval): use no_ff instead of ffdos as condition
2023-12-12 11:57:56 +01:00
d95e3a4c9c fix: use no_ff instead of ffdos as condition
Problem: line2byte behavior is changed after commit b051b13. It no
longer return `-1` on empty buffer.

Solution: use `nof_ff` instead of `!ff_dos` as condition. Then
compatible behavior of line2byte() is restored.
2023-12-12 13:49:04 +08:00
2d33a766a1 fix(extmarks): U changed_bytes after extmark_splice (#26501)
See also: https://github.com/neovim/neovim/pull/26364
2023-12-12 11:08:25 +08:00
a9fbba81d5 test(treesitter/fold_spec): fix flakiness (#26524) 2023-12-12 10:44:17 +08:00
b76cc974b9 fix(tui): don't forget to update cursor visibility (#26523) 2023-12-12 09:44:46 +08:00
8097b4a725 Merge pull request #26506 from tomtomjhj/tsfold
fix(treesitter): improve vim.treesitter.foldexpr
2023-12-11 19:30:53 +00:00
6f75facb9d fix(treesitter): improve vim.treesitter.foldexpr
* Collect on_bytes and flush at the invocation of the scheduled callback
  to take account of commands that triggers multiple on_bytes.
* More accurately track movement of folds so that foldexpr returns
  reasonable values even when the scheduled computation is not run yet.
* Start computing folds from the line above (+ foldminlines) the changed
  lines to handle the folds that are removed due to the size limit.
* Shrink folds that end at the line at which another fold starts to
  assign proper level to that line.
* Use level '=' for lines that are not computed yet.
2023-12-12 02:29:59 +09:00
7c6f9690f7 fix(treesitter): fix indexing in foldexpr 2023-12-12 02:29:59 +09:00
b88d1fb15f test(treesitter): more foldexpr tests 2023-12-12 02:29:59 +09:00
6d698c86d0 fix(coverity): unhandled retval for marktree_itr_get_overlap() #26518
buf_signcols_validate_range() is only called in a buffer with signs, in
which the marktree is thus non-empty. Also remove a redundant comment,
condition and variable.

    *** CID 470331:  Error handling issues  (CHECKED_RETURN)
    /src/nvim/decoration.c: 824 in buf_signcols_validate_range()
    818
    819       // Allocate an array of integers holding the overlapping signs in the range.
    820       assert(row2 >= row1);
    821       int *overlap = xcalloc(sizeof(int), (size_t)(row2 + 1 - row1));
    822
    823       // First find the number of overlapping signs at "row1".
    >>>     CID 470331:  Error handling issues  (CHECKED_RETURN)
    >>>     Calling "marktree_itr_get_overlap" without checking return value (as is done elsewhere 4 out of 5 times).
    824       marktree_itr_get_overlap(buf->b_marktree, currow, 0, itr);
    825       while (marktree_itr_step_overlap(buf->b_marktree, itr, &pair)) {
    826         if (!mt_invalid(pair.start) && pair.start.flags & MT_FLAG_DECOR_SIGNTEXT) {
    827           overlap[0]++;
    828         }
    829       }
2023-12-11 08:16:35 -08:00
c95b9a32f8 build(deps): bump luajit to HEAD - ff204d035 2023-12-11 10:29:46 +01:00
3692fd4c87 feat(gen_lsp.lua): validate CLI args #26514
- Improve CLI argument parsing, rejects invalid argument and commands as
  early as possible. Also prints USAGE in the command line.
- No longer allows `--<outfile>`, use `--out <outfile>` instead.
- Print a little bit of verbose messages to better know what's going on
  rather than remaining silent at all times.
- Add type annotation `gen_lsp._opt` to avoid type warnings.
2023-12-11 01:10:00 -08:00
529498685b Merge pull request #26458 from famiu/refactor/options/optionindex 2023-12-10 16:26:08 +01:00
c675e51c2f docs(news): very, very minorly
* fix garbled item for new treesitter injection format
* add missing item for new `vim.lpeg` and `vim.re`
* use taglinks where possible
* remove redundant "Added" and "Removed" from items
2023-12-10 14:28:07 +01:00
a34cc1a44d refactor(options): define kOptIndexCount
Add a macro to indicate the option count so that we can iterate through the options[] table more clearly. This also removes the need for having an option with NULL fullname at the end of `options[]`.
2023-12-10 19:20:28 +06:00
096211a87b test: make text-only snapshots work (#26494) 2023-12-10 07:06:48 +08:00
31fbd38066 ci: fix PR labeler 2023-12-10 06:40:51 +08:00
ec3c569dd8 Merge pull request #26490 from zeertzjq/screen-repeat
test: avoid repeated screen lines in expected states
2023-12-09 22:33:31 +08:00
1037ce2e46 test: avoid repeated screen lines in expected states
This is the command invoked repeatedly to make the changes:

    :%s/^\(.*\)|\%(\*\(\d\+\)\)\?$\n\1|\%(\*\(\d\+\)\)\?$/\=submatch(1)..'|*'..(max([str2nr(submatch(2)),1])+max([str2nr(submatch(3)),1]))/g
2023-12-09 22:15:02 +08:00
5e43630a26 test: allow avoiding repeated screen lines in expected states
Allow a "*count" suffix in a screen line to repeat the screen line for
"count" times.

The change is made to Screen:expect() and Screen:get_snapshot() instead
of Screen:render() so that screen expectations generated using code can
still work and test failures can still be readable.

A snapshot is now also printed on failure so that there is no need to
run the test again with Screen:snapshot_util().
2023-12-09 22:14:50 +08:00
8be24fed8f build: remove config-specific find_package search for libuv
Having two separate find_package calls makes it harder to maintain.
2023-12-09 14:55:37 +01:00
dd81e1e334 ci: refactor CI files
Mostly rename file and variable names to be more consistent. This makes
it easier to locate them in the "Actions" tab on github.
2023-12-09 14:14:38 +01:00
bf3bc1cec9 refactor(options): convert opt_idx variables to OptIndex 2023-12-09 17:54:43 +06:00
6346987601 refactor(options): reduce findoption() usage
Problem: Many places in the code use `findoption()` to access an option using its name, even if the option index is available. This is very slow because it requires looping through the options array over and over.

Solution: Use option index instead of name wherever possible. Also introduce an `OptIndex` enum which contains the index for every option as enum constants, this eliminates the need to pass static option names as strings.
2023-12-09 17:54:43 +06:00
29aa4dd10a vim-patch:61e984e212ed (#26484)
runtime(doc): link cmdline completion to to |wildcards| and fix typos (vim/vim#13636)

The docs for cmdline completion doesn't mention that [abc] is considered
a wildcard, and |wildcards| contains more detailed information, so just
link to it.

Also fix some typos in other help files.

61e984e212
2023-12-09 15:35:45 +08:00
2ebd328a79 refactor: format casting of negative number better (#26482) 2023-12-09 11:36:11 +08:00
c651fb3042 refactor(tui): use synchronized updates around actual buf flush (#26478)
Rather than writing the synchronized update begin and end sequences into
the TUI's internal buffer (where it is later flushed to the TTY), write
these sequences directly to the TTY before and after the TUI's internal
buffer is itself flushed to the TTY.

This guarantees that a synchronized update is always used when we are
actually sending data to the TTY. This means we do not need to keep
track of the TUI's "dirty" state (any sequences which affect the TUI
state will be written in the TUI's internal buffer, which is now
guaranteed to only ever be written when a synchronized update is
active).
2023-12-09 10:44:16 +08:00
f45bf44176 vim-patch:ff0baca86523 (#26476)
runtime(syntax): unlet b:filetype_in_cpp_family for cpp & squirrel

Update runtime/syntax/cpp.vim and runtime/syntax/squirrel.vim to unlet
b:filetype_in_cpp_family as it remains set even after updating the ft of
a file manually or through a modeline, not allowing c specific keywords
to be highlighted.

Since the variable b:filetype_in_cpp_family is only used by the c.vim
syntax script, unlet it directly after sourcing the c.vim runtime file
instead of at the end of the script.

Also update the last Change Header for both files.

closes: vim/vim#13650

ff0baca865

Co-authored-by: laburnumT <laburnumtec@gmail.com>
2023-12-09 07:45:31 +08:00
b8e227b621 vim-patch:9.0.2154: The option[] array is not sorted (#26475)
Problem:  The options[] array is not sorted alphabetically.
Solution: Sort it alphabetically.  Add a test.  Avoid unnecessary loop
          iterations in findoption().

closes: vim/vim#13648

Cherry-pick Test_set_one_column() change from patch 8.2.0432.

f48558e10a
2023-12-09 07:18:21 +08:00
9706ee59d0 ci: bump actions/labeler from 4 to 5 2023-12-08 22:13:07 +01:00
f707ce76ac ci: remove python workaround
The provider tests seems to work now without this workaround.
2023-12-08 22:00:49 +01:00
a1bdf2852d fix(snippet): remove misleading comment about TM_FILENAME_BASE (#26465) 2023-12-08 21:23:46 +01:00
2289ca273c perf(column): avoid counting when max signs are removed from a range 2023-12-08 15:42:18 +00:00
808fbe67a8 test(tui_spec): update cursor_address test for flush start (#26464) 2023-12-08 11:42:17 +08:00
999e167a52 fix(tui): start flush earlier (#26463)
Problem:  TUI flush (start sync or hide cursor) only starts on a "flush"
          event, which is too late.
Solution: Start the next flush when anything will be drawn.
2023-12-08 10:25:38 +08:00
3bb5d2f219 test: use termopen() instead of :terminal more (#26462) 2023-12-08 08:00:27 +08:00
5e3c1b976a test: fix Windows tests failures (#26461) 2023-12-08 06:58:03 +08:00
75aaec1b60 Merge pull request #26456 from gpanders/ignore-vim-runtime
fix(terminal): ignore $VIM and $VIMRUNTIME in pty jobs
2023-12-07 13:02:02 -08:00
8957df4f22 test: forward $VIMRUNTIME in child nvim instances 2023-12-07 11:54:22 -08:00
9ae7d36ff5 refactor(options): split get_option_value() into smaller functions
Problem: Currently, `get_option_value()` returns 3 separate things: The actual value of the option, whether the option is hidden, and the option flags. This makes the function difficult to refactor, modify or otherwise reason about.

Solution: Split `get_option_value()` into 3 functions, each with a single purpose. This also affects `get_option_value_for()`.
2023-12-07 19:36:34 +00:00
5e78fd7784 fix(terminal): ignore $VIM and $VIMRUNTIME in pty jobs 2023-12-07 08:02:22 -08:00
b2d471ab33 fix(lua): allow nil values in serialized Lua arrays (#26329)
When we convert a Lua table to an Object, we consider the table a
"dictionary" if it contains only string keys, and an array if it
contains all numeric indices with no gaps. While rare, Lua tables can
have both strictly numeric indices and gaps (e.g. { [2] = 2 }). These
currently cannot be serialized because it is not considered an array.

However, we know the maximum index of the table and as long as all of
the keys in the table are numeric, it is still possible to serialize
this table as an array. The missing indices will have nil values.
2023-12-07 08:01:27 -08:00
4a34da82c1 perf(column): keep track of number of lines that hold up the 'signcolumn'
Problem:  The entire marktree needs to be traversed each time a sign is
          removed from the sentinel line.
Solution: Remove sentinel line and instead keep track of the number of
          lines that hold up the 'signcolumn' in "max_count". Adjust this
          number for added/removed signs, and set it to 0 when the
          maximum number of signs on a line changes. Only when
          "max_count" is decremented to 0 due to sign removal do we need
          to check the entire buffer.

          Also replace "invalid_top" and "invalid_bot" with a map of
          invalid ranges, further reducing the number of lines to be
          checked.

          Also improve tree traversal when counting the number of signs.
          Instead of looping over the to be checked range and counting
          the overlap for each row, keep track of the overlap in an
          array and add this to the count.
2023-12-07 14:22:24 +00:00
e42f03264b Merge #26426 allow empty string key in msgpack => Vim conversion 2023-12-07 05:57:31 -08:00
a16218d4c6 refactor: object_to_vim() cannot fail
Since the parent commit, object_to_vim() can't fail, so callers don't
need to check its result.
2023-12-07 13:09:31 +01:00
cca6c4c698 feat(rpc): allow empty string key in msgpack => Vim conversion
Problem:
Since e057b38e70 #20757 we support empty key in JSON encode/decode,
but we don't allow it in RPC object => Vim dict conversion. But empty
string is a valid key in Vim dicts and the msgpack spec.

Empty string key was disallowed in 7c01d5ff92 (2014) but that
commit/PR doesn't explicitly discuss it, so presumably it was a "seems
reasonable" decision (or Vimscript didn't allow empty keys until later).

Solution:
Remove the check in `object_to_vim()`. Note that
`tv_dict_item_alloc_len` will invoke `memcpy(…, 0)` but that's allowed
by the C spec: https://stackoverflow.com/a/3751937/152142
2023-12-07 12:57:25 +01:00
5fa88a7ae1 Merge pull request #26438 from jamessan/log_spec-name
fix(log): increase size of buffer for nvim instance name
2023-12-07 06:32:06 -05:00
aba954b662 fix(terminal): never propagate $COLORTERM from outer env (#26440)
If $COLORTERM is "truecolor" but the user sets 'notermguicolors',
propagating $COLORTERM to :terminal usually doesn't work well.
2023-12-07 19:14:56 +08:00
94c2703a03 test(unit): correct header name (#26446) 2023-12-07 17:02:08 +08:00
4fc31cb69f Merge pull request #26445 from zeertzjq/inccommand
fix(inccommand): don't crash with "split" and 'n' flag
2023-12-07 16:39:30 +08:00
bc5b0da84e fix(inccommand): don't crash with "split" and 'n' flag 2023-12-07 15:57:21 +08:00
93011add10 test(inccommand_spec): actually trigger 'inccommand' preview 2023-12-07 15:32:56 +08:00
1dba570e63 fix(inccommand): save and restore '[ and '] marks (#26442)
Undoing a change moves '[ and '] marks, so it is necessary to save and
restore them.
2023-12-07 12:04:02 +08:00
a4047e0b80 version.c: update (#26441)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2023-12-07 11:12:24 +08:00
6c3ddd8c51 test: set 'termguicolors' in outer Nvim instance (#26437)
Currently, the value of $COLORTERM in :terminal in tests depends on
outer environment because of 'notermguicolors'.

If $COLORTERM is not set in :terminal, an inner Nvim instance will try
to detect 'termguicolors' support, which may interfere with tests.

So set 'termguicolors' in outer Nvim instance unless $COLORTERM needs to
be overridden, and unset it in inner Nvim instance when running TUI.
2023-12-07 10:16:00 +08:00
ec80e4cb4d fix(log): increase size of buffer for nvim instance name
16 bytes is not enough room for existing usage of the buffer by the
tests, so the name may get truncated and cause log_spec test to fail:

    FAILED   test/functional/core/log_spec.lua @ 30: log messages are formatted with name or test id
    test/helpers.lua:146: retry() attempts: 51
    test/helpers.lua:155: Pattern "%.%d+%.%d/c +server_init:%d+: test log message" not found in log (last 100 lines): Xtest_logging:
        ERR 2023-11-24T23:36:34.252 T1274.2445945.0 server_init:57: test log message
        ERR 2023-11-24T23:36:34.275 T1274.2445945.0 server_init:57: test log message
2023-12-06 19:35:19 -05:00
3198598e69 fix(tui): use uv_timer_t instead of TimeWatcher for input (#26435)
Avoid scheduling on main loop.

Fix #26425
2023-12-07 07:35:52 +08:00
6b00b8a369 test(terminal): remove unnecessary string operations (#26434) 2023-12-07 07:15:37 +08:00
8bb5089974 Merge pull request #26381 from bfredl/delaycolors
fix(startup): only send one default_colors_set event during startup
2023-12-06 19:58:02 +01:00
08545bd45b Merge pull request #26407 from gpanders/default-tgc
feat(defaults): enable 'termguicolors' by default when supported by terminal
2023-12-06 10:55:50 -08:00
a5a346678a test: set notermguicolors in tests
Set 'notermguicolors' in tests which spawn a child Nvim process to force
existing tests to use 16 colors. Also refactor the child process
invocation to make things a little bit less messy.
2023-12-06 10:38:44 -08:00
8f10362cdc fix(startup): only send one default_colors_set event during startup
If the color scheme is changed in a startup script, nvim used to send
multiple default_colors_set events, one for the default color scheme
and one for the user's chosen color scheme. This would cause flicker in
some UI:s. Throttle this event until we actually start drawing on the
screen.

fixes #26372
2023-12-06 18:46:39 +01:00
ca7f8786a0 test: unreliable 'nofsync' test #26423
Followup to 27501d3b6a.

Problem:
CI sometimes fails. Something is triggering an extra fsync().

    FAILED   test/functional/core/fileio_spec.lua @ 52: fileio fsync() with 'nofsync' #8304
    test/functional/core/fileio_spec.lua💯 Expected objects to be the same.
    Passed in:
    (number) 5
    Expected:
    (number) 4

Solution:
Relax the assertion.
2023-12-06 08:26:30 -08:00
2613ba5000 feat(defaults): enable 'termguicolors' by default when supported by terminal
Enable 'termguicolors' automatically when Nvim can detect that truecolor
is supported by the host terminal.

If $COLORTERM is set to "truecolor" or "24bit", or the terminal's
terminfo entry contains capabilities for Tc, RGB, or setrgbf and
setrgbb, then we assume that the terminal supports truecolor. Otherwise,
the terminal is queried (using both XTGETTCAP and SGR + DECRQSS). If the
terminal's response to these queries (if any) indicates that it supports
truecolor, then 'termguicolors' is enabled.
2023-12-06 07:57:09 -08:00
e057b38e70 fix(json): allow objects with empty keys #25564
Problem:
Empty string is a valid JSON key, but json_decode() treats an object
with empty key as ":help msgpack-special-dict". #20757

    :echo json_decode('{"": "1"}')
    {'_TYPE': [], '_VAL': [['', '1']]}

Note: vim returns `{'': '1'}`.

Solution:
Allow empty string as an object key.

Note that we still (currently) disallow empty keys in object_to_vim() (since 7c01d5ff92):
f64e4b43e1/src/nvim/api/private/converter.c (L333-L334)

Fix #20757

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2023-12-06 07:56:04 -08:00
c84af395e8 test: 'nofsync' with deadly signal #26415
Problem:
The test for 'nofsync' swapfile preservation on a deadly signal, does
not actually assert anything.

followup to 1fd29a2884

Solution:
Check that swapfile contents are present after getting SIGTERM.
TODO: this doesn't really verify that 'fsync' was called; it still
passes with this patch:

    diff --git a/src/nvim/main.c b/src/nvim/main.c
    index 216e39f3e81c..7a635520401d 100644
    --- a/src/nvim/main.c
    +++ b/src/nvim/main.c
    @@ -838,7 +838,7 @@ void preserve_exit(const char *errmsg)
           if (errmsg != NULL) {
             os_errmsg("Vim: preserving files...\r\n");
           }
    -      ml_sync_all(false, false, true);  // preserve all swap files
    +      ml_sync_all(false, false, false);  // preserve all swap files
           break;
         }
       }

However it correctly fails with this patch, at least:

    diff --git a/src/nvim/main.c b/src/nvim/main.c
    index 216e39f3e81c..f2306c310ddc 100644
    --- a/src/nvim/main.c
    +++ b/src/nvim/main.c
    @@ -838,7 +838,6 @@ void preserve_exit(const char *errmsg)
           if (errmsg != NULL) {
             os_errmsg("Vim: preserving files...\r\n");
           }
    -      ml_sync_all(false, false, true);  // preserve all swap files
           break;
         }
       }
2023-12-06 07:11:36 -08:00
f64e4b43e1 vim-patch:6863084d3bd0
runtime(fortran): update syntax and ftplugins

closes: vim/vim#13629

6863084d3b

Co-authored-by: Ajit-Thakkar <142174202+Ajit-Thakkar@users.noreply.github.com>
2023-12-06 14:59:38 +01:00
b95eba22ff vim-patch:4e043b1fc7ee
runtime(vim): Update syntax file and syntax test (vim/vim#13632)

Add missing assignment operators (:let*=, :let/= and :let%=).

4e043b1fc7

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-12-06 14:59:38 +01:00
040369e1e4 fix(treesitter): don't forcefully open folds
Problem:
When `vim._foldupdate()` is invoked inside a scheduled callback, the
cursor may have moved to a line with a closed fold, e.g., after `dd` on
the line that is one line above a folded region. Then it opens the fold,
which is unnecessary and distracting. Legacy foldexprs do not have this
issue.

Solution:
Don't explicitly open folds on cursor.

Note:
This doesn't completely prevent spurious opening of folds. That is due
to bugs in treesitter foldexpr algorithm, which should be addressed
separately.
2023-12-06 11:00:05 +00:00
f22e9e10f9 vim-patch:8.2.3695: confusing error for missing key (#26420)
Problem:    Confusing error for missing key.
Solution:   Use the actualy key for the error. (closes vim/vim#9241)

5c1ec439f0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-12-06 16:49:40 +08:00
401ce9f3fd vim-patch:8.1.1583: set_ref_in_list() only sets ref in items (#26418)
Problem:    Set_ref_in_list() only sets ref in items.
Solution:   Rename to set_ref_in_list_items() to avoid confusion.

7be3ab2589

Omit set_ref_in_list() and set_ref_in_dict(): only used in popup window,
if_pyth and if_lua.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-12-06 15:48:16 +08:00
e718866358 refactor(options): remove SOPT type enums (#26417)
Problem: SOPT type enums (`SOPT_NUM`, `SOPT_BOOL`, `SOPT_STRING`) are no longer used anywhere.

Solution: Remove them.
2023-12-06 15:39:36 +08:00
5b40a1c09d feat(lua): implement Iter:join() (#26416) 2023-12-05 18:35:22 -08:00
cc38086039 docs: small fixes (#26243)
Co-authored-by: umlx5h <umlx5h21@protonmail.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Evan Farrar <evan@evanfarrar.com>
2023-12-06 08:04:21 +08:00
06ff540e1c vim-patch:9.0.2151: 'breakindent' is not drawn after diff filler lines (#26412)
Problem:  'breakindent' is not drawn after diff filler lines.
Solution: Correct check for whether 'breakindent' should be drawn.

closes: vim/vim#13624

588f20dece

Cherry-pick Test_diff_with_syntax() change from patch 9.0.1257.
2023-12-06 07:16:02 +08:00
4a1abc91a0 vim-patch:2103a56eab5a (#26411)
runtime(doc): remove non-existent parameter in shift-command (vim/vim#13626)

The variant with the {count} parameter is explained in the next item.

2103a56eab

N/A patches:
vim-patch:9.0.2150: Using int for errbuflen in option funcs
vim-patch:3f7855a6123c

Co-authored-by: Roy Orbitson <Roy-Orbison@users.noreply.github.com>
2023-12-06 06:44:37 +08:00
27501d3b6a test: fileio_spec is unreliable/flaky #26404
Problem:
CI sometimes fails. Something is triggering an extra fsync().

    FAILED   test/functional/core/fileio_spec.lua @ 52: fileio fsync() codepaths #8304
    test/functional/core/fileio_spec.lua:87: Expected objects to be the same.
    Passed in:
    (number) 3
    Expected:
    (number) 2
    stack traceback:
            test/functional/core/fileio_spec.lua:87: in function <test/functional/core/fileio_spec.lua:52>

Solution:
Relax the assertion to `fsync >= 2` instead of exactly 2.

(Note this is not a behavior change: the next assertion has always
checked `fsync == 4`, it's just that the intermediate 3rd fsync was
never explicitly asserted.)
2023-12-05 12:52:06 -08:00
ca4fe083e5 Merge pull request #26361 from luukvbaal/invalid
fix(extmarks): restore old position before revalidating
2023-12-05 16:13:39 +01:00
1457272726 refactor(IWYU): move marktree types to marktree_defs.h (#26402) 2023-12-05 20:05:12 +08:00
0b74ad0a64 refactor(api): complete conversion from Dictionary to Dict(opts) (#26365) 2023-12-05 19:33:57 +08:00
32c8f951bb ci: use the latest stylua version
Using `jq` is not needed as github provides a "latest" shortcut to do
what download the latest release.
2023-12-05 09:43:06 +00:00
c9828200ac vim-patch:9.0.2148: Vim does not detect pacman.log file
Problem:  Vim does not detect pacman.log file
Solution: Detect pacmanlogs and add syntax highlighting

pacman.log is a filetype common to Arch Liux and related distributions.
Add some simple syntax highlighting for the pacmanlog filetype.

closes: vim/vim#13618

1e5d66408e

Co-authored-by: Ronan Pigott <ronan@rjp.ie>
2023-12-05 09:45:13 +01:00
3159a2c28f fix(change): update fold after on_bytes (#26364)
Problem:
With vim.treesitter.foldexpr, `o`-ing two lines above a folded region
opens the fold. This does not happen with legacy foldexprs. For example,
make a markdown file with the following text (without indentation),
enable treesitter fold, and follow the instruction in the text.

    put cursor on this line and type zoo<Esc>
    initially folded, revealed by zo
    # then this fold will be opened
    initially folded, revealed by o<Esc>

Analysis:
* `o` updates folds first (done in `changed_lines`), evaluating
  foldexpr, and then invokes `on_bytes` (done in `extmark_splice`).
* Treesitter fold allocates the foldinfo for added lines (`add_range`)
  on `on_bytes`.
* Therefore, when treesitter foldexpr is invoked while running `o`, it
  sees outdated foldinfo.

Solution:
`extmark_splice`, and then `changed_lines`. This seems to be the
standard order in other places, e.g., `nvim_buf_set_lines`.
2023-12-05 08:40:48 +08:00
c3836e40a2 build: enable lintlua for test/unit/ dir #26396
Problem:
Not all Lua code is checked by stylua. Automating code-style is an
important mechanism for reducing time spent on accidental
(non-essential) complexity.

Solution:
- Enable lintlua for `test/unit/` directory.
- TODO: only `test/functional/` remains unchecked.

previous: 45fe4d11ad
previous: 517f0cc634
2023-12-04 14:32:39 -08:00
45fe4d11ad build: enable lintlua for src/ dir #26395
Problem:
Not all Lua code is checked by stylua. Automating code-style is an
important mechanism for reducing time spent on accidental
(non-essential) complexity.

Solution:
- Enable lintlua for `src/` directory.

followup to 517f0cc634
2023-12-04 13:31:57 -08:00
517f0cc634 build: enable lintlua for scripts/ dir #26391
Problem:
We don't enable stylua for many Lua scripts. Automating code-style is an
important tool for reducing time spent on accidental (non-essential)
complexity.

Solution:
- Enable lintlua for `scripts/` directory.
- Specify `call_parentheses = "Input"`, we should allow kwargs-style
  function invocations.
2023-12-04 12:38:31 -08:00
e5d7003b02 build: rework formatting to use add_glob_target
This will ensure that we can pass flags and make adjustments from the
top level cmake file instead of digging through the cmake directory.
More importantly, this will only format files that have been changed.
This has a slightly higher initial cost compared to previous solution as
all files must be initially formatted, but the gained speed up should
more than make up for it quickly.

`make formatlua` is always run due to a quirk of stylua of always changing
modification time of the file regardless if there were any changes. This is not
a major blocker as stylua is very fast.
2023-12-04 20:21:38 +01:00
66f1563c7a refactor(terminal): only remove const qualifier when necessary (#26386) 2023-12-04 20:29:51 +08:00
cf612c64b0 fix(treesitter): allow passing lang to vim.treesitter.get_node() now correctly takes opts.lang (#26360)
PROBLEM: `vim.treesitter.get_node()` does not recognize the `lang` in
the option table. This option was used in somewhere else, for instance,
`vim.treesitter.dev` (for `inspect_tree`) but was never implemented.

SOLUTION: Make `get_node()` correctly use `opts.lang` when getting a
treesitter parser.
2023-12-04 10:00:49 +01:00
589f4761ee refactor(completion): use an inline function to free cptext (#26380) 2023-12-04 15:49:31 +08:00
5651c1ff27 vim-patch:9.0.2145: wrong scrolling in insert mode with smoothscroll (#26375)
Problem:  Wrong scrolling in Insert mode with 'smoothscroll' at the
          bottom of the window.
Solution: Don't use set_topline() when 'smoothscroll' is set.

fixes: vim/vim#13612
closes: vim/vim#13613

5b4d1fcbf0
2023-12-04 06:42:47 +08:00
988b472d90 feat(treesitter): highlight help files by default (#26347) 2023-12-03 15:58:27 +01:00
0d885247b0 Merge pull request #26334 from echasnovski/default-colorscheme
feat(highlight): update default color scheme
2023-12-03 11:59:00 +08:00
481a315886 refactor: remove unused file ringbuf.h 2023-12-02 19:02:20 +01:00
64a14026d7 feat(highlight): update default color scheme
Problem: Default color scheme is suboptimal.

Solution: Start using new color scheme. Introduce new `vim` color scheme
for opt-in backward compatibility.

------
Main design ideas
- Be "Neovim branded".
- Be minimal for 256 colors with a bit more shades for true colors.
- Be accessible through high enough contrast ratios.
- Be suitable for dark and light backgrounds via exchange of dark and
  light palettes.

------
Palettes

- Have dark and light variants. Implemented through exporeted
  `NvimDark*` and `NvimLight*` hex colors.

- Palettes have 4 shades of grey for UI elements and 6 colors (red,
  yellow, green, cyan, blue, magenta).

- Actual values are computed procedurally in Oklch color space based on
  a handful of hyperparameters.

- Each color has a 256 colors variant with perceptually closest color.

------
Highlight groups

Use:

- Grey shades for general UI according to their design.

- Bold text for keywords (`Statement` highlight group). This is an
  important choice to increase accessibility for people with color
  deficiencies, as it doesn't rely on actual color.

- Green for strings, `DiffAdd` (as background), `DiagnosticOk`, and some
  minor text UI elements.

- Cyan as main syntax color, i.e. for function usage (`Function`
  highlight group), `DiffText`, `DiagnosticInfo`, and some minor text UI
  elements.

- Red to generally mean high user attention, i.e. errors; in particular
  for `ErrorMsg`, `DiffDelete`, `DiagnosticError`.

- Yellow very sparingly only with true colors to mean mild user
  attention, i.e. warnings. That is, `DiagnosticWarn` and `WarningMsg`.

- Blue very sparingly only with true colors as `DiagnosticHint` and some
  additional important syntax group (like `Identifier`).

- Magenta very carefully (if at all).

------
Notes

- To make tests work without relatively larege updates, each one is
  prepended with an equivalent of the call `:colorscheme vim`.

  Plus some tests which spawn new Neovim instances also now use 'vim'
  color scheme.

  In some cases tests are updated to fit new default color scheme.
2023-12-02 18:53:19 +02:00
17f3a3ae31 build(nix): update flake.lock
Flake lock file updates:
• Updated input 'flake-utils':
    'github:numtide/flake-utils/a1720a10a6cfe8234c0e93907ffe81be440f4cef' (2023-05-31)
  → 'github:numtide/flake-utils/ff7b65b44d01cf9ba6a71320833626af21126384' (2023-09-12)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/a64b73e07d4aa65cfcbda29ecf78eaf9e72e44bd' (2023-06-08)
  → 'github:nixos/nixpkgs/e92039b55bcd58469325ded85d4f58dd5a4eaf58' (2023-11-29)
2023-12-02 12:50:15 +01:00
1cc358aed6 fix(extmarks): restore old position before revalidating 2023-12-02 12:35:52 +01:00
c45d1e32a9 Merge pull request #26358 from zeertzjq/vim-9.0.2140
vim-patch:9.0.{2140,2141,2142,2143}
2023-12-02 10:56:40 +08:00
9d7544ac4c vim-patch:9.0.2143: [security]: buffer-overflow in ex_substitute
Problem:  [security]: buffer-overflow in ex_substitute
Solution: clear memory after allocating

When allocating the new_start pointer in ex_substitute() the memory
pointer points to some garbage that the following for loop in
ex_cmds.c:4743 confuses and causes it to accessing the new_start pointer
beyond it's size, leading to a buffer-overlow.

So fix this by using alloc_clear() instead of alloc(), which will
clear the memory by NUL and therefore cause the loop to terminate
correctly.

Reported by @henices, thanks!

closes: vim/vim#13596

abfa13ebe9

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-12-02 10:41:31 +08:00
9cc346119b vim-patch:9.0.2142: [security]: stack-buffer-overflow in option callback functions
Problem:  [security]: stack-buffer-overflow in option callback functions
Solution: pass size of errbuf down the call stack, use snprintf()
          instead of sprintf()

We pass the error buffer down to the option callback functions, but in
some parts of the code, we simply use sprintf(buf) to write into the error
buffer, which can overflow.

So let's pass down the length of the error buffer and use sprintf(buf, size)
instead.

Reported by @henices, thanks!

b39b240c38

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-12-02 10:41:31 +08:00
01edcd6db8 vim-patch:9.0.2141: [security]: buffer-overflow in suggest_trie_walk
Problem:  [security]: buffer-overflow in suggest_trie_walk
Solution: Check n before using it as index into byts array

Basically, n as an index into the byts array, can point to beyond the byts
array. So let's double check, that n is within the expected range after
incrementing it from sp->ts_curi and bail out if it would be invalid.

Reported by @henices, thanks!

0fb375aae6

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-12-02 10:41:31 +08:00
7402655132 vim-patch:9.0.2140: [security]: use-after-free in win-enter
Problem:  [security]: use-after-free in win-enter
Solution: validate window pointer before calling win_enter()

win_goto() may stop visual mode, if it is active. However, this may in
turn trigger the ModeChanged autocommand, which could potentially free
the wp pointer which was valid before now became stale and points to now
freed memory.

So before calling win_enter(), let's verify one more time, that the
wp pointer still points to a valid window structure.

Reported by @henices, thanks!

eec0c2b3a4

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-12-02 10:41:31 +08:00
387c5ba3de revert: "memory: Free buffers after freeing variables" (#26356)
This reverts commit fe30d8ccef.

The original commit intends to prevent heap-use-after-free with EXITFREE
caused by changedtick_di, which is no longer a problem.

Freeing buffers after freeing variables will cause heap-use-after-free
with EXITFREE when a partial is used as prompt callback.
2023-12-02 09:55:11 +08:00
fedbf32250 vim-patch:9.0.2139: html.angular ft is problematic (#26357)
Problem:  html.angular ft is problematic
Solution: partly revert v9.0.2137

The html.angular filetype causes issues and does not trigger FileType
autocommands for the html or angular filetypes.

So let's roll back that particular change and detect this only as html
file

related: https://github.com/vim/vim/pull/13594#issuecomment-1834465890

closes: vim/vim#13604

4f3480c943

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-12-02 09:42:16 +08:00
f6e5366d00 refactor: free more reachable memory with EXITFREE (#26349)
Discovered using __sanitizer_print_memory_profile().
2023-12-02 07:55:44 +08:00
983defd284 refactor: remove kbtree.h 2023-12-01 20:46:07 +01:00
c58b2ee58e refactor: remove SIZEOF_INT check
I have not seen any indication that this is a problem tha can occur with
cmake.
2023-12-01 19:44:40 +01:00
ce6fefbab9 ci: create setup action
This deduplicates common operations.
2023-12-01 16:59:23 +01:00
76a30f2bd0 refactor: move float_relative_str[] to nvim_win_get_config() (#26344)
It's only used in one place, as it's usually conveyed as non-string.
2023-12-01 16:37:09 +08:00
548f03c66c refactor: change event_create() to a macro (#26343)
A varargs functions can never be inlined, so a macro is faster.
2023-12-01 15:22:22 +08:00
130cb4815a fix(api): use a conditional stack for nvim_cmd (#26341) 2023-12-01 13:56:04 +08:00
0bbe8e7fc2 refactor(IWYU): fix includes for highlight_group.h (#26340) 2023-12-01 09:38:04 +08:00
09e93d7c4d refactor(IWYU): create {ex_getln,rbuffer,os/fileio}_defs.h (#26338) 2023-12-01 08:06:37 +08:00
b32b5b2711 fix: use BEL to terminate OSC 11 request (#26335) 2023-11-30 16:17:38 -06:00
5e1ff4302f Merge pull request #25870 from dundargoc/build/libtermkey
build: vendor libtermkey
2023-11-30 13:56:54 -06:00
5d3562d810 docs: update MAINTAIN.md 2023-11-30 13:50:51 -06:00
50f5864dd2 fix(termkey): include IO header on Windows 2023-11-30 12:22:53 -06:00
5999214c24 fix(termkey): accept BEL (0x07) as OSC terminator 2023-11-30 12:02:10 -06:00
ce2f770aaa fix(termkey): do not sign extend mode value 2023-11-30 12:02:10 -06:00
404043e74c build: vendor libtermkey
This is a proof of concept/WIP to evaluate the viability of vendoring
libtermkey as it's been deprecated.
2023-11-30 12:02:10 -06:00
307d5bcc79 vim-patch:9.0.2137: Can't detect angular & mustache filetypes
Problem:  Can't detect angular & mustache filetypes
Solution: Detect *.mustache as Mustache filetype;
          detect *.component.html as html.angular filetype

closes: vim/vim#13594

7bed263c34
2023-11-30 18:40:27 +01:00
7feed6ccb7 refactor: explicitly abort on OOM condition (#26330)
assert() would not abort in release builds, meaning an OOM condition
would be undetected.
2023-11-30 11:05:33 -06:00
f5573fba3d fix: Remove nested for_each_tree in TSTreeView (#26328)
Problem:
`LanguageTree:for_each_tree` calls itself for child nodes, so when we
calls `for_each_tree` inside `for_each_tree`, this quickly leads to
exponential tree calls.

Solution:
Use `pairs(child:trees())` directly in this case, as we don't need the
extra callback for each children, this is already handled from the outer
`for_each_tree` call
2023-11-30 10:37:42 -06:00
758fdc287d refactor: suppress unused variable warnings in release builds (#26327) 2023-11-30 09:31:25 -06:00
a6f26c86cb refactor(IWYU): fix includes for cmdhist.h (#26324) 2023-11-30 22:48:15 +08:00
884a83049b fix(tui): grow termkey's internal buffer for large escape sequences (#26309)
Some escape sequences (in particular, OSC 52 paste responses) can be
very large, even unbounded in length. These can easily overflow
termkey's internal buffer. In order to process these long sequences,
dynamically grow termkey's internal buffer.
2023-11-30 08:04:33 -06:00
01b91deec7 fix(treesitter): fix parens stacking in inspector display (#26304)
When first opened, the tree-sitter inspector traverses all of the nodes
in the buffer to calculate an array of nodes. This traversal is done
only once, and _all_ nodes (both named and anonymous) are included.
Toggling anonymous nodes in the inspector only changes how the tree is
drawn in the buffer, but does not affect the underlying data structure
at all.

When the buffer is traversed and the list of nodes is calculated, we
don't know whether or not anonymous nodes will be displayed in the
inspector or not. Thus, we cannot determine during traversal where to
put closing parentheses. Instead, this must be done when drawing.

When we draw, the tree structure has been flatted into a single array,
so we lose parent-child relationships that would otherwise make
determining the number of closing parentheses straightforward. However,
we can instead rely on the fact that a delta between the depth of a node
and the depth of the successive node _must_ mean that more closing
parentheses are required:

  (foo
    (bar)
  (baz)  ↑
         │
         └ (bar) and (baz) have different depths, so (bar) must have an
           extra closing parenthesis

This does not depend on whether or not anonymous nodes are displayed and
so works in both cases.
2023-11-30 07:04:20 -06:00
52d738826c ci(release): perform a full checkout when building (#26323)
Ref #13471
2023-11-30 21:03:25 +08:00
c8e37a589a refactor(IWYU): move typedefs out of globals.h (#26322) 2023-11-30 19:52:23 +08:00
3b6dd8608d Merge pull request #23657 from luukvbaal/extmark
fix(extmark): restore extmarks when completing original text
2023-11-30 11:48:16 +01:00
95dbf1af73 refactor: move extern variables out of _defs.h files (#26320) 2023-11-30 18:41:52 +08:00
ce56e0a845 refactor(IWYU): move UI and LineFlags to ui_defs.h (#26318) 2023-11-30 17:16:57 +08:00
543e0256c1 build: don't define FUNC_ATTR_* as empty in headers (#26317)
FUNC_ATTR_* should only be used in .c files with generated headers.
Defining FUNC_ATTR_* as empty in headers causes misuses of them to be
silently ignored. Instead don't define them by default, and only define
them as empty after a .c file has included its generated header.
2023-11-30 15:51:05 +08:00
85be914879 test: unskip more terminal tests on Windows (#26315) 2023-11-30 10:55:21 +08:00
62dff43947 test(ex_terminal_spec): match descriptions (#26314) 2023-11-30 08:56:21 +08:00
463b577afb Merge pull request #25994 from luki446/windows-path-terminal-fix
Fix a bug in usage of windows-style paths as SHELL path.
2023-11-30 07:56:47 +08:00
90b213990f test: :terminal when 'shell' uses backslashes 2023-11-30 07:32:28 +08:00
5ca6c9e046 fix(terminal): make backslashes in 'shell' work on Windows
If backslashes are used in 'shell' option, escape them to make Terminal
mode work.
2023-11-30 07:32:28 +08:00
65de1a22c4 ci(lintcommit): fix empty and period check with multiple colons (#26312) 2023-11-30 07:31:22 +08:00
73691b6c3d test(ex_terminal_spec): unskip tests that work on Windows (#26310) 2023-11-30 07:06:23 +08:00
8e97edb93f fix(extmark): restore extmarks when completing original text 2023-11-29 23:38:27 +01:00
8594b0858f vim-patch:a9058440b7b9
runtime(html): Update syntax file (vim/vim#13591)

Add missing search element and update ARIA attribute list.

Add a very basic test file to check all elements are matched.

a9058440b7

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-11-29 21:00:07 +01:00
4a8bf24ac6 fix(treesitter): adjust indentation in inspector highlights (#26302) 2023-11-29 10:17:53 -06:00
400b7842a9 fix(termcap): escape escapes in passthrough sequence (#26301)
When using the tmux passthrough sequence any escape characters in the
inner sequence must be escaped by adding another escape character.
2023-11-29 09:49:44 -06:00
9b4b23493d fix(defaults): wait until VimEnter to set background (#26284)
The OptionSet autocommand does not fire until Vim has finished starting,
so setting 'background' before the VimEnter event would not fire the
OptionSet event. The prior implementation also waited until VimEnter to
set 'background', so this was a regression introduced when moving
background detection into Lua.
2023-11-29 09:43:11 -06:00
86cc791deb refactor: move function macros out of vim_defs.h (#26300) 2023-11-29 23:10:21 +08:00
18c1fd8e9d docs: document TSNode:byte_length() (#26287)
Also update the type annotation of TSNode:id(), which returns a string,
not an integer.
2023-11-29 08:59:36 -06:00
b6e339eb90 fix(treesitter): make InspectTree correctly handle nested injections (#26085)
Problem: Only injections under the top level tree are found.

Solution: Iterate through all trees to find injections. When two
injections are contained within the same node in the parent tree, prefer
the injection with the larger byte length.
2023-11-29 08:16:52 -06:00
7bc5ee7f93 fix(treesitter): use proper query syntax for inspector (#26274) 2023-11-29 08:10:02 -06:00
a6cba103ce refactor: move some constants out of vim_defs.h (#26298) 2023-11-29 20:32:40 +08:00
f4001d27ef perf(column): only invalidate lines affected by added sign 2023-11-29 10:17:15 +00:00
584c6c25cc Merge pull request #26292 from luukvbaal/decor
fix(decorations): do not apply sign highlight id as range attr id
2023-11-29 11:12:25 +01:00
640680ccce vim-patch:9.0.2134: ml_get error when scrolling (#26264)
Problem:  ml_get error when scrolling after delete
Solution: mark topline to be validated in main_loop
          if it is larger than current buffers line
          count

reset_lnums() is called after e.g. TextChanged autocommands and it may
accidentally cause curwin->w_topline to become invalid, e.g. if the
autocommand has deleted some lines.

So verify that curwin->w_topline points to a valid line and if not, mark
the window to have w_topline recalculated in main_loop() in
update_topline() after reset_lnums() returns.

fixes: vim/vim#13568
fixes: vim/vim#13578

c4ffeddfe5

The error doesn't happen in Nvim because Nvim triggers TextChanged after
calling update_topline().

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-29 13:24:24 +08:00
64b53b71ba refactor(IWYU): create normal_defs.h (#26293) 2023-11-29 12:10:42 +08:00
a0e9ef09d7 fix(decorations): do not apply sign highlight id as range attr id 2023-11-29 03:57:23 +01:00
8868ecd401 vim-patch:9.0.2136: MSVC errorformat can be improved (#26283)
Problem:  MSVC errorformat can be improved
Solution: parse error type and column number in MSVC errorformat

closes: vim/vim#13587

8ceb99001b

Co-authored-by: Shawn Hatori <shawn.hatori@gmail.com>
2023-11-29 07:22:13 +08:00
a9b4dc9614 fix(man): set the nested flag for the BufReadCmd autocommand (#26285)
The nested flag must be set so that other autocommands can fire while
the BufReadCmd is still executing.
2023-11-28 17:02:44 -06:00
aa9d9cafd0 vim-patch:9.0.2135: No test for mode() when executing Ex commands (#26282)
Problem:  No test for mode() when executing Ex commands
Solution: Add some test cases and simplify several other test cases.
          Also add a few more test cases for ModeChanged.

closes: vim/vim#13588

fcaeb3d42b
2023-11-29 06:51:00 +08:00
b7831c7f99 fix(termcap): use tmux passthrough sequence when running in tmux (#26281)
tmux intercepts and ignores XTGETTCAP so wrap the query in the tmux
passthrough sequence to make sure the query arrives at the "host"
terminal.

Users must still set the 'allow-passthrough' option in their tmux.conf.
2023-11-28 16:34:18 -06:00
79b6ff28ad refactor: fix headers with IWYU 2023-11-28 22:23:56 +01:00
d85e9935f2 Merge pull request #26276 from luukvbaal/decor
refactor(decor): remove sign conditions that are always true
2023-11-28 20:39:59 +01:00
bcaff309b6 build: disable UnusedIncludes from clangd
Include Cleaner is enabled by default since clangd 17 and gives
incorrect suggestions.
2023-11-28 20:22:59 +01:00
898f8d1f0b refactor(decor): remove sign conditions that are always true 2023-11-28 19:23:57 +01:00
35cec0de4a fix(column): redraw and update signcols for paired extmark
Problem:  Signcolumn width does not increase when ranged sign does not
          start at sentinel line.
Solution: Handle paired range of added sign when checking signcols.
2023-11-28 16:44:20 +00:00
adb2258345 fix(rplugin): dont create data dir if it's a broken symlink #25726
Checking if it's non-empty and not a directory gets us quite far, but
not all the way. While a working symlink would trigger the earlier
checks, a broken symlink does not.

This commit fixes the special case where ~/.local/share/nvim  already
exists but is a broken symlink. Thus, it fixes the following error on
startup:

E739: Cannot create directory /home/samuel/.local/share/nvim: file
already exists
2023-11-28 03:17:39 -08:00
c9f53d0e40 refactor: iwyu (#26269) 2023-11-28 19:00:14 +08:00
ba564442ae Merge pull request #26249 from bfredl/concealchar
feat(decoration): allow conceal_char to be a composing char
2023-11-28 11:01:21 +01:00
ae3685798d feat(decoration): allow conceal_char to be a composing char
decor->text.str pointer must go. This removes it for conceal char,
in preparation for a larger PR which will also handle the sign case.

By actually allowing composing chars for a conceal chars, this
becomes a feature and not just a refactor, as a bonus.
2023-11-28 10:35:25 +01:00
71e954ad30 refactor(IWYU): fix includes for ugrid.h (#26267) 2023-11-28 17:01:27 +08:00
570367ac83 docs(lua): don't include remote-only API functions (#26266) 2023-11-28 13:52:17 +08:00
e6d38c7dac vim-patch:9.0.2133: Cannot detect overstrike mode in Cmdline mode (#26263)
Problem:  Cannot detect overstrike mode in Cmdline mode
Solution: Make mode() return "cr" for overstrike

closes: vim/vim#13569

d1c3ef1f47
2023-11-28 11:46:20 +08:00
1a8f60c7d2 refactor: move hashtab types to hashtab_defs.h (#26262) 2023-11-28 10:47:22 +08:00
3a3474371b refactor(options): replace p_force_(on|off) with immutable (#26209)
Problem: We use the `p_force_on` and `p_force_off` variables to check if a variable is immutable and what its default value is. This is not only hacky and unintuitive, but also is limited to only boolean options.

Solution: Replace `p_force_on` and `p_force_off` with an `immutable` property for options, which indicates if an option is immutable. Immutable options cannot be changed from their default value.

Ref: #25672.
2023-11-28 08:15:26 +08:00
a314703cf1 vim-patch:9.0.2131: not all nushell files detected (#26260)
Problem:  not all nushell files detected
Solution: use *.nu to detect nushell files

closes: vim/vim#13586

b9efc72c24

Co-authored-by: Daniel Buch Hansen <boogiewasthere@gmail.com>
2023-11-28 07:58:31 +08:00
718053b7a9 refactor: fix runtime_defs.h (#26259) 2023-11-28 07:47:36 +08:00
6c14ae6bfa refactor: rename types.h to types_defs.h 2023-11-27 21:57:51 +01:00
e3f735ef10 refactor: fix includes for api/autocmd.h 2023-11-27 21:53:07 +01:00
f9231603c4 refactor: fix includes for iconv.h 2023-11-27 21:52:34 +01:00
ab7c0e9904 refactor: create runtime_defs.h 2023-11-27 21:35:21 +01:00
e38a053692 build(IWYU): export generated headers 2023-11-27 19:33:42 +01:00
f4aedbae4c build(IWYU): fix includes for undo_defs.h 2023-11-27 19:33:17 +01:00
8b428ca8b7 build(IWYU): fix includes for func_attr.h 2023-11-27 18:06:57 +01:00
LW
9fa9b3cad9 docs: support @since for api level #25574
close #25416
2023-11-27 08:23:04 -08:00
72ed99319d fix(treesitter): don't invalidate parser when discovering injections
When parsing with a range, languagetree looks up injections and adds
them if needed. This explicitly invalidates parser, making `is_valid`
report `false` both when including and excluding children.

This is an attempt to describe desired behaviour of `is_valid` in tests,
with what ended up being a single line change to satisfy them.
2023-11-27 15:53:26 +01:00
40139738eb build: enable IWYU on mac 2023-11-27 15:50:45 +01:00
5b765fcab4 ci: fix api-docs workflow
`git diff-index` only works for tracked files, and unchanged
documentation files counts as untracked when shallow cloning.
2023-11-27 14:44:03 +01:00
38a20dd89f build(IWYU): replace most private mappings with pragmas (#26247) 2023-11-27 20:58:37 +08:00
acf5252879 refactor: remove vim.h from more headers (#26244) 2023-11-27 18:37:35 +08:00
a03bd2b878 test: check vim.wait() error message in fast context (#26242) 2023-11-27 18:24:32 +08:00
2c16c6a6c4 docs: small fixes (#26154) 2023-11-27 17:43:13 +08:00
574d25642f refactor: move Arena and ArenaMem to memory_defs.h (#26240) 2023-11-27 17:21:58 +08:00
84bbe4b0ca fix(lua): disallow vim.wait() in fast contexts
`vim.wait()` cannot be called in a fast callback since the main loop
cannot be run in that context as it is not reentrant

Fixes #26122
2023-11-27 09:09:21 +00:00
6343d41436 refactor: move autocmd types to autocmd_defs.h (#26239) 2023-11-27 11:17:04 +08:00
09541d514d build(IWYU): replace public-to-public mappings with pragmas (#26237) 2023-11-27 09:51:26 +08:00
7e2387f41b build(clint): more precise check for "defs" headers (#26236) 2023-11-27 08:34:06 +08:00
c2a5105e88 build(IWYU): remove arabic_defs.h (#26235)
A _defs header is only needed if it's included by multiple files.
2023-11-27 07:41:43 +08:00
3514b26a5d Merge pull request #26233 from bfredl/strictchar
refactor(encoding): remove redundant vim_isprintc_strict
2023-11-26 22:41:40 +01:00
71141e8cf5 build(IWYU): fix headers for arabic.h 2023-11-26 22:15:53 +01:00
a917da4ca5 refactor(encoding): remove redundant vim_isprintc_strict
This function is identical to vim_isprintc when encoding=utf-8 is used
As this is the only internal encoding nvim supports, it is now redundant

ref #2905
2023-11-26 21:53:07 +01:00
27fc11c048 vim-patch:cf40409e7d17
runtime(nginx): add additional nginx keywords (vim/vim#13581)

* Add support for missing keywords to the nginx syntax plugin

This adds support for several keywords from
- the built-in HTTP/2 module,
- the built-in SSL module,
- the built-in uWSGI module,
- the experimental QUIC branch,
- the third-party SSL CT module,
- the third-party dynamic TLS records patch.

Co-Author: ObserverOfTime <chronobserver@disroot.org>

* Add missing http2/ http3 keywords to nginx plugin

cf40409e7d

Co-authored-by: Chris Aumann <me@chr4.org>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-26 16:17:03 +01:00
6361806aa2 refactor: move garray_T to garray_defs.h (#26227) 2023-11-26 22:58:52 +08:00
34509bbea3 build: sync IWYU and clint to ignore the same headers (#26228)
Also fix headers for autocmd.c.
2023-11-26 22:34:29 +08:00
ce6075f82a build: add check to clint to prevent non-defs header includes
Also enable iwyu on headers, but add an ignore for each file separately.

Work on https://github.com/neovim/neovim/issues/6371.
2023-11-26 15:06:51 +01:00
17d81ac2ab build(IWYU): map everything in the C99 specification 2023-11-26 12:13:25 +01:00
38e98754a5 vim-patch:9.0.2128: runtime(swig): add syntax and filetype plugins
Add syntax and filetype plugins for SWIG (Simplified Wrapper Interface
Generator) description files.

The default syntax for .i files highlights comments in a reverse
color scheme which doesn't look well.  This syntax builds
on vim's c++ syntax by adding highlighting for common swig
directives and user defined directives.  For an alternative
syntax, see vimscript vim/vim#1247 (which I found after writing this).

closes: vim/vim#13562

2e31065a65

Co-authored-by: Julien Marrec <julien.marrec@gmail.com>
Co-authored-by: Matěj Cepl <mcepl@cepl.eu>
2023-11-26 00:41:59 +01:00
ba88fd886a fix(health): malformed call to warn() #26217 2023-11-25 13:03:32 -08:00
a827003e30 build: rework IWYU mapping files
Create mapping to most of the C spec and some POSIX specific functions.
This is more robust than relying files shipped with IWYU.
2023-11-25 17:41:33 +01:00
03b7d35b54 vim-patch:813a538bb3ce
runtime(tsx): add indentation plugin (fixes vim/vim#13574) (vim/vim#13576)

for now, let's just use the typescript indent file.

813a538bb3

Co-authored-by: Jōshin <mrdomino@gmail.com>
2023-11-25 17:33:05 +01:00
fc4385ad94 docs: vim.iter #26169
closes #24141
closes #24746
2023-11-25 06:35:31 -08:00
0da62b579f Merge pull request #26203 from jamessan/swapfile-test-fix
fix(oldtest): always use a 64-bit int for swapfile block number
2023-11-25 07:08:27 -05:00
aad701abe7 docs: recommend testing nightly or stable for bug reports 2023-11-25 12:36:57 +01:00
ee276f8758 vim-patch:8.2.4685: when a swap file is found for a popup there is no dialog (#26207)
Problem:    When a swap file is found for a popup there is no dialog and the
            buffer is loaded anyway.
Solution:   Silently load the buffer read-only. (closes vim/vim#10073)

188639d75c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-25 10:50:51 +08:00
6a2a37b1e1 fix(mouse): avoid dragging when clicking next to popupmenu (#26201) 2023-11-25 07:10:19 +08:00
a1ded1b113 fix(oldtest): always use a 64-bit int for swapfile block number
09d4133 changed blocknr_T from long to int64_t, so pe_bnum is now always 64-bit.  This was an incompatible change in the swapfile format for 32-bit systems, but there have been no complaints in the past 9 years so just adjust the test.
2023-11-24 15:22:00 -05:00
53cc835b51 refactor(tui): remove unnecessary scheduling when suspending (#26190)
Nvim no longer calls loop_poll_events() when suspending, so it isn't
necessary to schedule suspend_event.
2023-11-24 11:31:07 +08:00
55dbf5c379 fix(messages): validate msg_grid before using msg_grid_pos (#26189) 2023-11-24 10:44:19 +08:00
a8a93e517f fix(mouse): avoid dragging after click label popupmenu callback (#26187) 2023-11-24 09:15:50 +08:00
73c7a0d58e docs(starting.txt): correct step number (#26185) 2023-11-24 07:19:06 +08:00
fe94e04893 vim-patch:9.0.2126: unused assignments when checking 'listchars' (#26182)
Problem:  Unused assignments when checking the value of 'listchars'.
Solution: Loop only once when just checking the value.  Add a test to
          check that this change doesn't cause double-free.

closes: vim/vim#13559

00624a2fa0
2023-11-24 06:52:50 +08:00
9510346141 vim-patch:9.0.2125: File info disappears when 'cmdheight' has decreased (#26180)
Problem:  File info disappears immediately when 'cmdheight' has just
          decreased due to switching tabpage and 'shortmess' doesn't
          contain 'o' or 'O'.
Solution: Make sure msg_row isn't smaller than cmdline_row.

fixes: vim/vim#13560
closes: vim/vim#13561

40ed6711bd
2023-11-24 06:13:24 +08:00
4ed1c2a8af fix(grid): don't draw beyond max column (#26172) 2023-11-24 05:59:06 +08:00
4ce3159e24 fix: missing case in setxattr error handling (#26176)
ENOTSUP case is present in vim, but doesn't appear to have included here.
2023-11-24 05:28:52 +08:00
32a4c9f4f9 perf: remove redundant strlen in skipwhite (#26177)
skipwhite was iterating over the input twice and scanning for the null
byte character with strlen. this is redundant, because it's already
covered by ascii_iswhite that accepts only space or tab character.

Co-authored-by: ii14 <ii14@users.noreply.github.com>
2023-11-24 05:26:33 +08:00
df399ea0d2 fix(column): reset decor state before starting from top 2023-11-23 16:27:17 +00:00
b514edcdf4 test: remove the pipe created by new_pipename() (#26173) 2023-11-23 23:05:52 +08:00
c126a3756a fix(column): apply numhl signs when 'signcolumn' is "no" (#26167) 2023-11-23 19:58:17 +08:00
62dc1f2663 vim-patch:8750e3cf81f1 (#26163)
runtime(netrw): Fix handling of very long filename on longlist style (vim/vim#12150)

If there is a file with a very long filename (longer than
g:netrw_maxfilenamelen), and if g:netrw_liststyle is set to 1, no space
is inserted between the filename and the filesize and the file cannot be
opened because of this.

E.g.:
```
$ echo hello > 12345678901234567890123456789012	  # 32 bytes: OK
$ echo hello > 123456789012345678901234567890123  # 33 bytes: not OK
$ echo hello > 1234567890123456789012345678901234 # 34 bytes: not OK
$ echo hello > こんにちは                         # multibyte filename
$ LC_ALL=C.UTF-8 vim . --clean --cmd "set loadplugins" --cmd "let g:netrw_liststyle=1"
```

Then, it will be shown like this:
```
" ============================================================================
" Netrw Directory Listing                                        (netrw v171)
"   /cygdrive/c/work/netrw-test
"   Sorted by      name
"   Sort sequence: [\/]$,\<core\%(\.\d\+\)\=\>,\.h$,\.c$,\.cpp$,\~\=\*$,*,\.o$,\
"   Quick Help: <F1>:help  -:go up dir  D:delete  R:rename  s:sort-by  x:special
" ==============================================================================
../                              0 Mon Mar 13 19:25:16 2023
./                               0 Mon Mar 13 19:44:58 2023
12345678901234567890123456789012 6 Mon Mar 13 19:29:43 2023
12345678901234567890123456789012346 Mon Mar 13 19:32:40 2023
1234567890123456789012345678901236 Mon Mar 13 19:29:49 2023
こんにちは                  6 Mon Mar 13 19:30:41 2023
```

If the length of the filename is 32 bytes, there is a space between the
filename and the filesize. However, when it is longer than 32 bytes, no
space is shown.

Also, you may find that the filesize of the multibyte named file is not
aligned.

After this patch is applied, the filelist will be shown like this:
```
" ============================================================================
" Netrw Directory Listing                                        (netrw v171)
"   /cygdrive/c/work/netrw-test
"   Sorted by      name
"   Sort sequence: [\/]$,\<core\%(\.\d\+\)\=\>,\.h$,\.c$,\.cpp$,\~\=\*$,*,\.o$,\
"   Quick Help: <F1>:help  -:go up dir  D:delete  R:rename  s:sort-by  x:special
" ==============================================================================
../                                             0 Mon Mar 13 20:49:22 2023
./                                              0 Mon Mar 13 21:12:14 2023
1234567890123456789012345678901             10000 Mon Mar 13 20:57:55 2023
12345678901234567890123456789012                6 Mon Mar 13 19:29:43 2023
123456789012345678901234567890123               6 Mon Mar 13 19:29:49 2023
1234567890123456789012345678901234              6 Mon Mar 13 19:32:40 2023
1234567890123456789012345678901234567       10000 Mon Mar 13 21:03:23 2023
1234567890123456789012345678901234567890    10000 Mon Mar 13 21:03:36 2023
123456789012345678901234567890123456789012  10000 Mon Mar 13 21:03:59 2023
1234567890123456789012345678901234567890123  10000 Mon Mar 13 21:03:45 2023
1234567890123456789012345678901234567890123456  5 Mon Mar 13 21:08:15 2023
12345678901234567890123456789012345678901234567  10 Mon Mar 13 21:05:21 2023
こんにちは                                      6 Mon Mar 13 19:30:41 2023
```

Now we have 32 + 2 + 15 = 49 characters for filename and filesize.
It tries to align the filesize as much as possible.
The last line that has multibyte filename is also aligned.

Also fixed the issue that the file list is not shown correctly when
g:netrw_sort_by is set to 'size' and g:netrw_sizestyle is set to 'h' or
'H'.

8750e3cf81

Co-authored-by: K.Takata <kentkt@csc.jp>
2023-11-23 17:02:53 +08:00
6224690c58 Merge pull request #26162 from zeertzjq/vim-9.0.2121
vim-patch:8.2.2784,9.0.2121
2023-11-23 16:34:11 +08:00
8d8136bfcf vim-patch:9.0.2121: [security]: use-after-free in ex_substitute
Problem:  [security]: use-after-free in ex_substitute
Solution: always allocate memory

closes: vim/vim#13552

A recursive :substitute command could cause a heap-use-after free in Vim
(CVE-2023-48706).

The whole reproducible test is a bit tricky, I can only reproduce this
reliably when no previous substitution command has been used yet
(which is the reason, the test needs to run as first one in the
test_substitute.vim file) and as a combination of the `:~` command
together with a :s command that contains the special substitution atom `~\=`
which will make use of a sub-replace special atom and calls a vim script
function.

There was a comment in the existing :s code, that already makes the
`sub` variable allocate memory so that a recursive :s call won't be able
to cause any issues here, so this was known as a potential problem
already.  But for the current test-case that one does not work, because
the substitution does not start with `\=` but with `~\=` (and since
there does not yet exist a previous substitution atom, Vim will simply
increment the `sub` pointer (which then was not allocated dynamically)
and later one happily use a sub-replace special expression (which could
then free the `sub` var).

The following commit fixes this, by making the sub var always using
allocated memory, which also means we need to free the pointer whenever
we leave the function. Since sub is now always an allocated variable,
we also do no longer need the sub_copy variable anymore, since this one
was used to indicated when sub pointed to allocated memory (and had
therefore to be freed on exit) and when not.

Github Security Advisory:
https://github.com/vim/vim/security/advisories/GHSA-c8qm-x72m-q53q

26c11c5688

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-23 16:17:37 +08:00
ed8f9ff47b vim-patch:8.2.2784: Vim9: cannot use \=expr in :substitute
Problem:    Vim9: cannot use \=expr in :substitute.
Solution:   Compile the expression into instructions and execute them when
            invoked.

4c13721482

Vim9 script is N/A, including substitute_instr.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-23 16:09:27 +08:00
879617c9bb Merge pull request #26105 from luukvbaal/signmerge
feat(extmarks): add sign name to extmark "details" array
2023-11-22 18:19:44 +01:00
c8fd82b26d build: reorder compiler option setting
The most general conditions should come before more specific conditions.
For example, `UNIX` options needs to be specified before any
distro-specific options. This way distro specific options takes priority
over the general case in case there's a conflict.
2023-11-22 14:03:50 +01:00
c249058758 feat(extmarks): add sign name to extmark "details" array
Problem:  Unable to identify legacy signs when fetching extmarks with
          `nvim_buf_get_extmarks()`.
Solution: Add "sign_name" to the extmark detail array.

Add some misc. changes as follow-up to #25724
2023-11-22 12:43:59 +01:00
34fa1e1ca4 Merge pull request #26151 from bfredl/signcount
fix(decorations): fix imbalanced sign count
2023-11-22 12:19:30 +01:00
fba17d5b88 fix(decorations): fix imbalanced sign count 2023-11-22 11:41:47 +01:00
2e722da44d Merge pull request #25826 from bfredl/art_deco
refactor(decorations): break up Decoration struct into smaller pieces
2023-11-22 10:13:10 +01:00
0b38fe4dbb refactor(decorations): break up Decoration struct into smaller pieces
Remove the monolithic Decoration struct. Before this change, each extmark
could either represent just a hl_id + priority value as a inline
decoration, or it would take a pointer to this monolitic 112 byte struct
which has to be allocated.

This change separates the decorations into two pieces: DecorSignHighlight
for signs, highlights and simple set-flag decorations (like spell,
ui-watched), and DecorVirtText for virtual text and lines.

The main separation here is whether they are expected to allocate more
memory. Currently this is not really true as sign text has to be an
allocated string, but the plan is to get rid of this eventually (it can
just be an array of two schar_T:s). Further refactors are expected to
improve the representation of each decoration kind individually. The
goal of this particular PR is to get things started by cutting the
Gordian knot which was the monolithic struct Decoration.

Now, each extmark can either contain chained indicies/pointers to
these kinds of objects, or it can fit a subset of DecorSignHighlight
inline.

The point of this change is not only to make decorations smaller in
memory. In fact, the main motivation is to later allow them to grow
_larger_, but on a dynamic, on demand fashion. As a simple example, it
would be possible to augment highlights to take a list of multiple
`hl_group`:s, which then would trivially map to a chain of multiple
DecorSignHighlight entries.

One small feature improvement included with this refactor itself, is
that the restriction that extmarks cannot be removed inside a decoration
provider has been lifted. These are instead safely lifetime extended
on a "to free" list until the current iteration of screen drawing is done.

NB: flags is a mess. but DecorLevel is useless, this slightly less so
2023-11-22 09:28:54 +01:00
8c6b0a5f21 vim-patch:9.0.2117: [security] use-after-free in qf_free_items (#26148)
Problem:  [security] use-after-free in qf_free_items
Solution: only access qfpnext, if it hasn't been freed

Coverity discovered a possible use-after-free in qf_free_items. When
freeing the qfline items, we may access freed memory, when qfp ==
qfpnext.

So only access qfpnext, when it hasn't been freed.

567cae2630

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-22 11:07:00 +08:00
059dc3f4a6 vim-patch:cb0c113ddc01 (#26147)
runtime(netrw): expand $COMSPEC without applying 'wildignore' (vim/vim#13542)

When expanding $COMSPEC and a user has set :set wildignore=*.exe
netrw won't be able to properly cmd.exe, because it does not ignore the
wildignore setting.

So let's explicitly use expand() without applying the 'wildignore' and
'suffixes' settings to the result

closes: vim/vim#13426

cb0c113ddc

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-22 11:06:46 +08:00
820823c76d vim-patch:596a9f29c83a (#26146)
runtime(doc): Fix whitespace and formatting of some help files (vim/vim#13549)

596a9f29c8

N/A patch:
vim-patch:aabca259fa48

Co-authored-by: h_east <h.east.727@gmail.com>
2023-11-22 10:46:11 +08:00
91ef26dece fix(messages): :map output with ext_messages (#26126) 2023-11-22 09:50:28 +08:00
7663584708 refactor: remove __clang_analyzer__ macro
It is less intrusive to silence the warning with a comment instead of a
macro if needed.
2023-11-21 23:05:18 +01:00
26033eee1d build: suppress bugprone-reserved-identifier warnings
These are only used when running `make lintc` with ENABLE_ASAN_UBSAN
enabled, which is why it wasn't caught by CI.
2023-11-21 22:18:57 +01:00
78239f0bbc build: reorganize cmake files
Also add _GNU_SOURCE compiler definition for all non MSVC compilers.

Closes https://github.com/neovim/neovim/issues/26087.
2023-11-21 22:18:21 +01:00
b4fee208ef docs: update MAINTAIN.md 2023-11-21 22:17:43 +01:00
7e97c773e3 perf(lsp): use async fs_stat for file watching on linux (#26123) 2023-11-21 17:46:19 +01:00
e89071522c fix(column): always set b_signcols.max
Fix #26135
2023-11-21 14:32:18 +00:00
585eeacb24 refactor(sign): store 'signcolumn' width range when it is set
Problem:  Minimum and maximum signcolumn width is determined each redraw.
Solution: Determine and store 'signcolumn' range when option is set.
2023-11-21 09:38:32 +00:00
fec5e3ab24 fix(vim.region): handle multibyte inclusive selection properly (#26129) 2023-11-21 14:25:45 +08:00
4880385809 build: adjust clang-tidy warning exclusion logic
Enable all clang-tidy warnings by default instead of disabling them.
This ensures that we don't miss useful warnings on each clang-tidy
version upgrade. A drawback of this is that it will force us to either
fix or adjust the warnings as soon as possible.
2023-11-20 20:05:43 +01:00
a6e3d93421 refactor: enable formatting for ternaries
This requires removing the "Inner expression should be aligned" rule
from clint as it prevents essentially any formatting regarding ternary
operators.
2023-11-20 19:57:09 +01:00
ec79ff893d refactor(lsp): add type annotations to _watchfiles (#26109) 2023-11-20 17:19:41 +01:00
77c0d5415b build: bump uncrustify to version 0.78.1 2023-11-20 15:48:43 +01:00
99b8a343e1 fixup: quick update, squash later 2023-11-20 15:21:55 +01:00
7a80e169c5 build: disable all compiler warnings from dependencies 2023-11-20 15:21:55 +01:00
d667e0e414 vim-patch:9.0.2116: No test for defining sign without attribute (#26115)
Problem:  No test for defining sign without attribute
Solution: Add test for defining sign without attributes

closes: vim/vim#13544

e670d17342
2023-11-20 10:25:14 +08:00
7ca2d64e8b test: skip failing watch file tests on freebsd (#26110)
Quick fix as follow up to https://github.com/neovim/neovim/pull/26108

kqueue only reports events on a watched folder itself, not for files
created or deleted within. So the approach the PR took doesn't work on FreeBSD.

We'll either need to bring back polling for it, combine watching with manual
file tracking, or disable LSP file watching on FreeBSD
2023-11-19 18:37:49 +01:00
ac1113ded5 refactor: follow style guide
- reduce variable scope
- prefer initialization over declaration and assignment
2023-11-19 15:08:35 +01:00
1798a4b5e9 build: bump uncrustify version
Biggest change is that uncrustify is silent during linting.
2023-11-19 15:03:07 +01:00
de28a0f84c perf(lsp): replace file polling on linux with per dir watcher (#26108)
Should help with https://github.com/neovim/neovim/issues/23291

On linux `new_fs_event` doesn't support recursive watching, but we can
still use it to watch folders.

The downside of this approach is that we may end up sending some false
`Deleted` events. For example, if you save a file named `foo` there will
be a intermediate `foo~` due to the save mechanism of neovim.

The events we get from vim.uv in that case are:

- rename: foo~
- rename: foo~
- rename: foo
- rename: foo
- change: foo
- change: foo

The mechanism in this PR uses a debounce to reduce this to:

- deleted: foo~
- changed: foo

`foo~` will be the false positive.
I suspect that for the LSP case this is good enough. If not, we may need
to follow up on this and keep a table in memory that tracks available
files.
2023-11-19 14:25:32 +01:00
a84b454ebe fix(sign): do not error when defining sign without attributes (#26106)
Fix https://github.com/airblade/vim-gitgutter/issues/875
2023-11-19 07:58:33 +08:00
debad0020c Merge pull request #26104 from bfredl/noextmarkinfo
refactor(extmark): redundant ExtmarkInfo delenda est, use MTPair instead
2023-11-18 22:38:27 +01:00
ec283e6b4b refactor(extmark): redundant ExtmarkInfo delenda est, use MTPair instead 2023-11-18 21:11:18 +01:00
bec2ebebda build: various cmake fixes
- Correct MSVC warning suppression. The C4003 warning is issued during
  file generation and not for the actual source files.
- Remove non-existent "scripts/pvscheck.sh" file from `lintsh` target.
- Remove spaces inside for loops with uncrustify.
- Point dependencies to use a git tag rather than releases, as releases
  might have changes that deviate from the actual source code.
- Automatically update uncrustify config before formatting or linting.
2023-11-18 18:38:45 +01:00
df87266b23 Merge pull request #25724 from luukvbaal/signmerge
refactor(sign): move legacy signs to extmarks
2023-11-18 15:04:14 +01:00
cdc8bacc79 fix(completion): filter results with complete+=f (#26029) 2023-11-18 12:26:52 +08:00
abac33605f Merge pull request #26096 from gpanders/tui-input-refactor
TUI input refactors
2023-11-17 14:24:47 -06:00
e80b83bf56 refactor(tui): use termkey_interpret_modereport
The sign extension issue has been fixed upstream, so we no longer need
to use our own workaround.
2023-11-17 13:37:33 -06:00
89dd939c15 refactor(tui): refactor Kitty keyboard query implementation
Refactor our implementation of querying for Kitty keyboard protocol
support:

- Remove usage of the "extkeys" term. This is not standard or really
  used elsewhere. Use "key encoding" instead
- Replace usages of "CSIu" with "Kitty". "Kitty keyboard protocol" is
  vastly more common than "CSIu" now
- Replace the countdown response counter with a simple boolean flag. We
  don't actually need a countdown counter because we request the primary
  device attributes along with the Kitty keyboard query, so we will
  always receive a "terminating event", making a countdown/timer
  unnecessary
- Move the CSI response handling into a dedicated function
- Bypass Unibilium for sending key encoding escape sequences. These
  sequences are not part of terminfo and do not have any parameters, so
  there's no reason to go through Unibilium
2023-11-17 13:37:33 -06:00
4972c80489 refactor(snippet): rename test utilities 2023-11-17 17:10:27 +01:00
7e36c8e972 feat(lsp): support for choice snippet nodes 2023-11-17 17:10:27 +01:00
ad867fee26 fix(tui): handle cursor visibility properly (#26091)
The test is for the case without 'termsync' because libvterm doesn't
support synchronized output, and it passes without this PR.
2023-11-17 22:13:30 +08:00
c4afb9788c refactor(sign): move legacy signs to extmarks
Problem:  The legacy signlist data structures and associated functions are
          redundant since the introduction of extmark signs.
Solution: Store signs defined through the legacy commands in a hashmap, placed
          signs in the extmark tree. Replace signlist associated functions.

Usage of the legacy sign commands should yield no change in behavior with the
exception of:
  - "orphaned signs" are now always removed when the line it is placed on is
    deleted. This used to depend on the value of 'signcolumn'.
  - It is no longer possible to place multiple signs with the same identifier
    in a single group on multiple lines. This will now move the sign instead.

Moreover, both signs placed through the legacy sign commands and through
|nvim_buf_set_extmark()|:
  - Will show up in both |sign-place| and |nvim_buf_get_extmarks()|.
  - Are displayed by increasing sign identifier, left to right.
    Extmark signs used to be ordered decreasingly as opposed to legacy signs.
2023-11-17 15:10:15 +01:00
677be4bdd2 docs: document breaking change of cursor blink behavior (#26075) 2023-11-17 08:07:35 -06:00
7af89ef464 Merge pull request #25934 from bfredl/screenlinechar
refactor(grid): make screen rendering more multibyte than ever before
2023-11-17 13:38:10 +01:00
b522cb1ac3 refactor(grid): make screen rendering more multibyte than ever before
Problem: buffer text with composing chars are converted from UTF-8
to an array of up to seven UTF-32 values and then converted back
to UTF-8 strings.

Solution: Convert buffer text directly to UTF-8 based schar_T values.

The limit of the text size is now in schar_T bytes, which is currently
31+1 but easily could be raised as it no longer multiplies the size
of the entire screen grid when not used, the full size is only required
for temporary scratch buffers.

Also does some general cleanup to win_line text handling, which was
unnecessarily complicated due to multibyte rendering being an "opt-in"
feature long ago. Nowadays, a char is just a char, regardless if it consists
of one ASCII byte or multiple bytes.
2023-11-17 12:58:57 +01:00
20ec4c776a fix(lua): only disable vim.schedule() when closing main loop (#26090) 2023-11-17 18:34:48 +08:00
dc9f7b8145 Merge pull request #26083 from zeertzjq/vim-9.0.1854
vim-patch:9.0.{1854,1857,1858,partial:1859,1860,1864,1868,1872,1873,1878,1881,1882,1969,1992,2004,2010,2106}
2023-11-17 10:19:56 +08:00
790bd4d585 vim-patch:9.0.2106: [security]: Use-after-free in win_close()
Problem:  [security]: Use-after-free in win_close()
Solution: Check window is valid, before accessing it

If the current window structure is no longer valid (because a previous
autocommand has already freed this window), fail and return before
attempting to set win->w_closing variable.

Add a test to trigger ASAN in CI

25aabc2b8e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:59:22 +08:00
d49be1cd28 vim-patch:9.0.2010: [security] use-after-free from buf_contents_changed()
Problem:  [security] use-after-free from buf_contents_changed()
Solution: block autocommands

41e6f7d6ba

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:59:22 +08:00
b6200fbdf2 vim-patch:9.0.1992: [security] segfault in exmode
Problem:  segfault in exmode when redrawing
Solution: skip gui_scroll when exmode_active

20d161ace3

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:59:22 +08:00
3ab0e296c6 vim-patch:9.0.1969: [security] buffer-overflow in trunc_string()
Problem:  buffer-overflow in trunc_string()
Solution: Add NULL at end of buffer

Currently trunc_string() assumes that when the string is too long,
buf[e-1] will always be writeable. But that assumption may not always be
true. The condition currently looks like this

    else if (e + 3 < buflen)
    [...]
    else
    {
	// can't fit in the "...", just truncate it
	buf[e - 1] = NUL;
    }

but this means, we may run into the last else clause with e still being
larger than buflen. So a buffer overflow occurs.

So instead of using `buf[e - 1]`, let's just always
truncate at `buf[buflen - 1]` which should always be writable.

3bd7fa12e1

vim-patch:9.0.2004: Missing test file

Problem:  Missing test file
Solution: git-add the file to the repo

closes: vim/vim#13305

d4afbdd071

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:59:16 +08:00
5a67878e86 vim-patch:9.0.1882: Trailing white space in tests
Problem:  Trailing white space in tests
Solution: Delete it

This causes test_codestyle to fail, so we need to remove it again.
Hopefully that makes the CI green again.

Note: I will start using annotated tags from now on.

da200c2f78

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:54:03 +08:00
7f62775d5d vim-patch:9.0.1881: Test_crash fails on Mac
Problem:  Test_crash fails on Mac
Solution: Skip test on Mac

5856b07795

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:54:03 +08:00
b5b6e6fb49 vim-patch:9.0.1878: tests running sh have problems
Problem:  tests running sh have problems
Solution: Check that dash is installed

closes: vim/vim#13040

1690ec64ff

Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:54:03 +08:00
eae10de14e vim-patch:9.0.1873: [security] heap-buffer-overflow in vim_regsub_both
Problem:  heap-buffer-overflow in vim_regsub_both
Solution: Disallow exchanging windows when textlock is active

f6d28fe2c9

Cherry-pick test_crash.vim change from patch 9.0.1876.

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:54:03 +08:00
6867d2492c vim-patch:9.0.1872: CI: test_crash() fails on CI
Problem:  CI: test_crash() fails on CI
Solution: Skip test on BSD

d2a08ba0fa

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:54:03 +08:00
0b0df9f5d7 vim-patch:9.0.1868: test_crash still fails for circle ci
Problem:  test_crash still fails for circle ci
Solution: give even more time to complete

59adcb4c20

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:54:03 +08:00
1274380029 vim-patch:9.0.1864: still crash with bt_quickfix1_poc
Problem:  crash with bt_quickfix1_poc when cleaning up
          and EXITFREE is defined
Solution: Test if buffer is valid in a window, else close
          window directly, don't try to access buffer properties

While at it, increase the crash timeout slightly, so that CI has a
chance to finish processing the test_crash() test.

623ba31821

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:54:03 +08:00
2371b9303d vim-patch:9.0.1860: CI: test_crash1() is flaky
Problem:  CI: test_crash1() is flaky
Solution: Wait a bit longer

f44cbe96fa

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:54:03 +08:00
bbb363f4bc vim-patch:partial:9.0.1859: heap-use-after-free in bt_normal()
Problem:  heap-use-after-free in bt_normal()
Solution: check that buffer is still valid

6e60cf444a

Test change only.

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:54:03 +08:00
8dc72789cf vim-patch:9.0.1858: [security] heap use after free in ins_compl_get_exp()
Problem:  heap use after free in ins_compl_get_exp()
Solution: validate buffer before accessing it

ee9166eb3b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:54:03 +08:00
a589156b4d vim-patch:9.0.1857: [security] heap-use-after-free in is_qf_win()
Problem:  heap-use-after-free in is_qf_win()
Solution: Check buffer is valid before accessing it

fc68299d43

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:54:03 +08:00
748198f5bf vim-patch:9.0.1854: test_crash1() fails on CI
Problem:  test_crash1() fails on CI
Solution: don't run Screendump test, verify that it doesn't crash
          by running it through a shell command line, testing
          the exit value and concatenating success cmd using '&&'

db510ca805

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 09:54:03 +08:00
86c2213b5e fix(osc52): use p for primary selection instead of s (#26076)
Co-authored-by: Gregory Anders <greg@gpanders.com>
2023-11-16 19:52:22 -06:00
6952b1951b vim-patch:9.0.2107: [security]: FPE in adjust_plines_for_skipcol (#26082)
Problem:  [security]: FPE in adjust_plines_for_skipcol
Solution: don't divide by zero, return zero

Prevent a floating point exception when calculating w_skipcol (which can
happen with a small window when the number option is set and cpo+=n).

Add a test to verify

cb0b99f067

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 08:40:02 +08:00
133a592d19 Merge pull request #26081 from zeertzjq/vim-9.0.2108
vim-patch:9.0.{1532,1534,1535,2108,2109,2110,2111}
2023-11-17 07:47:22 +08:00
9d39ad6318 vim-patch:9.0.2111: [security]: overflow in get_number
Problem:  [security]: overflow in get_number
Solution: Return 0 when the count gets too large

[security]: overflow in get_number

When using the z= command, we may overflow the count with values larger
than MAX_INT. So verify that we do not overflow and in case when an
overflow is detected, simply return 0

73b2d3790c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 07:19:14 +08:00
809b05bf27 vim-patch:9.0.2110: [security]: overflow in ex address parsing
Problem:  [security]: overflow in ex address parsing
Solution: Verify that lnum is positive, before substracting from
          LONG_MAX

[security]: overflow in ex address parsing

When parsing relative ex addresses one may unintentionally cause an
overflow (because LONG_MAX - lnum will overflow for negative addresses).

So verify that lnum is actually positive before doing the overflow
check.

060623e4a3

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 07:16:04 +08:00
016c6fae27 vim-patch:9.0.2109: [security]: overflow in nv_z_get_count
Problem:  [security]: overflow in nv_z_get_count
Solution: break out, if count is too large

When getting the count for a normal z command, it may overflow for large
counts given. So verify, that we can safely store the result in a long.

58f9befca1

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 07:13:49 +08:00
a4c111ae69 vim-patch:9.0.2108: [security]: overflow with count for :s command
Problem:  [security]: overflow with count for :s command
Solution: Abort the :s command if the count is too large

If the count after the :s command is larger than what fits into a
(signed) long variable, abort with e_value_too_large.

Adds a test with INT_MAX as count and verify it correctly fails.

It seems the return value on Windows using mingw compiler wraps around,
so the initial test using :s/./b/9999999999999999999999999990 doesn't
fail there, since the count is wrapping around several times and finally
is no longer larger than 2147483647. So let's just use 2147483647 in the
test, which hopefully will always cause a failure

ac63787734

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 07:06:52 +08:00
354b57b01f vim-patch:9.0.1535: test commented out in a wrong way
Problem:    Test commented out in a wrong way.
Solution:   Use legacy script comment character.

a4467c433a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-17 07:06:52 +08:00
f6658a1e78 vim-patch:9.0.1534: test for expanding "~" in substitute takes too long
Problem:    Test for expanding "~" in substitute takes too long.
Solution:   Disable the test for now.

916d6dd5b1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-17 07:06:52 +08:00
d2f2e2725c vim-patch:9.0.1532: crash when expanding "~" in substitute causes very long text
Problem:    Crash when expanding "~" in substitute causes very long text.
Solution:   Limit the text length to MAXCOL.

ab9a2d884b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-17 07:06:52 +08:00
a388c852c4 build: update libtermkey commit
The new commit includes the following patches:

bf544610f5
dcb198a85c

Fixes https://github.com/neovim/neovim/issues/26038.
2023-11-16 22:02:45 +01:00
5d75d9aef2 fix(osc52): enable OSC 52 by default in tmux sessions (#26072)
tmux has a set-clipboard option which, when set to 'on', allows
applications to set the system clipboard using the usual OSC 52 escape
sequence.
2023-11-16 13:56:05 -06:00
2f64546dc1 refactor: use optional base argument of tonumber (#26070) 2023-11-16 12:25:50 -06:00
db57df04b6 feat(clipboard): enable OSC 52 clipboard provider by default (#26064)
Use the XTGETTCAP sequence to determine if the host terminal supports
the OSC 52 sequence and, if it does, enable the OSC 52 clipboard
provider by default.

This is only done automatically when all of the following are true:

  1. Nvim is running in the TUI
  2. 'clipboard' is not set to unnamed or unnamedplus
  3. g:clipboard is unset
  4. Nvim is running in an SSH connection ($SSH_TTY is set)
  5. Nvim is not running inside tmux ($TMUX is unset)
2023-11-16 12:21:24 -06:00
4bf47222c9 feat: add vim.text module (#26069) 2023-11-16 11:35:54 -06:00
b4b7ca2d54 feat(tui): support DCS responses in TermResponse event (#26061) 2023-11-16 11:12:42 -06:00
dc3f84bf4f docs: fix vim.snippet help tags (#26068) 2023-11-16 10:53:25 -06:00
931f28841c refactor: remove B_SPELL macro (#26063) 2023-11-16 11:50:04 +08:00
bb4b4576e3 refactor: iwyu (#26062) 2023-11-16 10:55:54 +08:00
326d46f690 refactor: move some functions to winfloat.c (#26020) 2023-11-16 09:54:47 +08:00
405bad5e08 fix(tui): do not toggle cursor visibility when flushing the buffer (#26055)
When writing large amounts of data to the tty it is common to first hide
the cursor to avoid a flickering effect. This has been done in Nvim for
a long time and was implemented in the function that actually flushed
the TUI buffer out to the TTY.

However, when using synchronized updates with the 'termsync' option this
is no longer necessary, as the terminal emulator will buffer all of the
updates and display them atomically. Thus there is no need to toggle the
cursor visibility when flushing the buffer when synchronized updates are
used. In fact, doing so can actually reintroduce cursor flickering in
certain scenarios because the visibility state is itself being
synchronized by the terminal.

In addition, the management of the cursor visibility should not happen
when the TUI _buffer_ is flushed, but rather when the TUI itself is
flushed. This is a subtle but meaningful distinction: the former
literally writes bytes to the TTY while the latter flushes the TUI's
grid into its buffer. There is no need to hide the cursor every time we
write bytes to the TTY, only at the beginning of a full TUI "flush"
event.
2023-11-15 15:55:19 -06:00
d92dd2a0c0 build(deps): bump luajit to HEAD - 43d0a1915 2023-11-15 09:39:43 +01:00
64c2c7c40d ci: bump actions/github-script from 6 to 7 (#26041)
Bumps [actions/github-script](https://github.com/actions/github-script) from 6 to 7.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/github-script
  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>
2023-11-15 12:57:54 +08:00
ba58c6f8a4 fix: only attempt to close timer if not already closing (#26047)
This fixes an error that can occur in certain pathological cases when
the autocommand fires at just the right time such that it attempts to
close the timer after the timer has already exited, but before the
scheduled callback has fired.

We now let the timer continue to run even when the autocommand deletes
itself to avoid having to repeat the cleanup code multiple times. There
is no harm in letting the timer execute if the autocommand does not
exist, as the pcall will catch the error.
2023-11-14 17:02:57 -06:00
c37f7bdba5 vim-patch:67abf1592c83
runtime(tar): comment out strange error condition check

67abf1592c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-14 23:29:09 +01:00
7e0f6211af vim-patch:30c762d99ac8
runtime(doc): fix typo in pi_gzip.txt

30c762d99a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-14 23:29:09 +01:00
f4d95c05b9 vim-patch:9.0.2105: skipcol not reset when topline changed (#26042)
Problem:  Skipcol is not reset when topline changed scrolling cursor to top
Solution: reset skipcol

closes: vim/vim#13528

bb800a7907
2023-11-15 06:28:56 +08:00
9e2248ab58 vim-patch:9.0.2104: wast filetype should be replaced by wat filetype
Problem:  wast filetype should be replaced by wat filetype
Solution: start using the official wat filetype name

runtime: rename `wast` filetype to `wat` (Wasm text format)

The problem is the name of the current filetype wast. When the plugin
was initially created, the file extension for Wasm text format was not
fixed and .wast was more popular.

However, recently .wat became the official file extension for
WebAssembly text (WAT) format and .wast is now a file extension for the
unofficial WAST format, which is a superset of .wat for the convenience
to describe the Wasm specification conformance tests.

https://webassembly.js.org/docs/contrib-wat-vs-wast.html

However for now, let's keep using the `wat` filetype even for the .wast
extension, so that we at least do not lose the filetype settings and
syntax highlighting. This can be adjusted later, if it turns out to have
a separate need for.

closes: vim/vim#13533

bc8f79d36a

Co-authored-by: rhysd <lin90162@yahoo.co.jp>
2023-11-14 21:51:28 +01:00
1a4db51d06 Revert "docs: adjust help-tag-right CSS for HTML" #26046
The style change is mostly a regression.

Reverts #25858 d50274812b
2023-11-14 09:55:54 -08:00
d50274812b docs: adjust help-tag-right CSS for HTML #25858 2023-11-14 09:33:18 -08:00
ac8ed77afb feat(tui): add 'termsync' option (#25871)
The 'termsync' option enables a mode (provided the underlying terminal
supports it) where all screen updates during a redraw cycle are buffered
and drawn together when the redraw is complete. This eliminates tearing
or flickering in cases where Nvim redraws slower than the terminal
redraws the screen.
2023-11-14 08:53:58 -06:00
b73a829837 refactor: vim.ui.clipboard #26040
Problem:
Platform-specific UI providers should live in `vim.ui.*`. #24164

Solution:
- Move `vim.clipboard.osc52` module to `vim.ui.clipboard.osc52`.
- TODO: move all of `clipboard.vim` to `vim.ui.clipboard`.

ref #25872
2023-11-14 05:15:45 -08:00
5b45efbee6 fix(defaults): set 'fsync' #26034
Problem:
'nofsync' may lose data if the system has a hard shutdown. #9888

Solution:
Change default to 'fsync'. This may be revisited in the future when
'nofsync' can be made safer.
2023-11-14 02:56:50 -08:00
582d7f4790 Merge pull request #25918 from gpanders/background-color 2023-11-13 19:21:07 -06:00
22eb2ba183 fix(lua): do not schedule events if Nvim is exiting
If Nvim is in the process of exiting then we do not want to allocate any
new refs onto the event loop, because they will not be freed and will
result in a memory leak.
2023-11-13 19:04:47 -06:00
e7c46438ab test: use ST terminator instead of BEL in OSC sequences
libtermkey does not interpret OSC sequences that end with a BEL (0x07)
instead of an ST (0x1b 0x5c) terminator. This causes these tests to fail
since the OSC response is now parsed via libtermkey. Change the tests to
use the ST terminator to appease libtermkey.
2023-11-13 19:04:47 -06:00
8d9789a0f3 docs: deprecate the "term_background" UI field 2023-11-13 19:04:47 -06:00
ab102f188e refactor: move background color detection into Lua 2023-11-13 19:04:46 -06:00
28f4f3c484 refactor: follow style guide
- reduce variable scope
- prefer initialization over declaration and assignment
- use bool to represent boolean values
2023-11-13 23:39:56 +01:00
48bcc7b971 fix(lsp): advertise workspace.didChangeConfiguration capability (#26028)
This ensures workspace/didChangeConfiguration notification sent after init is correctly handled
2023-11-13 19:39:43 +01:00
d718a3e27a version.c: update (#26025)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2023-11-13 19:02:13 +08:00
e9bfbe99cd fix(textformat): remove unnecessary changed_bytes() (#26027)
This was removed from Vim in patch 8.1.0681.
2023-11-13 18:18:04 +08:00
cbad7f8c21 build(deps): bump luajit to HEAD - 113a168b7 2023-11-13 10:11:29 +01:00
3a1bf826ff vim-patch: mark N/A 8.1 patches #26008
Problem:
Numerous Vim 8.1 patches are listed by `vim-patch.sh -l`.

Solution:
Mark the following patches as N/A:

obviated by $NVIM env var:
vim-patch:8.1.0049 shell cannot tell running in a terminal window
vim-patch:8.1.0050 $VIM_TERMINAL is also set when not in a terminal window

'termwinkey' is not supported by Nvim:
vim-patch:8.1.0072 use of 'termwinkey' is inconsistent

Nvim handles STOP signal via libuv:
vim-patch:8.1.0304 no redraw when using a STOP signal on Vim and then CONT
vim-patch:8.1.0312 wrong type for flags used in signal handlers

Nvim does not have `parse_queued_messages`:
vim-patch:8.1.0367 getchar(1) no longer processes pending messages

N/A various:
vim-patch:8.1.1396 'wincolor' does not apply to lines below the buffer
vim-patch:8.1.1502 cannot play any sound
vim-patch:8.1.1515 memory leak reported for sound when build with EXITFREE

Nvim has extmarks instead of textprops:
vim-patch:8.1.0579 cannot attach properties to text
vim-patch:8.1.0582 text properties are not enabled
vim-patch:8.1.0634 text properties cannot cross line boundaries
vim-patch:8.1.0638 text property highlighting is off by one column
vim-patch:8.1.0639 text properties test fails on MS-Windows
vim-patch:8.1.0643 computing byte offset wrong
vim-patch:8.1.0654 when deleting a line text property flags are not adjusted
vim-patch:8.1.0655 when appending a line text property flags are not added
vim-patch:8.1.0663 text property display wrong when 'number' is set
vim-patch:8.1.0665 text property display wrong when 'spell' is set
vim-patch:8.1.0667 textprop test leaves file behind
vim-patch:8.1.0675 text property column in screen columns is not practical
vim-patch:8.1.0676 textprop screendump test fails
vim-patch:8.1.0681 text properties as not adjusted for deleted text
vim-patch:8.1.0682 text properties not adjusted when backspacing replaced text
vim-patch:8.1.0688 text properties are not restored by undo
vim-patch:8.1.0689 undo with text properties not tested
vim-patch:8.1.0690 setline() and setbufline() do not clear text properties
vim-patch:8.1.0691 text properties are not adjusted for :substitute
vim-patch:8.1.0694 when using text props may free memory that is not allocated
vim-patch:8.1.0703 compiler warnings with 64-bit compiler
vim-patch:8.1.0707 text property columns are not adjusted for changed indent
vim-patch:8.1.0970 text properties test fails when 'encoding' is not utf-8
vim-patch:8.1.1035 prop_remove() second argument is not optional
vim-patch:8.1.1276 cannot combine text properties with syntax highlighting
vim-patch:8.1.1278 missing change for "combine" field
vim-patch:8.1.1333 text properties don't always move after changes
vim-patch:8.1.1337 get empty text prop when splitting line just after text prop
vim-patch:8.1.1341 text properties are lost when joining lines
vim-patch:8.1.1343 text properties not adjusted for Visual block mode delete
vim-patch:8.1.1340 attributes from 'cursorline' overwrite textprop
vim-patch:8.1.1351 text property wrong after :substitute
vim-patch:8.1.1359 text property wrong after :substitute with backslash
vim-patch:8.1.1387 calling prop_add() in an empty buffer doesn't work
vim-patch:8.1.1388 errors when calling prop_remove() for an unloaded buffer
vim-patch:8.1.1463 gcc warns for uninitialized variable

N/A Nvim has buf_attach instead of "listeners":
vim-patch:8.1.1320 it is not possible to track changes to a buffer
vim-patch:8.1.1321 no docs or tests for listener functions
vim-patch:8.1.1326 no test for listener with partial
vim-patch:8.1.1328 no test for listener with undo operation
vim-patch:8.1.1332 cannot flush listeners without redrawing, mix of changes
vim-patch:8.1.1335 listener callback is called after inserting text
vim-patch:8.1.1419 listener callbacks may be called recursively
vim-patch:8.1.1486 a listener change is merged even when it adds a line

N/A build issues:
vim-patch:8.1.0601 a few compiler warnings
vim-patch:8.1.0612 cannot use two global runtime dirs with configure
vim-patch:8.1.0684 warnings from 64-bit compiler
vim-patch:8.1.1344 Coverity complains about possibly using a NULL pointer
vim-patch:8.1.1376 warnings for size_t/int mixups
vim-patch:8.1.1414 alloc() returning "char_u *" causes a lot of type casts
vim-patch:8.1.1508 sound keeps failing on Travis
vim-patch:8.1.1494 build failure

N/A terminal / job control patches:
vim-patch:8.1.0761 default value for brief_wait is wrong
vim-patch:8.1.0824 SunOS/Solaris has a problem with ttys
vim-patch:8.1.0845 having job_status() free the job causes problems
vim-patch:8.1.0870 Vim doesn't use the new ConPTY support in Windows 10
vim-patch:8.1.0880 MS-Windows: inconsistent selection of winpty/conpty
vim-patch:8.1.0890 pty allocation wrong if using file for out channel
vim-patch:8.1.0906 using clumsy way to get console window handle
vim-patch:8.1.0909 MS-Windows: using ConPTY even though it is not stable
vim-patch:8.1.0928 stray log function call
vim-patch:8.1.0940 MS-Windows console resizing not handled properly
vim-patch:8.1.1028 MS-Windows: memory leak when creating terminal fails
vim-patch:8.1.1265 when GPM mouse support is enabled double clicks do not work
vim-patch:8.1.1267 cannot check if GPM mouse support is working

N/A encoding patches:
vim-patch:8.1.0879 MS-Windows: temp name encoding can be wrong
vim-patch:8.1.0895 MS-Windows: dealing with temp name encoding not quite right
vim-patch:8.1.0918 MS-Windows: startup messages are not converted
vim-patch:8.1.1090 MS-Windows: modify_fname() has problems with some 'encoding'

N/A platform patches:
vim-patch:8.1.1103 MS-Windows: old API calls are no longer needed

N/A Lua patches:
vim-patch:8.1.1019 Lua: may garbage collect function reference in use

N/A Nvim has floating windows instead of popup window:
vim-patch:8.1.1329 plans for popup window support are spread out
vim-patch:8.1.1364 design for popup window support needs more details
vim-patch:8.1.1391 no popup window support
vim-patch:8.1.1400 using global pointer for tab-local popups is clumsy
vim-patch:8.1.1399 popup windows not adjusted when switching tabs
vim-patch:8.1.0062 popup menu broken if a callback changes the window layout
vim-patch:8.1.1405 "highlight" option of popup windows not supported
vim-patch:8.1.1406 popup_hide() and popup_show() not implemented yet
vim-patch:8.1.1407 popup_create() does not support text properties
vim-patch:8.1.1410 popup_move() is not implemented yet
vim-patch:8.1.1402 "timer" option of popup windows not supported
vim-patch:8.1.1408 PFL_HIDDEN conflicts with system header file
vim-patch:8.1.1420 popup window size only uses first line length
vim-patch:8.1.1421 drawing "~" line in popup window
vim-patch:8.1.1422 popup_getoptions() not implemented yet
vim-patch:8.1.1423 popup windows use options from current window and buffer
vim-patch:8.1.1426 no test for syntax highlight in popup window
vim-patch:8.1.1427 popup window screenshot test fails
vim-patch:8.1.1428 popup_atcursor() not implemented yet
vim-patch:8.1.1429 "pos" option of popup window not supported yet
vim-patch:8.1.1430 popup window option "wrap" not supported
vim-patch:8.1.1431 popup window listed as "Scratch"
vim-patch:8.1.1432 can't build with eval feature
vim-patch:8.1.1438 some commands cause trouble in a popup window
vim-patch:8.1.1441 popup window filter not yet implemented
vim-patch:8.1.1442 popup windows not considered when the Vim window is resized
vim-patch:8.1.1443 popup window padding and border not implemented yet
vim-patch:8.1.1444 not using double line characters for popup border
vim-patch:8.1.1445 popup window border highlight not implemented yet
vim-patch:8.1.1446 popup window callback not implemented yet
vim-patch:8.1.1447 not allowed to create an empty popup
vim-patch:8.1.1448 statusline is sometimes drawn on top of popup
vim-patch:8.1.1449 popup text truncated at end of screen
vim-patch:8.1.1450 popup window positioning wrong when using padding or borders
vim-patch:8.1.1451 CTRL-L does not clear screen with a popup window
vim-patch:8.1.1452 line and col property of popup windows not properly checked
vim-patch:8.1.1453 popup window "moved" property not implemented yet
vim-patch:8.1.1455 popup_atcursor() not completely implemented
vim-patch:8.1.1459 popup window border looks bad when 'ambiwidth' is "double"
vim-patch:8.1.1460 popup window border characters may be wrong
vim-patch:8.1.1416 popup_getposition() not implemented yet
vim-patch:8.1.1493 redrawing with popups is slow and causes flicker
vim-patch:8.1.1496 popup window height is not recomputed
vim-patch:8.1.1499 ruler not updated after popup window was removed
vim-patch:8.1.1511 matches in a popup window are not displayed properly
vim-patch:8.1.1513 all popup functionality is in functions, except :popupclear
vim-patch:8.1.1517 when a popup changes all windows are redrawn
vim-patch:8.1.1518 crash when setting 'columns' while a popup is visible
vim-patch:8.1.1520 popup windows are ignored when dealing with mouse position
vim-patch:8.1.1521 when a popup window is closed the buffer remains
vim-patch:8.1.1522 poup_notification() not implemented yet
vim-patch:8.1.1495 memory access error
vim-patch:8.1.1497 accessing memory beyond allocated space

N/A already applied:
vim-patch:8.1.1226 {not in Vi} remarks get in the way of useful help text
vim-patch:8.1.1280 remarks about functionality not in Vi clutters the help
2023-11-13 00:40:34 -08:00
422af9c5c5 vim-patch:8.1.1521: when a popup window is closed the buffer remains (#26024)
Problem:    When a popup window is closed the buffer remains.
Solution:   Wipe out the buffer.

7c7f01e2b2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 15:41:22 +08:00
91872d7712 vim-patch:8.1.0970: text properties test fails when 'encoding' is not utf-8 (#26023)
Problem:    Text properties test fails when 'encoding' is not utf-8.
Solution:   Compare with original value of 'encoding'. (Christian Brabandt,
            closes vim/vim#3986)

ed79d1e348

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 15:01:40 +08:00
e3e5fadee0 Merge pull request #26022 from zeertzjq/vim-8.0.1592
vim-patch:partial:8.0.1592,8.1.{0870,partial:1218,1581,2276,2373},8.2.{2112,4850}
2023-11-13 14:21:34 +08:00
c23c44f845 vim-patch:8.2.4850: mksession mixes up "tabpages" and "curdir" arguments
Problem:    Mksession mixes up "tabpages" and "curdir" arguments.
Solution:   Correct logic for storing tabpage in session. (closes vim/vim#10312)

d7c9564d8d

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-11-13 13:58:32 +08:00
3d9593523d vim-patch:8.2.2112: running tests may leave some files behind
Problem:    Running tests may leave some files behind.
Solution:   Delete the right files.  Fix a few typos. (Dominique Pellé,
            closes vim/vim#7436

ac665c24c9

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 13:50:43 +08:00
0ff3187fb8 vim-patch:8.1.2373: cannot build with +popupwin but without +quickfix
Problem:    Cannot build with +popupwin but without +quickfix. (John Marriott)
Solution:   Adjust #ifdefs.

5a4c3082d7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 13:50:43 +08:00
30d09d8258 vim-patch:8.1.2276: MS-Windows: session test leaves files behind
Problem:    MS-Windows: session test leaves files behind.
Solution:   Wipe out buffers before deleting the directory. (closes vim/vim#5187)

5bf46e9786

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 13:50:43 +08:00
bcac7674f7 vim-patch:8.1.1581: shared functions for testing are disorganised
Problem:    Shared functions for testing are disorganised.
Solution:   Group finctions in script files. (Ozaki Kiichi, closes vim/vim#4573)

7a39dd7f00

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 13:50:43 +08:00
538749410b vim-patch:partial:8.1.1218: cannot set a directory for a tab page
Problem:    Cannot set a directory for a tab page.
Solution:   Add the tab-local directory. (Yegappan Lakshmanan, closes vim/vim#4212)

00aa069db8

Session-related changes only.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 13:29:57 +08:00
36ce30be20 vim-patch:8.1.0870: Vim doesn't use the new ConPTY support in Windows 10
Problem:    Vim doesn't use the new ConPTY support in Windows 10.
Solution:   Use ConPTY support, if available. (Nobuhiro Takasaki, closes vim/vim#3794)

aa5df7e312

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 13:24:51 +08:00
4872e2da3c vim-patch:partial:8.0.1592: terminal windows in a session are not properly restored
Problem:    Terminal windows in a session are not properly restored.
Solution:   Add "terminal" in 'sessionoptions'.  When possible restore the
            command running in a terminal.

4d8bac8bf5

Tests only. Nvim has no equivalent to "norestore" yet.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 13:22:54 +08:00
748eae6bb5 test(old): reorder test_mksession.vim to match upstream (#26021) 2023-11-13 12:34:49 +08:00
d3582e102b feat(statuscolumn): re-evaluate for every screen line (#25885)
Problem:  v:virtnum is less useful than it could be.
Solution: Always re-evaluate 'statuscolumn', and update v:virtnum
          accordingly.
2023-11-13 11:24:02 +08:00
2a58aa5709 vim-patch:9.0.2102: matchparen highlight not cleared in completion mode (#26019)
Problem:  matchparen highlight not cleared in completion mode
Solution: Clear matchparen highlighting in completion mode

Remove hard-coded hack in insexpand.c to clear the :3match before
displaying the completion menu.

Add a test for matchparen highlighting. While at it, move all test tests
related to the matchparen plugin into a separate test file.

closes: vim/vim#13493
closes: vim/vim#13524

9588666360

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-13 10:47:12 +08:00
6fa9f45723 Merge pull request #26018 from zeertzjq/vim-9.0.0137
vim-patch:9.0.{0137,0336,0525}
2023-11-13 10:14:12 +08:00
629f117945 vim-patch:9.0.0525: manually deleting temp test files
Problem:    Manually deleting temp test files.
Solution:   Add the 'D' flag to writefile().

5917341f65

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 09:34:39 +08:00
b9cffe40fa vim-patch:9.0.0336: tests are flaky because of using a common file name
Problem:    Tests are flaky because of using a common file name.
Solution:   Rename files and directories to be more unique.

61abe7d8f8

Cherry-pick Test_custom_complete_autoload() from patch 8.2.4584.
Cherry-pick test_delete.vim & test_edit.vim changes from patch 9.0.0323.
Cherry-pick test_edit.vim changes from patch 8.2.3637.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 09:26:59 +08:00
5c69f8569a vim-patch:9.0.0137: debugger test may fail when $CWD is very long
Problem:    Debugger test may fail when $CWD is very long.
Solution:   Skip the test if the directory name is too long. (James McCoy,
            closes vim/vim#10837)

db7a88db8b

Co-authored-by: James McCoy <jamessan@jamessan.com>
2023-11-13 08:58:48 +08:00
1fd0ded080 vim-patch:8.2.4809: various things no6 properly tested (#26017)
Problem:    Various things no6 properly tested.
Solution:   Add various test cases. (Yegappan Lakshmanan, closes vim/vim#10259)

885de449c0

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-11-13 08:55:25 +08:00
d2983dcdb1 fix(clipboard): make osc52 work with PUC Lua (#26014) 2023-11-13 07:27:45 +08:00
d65c574ca3 Merge pull request #26016 from zeertzjq/vim-8.2.2985
vim-patch:8.2.{2985,2996,3003,3011,3013,3017,3026,3027,3039,3066,3086,3096,3116,3138,3395,3984,4020,4541}
2023-11-13 07:24:08 +08:00
d064f55704 vim-patch:8.2.4541: Crash in debugger when a variable is not available
Problem:    Crash in debugger when a variable is not available in the current
            block.
Solution:   Check for a NULL name. (closes vim/vim#9926)

e406ff87c8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 07:00:56 +08:00
c5d4d1cc0d vim-patch:8.2.4020: debugger test fails
Problem:    Debugger test fails.
Solution:   Fix import statement.

84c62d59a3

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:59:40 +08:00
2503de4c92 vim-patch:8.2.3984: debugger test fails
Problem:    Debugger test fails.
Solution:   Adjust the test for modified debugging of a for loop.

3d0da09bb2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:59:10 +08:00
331d213c0b vim-patch:8.2.3395: Vim9: expression breakpoint not checked in :def function
Problem:    Vim9: expression breakpoint not checked in :def function.
Solution:   Always compile a function for debugging if there is an expression
            breakpoint. (closes vim/vim#8803)

26a4484da2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:55:58 +08:00
49d126e005 vim-patch:8.2.3138: debugger test fails
Problem:    Debugger test fails.
Solution:   Adjust eval command.

31e21766d6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:49:57 +08:00
b313109a25 vim-patch:8.2.3116: Vim9: crash when debugging a function with line continuation
Problem:    Vim9: crash when debugging a function with line continuation.
Solution:   Check for a NULL pointer. (closes vim/vim#8521)

303215d60c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:49:40 +08:00
310d0f15c0 vim-patch:8.2.3096: temp files remain after running tests
Problem:    Temp files remain after running tests.
Solution:   Delete the right files. (Dominique Pellé, closes vim/vim#8509)

6c72fd51a8

Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
2023-11-13 06:49:09 +08:00
1cc2143710 vim-patch:8.2.3086: Vim9: breakpoint on "for" does not work
Problem:    Vim9: breakpoint on "for" does not work.
Solution:   Use the right line number in ISN_DEBUG. (closes vim/vim#8486)

6fc0161682

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:48:24 +08:00
32012b3fe8 vim-patch:8.2.3066: Vim9: debugging lambda does not work
Problem:    Vim9: debugging lambda does not work.
Solution:   Use the compile type of the function when compiling a lambda.
            (closes vim/vim#8412)

17d868b8b2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:47:43 +08:00
06acf78cd3 vim-patch:8.2.3039: Vim9: breakpoint at a comment line does not work
Problem:    Vim9: breakpoint at a comment line does not work.
Solution:   Add the comment line number to the debug instruction.
            (closes vim/vim#8429)

8cec9273d2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:46:17 +08:00
7e789137e9 vim-patch:8.2.3027: Vim9: breakpoint in compiled function not always checked
Problem:    Vim9: breakpoint in compiled function not always checked.
Solution:   Check for breakpoint when calling compiled function from compiled
            function.

2ac4b2536a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:46:17 +08:00
0bca5bff53 vim-patch:8.2.3026: Vim9: cannot set breakpoint in compiled function
Problem:    Vim9: cannot set breakpoint in compiled function.
Solution:   Check for breakpoint when calling a function.

4f8f54280f

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:46:17 +08:00
940d9c59a7 vim-patch:8.2.3017: Vim9: debugger shows too many lines
Problem:    Vim9: debugger shows too many lines.
Solution:   Truncate at a comment, "enddef", etc. (closes vim/vim#8392)

59b50c3bee

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:46:17 +08:00
02a43ddf1e vim-patch:8.2.3013: Vim: when debugging only first line of command is displayed
Problem:    Vim: when debugging only the first line of a command using line
            continuation is displayed.
Solution:   Find the next command and concatenate lines until that one.
            (closes vim/vim#8392)

4cea536bdf

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:46:17 +08:00
d46b6b2978 vim-patch:8.2.3011: Vim9: cannot get argument values during debugging
Problem:    Vim9: cannot get argument values during debugging.
Solution:   Lookup names in the list of arguments.  Put debug instruction
            halfway for command.

6bc30b05e6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:46:17 +08:00
3e8541f4a0 vim-patch:8.2.3003: Vim9: closure compiled with wrong compile type
Problem:    Vim9: closure compiled with wrong compile type.
Solution:   Use COMPILE_TYPE() when calling a function. (closes vim/vim#8384)

968a5b62ff

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:46:17 +08:00
04d951685b vim-patch:8.2.2996: Vim9: when debugging cannot inspect local variables
Problem:    Vim9: when debugging cannot inspect local variables.
Solution:   Make local variables available when debugging.

b69c6fb7b4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:46:17 +08:00
5ce3b89ff3 vim-patch:8.2.2985: Vim9: a compiled function cannot be debugged
Problem:    Vim9: a compiled function cannot be debugged.
Solution:   Add initial debugging support.

e99d422bbd

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-13 06:46:17 +08:00
03c3f7887d build: enforce PREFER_LUA
Only search for luajit if PREFER_LUA=OFF. If PREFER_LUA is OFF, then
always prioritize luajit first and then fall back to lua.
2023-11-12 23:43:57 +01:00
6d14f3ddab vim-patch:9.0.2103: recursive callback may cause issues on some archs (#26013)
Problem:  recursive callback may cause issues on some archs
Solution: Decrease the limit drastically to 20

Recursive callback limit causes problems on some architectures

Since commit 47510f3d6598a1218958c03ed11337a43b73f48d we have a test
that causes a recursive popup callback function to be executed. However
it seems the current limit of 'maxfuncdepth' option value is still too
recursive for some 32bit architectures (e.g. 32bit ARM).

So instead of allowing a default limit of 100 (default value for
'maxfuncdepth'), let's reduce this limit to 20. I don't think there is a
use case where one would need such a high recursive callback limit and a
limit of 20 seems reasonable (although it is currently hard-coded).

closes: vim/vim#13495
closes: vim/vim#13502

2076463e38

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-13 06:33:34 +08:00
74e23b3b2a vim-patch:2dd613f57bf1 (#26009)
runtime(termdebug): improve the breakpoint sign label (vim/vim#13525)

// related vim/vim#12589
// that should be the last chat (I) with Bram, r.i.p

2dd613f57b

Co-authored-by: Shane-XB-Qian <shane.qian@foxmail.com>
2023-11-13 05:44:30 +08:00
4f8941c1a5 refactor: replace manual header guards with #pragma once
It is less error-prone than manually defining header guards. Pretty much
all compilers support it even if it's not part of the C standard.
2023-11-12 22:01:28 +01:00
353a4be7e8 build: remove PVS
We already have an extensive suite of static analysis tools we use,
which causes a fair bit of redundancy as we get duplicate warnings. PVS
is also prone to give false warnings which creates a lot of work to
identify and disable.
2023-11-12 21:26:39 +01:00
2a57613b9b build: use stylua with add_glob_target
stylua version 0.19.0 has added the flag `--respect-ignores` which
unbreaks stylua when used with add_glob_target.

See eecddd2416 for more context.
2023-11-12 20:19:10 +01:00
LW
448907f65d feat(lsp)!: vim.lsp.inlay_hint.get(), enable(), is_enabled() #25512
refactor!: `vim.lsp.inlay_hint()` -> `vim.lsp.inlay_hint.enable()`

Problem:
The LSP specification allows inlay hints to include tooltips, clickable
label parts, and code actions; but Neovim provides no API to query for
these.

Solution:
Add minimal viable extension point from which plugins can query for
inlay hints in a range, in order to build functionality on top of.

Possible Next Steps
---

- Add `virt_text_idx` field to `vim.fn.getmousepos()` return value, for
  usage in mappings of `<LeftMouse>`, `<C-LeftMouse>`, etc
2023-11-12 04:54:27 -08:00
ad3568a701 vim-patch:9.0.2101: CI: test_termdebug may still fail (#26003)
Problem:  CI: test_termdebug may still fail
Solution: use term_wait() to make it more robust

closes: vim/vim#13529

fdbadea4b6

Co-authored-by: shane.xb.qian <shane.qian@foxmail.com>
2023-11-12 18:18:28 +08:00
c6b317dd13 vim-patch:2c133f6c1a16
runtime(lynx): Update for Lynx 2.8.9 (vim/vim#13510)

2c133f6c1a

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-11-12 10:53:57 +01:00
9ecb43b637 fix(float): apply 'winblend' to title/footer highlight (#25999) 2023-11-12 09:23:34 +08:00
b331302442 vim-patch:9358b8d99349 (#25998)
runtime(vim): Improve :let-heredoc syntax highlighting (vim/vim#12923)

"trim" and "eval" are allowed in any order and whitespace is not
required after "=<<".

9358b8d993

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-11-12 08:26:56 +08:00
145d9ed0fc vim-patch:9.0.2100: CI: test_termdebug fails (#25997)
Problem:  CI: test_termdebug fails
Solution: only test for a changed winlayout, if the window
          width actually changed

Also, include an unrelated comment (which doesn't warrant its own patch
number)

305127f9f2

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-12 08:18:40 +08:00
c23dd7c9ef vim-patch:9.0.2098: No filetype support for xcompose files (#25983)
Problem:  No filetype support for xcompose files
Solution: Add filetype detection

closes: vim/vim#13508

4f9074b96c
2023-11-12 07:51:25 +08:00
2494009885 vim-patch:1b08d2cd0789 (#25993)
runtime(doc): clarify when formatoptions applies

closes: vim/vim#13503

1b08d2cd07

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-12 07:49:57 +08:00
84688ec372 vim-patch:9.0.2097: No support for cypher files
Problem:  No support for cypher files
Solution: Add cypher filetype detection

Cypher query language support to work with (mostly) graph databases.

Already existing lsp support in Neovim's nvim-lspconfig:
https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#cypher_ls

closes: vim/vim#13516

8f0fe20ff1

Co-authored-by: Gerrit Meier <meistermeier@gmail.com>
2023-11-12 00:22:28 +01:00
592e4472da fix(PVS/V564): the '|' operator is applied to bool type value 2023-11-11 23:58:50 +01:00
128e194f64 fix(PVS/V1001): variable is assigned but is not used 2023-11-11 17:06:52 +01:00
be83cd73b2 vim-patch:5994329667a6
runtime(i3config): Update for i3 4.23 (vim/vim#13522)

5994329667

Co-authored-by: Ivan Grimaldi <grimaldi.ivan@gmail.com>
Co-authored-by: Ivan Grimaldi <grimaldi.ivam@gmail.com>
2023-11-11 15:11:49 +01:00
b2ca768196 ci: skip api-doc workflow on draft PRs
Checking the documentation generation is mostly useful towards the end
of a pull request like with the lintcommit workflow.
2023-11-11 13:50:53 +01:00
8e58d37f2e refactor: remove redundant casts 2023-11-11 13:31:17 +01:00
c4ad15ae32 fix(PVS/V009): add top-level message 2023-11-11 12:06:26 +01:00
6c3e170e56 fix(highlight): apply 'winblend' to float border (#25981) 2023-11-11 15:12:58 +08:00
fdaf6bc557 fix(context): don't leak memory on multiple invalid objects (#25979) 2023-11-11 13:10:26 +08:00
e9b9a86cd5 fix(context): don't crash on invalid arg to nvim_get_context (#25977)
Note: The crash happens in the second test case when using uninitialized
memory, and therefore doesn't happen with ASAN.
2023-11-11 10:21:14 +08:00
d1b2a5cf5f fix(completion): make sure the buffer name is valid (#25975)
Problem:
crash from
  set complete+=f
  open a empty buffer
  C-N

Solution:
make sure the buffer name is valid.

regression from ae4ca4edf8
2023-11-11 06:41:10 +08:00
4e33ef747c test: skip failing test on freebsd
The watch_file test started failing on bsd after
3ca967387c.
2023-11-10 21:10:15 +01:00
e112081daf docs: update contributing 2023-11-10 17:57:53 +01:00
3294d65416 PVS fixes
* build(PVS): exclude mpack and klib as they are external dependencies

* build(PVS): suppress warning V601

See https://pvs-studio.com/en/docs/warnings/v601/

* fix(PVS/V009): add top-level message

* fix(PVS/V547): expression 'p != NULL' is always true

* fix(PVS/V547): expression '* termpp == NULL' is always false
2023-11-10 17:48:45 +01:00
430b8da01d build(deps): bump tree-sitter-markdown to v0.1.7 2023-11-10 16:56:10 +01:00
0a82fa9989 build(deps): bump luajit to HEAD - 69bbbf773 2023-11-10 15:33:18 +01:00
06d37becca Merge pull request #25954 from bfredl/noxmalloc
refactor(drawline): avoid xmalloc/xfree cycles on each screenline
2023-11-10 12:26:51 +01:00
98bb1d66b1 ci: remove UBSAN_OPTIONS environment variable (#25963)
Because it overrides log_path from ASAN_OPTIONS.

Ref https://github.com/google/sanitizers/issues/1675
2023-11-10 15:47:34 +08:00
d5a85d737a fix(f_wait): flush UI before blocking (#25962) 2023-11-10 15:24:36 +08:00
bf5cf8ae82 vim-patch:8.2.4078: terminal test for current directory not used on FreeBSD (#25961)
Problem:    Terminal test for current directory not used on FreeBSD.
Solution:   Make it work on FreeBSD. (Ozaki Kiichi, closes vim/vim#9516) Add
            TermWait() inside Run_shell_in_terminal() as a generic solution.

ced2b38a56

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-10 14:20:32 +08:00
9af03bcd47 fix(options): do not change inccommand during preview (#25462) 2023-11-09 22:20:26 -06:00
cd63a9addd refactor: change some xstrndup() and xstrnsave() to xmemdupz() (#25959)
When the given length is exactly the number of bytes to copy, xmemdupz()
makes the intention clearer.
2023-11-10 08:39:21 +08:00
74581ec7eb refactor(drawline): avoid xmalloc/xfree cycles on each screenline 2023-11-09 21:55:21 +01:00
ae8ca79920 vim-patch:d56f15caf602
runtime(wget): Update for Wget2 2.1.0 (vim/vim#13497)

d56f15caf6

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-11-09 19:17:11 +01:00
267c346e2c Merge pull request #25951 from zeertzjq/vim-8.2.4140
vim-patch:8.2.{4140,4820,4825,4861,4932}
2023-11-09 21:53:34 +08:00
04d299c170 vim-patch:8.2.4932: not easy to filter the output of maplist()
Problem:    Not easy to filter the output of maplist().
Solution:   Add mode_bits to the dictionary. (Ernie Rael, closes vim/vim#10356)

d8f5f76621

Co-authored-by: Ernie Rael <errael@raelity.com>
2023-11-09 21:34:04 +08:00
f748a73a35 vim-patch:8.2.4861: it is not easy to restore saved mappings
Problem:    It is not easy to restore saved mappings.
Solution:   Make mapset() accept a dict argument. (Ernie Rael, closes vim/vim#10295)

51d04d16f2

Co-authored-by: Ernie Rael <errael@raelity.com>
2023-11-09 21:34:04 +08:00
d4dbfb092b vim-patch:8.2.4825: can only get a list of mappings
Problem:    Can only get a list of mappings.
Solution:   Add the optional {abbr} argument. (Ernie Rael, closes vim/vim#10277)
            Rename to maplist().  Rename test file.

09661203ec

Co-authored-by: Ernie Rael <errael@raelity.com>
2023-11-09 21:34:04 +08:00
2dfcd5a22b vim-patch:8.2.4820: not simple programmatic way to find a specific mapping
Problem:    Not simple programmatic way to find a specific mapping.
Solution:   Add getmappings(). (Ernie Rael, closes vim/vim#10273)

659c240cf7

Co-authored-by: Ernie Rael <errael@raelity.com>
2023-11-09 21:34:04 +08:00
a4b80c71ea vim-patch:8.2.4140: maparg() does not indicate the type of script
Problem:    maparg() does not indicate the type of script where it was defined.
Solution:   Add "scriptversion".

a9528b39a6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-09 21:34:02 +08:00
610f50ddaf vim-patch:20a94f44b3cd (#25946)
runtime(doc): fix grammar in termdebug doc, remove trailing spaces (vim/vim#13505)

20a94f44b3
2023-11-09 15:46:14 +08:00
43b0e2752c refactor(api): simplify nvim_set_keymap shortname check (#25945) 2023-11-09 12:28:43 +08:00
77bb69d7b0 vim-patch:7fbbd7fdc6df (#25944)
runtime(termdebug):  handle buffer-local mappings properly

closes: vim/vim#13475

7fbbd7fdc6

Co-authored-by: shane.xb.qian <shane.qian@foxmail.com>
2023-11-09 08:38:25 +08:00
04187d1cb5 Merge pull request #25942 from zeertzjq/vim-9.0.1791
vim-patch:9.0.{1791,1808,1809,1811},ca48202b6f46
2023-11-09 07:38:05 +08:00
89d785e530 vim-patch:ca48202b6f46
runtime(termdebug): improve window handling, shorten var types

closes vim/vim#13474

ca48202b6f

Co-authored-by: shane.xb.qian <shane.qian@foxmail.com>
2023-11-09 07:24:31 +08:00
7b921c5501 vim-patch:9.0.1811: still some issues with term_debug test
Problem:  still some issues with term_debug test
Solution: Use WaitForAssert()

closes: vim/vim#12936

85c3a5bc26

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-11-09 07:05:21 +08:00
4d36892191 vim-patch:9.0.1809: termdebug test flayk
Problem:  termdebug test flayk
Solution: wait slightly longer

6c93c94929

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-09 07:05:21 +08:00
c9e7e94fcc vim-patch:9.0.1808: termdebug: Typo in termdebug test
Problem:  termdebug: Typo in termdebug test
Solution: fix the typos

f2534434c9

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-09 07:05:21 +08:00
8d3dbf2746 vim-patch:9.0.1791: No tests for the termdebug plugin
Problem:  No tests for the termdebug plugin
Solution: Add some simple tests for the termdebug plugin

closes: vim/vim#12927

58f39d89a8

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-11-09 07:05:21 +08:00
ed464ba487 docs: list NVIM_APPNAME as env on manpage (#25935) 2023-11-09 07:04:44 +08:00
f7b2ea59a6 vim-patch:9.0.2095: statusline may look different than expected (#25941)
Problem:  statusline may look different than expected
Solution: do not check for highlighting of stl and stlnc characters

statusline fillchar may be different than expected

If the highlighting group for the statusline for the current window
|hl-StatusLine| or the non-current window |hl-StatusLineNC| are cleared
(or do not differ from each other), than Vim will use the hard-coded
fallback values '^' (for the non-current windows) or '=' (for the
current window).  I believe this was done, to make sure the statusline
will always be visible and be distinguishable from the rest of the
window.

However, this may be unexpected, if a user explicitly defined those
fillchar characters just to notice that those values are then not used
by Vim.

So, let's assume users know what they are doing and just always return
the configured stl and stlnc values.  And if they want the statusline to
be non-distinguishable from the rest of the window space, so be it.  It
is their responsibility and Vim shall not know better what to use.

fixes: vim/vim#13366
closes: vim/vim#13488

6a650bf696

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-09 06:34:34 +08:00
3128cff6b1 fix(clipboard): increase OSC 52 wait timeout (#25936)
When pasting with OSC 52 some terminals show a prompt to the user asking
for permission to read from the system clipboard. When this prompt
appears, 1s is not long enough to wait.

Increase the timeout to 10s and show a message to the user indicating
how to interrupt the wait after 1s.
2023-11-08 12:42:47 -06:00
bb7324292c fix: flush UI state before blocking in vim.wait (#25938) 2023-11-08 12:16:45 -06:00
08847a9ea1 refactor: move defaults into separate module (#25929)
Move default mappings and autocommands into a separate module and add
comments and docstrings to document each of the defaults.
2023-11-08 09:33:37 -06:00
1b0fd377ab Merge pull request #25767 from luukvbaal/signdel
feat(extmarks): add 'invalidate' property
2023-11-08 12:17:25 +01:00
4c8fdc018b build(deps): bump luajit to HEAD - b94fbfbee 2023-11-08 08:30:14 +01:00
4e6f559b8c feat(extmarks): add 'invalidate' property to extmarks
Problem:  No way to have extmarks automatically removed when the range it
          is attached to is deleted.
Solution: Add new 'invalidate' property that will hide a mark when the
          entirety of its range is deleted. When "undo_restore" is set
          to false, delete the mark from the buffer instead.
2023-11-08 02:53:49 +01:00
3d8f0cb695 fix(diagnostic): check if delete failed in qf_fill_buffer() (#25932)
When the contents of a quickfix buffer are replaced, there is a chance
that deletion of the previous lines fails. This ensures that we don't
get stuck in an infinite loop of retrying.

Fix #25402
2023-11-08 09:23:13 +08:00
1c71c32b29 fix(job-control): make jobwait() flush UI after hiding cursor (#25927) 2023-11-08 06:29:58 +08:00
cd31a72f9b Merge pull request #25872 from gpanders/osc52
feat(clipboard): add OSC 52 clipboard support
2023-11-07 08:47:27 -06:00
a14c780918 fix(input): set termkey buffer size to read stream capacity
This ensures that the read stream never overflows termkey's internal
buffer. This only happens when a large amount of bytes are pushed into
termkey at the same time, which is exactly what happens when we receive
a large OSC 52 response.
2023-11-07 08:25:43 -06:00
748bc4d22d feat(clipboard): add OSC 52 clipboard support
This is opt-in as not all terminal emulators support OSC 52, so it is up
to the user to enable it explicitly.
2023-11-07 08:25:33 -06:00
3ca967387c build(deps): bump libuv to v1.47.0 2023-11-07 09:43:48 +01:00
cd097ab8cc build: allow using system rocks
This allow distributions and other interested parties to use a system
busted rather than the on neovim bundles by passing the
-D USE_BUNDLED_BUSTED=ON flag to cmake when building.

Closes https://github.com/neovim/neovim/issues/23814.
2023-11-07 08:56:08 +01:00
a935c7531a test(ui/decorations_spec): avoid flakiness caused by undo msg (#25924) 2023-11-07 11:09:50 +08:00
6f936c9d85 fix(man): make :Man with a range work (#25922) 2023-11-07 10:39:27 +08:00
3198038224 fix(lua): correct return value for on_key with no arguments (#25911) 2023-11-07 08:33:38 +08:00
88ed9ffcd1 ci: work around flaky python3 tests
Python3 provider tests suddenly became extremely flaky on macos for
unknown reasons. For some reason, installing python with the
setup-python action over using the default python fixes the flakiness.
Use this workaround for the time being to unblock CI while we figure out
the root cause.
2023-11-06 23:06:35 +01:00
56627ca242 feat(tui): use TermResponse event for OSC responses (#25868)
When the terminal emulator sends an OSC sequence to Nvim (as a response
to another OSC sequence that was first sent by Nvim), populate the OSC
sequence in the v:termresponse variable and fire the TermResponse event.
The escape sequence is also included in the "data" field of the
autocommand callback when the autocommand is defined in Lua.

This makes use of the already documented but unimplemented TermResponse
event. This event exists in Vim but is only fired when Vim receives a
primary device attributes response.

Fixes: https://github.com/neovim/neovim/issues/25856
2023-11-06 12:42:40 -06:00
f9416470b1 fix(build): include FindPackageHandleStandardArgs 2023-11-06 17:46:02 +01:00
0774d0cfe1 vim-patch:da4e433dc3be (#25912)
runtime(doc): document vim-script library function

da4e433dc3

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-06 19:03:08 +08:00
cfe23a80f0 Merge pull request #25905 from bfredl/nested_rabbit_holes
refactor(grid): reimplement 'rightleft' as a post-processing step
2023-11-06 11:45:34 +01:00
f1e9aa8f7e build(deps): bump luajit to HEAD - 07b3cd3cf 2023-11-06 08:12:00 +01:00
324fad1e88 vim-patch:9.0.2092: tests: failure in test_arabic
Problem:  tests: failure in test_arabic
Solution: adjust the test for the changed arabic keymap

2a94e98792

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-05 21:56:56 +01:00
bbd7ec9e64 vim-patch:caee7956a21a
runtime(keymap): Switch Hindu-Arabic to Arabic numerals in arabic keymap (vim/vim#13430)

caee7956a2

Co-authored-by: avidseeker <avidseeker7@protonmail.com>
2023-11-05 21:56:56 +01:00
b329a21bd3 vim-patch:3d37231437fc
runtime(tar): improve the error detection

Do not rely on the fact, that the last line matches warning, error,
inappropriate or unrecognized to determine if an error occurred. It
could also be a file, contains such a keyword.

So make the error detection slightly more strict and only assume an
error occured, if in addition to those 4 keywords, also a space matches
(this assumes the error message contains a space), which luckily on Unix
not many files match by default.

The whole if condition seems however slightly dubious.  In case an error
happened, this would probably already be caught in the previous if
statement, since this checks for the return code of the tar program.

There may however be tar implementations, that do not set the exit code
for some kind of error (but print an error message)? But let's keep this
check for now, not many people have noticed this behaviour until now, so
it seems to work reasonably well anyhow.

related: vim/vim#6425
fixes: vim/vim#13489

3d37231437

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-05 21:56:56 +01:00
dcf5999fcd vim-patch:b2a4c110a5d1
runtime(dist): Make dist/vim.vim work properly when lacking vim9script support (vim/vim#13487)

`:return` cannot be used outside of `:function` (or `:def`) in older Vims
lacking Vim9script support or in Neovim, even when evaluation is being skipped
in the dead `:else` branch.

Instead, use the pattern described in `:h vim9-mix`, which uses `:finish` to end
script processing before it reaches the vim9script stuff.

b2a4c110a5

Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
2023-11-05 21:52:02 +01:00
2a47dbe228 vim-patch:4f174f0de90b
runtime(dist): add legacy version for central vim library

Also, enable the zip and gzip plugins by default, unless those variables
were not explicitly set by the user.

related: vim/vim#13413

4f174f0de9

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-05 21:52:02 +01:00
26cdff0e92 vim-patch:cd8a3eaf5348
runtime(dist): centralize safe executable check and add vim library (vim/vim#13413)

Follow up to 816fbcc26 (patch 9.0.1833: [security] runtime file fixes,
2023-08-31) and f7ac0ef50 (runtime: don't execute external commands when
loading ftplugins, 2023-09-06).

This puts the logic for safe executable checks in a single place, by introducing
a central vim library, so all filetypes benefit from consistency.

Notable changes:
- dist#vim because the (autoload) namespace for a new runtime support
  library. Supporting functions should get documentation. It might make
  life easier for NeoVim devs to make the documentation a new file
  rather than cram it into existing files, though we may want
  cross-references to it somewhere…
- The gzip and zip plugins need to be opted into by enabling execution
  of those programs (or the global plugin_exec). This needs
  documentation or discussion.
- This fixes a bug in the zig plugin: code setting s:tmp_cwd was removed
  in f7ac0ef50 (runtime: don't execute external commands when loading
  ftplugins, 2023-09-06), but the variable was still referenced. Since
  the new function takes care of that automatically, the variable is no
  longer needed.

cd8a3eaf53

Co-authored-by: D. Ben Knoble <ben.knoble+github@gmail.com>
2023-11-05 21:52:02 +01:00
8ae39eb584 build: remove git requirement
We do not have any patches that we use at the moment, so git is not
needed right now. Futhermore, we've become more strict with not adding
patches, which makes it pretty safe to remove this for the time being.
2023-11-05 21:39:24 +01:00
397b92e02d build: enable ASAN for MSVC
It is enabled with ENABLE_ASAN_UBSAN like other compilers. Technically
it only enables ASAN as UBSAN is not available, meaning to make the
variable names fully correct we'd need to separate it into two checks:
ENABLE_ASAN and ENABLE_UBSAN, but the convenience of combining them into
the same flag outweighs the theoretical correctness.

Also note in CONTRIBUTING.md that debug builds in ASAN is not supported.
Technically it is the debug runtime that is not supported, which cmake
automatically enables when using the debug build type. However, neovim
can't be built with debug builds without linking to the debug runtime
since the third party libraries has likely been linked to the debug
runtime if it was built with debug build type. This technicality is
likely uninteresting to the potential developer and it's easier to just
say to use a release build type.
2023-11-05 21:39:12 +01:00
83db9115af refactor(grid): reimplement 'rightleft' as a post-processing step
problem: checks for wp->w_p_rl are all over the place, making simple
things like "advance column one cell" incredibly complicated.

solution: always fill linebuf_char[] using an incrementing counter,
and then mirror the buffer as a post-processing step

This was "easier" that I first feared, because the stupid but simple
workaround for things like keeping linenumbers still left-right,
e.g. "mirror them and them mirror them once more" is more or less
what vim did already. So let's just keep doing that.
2023-11-05 21:19:35 +01:00
acc646ad8f refactor: the long goodbye
long is 32 bits on windows, while it is 64 bits on other architectures.
This makes the type suboptimal for a codebase meant to be
cross-platform. Replace it with more appropriate integer types.
2023-11-05 20:19:06 +01:00
c513cbf361 build(deps): bump luajit to HEAD - 0afa1676b 2023-11-05 15:25:44 +01:00
a8aebcff50 build(deps): bump libiconv to 1.17
new license (LGPL 2.1), adds EBCDIC encodings
2023-11-05 13:30:47 +01:00
22fa66bb1d Merge pull request #25882 from bfredl/noundo
feat(extmarks): add "no_undo_restore" flag to opt out of undo-restoring
2023-11-05 13:17:23 +01:00
68cb4a7405 feat(extmarks): add "undo_restore" flag to opt out of undo-restoring
It is a design goal of extmarks that they allow precise tracking
of changes across undo/redo, including restore the exact positions
after a do/undo or undo/redo cycle. However this behavior is not useful
for all usecases. Many plugins won't keep marks around for long after
text changes, but uses them more like a cache until some external source
(like LSP semantic highlights) has fully updated to changed text and
then will explicitly readjust/replace extmarks as needed.

Add a "undo_restore" flag which is true by default (matches existing
behavior) but can be set to false to opt-out of this behavior.

Delete dead u_extmark_set() code.
2023-11-05 12:18:29 +01:00
4d757bbfbb refactor: combine regexp files
regext_bt.c and regexp_nfa.c are inlined into regexp.c instead of
included as a header. This makes developer tools like clang-tidy and
clangd be able to understand the code better.
2023-11-05 11:48:42 +01:00
92e99bb105 ci: don't install unzip
It is no longer needed now that luarocks isn't used.
2023-11-05 11:40:54 +01:00
5cefec7349 build: various cmake fixes
- silence false warnings on MSVC
- merge `clang-tidy` cmake target into `lintc` and remove the
  corresponding make target
- use cmake's built-in endianness detection
2023-11-04 18:32:47 +01:00
ec66a95fbc vim-patch:9.0.2090: complete_info() skips entries with 'noselect' (#25890)
Problem:  complete_info() skips entries with 'noselect'
Solution: Check, if first entry is at original text state

Unfortunately, Commit daef8c74375141974d61b85199b383017644978c
introduced a regression, that when ':set completeopt+=noselect' is set
and no completion item has been selected yet, it did not fill the
complete_info['items'] list.

This happened, because the current match item did not have the
CP_ORIGINAL_TEXT flag set and then the cp->prev pointer did point to the
original flag item, which caused the following while loop to not being
run but being skipped instead.

So when the 'noselect' is set, only start with to the previous selection
item, if the initial completion item has the CP_ORIGINAL_TEXT flag set,
else use the 2nd previous item instead.

fixes: vim/vim#13451
closes: vim/vim#13452

57f9ce1a09

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-04 21:59:03 +08:00
6c150e0b93 docs(treesitter): add disclaimer about needing to parse before get_node()
Problem:
---
Misuse of `get_node()` is common:
https://github.com/search?q=get_node_at_cursor+language%3Alua&type=code

Solution:
---
Add a note clarifying proper usage.
2023-11-04 14:55:44 +01:00
d3e9cbedc7 vim-patch:ce3b0136c6d9
runtime(sh): Update sh syntax and add shDerefOffset to shDerefVarArray for bash (vim/vim#13480)

Add shDerefOffset to shDerefVarArray.

Example code:

```bash
declare -a a=({a..z})

echo "${a[@]:1:3}"
```

ce3b0136c6

Co-authored-by: Lucien Grondin <grondilu@yahoo.fr>
2023-11-04 12:55:54 +01:00
e960fa2412 vim-patch:2f54c13292af
runtime(script.vim): make strace ft check less strict (vim/vim#13482)

Strace output, depending on parameters (-ttf this time), can dump both
times and pid:
  1038  07:14:20.959262 execve("./e.py", ["./e.py"], 0x7ffca1422840 /* 51 vars */) = 0 <0.000150>

So loose the regexp matching this, so that the above is matched too.

Fixes vim/vim#13481.

2f54c13292

Co-authored-by: Jiri Slaby <jirislaby@gmail.com>
Co-authored-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
2023-11-04 12:55:25 +01:00
9281edb334 fix(lsp): create per client params in lsp.buf.code_action
`code_action` used the same parameters for all clients, which led to the
following warning and incorrect start/end column locations if using
clients with mixed encodings:

    warning: multiple different client offset_encodings detected for
    buffer, this is not supported yet
2023-11-04 08:17:42 +01:00
LW
468292dcb7 fix(rpc): "grid_line" event parsing crashes (#25581)
refactor: use a more idiomatic loop to iterate over the cells

There are two cases in which the following assertion would fail:
```c
assert(g->icell < g->ncells);
```

1. If `g->ncells = 0`. Update this to be legal.
2. If an EOF is reached while parsing `wrap`. In this case, the unpacker
   attempts to resume from `cells`, which is a bug. Create a new state
   for parsing `wrap`.

Reference: https://neovim.io/doc/user/ui.html#ui-event-grid_line
2023-11-04 06:56:45 +08:00
9ad239690f ci: various fixes
- adjust reviewers
- add workflow as cache key
- install attr only when tesitng
- fix s390x workflow by checking out the merge PR instead of master
2023-11-03 22:16:45 +01:00
310896f6aa Merge pull request #25874 from bfredl/lets_rock
refactor(grid): implement rightleftcmd as a post-processing step
2023-11-03 14:25:15 +01:00
44f0480a22 refactor(grid): implement rightleftcmd as a post-processing step
Previously, 'rightleftcmd' was implemented by having all code which
would affect msg_col or output screen cells be conditional on `cmdmsg_rl`.
This change removes all that and instead implements rightleft as a
mirroring post-processing step.
2023-11-03 11:35:42 +01:00
d4dc1355ed vim-patch:1858e2b22ad1
runtime(sh) Update sh syntax and add shDblParen to shCaseList (vim/vim#13469)

1858e2b22a

Co-authored-by: Lucien Grondin <grondilu@yahoo.fr>
2023-11-03 10:04:55 +01:00
80cf1ee2c5 vim-patch:2b89afd5eb63
runtime(debversions): Add noble (24.04 LTS) as Ubuntu release name (vim/vim#13472)

2b89afd5eb

Co-authored-by: James McCoy <jamessan@jamessan.com>
2023-11-03 10:04:55 +01:00
4c32927084 test(ui/embed_spec): make sure server is started (#25880) 2023-11-03 08:19:04 +08:00
5a2543c159 docs: small fixes (#25831)
Co-authored-by: Peter Aronoff <peter@aronoff.org>
2023-11-03 07:22:02 +08:00
c1a05f6112 build: make the vimdoc generation depend on the nvim target (#25876)
The gen_vimdoc.py script uses the nvim executable, so the executable
must be built before running the script.
2023-11-02 12:34:16 -07:00
e0d97d264f build: use built nvim artifact to generate eval files (#25875)
In cases where the generated files depend on changes to Nvim itself,
generating the files with an older version of Nvim will fail because
those changes are not present in the older version.

For example, if a new option is added then the generator script should
be run with the version of Nvim that contains the new option, or else
the generation will fail.

Co-authored-by: dundargoc <gocdundar@gmail.com>
2023-11-02 11:12:38 -07:00
363e029e7a Merge pull request #25859 from luukvbaal/extmarkdel
refactor(extmarks): extmark_del() with MarkTreeIter
2023-11-02 10:55:56 +01:00
14c7bf3916 refactor(extmarks): extmark_del() with MarkTreeIter 2023-11-01 23:20:38 +01:00
20dd9f3a26 ci: add optional CI that can be triggered manually
These are meant for expensive or situational tests that may not be
suitable to run each time, but can occasionally be useful.

Currently only add testing for s390x. The job is enabled by adding the
ci-s390x label in github.
2023-11-01 11:17:35 +01:00
1997ef134a build: set char to always be signed
Sticking to the same convention makes it easier to reason about the code
and reduces complexity.
2023-11-01 08:20:24 +01:00
d7359a8742 fix(startup): trigger UIEnter for the correct channel (#25860) 2023-11-01 12:16:37 +08:00
4e6096a67f feat(server): allow embed with listen (#25709)
connection from any channel or stdio will unblock
remote_ui_wait_for_attach.  Wait on stdio only if
only —embed specified, if both —embed and
—listen then wait on any channel.
2023-11-01 11:04:53 +08:00
746a153bc1 fix(base64): only check padding if leftover index is set (#25854) 2023-10-31 10:13:45 -05:00
224f303ee5 feat(stdlib): add vim.base64 module (#25843)
Add base64 encode() and decode() functions to a vim.base64 module.
2023-10-31 09:15:32 -05:00
adbe7f3683 fix(lsp): call on_list() even for single location (#25830)
Problem: Currently there is no way of customizing behavior of
  `declaration`, `definition`, `typeDefinition`, and `implementation`
  methods in `vim.lsp.buf` when LSP server returns `Location`. Instead,
  cursor jumps to that location directly.

Solution: Normalize LSP response to be `Location[]` for those four cases.
2023-10-31 13:18:44 +01:00
c1a93285d2 Merge pull request #25850 from famiu/refactor/option/string
refactor(options): remove `os_doskip`
2023-10-31 12:24:16 +01:00
5e8d4ee0db refactor(options): remove os_doskip
Problem: `os_doskip` seems to be unnecessary since everything that sets it to true also returns an error, and `errmsg` being non-`NULL` already skips most of the processing.

Solution: Remove `os_doskip`.
2023-10-31 13:36:06 +06:00
d4c2fc6ff6 fix(terminal): keep focus when scrolling number column of another window (#25848) 2023-10-31 15:23:20 +08:00
c881092ffe fix(terminal): don't lose focus on <MouseMove> (#25845) 2023-10-31 12:05:37 +08:00
6d1a2f2c3c Merge pull request #25674 from famiu/refactor/options/unify_string_options
refactor(options): unify `set_option` and `set_string_option`
2023-10-30 20:06:57 +01:00
788bc12a6f ci: bump korthout/backport-action from 1 to 2 2023-10-30 18:23:11 +01:00
e19cc9c9b7 refactor(options)!: unify set_option and set_string_option
While the interfaces for setting number and boolean options are now unified by #25394, there is still a separate `set_string_option` function that is used for setting a string option. This PR removes that function and merges it with set_option.

BREAKING CHANGE: `v:option_old` is now the old global value for all global-local options, instead of just string global-local options. Local value for a global-local number/boolean option is now unset when the option is set (e.g. using `:set` or `nvim_set_option_value`) without a scope, which means they now behave the same way as string options.

Ref: #25672
2023-10-30 21:38:02 +06:00
0fe0cf5ada fix(lsp): do not cancel snippet when selecting placeholder (#25835) 2023-10-30 12:58:28 +01:00
8405649f92 build: use neovim/libvterm instead of neovim/deps for libvterm
Using a mirror makes it easier to test patches as well as reducing
maintenance when a new version is released.
2023-10-29 12:14:19 +01:00
2dc9ceb99c docs: small fixes (#25585)
Co-authored-by: tmummert <doczook@gmx.de>
Co-authored-by: parikshit adhikari <parikshitadhikari@gmail.com>
2023-10-29 16:02:32 +08:00
0da27e9bde fix(api): load buffer first on nvim_buf_set_lines (#25823)
Fix #22670
Fix #8659
2023-10-29 15:44:52 +08:00
82b1a389ba fix(terminal): avoid Insert mode in Terminal buffer (#25820) 2023-10-29 09:32:03 +08:00
a5629abce2 vim-patch:a390e984db20
runtime(sh): add shDblParen to shLoopList for bash (vim/vim#13445)

add shDblParen to shLoopList to correctly highlight
arithmetic expressions for Bash and Ksh

This should allow code such as:

```bash
declare -i i j
for i in foo bar
do ((j = 1 << j))
done
```

a390e984db

Co-authored-by: Lucien Grondin <grondilu@yahoo.fr>
2023-10-29 01:37:07 +02:00
c34e816608 vim-patch:9.0.2079: Not all Dart files detected
Problem:  Not all Dart files detected
Solution: Add shebang filetype detection for Dart

closes: vim/vim#13449

c1c177a47b

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-10-29 01:36:51 +02:00
a2a1a65b98 vim-patch:8ebdbc9e6d80 (#25816)
runtime(doc): all secure options should note this restriction in the documentation (vim/vim#13448)

Problem:  Not all secure options document their status
Solution: Describe secure context :set restrictions in each help entry

8ebdbc9e6d

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-10-29 06:15:13 +08:00
f2fb05238a vim-patch:9.0.2081: smoothscroll may result in wrong cursor position (#25815)
Problem:  With 'smoothscroll' set, "w_skipcol" is not reset when unsetting 'wrap'.
          Resulting in incorrect calculation of the cursor position.
Solution: Reset "w_skipcol" when unsetting 'wrap'.

fixes:  vim/vim#12970
closes: vim/vim#13439

1bf1bf569b
2023-10-29 06:05:29 +08:00
4f526b9fd8 build: use neovim/libtermkey instead of neovim/deps for libtermkey
Using a mirror makes it easier to test patches as well as reducing
maintenance when a new version is released.
2023-10-28 22:32:52 +02:00
c5f2472661 Merge pull request #25812 from famiu/test/api/option_value/modified
test: add test coverage for #25741
2023-10-28 21:47:40 +02:00
43a7945f1b test: add test coverage for #25741 2023-10-28 22:51:07 +06:00
7a5effb0f9 build: bump required minimum libvterm version to 0.3.3
Also add detection for libvterm patch version.
2023-10-28 10:46:58 +02:00
ac353e87ae vim-patch:9.0.2075: TextChangedI may not always trigger (#25808)
Problem:  TextChangedI may not always trigger
Solution: trigger it in more cases: for insert/
          append/change operations, and when
          opening a new line,

fixes: vim/vim#13367
closes: vim/vim#13375

4bca4897a1

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-10-28 10:42:18 +08:00
f97248db75 vim-patch:9.0.2070: [security] disallow setting env in restricted mode (#25807)
Problem:  [security] disallow setting env in restricted mode
Solution: Setting environment variables in restricted mode could
          potentially be used to execute shell commands. Disallow this.

restricted mode: disable allow setting of environment variables

Setting environment variables in restricted mode, may have some unwanted
consequences. So, for example by setting $GCONV_PATH in restricted mode
and then calling the iconv() function, one may be able to execute some
unwanted payload, because the `iconv_open()` function internally uses
the `$GCONV_PATH` variable to find its conversion data.

So let's disable setting environment variables, even so this is no
complete protection, since we are not clearing the existing environment.
I tried a few ways but wasn't successful :(

One could also argue to disable the iconv() function completely in
restricted mode, but who knows what other API functions can be
influenced by setting some other unrelated environment variables.
So let's leave it as it is currently.

closes: vim/vim#13394
See: https://huntr.com/bounties/b0a2eda1-459c-4e36-98e6-0cc7d7faccfe/

6b89dd6a72

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-10-28 10:06:43 +08:00
d2e7cc68e9 Merge pull request #25806 from zeertzjq/vim-9.0.2074
vim-patch:9.0.{2074,2077}: Completion menu may be wrong
2023-10-28 06:44:08 +08:00
9455f6b17c vim-patch:650dcfc8d12e
runtime(netrw): don't echo empty lines (vim/vim#13431)

650dcfc8d1

Co-authored-by: nwounkn <nwounkn@gmail.com>
2023-10-28 00:24:40 +02:00
063a78fda2 vim-patch:9.0.2077: CI fails because of trailing whitespace in test
Problem:  CI fails because of trailing whitespace in test
Solution: Remove it

87ca5e86fa

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-10-28 06:17:08 +08:00
0b23207c73 vim-patch:9.0.2074: Completion menu may be wrong
Problem:  Completion menu may be wrong
Solution: Check for the original direction of the completion menu,
          add more tests, make it work with 'noselect'

completion: move in right direction when  filling completion_info()

When moving through the insert completion menu and switching directions,
we need to make sure we start at the correct position in the list and
move correctly forward/backwards through it, so that we do not skip
entries and the selected item points to the correct entry in the list
of completion entries generated by the completion_info() function.

The general case is this:

1) CTRL-X CTRL-N, we will traverse the list starting from
   compl_first_match and then go forwards (using the cp->next pointer)
   through the list (skipping the very first entry, which has the
   CP_ORIGINAL_TEXT flag set (since that is the empty/non-selected entry

2) CTRL-X CTRL-P, we will traverse the list starting from
   compl_first_match (which now points to the last entry). The previous
   entry will have the CP_ORIGINAL_TEXT flag set, so we need to start
   traversing the list from the second prev pointer.

There are in fact 2 special cases after starting the completion menu
with CTRL-X:

3)  CTRL-N and then going backwards by pressing CTRL-P again.
    compl_first_match will point to the same entry as in step 1 above,
    but since compl_dir_foward() has been switched by pressing CTRL-P
    to backwards we need to pretend to be in still in case 1 and still
    traverse the list in forward direction using the cp_next pointer

4)  CTRL-P and then going forwards by pressing CTRL-N again.
    compl_first_match will point to the same entry as in step 2 above,
    but since compl_dir_foward() has been switched by pressing CTRL-N
    to forwards we need to pretend to be in still in case 2 and still
    traverse the list in backward direction using the cp_prev pointer

For the 'noselect' case however, this is slightly different again. When
going backwards, we only need to go one cp_prev pointer back. And
resting of the direction works again slightly different. So we need to
take the noselect option into account when deciding in which direction
to iterate through the list of matches.

related: vim/vim#13402
related: vim/vim#12971
closes: vim/vim#13408

daef8c7437

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-10-28 06:16:55 +08:00
add1b10b79 fix(diagnostic): virtual_text prefix function should have index and total (#25801)
The prefix option of the diagnostic virtual text can be a function,
but previously it was only a function of diagnostic.

This function should also have additional parameters index and total,
more consistently and similarily as in the prefix function for
`vim.diagnostic.open_float()`.

These additional parameters will be useful when there are too many
number of diagnostics in a single line.
2023-10-27 08:17:46 -05:00
4fcdfa5ad0 vim-patch:7b7cda67a124
runtime(debian): update debian related runtime files (vim/vim#13423)

* Update Debian runtime files

Add mantic as a supported Ubuntu release and move buster/kinetic to
unsupported.

Add syntax highlighting for deb822sources filetype.

Add debsources ftplugin to set relevant comment options.

Move common version information to shared/debversions.vim

Closes vim/vim#11934

* Add myself as codeowner for Debian-related runtime files

---------

7b7cda67a1

Co-authored-by: James McCoy <jamessan@jamessan.com>
Co-authored-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Co-authored-by: James Addison <jay@jp-hosting.net>
Co-authored-by: Viktor Szépe <viktor@szepe.net>
Co-authored-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Co-authored-by: James Addison <jay@jp-hosting.net>
Co-authored-by: Viktor Szépe <viktor@szepe.net>
2023-10-27 10:06:52 +02:00
5753e5e7eb vim-patch:9.0.2071: objdump files not recognized
Problem:  objdump files not recognized
Solution: detect *.objdump files, add a filetype plugin

Added the objdump file/text format

closes: vim/vim#13425

10407df7a9

Co-authored-by: Colin Kennedy <colinvfx@gmail.com>
2023-10-27 10:03:09 +02:00
9dc440400c vim-patch:9.0.2068: [security] overflow in :history (#25794)
Problem:  [security] overflow in :history
Solution: Check that value fits into int

The get_list_range() function, used to parse numbers for the :history
and :clist command internally uses long variables to store the numbers.
However function arguments are integer pointers, which can then
overflow.

Check that the return value from the vim_str2nr() function is not larger
than INT_MAX and if yes, bail out with an error. I guess nobody uses a
cmdline/clist history that needs so many entries... (famous last words).

It is only a moderate vulnerability, so impact should be low.

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-q22m-h7m2-9mgm

9198c1f2b1

N/A patch:
vim-patch:9.0.2073: typo in quickfix.c comments

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-10-27 06:37:52 +08:00
ba6761eafe fix(lsp): fix omnicomplete in middle of the line (#25787)
Fixes a regression from 5e5f5174e3

Until that commit we had a logic like this:
`local prefix = startbyte and line:sub(startbyte + 1) or line_to_cursor:sub(word_boundary)`

The commit changed the logic and no longer cut off the line at the cursor,  resulting in a prefix that included trailing characters
2023-10-26 22:40:36 +02:00
15983cf2c6 fix(lsp): cancel session when leaving snippet region (#25762) 2023-10-26 07:29:05 +02:00
9de157bce4 fix(float): win_get_bordertext_col returning negative column number (#25752)
Problem:
  `win_get_bordertext_col` returns column < 1 for right or center
  aligned text, if its length is more than window width.

Solution:
  Return max(resulting_column, 1)
2023-10-26 11:44:28 +08:00
f2fc44550f vim-patch:9.0.2064: cannot use buffer-number for errorformat (#25782)
Problem:  cannot use buffer-number for errorformat
Solution: add support for parsing a buffer number using '%b' in
          'errorformat'

closes: vim/vim#13419

b731800522

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-10-26 07:42:29 +08:00
bfe8a39512 vim-patch:partial:5985879e3c36 (#25780)
runtime(doc): Fix typos in several documents (vim/vim#13420)

* Fix typos in several documents
* Update runtime/doc/terminal.txt

5985879e3c

Skip runtime/doc/indent.txt: not ported yet

Co-authored-by: h_east <h.east.727@gmail.com>
Co-authored-by: K.Takata <kentkt@csc.jp>
2023-10-26 06:41:54 +08:00
3347519dd7 vim-patch:9.0.2065: EXPAND flag set for filetype option (#25779)
Problem:  EXPAND flag set for filetype option
Solution: Remove P_EXPAND flag from the 'filetype' option

Remove P_EXPAND flag from the 'filetype' option

Problem:  P_EXPAND flag is erroneously set for 'filetype' option
Solution: Remove the P_EXPAND flag

This flag is used by string options that accept file path values.  See
:help set_env.

This appears to have been included in d5e8c92 and resulted from an
incorrect implementation of 'filetype' completion.

See vim/vim#12900 for a small discussion.

related: vim/vim#12900
closes: vim/vim#13416

3932072ab4

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-10-26 06:34:56 +08:00
684e93054b fix(terminal): assign channel to terminal earlier (#25771) 2023-10-25 09:59:02 +08:00
1094d0c0db build: add CMAKE_C_FLAGS to --version output
Closes https://github.com/neovim/neovim/issues/25754.
2023-10-24 11:09:15 +02:00
0b1ec3b162 vim-patch:9.0.2063: pacman hooks are detected as conf filetype
Problem:  pacman hooks are detected as conf filetype
Solution: make it consistent to pacman.conf and detect those
          hooks as confini

Because confini has much better syntax highlighting than conf.

For reference, I identified pacman.conf and pacman hooks as dosini in
https://github.com/vim/vim/pull/6335, then
https://github.com/vim/vim/pull/10213 changed them to conf, then
https://github.com/vim/vim/pull/10518 changed pacman.conf to confini but
forgot to change hooks.

closes: vim/vim#13399

7d254dbc2d

Co-authored-by: Guido Cella <guido@guidocella.xyz>
2023-10-24 10:15:47 +02:00
4f0adb6a78 vim-patch:9.0.2062: Janet files are not recognised
Problem:  Janet files are not recognised
Solution: Add filename and shebang detection (without
          adding an extra filetype plugin)

Those are used by the Janet language:
http://www.janet-lang.org

closes: vim/vim#13400

c038427d2a

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-10-24 10:15:47 +02:00
94fee35446 vim-patch:9.0.2061: not able to detect xkb filetypes
Problem:  not able to detect xkb filetypes
Solution: Detect files below /u/s/X11/xkb as xkb files (without adding
          an extra filetype)

Those files are used from the X11 xkb extension

closes: vim/vim#13401

ae9021a840

Co-authored-by: Guido Cella <guido@guidocella.xyz>
2023-10-24 10:15:47 +02:00
5f0224e848 vim-patch:9.0.2060: *.{gn,gni} files are not recognized
Problem:  *.{gn,gni} files are not recognized
Solution: Detect some as gn filetype (without adding an extra filetype)

Those come from: https://gn.googlesource.com/gn/

closes: vim/vim#13405

84394f2be4

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-10-24 10:15:47 +02:00
d432bba4e4 fix(marks): handle switching buffer properly (#25763) 2023-10-24 16:10:36 +08:00
25cfe3fd43 build: enable formatting during rebase
Closes https://github.com/neovim/neovim/issues/25654
2023-10-23 21:48:06 +02:00
5f03a1eaab build(lint): remove unnecessary clint.py rules
Uncrustify is the source of truth where possible.
Remove any redundant checks from clint.py.
2023-10-23 20:06:21 +02:00
e606604322 vim-patch:fea96c00e55a
runtime(vim): Update ftplugin - comment motions (vim/vim#13412)

Fix the pattern used by comment-motion mappings to match the start of a
block comment.

Block-comment start lines were being ignored if the previous line
contained a double-quote character anywhere in the line.  Line comments
should only be ignored if the previous line is a full-line comment and,
therefore, part of the current block comment.

fea96c00e5

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-10-23 19:48:50 +02:00
94127cb5df fix(lsp): do not add extra indentation 2023-10-23 17:21:41 +02:00
370232dbef fix(lsp): track snippet deletion 2023-10-23 17:21:41 +02:00
5e5f5174e3 fix(lsp): fix off-by-one error for omnifunc word boundary
Fixes https://github.com/neovim/neovim/issues/25177

I initially wanted to split this into a refactor commit to make it more
testable, but it appears that already accidentally fixed the issue by
normalizing lnum/col to 0-indexing
2023-10-23 08:26:38 +02:00
bc850ba2a0 ci: run tests in parallel
This will run the three test suites (unit, functional and old) in
parallel, meaning that neovim is built for each test and run separately.
This has a slight increase in total CI usage, but it allows rerunning
only the specific test suite that failed for flaky tests, which will
save some time.

Ideally we'd remove any drawbacks by building neovim once and reusing it
for each test suite, but that is not currently possible due to poor
upload/download speeds of the upload-artifact and download-artifact
actions. This has been addressed in
https://github.com/actions/toolkit/pull/1488, but will only be made
available in upload-artifact@v4 and download-artifact@v4.
2023-10-22 16:13:34 +02:00
3a3e025126 ci: install perl provider on mac
Perl provider installation was previously disabled on mac due to a
version conflict in 79bf507449. It is no
longer present, so we enable it.
2023-10-21 21:54:11 +02:00
999879a512 Merge pull request #25741 from famiu/fix/options/modified
fix(options): `'modified'` showing incorrect value for scratch buffers
2023-10-21 21:46:51 +02:00
9d01385c6c fix(options): 'modified' showing incorrect value for scratch buffers
Problem: #25716 removed the logic for getting the correct value of the `'modified'` option when using `nvim_buf_get_option()`. So the function now returns an incorrect value of `'modified'` for scratch buffers.

Solution: Re-add the logic for getting the correct value of `'modified'`. Also make it so that the logic only exists in one place instead of being duplicated across multiple places in the code.
2023-10-22 01:17:27 +06:00
40574b424f Merge pull request #25624 from glepnir/fix_25598
feat(complete): support f flag for complete buffer name part
2023-10-21 15:52:47 +02:00
752c6ce4ad build(deps): bump luajit to HEAD - e826d0c10 2023-10-21 14:14:12 +02:00
ae4ca4edf8 feat(complete): support f flag for complete buffer part 2023-10-21 20:06:36 +08:00
195301c609 refactor(lsp): deprecate completion util methods
Relates to https://github.com/neovim/neovim/issues/25272
2023-10-21 13:49:05 +02:00
1e10310f4c refactor(lsp): move completion logic into _completion module
To reduce cross-chatter between modules and for https://github.com/neovim/neovim/issues/25272
Also preparing for https://github.com/neovim/neovim/issues/25714
2023-10-21 13:49:05 +02:00
9971bea6f1 vim-patch:9.0.2059: outstanding exceptions may be skipped (#25736)
Problem:  outstanding exceptions may be skipped
Solution: When restoring exception state, process remaining outstanding
          exceptions

closes: vim/vim#13386

0ab500dede

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-10-21 18:46:52 +08:00
c049ce56cd vim-patch:9.0.2058: tests: avoid error when no swap files exist (#25735)
Problem:  tests: avoid error when no swap files exist
Solution: use unlet! so that no error message is reported
          in case the variable does not exists

When s:GetSwapFileList() does not find any swapfiles, it will return an
empty list []. This means, that the variable 'name' will not be
declared, cause the following unlet command to fail and causing a 1 sec
delay on running the tests.

So let's instead use the :unlet! command which simply skips reporting an
error when the variable given as parameter does not exists.

closes: vim/vim#13396

a36acb7ac4
2023-10-21 18:14:32 +08:00
fc02908c97 vim-patch:d3e277f279ed (#25734)
matchparen: do not use hard-coded match id (vim/vim#13393)

* matchparen: do not use hard-coded match id

Instead of using the hard-coded match id 3, which may also be used by
other plugins, let the matchparen plugin use whatever ids are
automatically returned when calling matchaddpos().

For backwards-compatibility, keep the `:3match` call, which will still
use the hard-coded id 3 (as mentioned in :h :3match).

closes: vim/vim#13381

d3e277f279

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-10-21 18:04:08 +08:00
f1775da07f feat(lsp): add snippet API (#25301) 2023-10-21 08:51:26 +02:00
3304449946 fix(lsp): log unknown diagnostic tags instead of showing a warning (#25705)
To be more in line with the specification:

> To support the evolution of enumerations the using side of an enumeration shouldn’t fail on an enumeration value it doesn’t know. It should simply ignore it as a value it can use and try to do its best to preserve the value on round trips
2023-10-21 08:47:14 +02:00
7a6e27958a ci(cirrus): don't run lua/help_spec (#25498) 2023-10-21 07:21:19 +08:00
ad2fad9a3b fix(event-loop): flush UI when no input is available (#25728)
Problem:  With lots of events, UI flush may be delayed for too long.
Solution: Flush UI when no input is available. This still flushes less
          frequently than before #25629, when a flush also happens when
          typeahead buffer is empty but input is available.
2023-10-20 23:02:56 +08:00
6c87d3e0fb refactor(options): get_option_value_strict() and SREQ_*
`SREQ_*` values are now actual typedef'd enums. `get_option_value_strict()` has also been refactored and split into two functions, `get_option_attrs()` for getting the option attributes, and `get_option_value_strict()` for getting the actual value. Moreover, it now returns an `OptVal`. Other miscellaneous refactors have also been made.
2023-10-20 13:35:47 +01:00
f4b896198f vim-patch:9.0.2056: no digraph for quadruple prime
Problem:  no digraph for quadruple prime
Solution: add quadruple prime digraph using 4'

closes: vim/vim#13380

47416d1a74

Co-authored-by: Jonathan Wright <quaggy@gmail.com>
2023-10-20 13:03:36 +02:00
594ff34581 vim-patch:d5dc58aeed1b (#25720)
runtime(json5): Add new ftplugin (vim/vim#13385)

d5dc58aeed

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-10-19 16:22:51 -05:00
2c9d4ef459 Merge pull request #25717 from gpanders/vim-e08bfef88bd0
vim-patch:e08bfef88bd0, vim-patch:9.0.2053
2023-10-19 14:30:19 -05:00
3ea13bca14 vim-patch:9.0.2053: zig filetype detection test wrong
Problem:  zig filetype detection test wrong
Solution: Remove .zir pattern, add new test for .zon pattern

closes: vim/vim#13389

a8c664a042

Co-authored-by: Gregory Anders <greg@gpanders.com>
2023-10-19 13:06:58 -05:00
e6d352d8d7 vim-patch:e08bfef88bd0
runtime(zig): Update Zig runtime files (vim/vim#13388)

Update runtime files from upstream (https://github.com/zig/zig.vim) at
commit 54c216e5306a5c3878a60596aacb94dca8652ab9.

e08bfef88b

Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
2023-10-19 10:20:55 -05:00
315c711700 fix(treesitter): set cursor position when opening inspector 2023-10-19 14:54:10 +02:00
a096165977 vim-patch:9.0.2050: Vim9: crash with deferred function call and exception (#25715)
Problem:  Vim9: crash with deferred function call and exception
Solution: Save and restore exception state

Crash when a deferred function is called after an exception and another
exception is thrown

closes: vim/vim#13376
closes: vim/vim#13377

c59c1e0d88

The change in check_due_timer() is N/A as Nvim calls timer callbacks on
the main loop.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-10-19 18:34:48 +08:00
ae7020c667 fix(docs): fix TSNode incorrect signatures 2023-10-19 09:23:13 +01:00
a8fc94a2fd build(deps): include Find module
Now that all the Find<Foo>.cmake modules are using our custom
find_path2, the bundled deps build needs to include the Find module so
it has access to find_path2.

The missing include was causing the PPA build to fail:

```
cd .deps && \
	cmake -G 'Unix Makefiles'   \
	-DUSE_EXISTING_SRC_DIR=ON -DUSE_BUNDLED_LUAROCKS=OFF -DUSE_BUNDLED_LUAJIT=OFF -DUSE_BUNDLED_GPERF=OFF -DUSE_BUNDLED_LUA=OFF /<<PKGBUILDDIR>>//cmake.deps
-- The C compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found GNU Make at /usr/bin/make
-- CMAKE_BUILD_TYPE not specified, default is 'Debug'
-- Performing Test HAS_OG_FLAG
-- Performing Test HAS_OG_FLAG - Success
-- Found Git: /usr/bin/git (found version "2.17.1")
CMake Error at /<<PKGBUILDDIR>>/cmake/FindLuajit.cmake:1 (find_path2):
  Unknown CMake command "find_path2".
Call Stack (most recent call first):
  cmake/BuildLuv.cmake:13 (find_package)
  CMakeLists.txt:127 (include)

-- Configuring incomplete, errors occurred!
```
2023-10-18 23:47:20 +02:00
c49cfd89fd Merge pull request #25703 from zeertzjq/vim-9.0.2044
vim-patch:9.0.{2044,2045}
2023-10-18 19:19:02 +08:00
09fb243bdd vim-patch:9.0.2045: tests: checking for swap files takes time
Problem:  tests: checking for swap files takes time
Solution: don't check for swap files  when test has been skipped

Check for swap files takes a considerable about of time, so don't do
that for skipped tests to avoid wasting time.

closes: vim/vim#13371

a0e1f06f04
2023-10-18 18:30:20 +08:00
9e3640a779 vim-patch:9.0.2044: Vim9: exceptions confuse defered functions
Problem:  Vim9: exceptions confuse defered functions
Solution: save and restore exception state when calling defered
          functions

closes: vim/vim#13364
closes: vim/vim#13372

0672595fd5

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-10-18 18:29:47 +08:00
831d662ac6 build: add sub-targets to the doc target
It's easier to debug and to customize scripting if there are sub-targets
that build up each target.
2023-10-18 11:18:38 +02:00
eadedfd908 vim-patch:5a33ce2a661f
runtime(json5): include syntax script for json5 (vim/vim#13356)

Merging syntax file from gutenye/json5.vim, modified to include proper
vim header.

See: https://github.com/vim/vim/issues/8499

5a33ce2a66

Co-authored-by: Rolf Vidar Mazunki Hoksaas <32819373+mazunki@users.noreply.github.com>
Co-authored-by: Guten Ye <ywzhaifei@gmail.com>
2023-10-18 09:09:33 +02:00
366d0c7887 fix(move): check the correct buffer (#25698) 2023-10-18 10:34:55 +08:00
bbc74d51ad test(autocmd/termxx_spec): fix flakiness (#25694) 2023-10-18 07:19:29 +08:00
4db4168aaf vim-patch:8.2.4497: wrong color for half of wide character next to pum scrollbar (#25693)
Problem:    Wrong color for half of wide character next to pum scrollbar.
Solution:   Redraw the screen cell with the right color. (closes vim/vim#9874)

35d8c2010e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-10-18 06:40:08 +08:00
bc5dfda441 vim-patch:9.0.2041: trim(): hard to use default mask (#25692)
Problem:  trim(): hard to use default mask (partly revert v9.0.2040)
Solution: use default mask when it is empty

The default 'mask' value is pretty complex, as it includes many
characters.  Yet, if one needs to specify the trimming direction, the
third argument, 'trim()' currently requires the 'mask' value to be
provided explicitly.

Currently, an empty 'mask' will make 'trim()' call return 'text' value
that is passed in unmodified.  It is unlikely that someone is using it,
so the chances of scripts being broken by this change are low.

Also, this reverts commit 9.0.2040 (which uses v:none for the default
and requires to use an empty string instead).

closes: vim/vim#13358

8079917447

vim-patch:9.0.2040: trim(): hard to use default mask

Problem:  trim(): hard to use default mask
Solution: Use default 'mask' when it is v:none

The default 'mask' value is pretty complex, as it includes many
characters.  Yet, if one needs to specify the trimming direction, the
third argument, 'trim()' currently requires the 'mask' value to be
provided explicitly.

'v:none' is already used to mean "use the default argument value" in
user defined functions.  See |none-function_argument| in help.

closes: vim/vim#13363

6e6386716f

Co-authored-by: Illia Bobyr <illia.bobyr@gmail.com>
2023-10-18 06:08:14 +08:00
3fd7449d5a fix(treesitter): check that buf is loaded in autocommands (#25679) 2023-10-17 15:34:39 -05:00
272ef27115 vim-patch:9.0.2035: [security] use-after-free with wildmenu (#25687)
Problem:  [security] use-after-free with wildmenu
Solution: properly clean up the wildmenu when exiting

Fix wildchar/wildmenu/pum memory corruption with special wildchar's

Currently, using `wildchar=<Esc>` or `wildchar=<C-\>` can lead to a
memory corruption if using wildmenu+pum, or wrong states if only using
wildmenu. This is due to the code only using one single place inside the
cmdline process loop to perform wild menu clean up (by checking
`end_wildmenu`) but there are other odd situations where the loop could
have exited and we need a post-loop clean up just to be sure. If the
clean up was not done you would have a stale popup menu referring to
invalid memory, or if not using popup menu, incorrect status line (if
`laststatus=0`).

For example, if you hit `<Esc>` two times when it's wildchar, there's a
hard-coded behavior to exit command-line as a failsafe for user, and if
you hit `<C-\><C-\><C-N>` it will also exit command-line, but the clean
up code would not have hit because of specialized `<C-\>` handling.

Fix Ctrl-E / Ctrl-Y to not cancel/accept wildmenu if they are also
used for 'wildchar'/'wildcharm'. Currently they don't behave properly,
and also have potentially memory unsafe behavior as the logic is
currently not accounting for this situation and try to do both.
(Previous patch that addressed this: vim/vim#11677)

Also, correctly document Escape key behavior (double-hit it to escape)
in wildchar docs as it's previously undocumented.

In addition, block known invalid chars to be set in `wildchar` option,
such as Ctrl-C and `<CR>`. This is just to make it clear to the user
they shouldn't be set, and is not required for this bug fix.

closes: vim/vim#13361

8f4fb007e4

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-10-17 22:43:42 +08:00
356a6728ac vim-patch:9.0.2037: A few remaining cmdline completion issues with C-E/Y (#25686)
Problem:  A few remaining cmdline completion issues with C-E/Y
Solution: Fix cmdline completion fuzzy/Ctrl-E/Ctrl-Y/options when not
          used at the end

Fix cmdline completion fuzzy/Ctrl-E/Ctrl-Y/options when not used at the end

A few places in the cmdline completion code only works properly when the
user hits Tab (or 'wildchar') at the end of the cmdline, even though
it's supposed to work even in the middle of the line.

For fuzzy search, `:e ++ff`, and `:set hl=`, fix completion code to make
sure to use `xp_pattern_len` instead of assuming the entire `xp_pattern`
is the search pattern (since it contains texts after the cursor).

Fix Ctrl-E / Ctrl-Y to not jump to the end when canceling/accepting a
wildmenu completion. Also, make them work even when not using
`set wildoptions+=pum` as there is no drawback to doing so.
(Related issue where this was brought up: vim/vim#13331)

closes: vim/vim#13362

209ec90b9b

Cherry-pick ex_getln.c changes from patch 9.0.2035.

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-10-17 21:42:34 +08:00
c9963e2212 vim-patch:9.0.2039: completion shows current word after completion restart (#25682)
Problem:  completion shows current word after completion restart
Solution: remove the word being completed after completion restart

The word being completed is shown in a completion list after completion
restart, because it isn't removed from the current buffer before
searching for matches.

Also adjust `Test_complete_add_onechar` to match the new behavior.

closes: vim/vim#13349

2e3cd52fa0

Co-authored-by: nwounkn <nwounkn@gmail.com>
2023-10-17 17:49:22 +08:00
35f475d0a5 fix(diagnostics): if buffer not loaded, skip handlers that set extmark (#25628)
Problem:
When enabling diagnostics, there can be diagnostics for unloaded buffer,
but some handlers nevertheless attempt to set extmarks in such buffers.

Solution:
* Exit underline/virtual_text handler if buffer is not loaded.
* Don't require is_loaded as precondition for show(), because handlers
  don't necessarily depend on it.
2023-10-16 20:51:36 -05:00
a63c67005b Merge pull request #25394 from famiu/refactor/options/set_option
refactor(options)!: unify interfaces for setting options
2023-10-16 20:41:35 +02:00
b80a8e2c16 build: adjust how find order is prioritized
Ensure bundled libraries and include directories are always searched
first before any others. This will provide a more consistent experience
as the search order of the builtin find_ functions can vary depending on
system. This should make the build process faster when building with
bundled deps as we limit the search to only the .deps directory.
Separating the search between .deps and everything makes debugging
find_-related problems simpler if you need to check how dependencies are
found.

For libraries, we divide the search process into the following order:
1. Only search in .deps directory and only search for static libraries.
2. Only search in .deps directory and search for all libraries.
3. Search everywhere and search for all libraries.

Make an exception for FindLibintl.cmake as changing the search order
seems to break some tests on macos.
2023-10-16 20:15:41 +02:00
3642f2fb44 refactor(options): make did_set_shada a normal option callback 2023-10-17 00:08:47 +06:00
f1a58a8dcc refactor(options): make os_oldval and os_newval use OptValData 2023-10-17 00:08:47 +06:00
af010e23f3 refactor(options): rename empty_option to empty_string_option 2023-10-17 00:08:47 +06:00
526234cf56 refactor(options): deduplicate the do_set_option codepath 2023-10-17 00:08:47 +06:00
ca77089e2d refactor(options): deduplicate do_set_option_string
Reduce code duplication between `do_set_option_string` and `set_string_option` by making the former call the latter within itself.
2023-10-17 00:08:47 +06:00
36e4901cbd refactor(options): remove os_op 2023-10-17 00:08:47 +06:00
5df4fdf253 refactor(options)!: make OptionSet v: values use typval
BREAKING CHANGE: This breaks the OptionSet autocommand, as the `v:` values associated with it (`v:option_new`, `v:option_old`, `v:option_oldlocal` and `v:option_oldglobal`) are now the same type as the option, instead of all option values being converted to strings.
2023-10-17 00:08:47 +06:00
93b9c88946 refactor(options): unify set_num_option and set_bool_option 2023-10-17 00:08:47 +06:00
a4c4b39d55 fix(man.lua): hardwrapped manpage is not resized #25646
Problem:
If a manpage is opened, its hardwrapped dimensions are not recalculated
after closing then revisiting the same manpage.

Solution:
Unload the manpage when it is hidden. This forces it to be reloaded,
which forces the hard-wrapping to be recalculated when it is revisited.

Fixes: #25457
2023-10-16 09:59:33 -07:00
2eecb1b85d fix(lsp): highlight active parameter in signature help #25663
Fixes #25662
2023-10-16 08:52:48 -07:00
c46a6c065e docs: do not hardcode LSP version in URL #25648 2023-10-16 08:13:37 -07:00
0892c1cd94 vim-patch:9.0.2033: gcc overflow-warning for f_resolve (#25666)
Problem:  gcc overflow-warning for f_resolve
Solution: use pointer p instead of pointer q[-1]

Suppress the following warning:
```
filepath.c: In function ‘f_resolve’:
filepath.c:2162:27: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
 2162 |                     q[-1] = NUL;
```

Closes: vim/vim#13352
closes: vim/vim#13353

215c3261a2

Co-authored-by: Ken Takata <kentkt@csc.jp>
2023-10-16 16:41:17 +08:00
3222f0ad00 vim-patch:dbf749bd5aae (#25665)
runtime: Fix more typos (vim/vim#13354)

* Fix more typos

* Fix typos in ignored runtime/ directory

dbf749bd5a

Co-authored-by: Viktor Szépe <viktor@szepe.net>
2023-10-16 16:36:25 +08:00
0a3505eb9d Merge pull request #25602 from bfredl/have_no_ifdef
refactor(lang): reduce scope of HAVE_WORKING_LIBINTL #ifdefs
2023-10-15 18:48:22 +02:00
3a44db510b refactor(lang): reduce scope of HAVE_WORKING_LIBINTL #ifdefs
A lot of code inside HAVE_WORKING_LIBINTL doesn't really depend on a
"working libintl". For instance ex_language is also used for ":lang collate"
and ":lang time".

Also ":lang C" should not fail just because translations aren't available (it
just means use the default text).

References:

https://github.com/neovim/neovim/pull/1 2d00ead2e5
separate ifdefs for locale and gettext got merged together.

8253e29971
Unmotivated switcharoo of get_mess_env() logic. If available, get_locale_val(LC_MESSAGES) is the correct implementation.
2023-10-15 14:17:50 +02:00
0818d65528 fix(extmarks): skip virt_text if it is out of window (#25658) 2023-10-15 19:36:19 +08:00
75b488d3ef vim-patch:9.0.2025: no cmdline completion for ++opt args (#25657)
Problem:  no cmdline completion for ++opt args
Solution: Add cmdline completion for :e ++opt=arg and :terminal
          [++options]

closes: vim/vim#13319

989426be6e

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-10-15 17:52:08 +08:00
d974a3dcbb vim-patch:9.0.2032: cannot get mouse click pos for tab or virt text (#25653)
Problem:  Cannot accurately get mouse clicking position when clicking on
          a TAB or with virtual text.
Solution: Add a "coladd" field to getmousepos() result.

closes: vim/vim#13335

f5a94d5165
2023-10-15 17:19:01 +08:00
a350fb2976 vim-patch:9.0.2031: TextChangedI may be triggered by non-insert mode change (#25656)
Problem:  `TextChangedI` can trigger on entering Insert mode if there
          was previously a change not in Insert mode.
Solution: Make it trigger only when text is actually changed in Insert
          mode.

closes: vim/vim#13265
closes: vim/vim#13338

d7ae263af8

Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
2023-10-15 17:14:18 +08:00
e5a424d78e vim-patch:9.0.2030: no max callback recursion limit (#25655)
Problem:  no max callback recursion limit
Solution: bail out, if max call recursion for callback functions
          has been reached.

This checks the 'maxfuncdepth' setting and throws E169 when a callback
function recursively calls itself.

closes: vim/vim#13337
closes: vim/vim#13339

47510f3d65

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-10-15 17:02:17 +08:00
aa62579a68 docs: restore accidentally removed line in :h 'ignorecase' (#25651) 2023-10-15 09:05:27 +08:00
85ddd0074b test(terminal/channel_spec): fix flakiness (#25649) 2023-10-15 06:38:43 +08:00
28ef4a4492 vim-patch:7687238e1b0d
runtime(tcsh): Update ftplugin (vim/vim#13327)

Fix b:browsefilter deletion error when calling b:undo_ftplugin.

Fixes vim/vim#13167

7687238e1b

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-10-14 17:07:09 +02:00
729a9c4c61 vim-patch:9.0.2024: no filetype detection for Debian sources
Problem:  no filetype detection for Debian sources
Solution: Add new deb822sources filetype

closes: vim/vim#13320

bd734c3bea

Co-authored-by: James McCoy <jamessan@jamessan.com>
2023-10-14 16:41:33 +02:00
af4985feda test(winscrolled): make sure floating window is drawn (#25639) 2023-10-14 20:09:49 +08:00
20dacacf37 vim-patch:2bbd0d30eebd (#25637)
runtime(doc): Improve command-line completion docs (vim/vim#13331)

* Improve command-line completion docs

Add more details about 'ignorecase' and its effect on cmdline
completion.

Make sure keys used in wildmenu are properly documented and linked in the
keys' documentation entries, and in `:h index` for proper
cross-referencing, as wildmenu popup is slightly different from
insert-mode popup menu.

* Fix docs typos

2bbd0d30ee

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-10-14 19:28:41 +08:00
bcda800933 vim-patch:9.0.2022: getmousepos() returns wrong index for TAB char (#25636)
Problem:  When clicking in the middle of a TAB, getmousepos() returns
          the column of the next char instead of the TAB.
Solution: Break out of the loop when the vcol to find is inside current
          char. Fix invalid memory access when calling virtcol2col() on
          an empty line.

closes: vim/vim#13321

b583eda703
2023-10-14 19:18:25 +08:00
99b1163b5a vim-patch:9.0.2021: Coverity complains about change in charset (#25634)
Problem:  Coverity complains about change in charset (after v9.0.2017)
Solution: check pointer t at index 0

closes: vim/vim#13322

cd6ee69358

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-10-14 18:39:24 +08:00
57ce9b6a92 refactor(lsp): fix luals warnings in tagfunc and add type annotations (#25150) 2023-10-14 11:31:16 +02:00
712adacdf5 refactor(lsp): make is_pull in lsp.diagnostic.get_namespace optional (#25156)
Follw up to 63b3408551

`is_pull` should be optional, otherwise it is an API change that
introduces warnings in consumers.

Also fixes the type annotation of `_client_pull_namespaces` where the
key is a string.
2023-10-14 09:47:20 +02:00
ee156ca60e fix(lsp): refactor escaping snippet text (#25611) 2023-10-14 09:06:40 +02:00
8ee8112b92 Merge pull request #25630 from nwounkn/fix-extra-line
fix(ui): empty line before the next message after :silent command
2023-10-14 14:55:01 +08:00
13f55750e9 fix(ui): empty line before the next message after :silent command
Problem:
  The next command after `silent !{cmd}` or `silent lua print('str')`
  prints an empty line before printing a message, because these commands
  set `msg_didout = true` despite not printing any messages.

Solution:
  Set `msg_didout = true` only if `msg_silent == 0`
2023-10-14 14:23:08 +08:00
ce0f80835a test(ui/searchhl_spec): match more in :terminal test (#25631) 2023-10-14 13:53:52 +08:00
bf70a33f5e vim-patch:8.1.0822: peeking and flushing output slows down execution (#25629)
Problem:    Peeking and flushing output slows down execution.
Solution:   Do not update the mode message when global_busy is set.  Do not
            flush when only peeking for a character. (Ken Takata)

cb574f4154
2023-10-14 09:58:30 +08:00
9f32deba56 fix(grid): add start column when getting char on line (#25627) 2023-10-13 21:43:06 +08:00
ebe489d8f0 fix: allow multiline message for echoerr (#25380)
PROBLEM:

Currently `:echoerr` prints multi-line strings in a single line
as `:echom` does (Note: `:echon` can print multi-line strings well).
This makes stacktrace printed via echoerr difficult to read.

Example code:

    try
      lua error("lua stacktrace")
    catch
      echoerr v:exception
    endtry

Output:

    Error detected while processing a.vim[5]..a.vim:
    line    4:
    Vim(lua):E5108: Error executing lua [string ":lua"]:1: lua stacktrace^@stack traceback:^@^I[C]: in function 'error'^@^I[string ":lua"]:1: in main chunk

SOLUTION:

Allow echoerr to print multiline messages (e.g., lua exceptions),
because this command is usually used to print stacktraces.

Output after the fix:

    Error detected while processing a.vim[5]..a.vim:
    line    4:
    Vim(lua):E5108: Error executing lua [string ":lua"]:1: lua stacktrace
    stack traceback:
            [C]: in function 'error'
            [string ":lua"]:1: in main chunk
2023-10-13 07:27:45 +08:00
2c9f22e7e4 refactor(test): cleanup #25614
- unnecessary separate describe() group
- clear() wasn't called in the describe() group
- unnecessary indirection in function parameters
2023-10-12 07:04:16 -07:00
9c2270b834 feat(types): add test/.luarc.json
Authored-By: Lewis Russell <lewis6991@gmail.com>
Co-Authored-By: Lewis Russell <lewis6991@gmail.com>
2023-10-12 09:50:29 +01:00
840e1864c2 fix(lsp): handle NUL bytes in popup text (#25612)
Fix #25610
2023-10-12 15:39:39 +08:00
d2d38858d1 vim-patch:9.0.2018: complete_info() returns wrong index (#25607)
Problem:  complete_info() returns wrong index
Solution: Make order of 'info' in completion_info consistent

Start the iteration from the same point and follow the same direction as
done when assigning the completion numbers. This way we remove the
dependence on the completion direction and make the order of 'info'
consistent.

closes: vim/vim#12230
closes: vim/vim#12971

69fb5afb3b

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-10-12 08:21:01 +08:00
3cbb02ce77 vim-patch:8.2.3064: Vim9: in script cannot set item in uninitialized list (#25605)
Problem:    Vim9: in script cannot set item in uninitialized list.
Solution:   When a list is NULL allocate an empty one. (closes vim/vim#8461)

e65081d1b5

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-10-12 07:38:56 +08:00
f4c85b9ad1 Merge pull request #25606 from zeertzjq/vim-9.0.2017 2023-10-12 07:34:14 +08:00
dac79b165d vim-patch:9.0.2017: linebreak applies for leading whitespace
Problem:  linebreak applies for leading whitespace
Solution: only apply linebreak, once we have found non-breakat chars in
          the line

closes: vim/vim#13228
closes: vim/vim#13243

dd75fcfbdf

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-10-12 07:02:49 +08:00
e2406d119f vim-patch:9.0.2017: linebreak applies for leading whitespace (#25604)
Problem:  linebreak applies for leading whitespace
Solution: only apply linebreak, once we have found non-breakat chars in
          the line

closes: vim/vim#13228
closes: vim/vim#13243

dd75fcfbdf

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-10-12 06:49:11 +08:00
7474874baa vim-patch:9.0.2011: INI files not detected
Problem:  INI files not detected
Solution: detect uppercase .INI as dosini files

It previo~1 only worked for lower-case .ini files, but upperc~1 .INI is
also somewhat common on account of DOS' old 8.3 upperc~2 only filena~1.

closes: vim/vim#13316

4a82bdfaa8

Co-authored-by: Martin Tournoij <martin@arp242.net>
2023-10-11 23:54:41 +02:00
2fde6295df fix(lsp): display initialization errors (#25409) 2023-10-11 15:38:58 -05:00
37da0bc0c6 docs: clarify about error in shada (#25594) 2023-10-11 17:58:07 +08:00
f79052faef refactor(float): rename ex_floatclose to ex_fclose (#25596) 2023-10-11 15:03:59 +08:00
4eea60939f test(core/path_spec): don't use fnameescape() (#25593)
Using fnameescape() for the path argument of findfile() and finddir() is
wrong, as fnameescape() is intended to be used for parts of Ex commands,
not function arguments.
2023-10-11 07:24:37 +08:00
c4f8be464c docs(style): add guideline for fixing compiler error on switch statement
Problem: Certain compilers (primarily GCC) do not recognize an exhaustive enum switch statement as being exhaustive. This manifests in the form of compiler errors in exhaustive switch statements where each case has a return statement but there isn't a catch-all return statements. These compiler errors are spurious in the context of the Neovim codebase. So #25533 added the `UNREACHABLE` macro to denote apart of the code that's unreachable, which was used after every such switch statement to tell the compiler to treat the switch statement as exhaustive. However, the macro is mentioned nowhere in the style guide,and new contributors would not have any natural way of learning about it as it stands now. This would lead to confusion when they inevitably encounter one of these compiler errors.

Solution: Add a style guideline which shows how to use the `UNREACHABLE` macro to fix these compiler errors.
2023-10-10 22:23:54 +02:00
c3d21ad1bc docs: small fixes
Co-authored-by: Wansmer <wansmer@gmail.com>
Co-authored-by: Andrew Voynov <andrewvoynov.b@gmail.com>
Co-authored-by: David Moberg <david.moberg@mediatek.com>
2023-10-10 19:20:32 +02:00
fd39f5ce8c Merge pull request #25561 from glepnir/9663
feat(float): add fclose command
2023-10-10 16:36:55 +02:00
468a3a1407 refactor: use xstpcpy() instead of strcat() (#25572) 2023-10-10 22:03:55 +08:00
372aa2eb3d feat(float): add fclose command 2023-10-10 21:17:08 +08:00
9ff6f73f83 refactor: allow not having a default case for enum
Problem: The style guide states that all switch statements that are not conditional on an enum must have a `default` case, but does not give any explicit guideline for switch statements that are conditional on enums. As a result, a `default` case is added in many enum switch statements, even when the switch statement is exhaustive. This is not ideal because it removes the ability to have compiler errors to easily detect unchanged switch statements when a new possible value for an enum is added.

Solution: Add explicit guidelines for switch statements that are conditional on an enum, clarifying that a `default` case is not necessary if the switch statement is exhaustive. Also refactor pre-existing code with unnecessary `default` cases.
2023-10-10 11:19:41 +01:00
a2f17e97ec fix(highlight): add FloatFooter to 'highlight_defs.h' (#25577) 2023-10-10 17:33:30 +08:00
c40a1c0f41 vim-patch:9.0.2009: cmdline-completion for comma-separated options wrong (#25569)
Problem:  cmdline-completion for comma-separated options wrong
Solution: Fix command-line expansions for options with filenames with
          commas

Fix command-line expansions for options with filenames with commas

Cmdline expansion for option values that take a comma-separated list
of file names is currently not handling file names with commas as the
commas are not escaped. For such options, the commas in file names need
to be escaped (to differentiate from a comma that delimit the list
items). The escaped comma is unescaped in `copy_option_part()` during
option parsing.

Fix as follows:
- Cmdline completion for option values with comma-separated file/folder
  names will not start a new match when seeing `\\,` and will instead
  consider it as one value.
- File/folder regex matching will strip the `\\` when seeing `\\,` to
  make sure it can match the correct files/folders.
- The expanded value will escape `,` with `\\,`, similar to how spaces
  are escaped to make sure the option value is correct on the cmdline.

This fix also takes into account the fact that Win32 Vim handles file
name escaping differently. Typing '\,' for a file name results in it
being handled literally but in other platforms '\,' is interpreted as a
simple ',' and commas need to be escaped using '\\,' instead.

Also, make sure this new logic only applies to comma-separated options
like 'path'. Non-list options like 'set makeprg=<Tab>' and regular ex
commands like `:edit <Tab>` do not require escaping and will continue to
work.

Also fix up documentation to be clearer. The original docs are slightly
misleading in how it discusses triple slashes for 'tags'.

closes: vim/vim#13303
related: vim/vim#13301

54844857fd

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-10-10 09:15:21 +08:00
f5eabaa940 fix(path): restore space separation in 'path' (#25571)
Removing this behavior causes more inconsistencies and bugs.
2023-10-10 08:22:32 +08:00
43f22853fe docs: fix misplaced mention of 'backupdir' (#25568) 2023-10-10 07:06:34 +08:00
c80a3976cb docs: miscellaneous doc and type fixes (#25554) 2023-10-10 06:34:48 +08:00
81f67b79e8 fix(file_search): path with spaces in finddir() and findfile() (#25493)
Co-authored-by: dundargoc <gocdundar@gmail.com>
2023-10-10 06:08:58 +08:00
4ab2b43c8f vim-patch:9.0.2008: test: undofile left behind (#25567)
Problem:  test: undofile left behind
Solution: cleanup undofile

fix: tmp file not deleted when running make test_undo

Temporary file `.Xtestfile.txt.un~` was left running `make test_undo`
and vim was configured with:
```
./configure --with-features=normal --enable-gui=no --enable-terminal
```

closes: vim/vim#13304

b07b9dc4da

Co-authored-by: Dominique Pellé <dominique.pelle@tomtom.com>
2023-10-10 05:56:28 +08:00
40bd96b6f9 ci: use clang 17 as the default clang version is too old 2023-10-09 21:52:56 +02:00
9eb5d9f13f ci: various cleanups
- add reviewers
- correct cache key
2023-10-09 20:27:48 +02:00
6c0f900699 ci: enable clang-analyzer warnings
This adds the checks in https://neovim.io/doc/reports/clang/ when using
clang-tidy. The strategy is to enable all clang-analyzer checks, and
disable only the checks for the warnings that exist currently. This
allows us to eliminate each warning type without blocking ongoing work,
but also without adding bugs for already eliminated warnings.

The plan is to eventually eliminate https://neovim.io/doc/reports/clang/
by completely integrating it into the clang-tidy check.

Also add make and cmake targets `clang-analyzer` to run this check.
2023-10-09 16:52:28 +02:00
55be4a4e26 fix(coverity): dead code #25562
*** CID 466056:  Control flow issues  (DEADCODE)
    /src/nvim/window.c: 6951 in file_name_in_line()
    6945       // Search backward for first char of the file name.
    6946       // Go one char back to ":" before "//", or to the drive letter before ":\" (even if ":"
    6947       // is not in 'isfname').
    6948       while (ptr > line) {
    6949         if ((len = (size_t)(utf_head_off(line, ptr - 1))) > 0) {
    6950           ptr -= len + 1;
    >>>     CID 466056:  Control flow issues  (DEADCODE)
    >>>     Execution cannot reach the expression "path_has_drive_letter(ptr - 2)" inside this statement: "if (vim_isfilec((uint8_t)pt...".
    6951         } else if (vim_isfilec((uint8_t)ptr[-1])
    6952                    || (len >= 2 && path_has_drive_letter(ptr - 2))
    6953                    || ((options & FNAME_HYP) && path_is_url(ptr - 1))) {
    6954           ptr--;
    6955         } else {
    6956           break;
2023-10-09 06:05:36 -07:00
307a7abf86 build(deps): bump libmpack-lua to 1.0.11
update vendored libmpack-lua to match

https://github.com/libmpack/libmpack-lua/releases/tag/1.0.11
2023-10-09 12:37:15 +02:00
139e6f68f9 fix(autocmd): API functions accept garbage after event name #25523
"VimEnter foo" was accepted as a valid event name for "VimEnter".
Events delimited with commas, eg. "VimEnter,BufRead", were also
accepted, even though only the first event was actually parsed.

Co-authored-by: ii14 <ii14@users.noreply.github.com>
2023-10-09 02:50:44 -07:00
8e932480f6 refactor: the long goodbye
long is 32 bits on windows, while it is 64 bits on other architectures.
This makes the type suboptimal for a codebase meant to be
cross-platform. Replace it with more appropriate integer types.
2023-10-09 11:45:46 +02:00
dacd34364f feat(ui-ext): make 'mousehide' into proper ui_option (#25532) 2023-10-09 16:48:24 +08:00
f96f8566b5 test(ui/embed_spec): use notification instead of request (#25555)
This avoid the hang mentioned in #24888, and also matches TUI better.
2023-10-09 16:14:37 +08:00
dadc06ced2 build(deps): bump luajit to HEAD - 656ecbcf8 2023-10-09 09:25:26 +02:00
61f1e992ce Merge pull request #25503 from bfredl/unishape
refactor(grid): do arabic shaping in one place
2023-10-08 23:32:24 +02:00
e5855697e9 vim-patch:1e33cd72b60a
runtime: make command name for &iskeywordprg more unique (vim/vim#13297)

See https://github.com/vim/vim/pull/13213/commits by @dkearns:
Rename 'keywordprg' user command to ShKeywordPrg as this is just a
leaking implementation detail.

1e33cd72b6

Co-authored-by: Enno <Konfekt@users.noreply.github.com>
2023-10-08 23:31:49 +02:00
ddef39299f refactor(grid): do arabic shaping in one place
The 'arabicshape' feature of vim is a transformation of unicode text to
make arabic and some related scripts look better at display time. In
particular the content of a cell will be adjusted depending on the
(original) content of the cells just before and after it.

This is implemented by the arabic_shape() function in nvim. Before this
commit, shaping was invoked in four different contexts:

- when rendering buffer text in win_line()
- in line_putchar() for rendering virtual text
- as part of grid_line_puts, used by messages and statuslines and
  similar
- as part of draw_cmdline() for drawing the cmdline

This replaces all these with a post-processing step in grid_put_linebuf(),
which has become the entry point for all text rendering after recent
refactors.

An aim of this is to make the handling of multibyte text yet simpler.
One of the main reasons multibyte chars needs to be "parsed" into
codepoint arrays of composing chars is so that these could be inspected
for the purpose of shaping. This can likely be vastly simplified in many
contexts where only the total length (in bytes) and width of composed
char is needed.
2023-10-08 15:22:45 +02:00
30d311ebcf fix(PVS/V592): expression is enclosed by parentheses twice 2023-10-08 12:36:39 +02:00
1bbbca267d fix(PVS/V547): expression is always true/false 2023-10-08 12:36:39 +02:00
LW
9abced6ad9 fix(lsp): account for border height in max floating popup height (#25539) 2023-10-08 10:09:25 +02:00
6823fdb20b build(PVS): exclude build directory
This is to prevent reports on generated files.
2023-10-07 22:02:30 +02:00
506d119c16 Merge pull request #25533 from famiu/docs/style/abort-default
docs: use `abort()` for unreachable `default:` case in C
2023-10-07 20:57:55 +02:00
753adcc66c ci: fix mac release 2023-10-07 18:25:43 +02:00
380870335f docs: use abort() for unreachable default: case in C
Problem: The style guide currently recommends having a `default:` case for switch statements that are not conditional on an enumerated value. Additionally, it recommends using `assert(false)` if `default:` is unreachable. This is problematic because `assert()` only runs on debug builds, which may lead to confusing breakages in release builds. Moreover, this suggestion is followed nowhere in the C code and `abort()` is used everywhere instead.

Solution: Suggest using `abort()` instead of `assert(false)`, that way the program always terminates if a logically unreachable case is reached.
2023-10-07 20:47:55 +06:00
1f864139b2 Merge pull request #25522 from glepnir/4334
fix(ui): trigger TabNewEntered after split new tab
2023-10-07 11:10:28 +02:00
1cd7824dd6 fix(ui): trigger TabNewEntered after split new tab 2023-10-07 16:40:57 +08:00
7f65431d90 vim-patch:9.0.1997: Some unused code in move.c and string.c
Problem:  Some unused code in move.c and string.c
Solution: Remove it

closes: vim/vim#13288

580c1fcb4a

Co-authored-by: dundargoc <gocdundar@gmail.com>
2023-10-07 10:11:22 +02:00
7e9407490c Merge pull request #25529 from zeertzjq/vim-9.0.1990
vim-patch:9.0.1990,27e12c7669e3
2023-10-07 07:01:55 +08:00
e7c268e38f vim-patch:2a281ccca017
runtime(sh): Update ftplugin (vim/vim#13213)

Rename 'keywordprg' user command to ShKeywordPrg as this is just a
leaking implementation detail.

2a281ccca0

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-10-07 00:48:35 +02:00
1ac588543d vim-patch:9.0.1995: Invalid memory access with empty 'foldexpr' (#25530)
Problem:  Invalid memory access when 'foldexpr' returns empty string.
Solution: Check for NUL.

closes: vim/vim#13293

a991ce9c08
2023-10-07 06:32:06 +08:00
92df389f1b vim-patch:27e12c7669e3
runtime(doc): remove E1520 tag (vim/vim#13289)

27e12c7669
2023-10-07 05:54:12 +08:00
8bb0878013 vim-patch:9.0.1990: strange error number
Problem:  strange error number
Solution: change error number,
          add doc tag for E1507

closes: vim/vim#13270

ea746f9e86

Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
2023-10-07 05:54:10 +08:00
5db076c7cc fix(lua): vim.region on linewise selection #25467
fixes #18155
2023-10-06 05:44:50 -07:00
01374446af Merge #25236 from lsvmello/fix-gf 2023-10-06 05:39:36 -07:00
133e2990ef refactor: cleanup 2023-10-06 14:09:21 +02:00
56dc8b9212 fix: heap-buffer-overflow in file_name_in_line
heap-buffer-overflow on address 0x6020000079cf at pc 0x563e98bd70b6 bp 0x7ffc52efc430 sp 0x7ffc52efbbf8
    = READ of size 1 at 0x6020000079cf thread T0
    =     0 0x563e98bd70b5 in strlen (/home/runner/work/neovim/neovim/build/bin/nvim+0xc7b0b5) (BuildId: e40ec79ca4eae53c0155aeb03de88ddd5d29c5d2)
    =     1 0x563e99da4f45 in path_has_drive_letter /home/runner/work/neovim/neovim/src/nvim/path.c:1754:10
    =     2 0x563e9a610d81 in file_name_in_line /home/runner/work/neovim/neovim/src/nvim/window.c:6951:49
    =     3 0x563e9a61066f in file_name_at_cursor /home/runner/work/neovim/neovim/src/nvim/window.c:6917:10
    =     4 0x563e995a08d6 in eval_vars /home/runner/work/neovim/neovim/src/nvim/ex_docmd.c:6903:16
    =     5 0x563e9937c648 in f_expand /home/runner/work/neovim/neovim/src/nvim/eval/funcs.c:1754:20
    =     6 0x563e99357819 in call_internal_func /home/runner/work/neovim/neovim/src/nvim/eval/funcs.c:273:3
    =     7 0x563e994656de in call_func /home/runner/work/neovim/neovim/src/nvim/eval/userfunc.c:1719:15
    =     8 0x563e99461ae6 in get_func_tv /home/runner/work/neovim/neovim/src/nvim/eval/userfunc.c:557:11
    =     9 0x563e992c7c5d in eval_func /home/runner/work/neovim/neovim/src/nvim/eval.c:2281:13
    =     10 0x563e992bf708 in eval7 /home/runner/work/neovim/neovim/src/nvim/eval.c:3208:15
    =     11 0x563e992bbda9 in eval6 /home/runner/work/neovim/neovim/src/nvim/eval.c:2935:7
    =     12 0x563e992b9e8d in eval5 /home/runner/work/neovim/neovim/src/nvim/eval.c:2791:7
    =     13 0x563e992b87e2 in eval4 /home/runner/work/neovim/neovim/src/nvim/eval.c:2666:7
    =     14 0x563e992b758d in eval3 /home/runner/work/neovim/neovim/src/nvim/eval.c:2575:7
    =     15 0x563e9926299d in eval2 /home/runner/work/neovim/neovim/src/nvim/eval.c:2497:7
    =     16 0x563e99250b0c in eval1 /home/runner/work/neovim/neovim/src/nvim/eval.c:2401:7
    =     17 0x563e9924d68a in eval0 /home/runner/work/neovim/neovim/src/nvim/eval.c:2346:9
    =     18 0x563e98f17315 in nvim_eval /home/runner/work/neovim/neovim/src/nvim/api/vimscript.c:170:3
    =     19 0x563e98e7bb5e in handle_nvim_eval /home/runner/work/neovim/neovim/build/src/nvim/auto/api/private/dispatch_wrappers.generated.h:8953:15
    =     20 0x563e99b62f59 in request_event /home/runner/work/neovim/neovim/src/nvim/msgpack_rpc/channel.c:444:19
    =     21 0x563e9a1dcdc9 in state_handle_k_event /home/runner/work/neovim/neovim/src/nvim/state.c:115:7
    =     22 0x563e99bf0718 in nv_event /home/runner/work/neovim/neovim/src/nvim/normal.c:6623:3
    =     23 0x563e99bb4069 in normal_execute /home/runner/work/neovim/neovim/src/nvim/normal.c:1227:3
    =     24 0x563e9a1dcb8d in state_enter /home/runner/work/neovim/neovim/src/nvim/state.c:97:26
    =     25 0x563e99b9673c in normal_enter /home/runner/work/neovim/neovim/src/nvim/normal.c:516:3
    =     26 0x563e98c82e0d in main /home/runner/work/neovim/neovim/src/nvim/main.c:643:3
    =     27 0x7fcb81429d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: 229b7dc509053fe4df5e29e8629911f0c3bc66dd)
    =     28 0x7fcb81429e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f) (BuildId: 229b7dc509053fe4df5e29e8629911f0c3bc66dd)
    =     29 0x563e98bc0f74 in _start (/home/runner/work/neovim/neovim/build/bin/nvim+0xc64f74) (BuildId: e40ec79ca4eae53c0155aeb03de88ddd5d29c5d2)
    =
    = 0x6020000079cf is located 1 bytes to the left of 9-byte region [0x6020000079d0,0x6020000079d9)
    = allocated by thread T0 here:
    =     0 0x563e98c43dbe in __interceptor_malloc (/home/runner/work/neovim/neovim/build/bin/nvim+0xce7dbe) (BuildId: e40ec79ca4eae53c0155aeb03de88ddd5d29c5d2)
    =     1 0x563e99a7b6f6 in try_malloc /home/runner/work/neovim/neovim/src/nvim/memory.c:89:15
    =     2 0x563e99a7b8dc in xmalloc /home/runner/work/neovim/neovim/src/nvim/memory.c:123:15
    =     3 0x563e9901ace2 in ins_str /home/runner/work/neovim/neovim/src/nvim/change.c:801:16
    =     4 0x563e99208133 in insertchar /home/runner/work/neovim/neovim/src/nvim/edit.c:2172:5
    =     5 0x563e9921936c in insert_special /home/runner/work/neovim/neovim/src/nvim/edit.c:1995:5
    =     6 0x563e99218e9f in insert_handle_key /home/runner/work/neovim/neovim/src/nvim/edit.c:1173:7
    =     7 0x563e991f0f1d in insert_execute /home/runner/work/neovim/neovim/src/nvim/edit.c:671:10
    =     8 0x563e9a1dcb8d in state_enter /home/runner/work/neovim/neovim/src/nvim/state.c:97:26
    =     9 0x563e991f8c75 in insert_enter /home/runner/work/neovim/neovim/src/nvim/edit.c:338:5
    =     10 0x563e991ed4e2 in edit /home/runner/work/neovim/neovim/src/nvim/edit.c:1270:3
    =     11 0x563e99bf6007 in invoke_edit /home/runner/work/neovim/neovim/src/nvim/normal.c:6269:7
    =     12 0x563e99bcb665 in nv_edit /home/runner/work/neovim/neovim/src/nvim/normal.c:6246:5
    =     13 0x563e99bb4069 in normal_execute /home/runner/work/neovim/neovim/src/nvim/normal.c:1227:3
    =     14 0x563e9a1dcb8d in state_enter /home/runner/work/neovim/neovim/src/nvim/state.c:97:26
    =     15 0x563e99b9673c in normal_enter /home/runner/work/neovim/neovim/src/nvim/normal.c:516:3
    =     16 0x563e98c82e0d in main /home/runner/work/neovim/neovim/src/nvim/main.c:643:3
    =     17 0x7fcb81429d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: 229b7dc509053fe4df5e29e8629911f0c3bc66dd)
2023-10-06 14:09:21 +02:00
1dd700a8d9 fix: gf fails on "foo/bar.txt:1:2" on Windows
Problem:
On Windows, "gf" fails on a filepath that has a line:column suffix.
Example:

    E447: Can't find file "src/app/core/services/identity/identity.service.ts:64:23"

Solution:
- Remove ":" from 'isfname' on Windows. Colon is not a valid filename
  character (except for the drive-letter).
- Handle drive letters specially in file_name_in_line().

Fixes #25160
2023-10-06 12:59:58 +02:00
4e4ad4312e Merge pull request #25513 from bfredl/cleangrid
refactor(grid): get rid of unbatched grid_puts and grid_putchar
2023-10-06 11:21:46 +02:00
a6cccd728a vim-patch:0e958410046a
runtime(netrw): diff (`df`) may open the wrong window (vim/vim#13275)

closes: vim/vim#11359

0e95841004

Co-authored-by: KSR-Yasuda <31273423+KSR-Yasuda@users.noreply.github.com>
2023-10-06 10:18:33 +02:00
ac6d8d0087 vim-patch:f449825ae238
runtime(netrw): Update `.netrwbook` immediately on bookmark change (vim/vim#13276)

closes: vim/vim#9738

f449825ae2

Co-authored-by: KSR-Yasuda <31273423+KSR-Yasuda@users.noreply.github.com>
2023-10-06 10:18:33 +02:00
a58bb21544 refactor(grid): get rid of unbatched grid_puts and grid_putchar
This finalizes the long running refactor from the old TUI-focused grid
implementation where text-drawing cursor was not separated from the
visible cursor.

Still, the pattern of setting cursor position together with updating a
line was convenient. Introduce grid_line_cursor_goto() to still allow
this but now being explicit about it.

Only having batched drawing functions makes code involving drawing
a bit longer. But it is better to be explicit, and this highlights
cases where multiple small redraws can be grouped together. This was the
case for most of the changed places (messages, lastline, and :intro)
2023-10-06 10:16:30 +02:00
1338140ee3 vim-patch:9.0.1978: No filetype detection for just files
Problem:  No filetype detection for just files
Solution: Detect just files (*.just, justfile, etc)

closes: vim/vim#13271

3d90f71b76

vim-patch:b6d01f13: runtime(just): Correct filetype detection pattern and style

Co-authored-by: dundargoc <gocdundar@gmail.com>
2023-10-06 09:52:24 +02:00
f67517bba3 Merge pull request #25510 from llllvvuu/fix/correct_qsort_usage
fix(marktree): correct qsort usage
2023-10-05 13:31:14 +02:00
62306a29ad fix(marktree): correct qsort usage
> The application shall ensure that the function returns an integer less
than, equal to, or greater than 0, if the first argument is considered
respectively less than, equal to, or greater than the second. If two
members compare as equal, their order in the sorted array is unspecified.

https://pubs.opengroup.org/onlinepubs/009696899/functions/qsort.html
2023-10-05 04:04:21 -07:00
0ff13a6a5a vim-patch:4dbb2669e9ed
runtime(netrw): error when trying to :bd unloaded buffer

closes: vim/vim#13215
closes: vim/vim#13082

4dbb2669e9

Co-authored-by: yasuda <yasuda@kyoto-sr.co.jp>
2023-10-05 09:08:17 +02:00
5f4f83ba32 vim-patch:9.0.1983: scrolling inactive window not possible with cursorbind (#25507)
Problem:  Scrolling non-current window using mouse is inconsistent
          depending on 'scrollbind'/'scrolloff' and different from GUI
          vertical scrollbar when 'cursorbind' is set.
Solution: Don't move cursor in non-current windows for 'cursorbind' if
          cursor in the current window didn't move.

closes: vim/vim#13219
closes: vim/vim#13210

8e5f26ec6a
2023-10-05 07:48:37 +08:00
d7a240b1e9 vim-patch:9.0.1981: not being able to scroll up in diff mode (#25506)
Problem:  Cannot scroll up in diff mode with many filler lines and zero
          'scrolloff'.
Solution: Invalidate w_cline_row before calling comp_botline().

closes: vim/vim#13256

0583491277
2023-10-05 07:36:14 +08:00
3079fa1f9f Merge pull request #25491 from glepnir/25474
fix(highlight): attr set all when normal attr changed
2023-10-04 16:24:33 +02:00
29fe883aa9 feat: ignore swapfile for running Nvim processes #25336
Problem:
The swapfile "E325: ATTENTION" dialog is displayed when editing a file
already open in another (running) Nvim. Usually this behavior is
annoying and irrelevant:
- "Recover" and the other options ("Open readonly", "Quit", "Abort") are
  almost never wanted.
- swapfiles are less relevant for "multi-Nvim" since 'autoread' is
  enabled by default.
  - Even less relevant if user enables 'autowrite'.

Solution:
Define a default SwapExists handler which does the following:
1. If the swapfile is owned by a running Nvim process, automatically
   chooses "(E)dit anyway" (caveat: this creates a new, extra swapfile,
   which is mostly harmless and ignored except by `:recover` or `nvim -r`.
2. Shows a 1-line "ignoring swapfile..." message.
3. Users can disable the default SwapExists handler via `autocmd! nvim_swapfile`.
2023-10-04 06:31:25 -07:00
d4872377fe fix(highlight): attr set all when normal attr changed 2023-10-04 18:42:13 +08:00
1e7e9ee91f fix(path): accept special characters on Windows (#25424) 2023-10-04 06:04:19 +08:00
e72b546354 refactor: the long goodbye
long is 32 bits on windows, while it is 64 bits on other architectures.
This makes the type suboptimal for a codebase meant to be
cross-platform. Replace it with more appropriate integer types.
2023-10-03 22:02:55 +02:00
70ec8d60e0 Merge pull request #25470 from bfredl/msg_display
refactor(message): simplify msg_puts_display and use batched grid updates
2023-10-03 20:56:43 +02:00
a9a48d6b5f refactor(message): simplify msg_puts_display and use batched grid updates
msg_puts_display was more complex than necessary in nvim, as in
nvim, it no longer talks directly with a terminal.

In particular we don't need to scroll the grid before emiting the last
char. The TUI already takes care of things like that, for terminals
where it matters.
2023-10-03 15:20:09 +02:00
b2a8a93147 fix(api): avoid immediate TextChanged with nvim_create_buf (#25492) 2023-10-03 20:54:42 +08:00
08aea256c8 vim-patch:2dfc22908e43 (#25485)
runtime(doc): remove E1507 help tag, which is no longer used (vim/vim#13254)

2dfc22908e
2023-10-03 14:32:47 +08:00
3af59a415c fix(treesitter): make Visual hl work consistently with foldtext (#25484)
Problem:  Visual highlight is inconsistent on a folded line with
          treesitter foldtext.
Solution: Don't added Folded highlight as it is already in background.
2023-10-03 13:07:03 +08:00
04af9d49ee test(fileio_spec): fix files not cleaned up properly (#25483) 2023-10-03 12:13:04 +08:00
6851b265ba fix(clipboard): don't pass --foreground to wl-copy (#25481)
Fix #25466
2023-10-03 11:24:33 +08:00
e115732465 fix(terminal): check terminal size at end of screen update (#25480) 2023-10-03 10:23:03 +08:00
3c76038755 vim-patch:9.0.1975: xattr: permission-denied errors on write (#25478)
Problem:  xattr: permission-denied errors on write
Solution: ignore those errors

closes: vim/vim#13246

993b17569b

N/A patches:
vim-patch:9.0.1965: wrong auto/configure script
vim-patch:9.0.1966: configure prints stray 6 when checking libruby

Co-authored-by: Gene C <arch@sapience.com>
2023-10-03 07:45:51 +08:00
bd8550ddca vim-patch:9.0.1973: Clean up cmdline option completion code (#25477)
Problem:  Clean up cmdline option completion code
Solution: Fix various minor problems

- Fix manual array size calculations to just use `ARRAY_LENGTH()`.
- Fix unintentional typo in comments due to copy-paste error.
- Fix assert_equal() usages to pass the expected value to first
  parameter instead of 2nd one to avoid confusion.
- Fix signed vs unsigned warnings
- Correct misplaced comments about set_op_T and set_prefix_T
  and fix a typo in another comment

closes: vim/vim#13249
closes: vim/vim#13237

6d11347260

N/A patch:
vim-patch:9.0.1976: style: space before tab in optionstr.c

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-10-03 07:45:37 +08:00
1101cfeb34 vim-patch:9.0.1972: win32: missing '**' expansion test (#25476)
Problem:  win32: missing '**' expansion test (after v9.0.1947)
Solution: Add test for MS-Windows

win32: Add "**" test

Vim supports "**" on MS-Windows. However, it is not tested by
`Test_glob_extended_bash`.

Unlike Unix, it doesn't use 'shell' and doesn't support {,} expansion.
So, I added as a separate test.

related: vim/vim#13205
closes: vim/vim#13250

4a1ad55564

Co-authored-by: Ken Takata <kentkt@csc.jp>
2023-10-03 07:24:54 +08:00
e634222dad Merge pull request #25475 from zeertzjq/vim-ba77bbb5c775
vim-patch:ba77bbb5c775,20f48d5b2ddb,cd39b69b0200
2023-10-03 07:24:37 +08:00
e0d669ffdb vim-patch:cd39b69b0200
runtime(doc): add missing error numbers in the help.  (vim/vim#13241)

closes: vim/vim#13240

cd39b69b02

Co-authored-by: Yegappan Lakshmanan <4298407+yegappan@users.noreply.github.com>
2023-10-03 06:26:54 +08:00
19b49b063c vim-patch:20f48d5b2ddb
runtime(doc): mention how to disable folding in diff mode (vim/vim#13242)

20f48d5b2d

Co-authored-by: dundargoc <33953936+dundargoc@users.noreply.github.com>
2023-10-03 06:23:15 +08:00
b003e7feca vim-patch:ba77bbb5c775
runtime(doc): fix typos.

* Fix typo in document (Related: vim/vim#12516)
* Fix E1363 duplication
* Fix one more typo.

ba77bbb5c7

Co-authored-by: h_east <h.east.727@gmail.com>
2023-10-03 06:21:37 +08:00
fd791db0ec fix: fix ASAN errors on clang 17 (#25469) 2023-10-03 06:19:30 +08:00
eb1f0e8fcc feat(lsp)!: replace snippet parser by lpeg grammar 2023-10-02 22:21:35 +02:00
f736b075d3 feat(lsp): snippet parsing using lpeg 2023-10-02 22:21:35 +02:00
4a09c178a1 feat(lsp): fallback to code-action command on resolve failure (#25464)
The haskell-language-server supports resolve only for a subset of code
actions. For many code actions trying to resolve the `edit` property
results in an error, but the unresolved action already contains a
command that can be executed without issue.

The protocol specification is unfortunately a bit vague about this,
and what the haskell-language-server does seems to be valid.

Example:

    newtype Dummy = Dummy Int
    instance Num Dummy where

Triggering code actions on "Num Dummy" and choosing "Add placeholders
for all missing methods" resulted in:

    -32601: No plugin enabled for SMethod_CodeActionResolve, potentially available: explicit-fields, importLens, hlint, overloaded-record-dot

With this change it will insert the missing methods:

    instance Num Dummy where
      (+) = _
      (-) = _
      (*) = _
      negate = _
      abs = _
      signum = _
      fromInteger = _
2023-10-02 22:14:19 +02:00
09a17f91d0 refactor: move cmdline completion types to cmdexpand_defs.h (#25465) 2023-10-02 10:45:33 +08:00
9ce1623837 feat(treesitter): add foldtext with treesitter highlighting (#25391) 2023-10-01 14:10:51 -05:00
c0f4d60016 refactor(option.c): change :set boolean prefix to an enum (#25458)
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-10-01 22:16:04 +08:00
b40c70f2fc Merge pull request #25456 from zeertzjq/vim-9.0.1958
vim-patch:9.0.{1958,1960,1961,1968}: string option completion
2023-10-01 21:05:12 +08:00
01c51a4913 feat(completion): support completing more string options 2023-10-01 20:00:23 +08:00
5821c857e0 vim-patch:9.0.1968: cmdline completion should consider key option
Problem:  cmdline completion should consider key option
Solution: Disable cmdline completion for key option, slightly
          refactor how P_NO_CMD_EXPAND is handled

Harden crypto 'key' option: turn off cmdline completion, disable set-=

"set-=" can be used maliciously with a crypto key, as it allows an
attacker (who either has access to the computer or a plugin author) to
guess a substring by observing the modified state. Simply turn off
set+=/-=/^= for this option as there is no good reason for them to be
used.

Update docs to make that clear as well.

Also, don't allow cmdline completion for 'key' as it just shows *****
which is not useful and confusing to the user what it means (if the user
accidentally hits enter they will have replaced their key with "*****"
instead).

Move logic to better location, don't use above 32-bit for flags

Move P_NO_CMD_EXPAND to use the unused 0x20 instead of going above
32-bits, as currently the flags parameter is only 32-bits on some
systems. Left a comment to warn that future additions will need to
change how the flags work either by making it 64-bit or split into two
member vars.

Also, move the logic for detecting P_NO_CMD_EXPAND earlier so it's not
up to each handler to decide, and you won't see the temporary "..." that
Vim shows while waiting for completion handler to complete.

closes: vim/vim#13224

6ee7b521fa

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-10-01 20:00:23 +08:00
81be840768 vim-patch:9.0.1961: 'listchars' completion misses "multispace" and "leadmultispace"
Problem:  Cmdline completion for 'listchars' fields doesn't include
          "multispace" and "leadmultispace" (after 9.0.1958).
Solution: Include "multispace" and "leadmultispace" in lcstab.

closes: vim/vim#13225

1f025b01e2
2023-10-01 20:00:23 +08:00
6a7d533444 vim-patch:9.0.1960: Make CI checks more strict
Problem:  Make CI checks more strict
Solution: Add -Wstrict-prototypes -Wmissing-prototypes to CI,
          fix uncovered problems

Add -Wstrict-prototypes -Wmissing-prototypes warnings check to CI

Add two new warnings to CI, silence some Perl related build-warnings:

- `strict-prototypes` helps prevent declaring a function with an empty
  argument list, e.g. `int func()`. In C++, that's equivalent to `int
  func(void)`, but in C, that means a function that can take any number
  of arguments which is rarely what we want.

- `missing-prototypes` makes sure we use `static` for file-only internal
  functions. Non-static functions should have been declared on a
  prototype file.

- Add `no-compound-token-split-by-macro` to the perl cflags, since it
  throws out a bunch of perl-related warnings that make the CI log
  unnecessary verbose and hard to read. This seems to happen only with
  clang 12 and above.

When applying those changes, it already uncovered a few warnings, so fix
up the code as well (fix prototypes, make the code static, remove
shadowed var declaration)

GTK header needs to have #pragma warning suppressiong because GTK2
headers will warn on `-Wstrict-prototypes`, and it's included by gui.h
and so we can't just turn off the warning in a couple files.

closes: vim/vim#13223
closes: vim/vim#13226

f7f746b167

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-10-01 20:00:23 +08:00
f06af5e669 vim-patch:9.0.1958: cannot complete option values
Problem:  cannot complete option values
Solution: Add completion functions for several options

Add cmdline tab-completion for setting string options

Add tab-completion for setting string options on the cmdline using
`:set=` (along with `:set+=` and `:set-=`).

The existing tab completion for setting options currently only works
when nothing is typed yet, and it only fills in with the existing value,
e.g. when the user does `:set diffopt=<Tab>` it will be completed to
`set diffopt=internal,filler,closeoff` and nothing else. This isn't too
useful as a user usually wants auto-complete to suggest all the possible
values, such as 'iblank', or 'algorithm:patience'.

For set= and set+=, this adds a new optional callback function for each
option that can be invoked when doing completion. This allows for each
option to have control over how completion works. For example, in
'diffopt', it will suggest the default enumeration, but if `algorithm:`
is selected, it will further suggest different algorithm types like
'meyers' and 'patience'. When using set=, the existing option value will
be filled in as the first choice to preserve the existing behavior. When
using set+= this won't happen as it doesn't make sense.

For flag list options (e.g. 'mouse' and 'guioptions'), completion will
take into account existing typed values (and in the case of set+=, the
existing option value) to make sure it doesn't suggest duplicates.

For set-=, there is a new `ExpandSettingSubtract` function which will
handle flag list and comma-separated options smartly, by only suggesting
values that currently exist in the option.

Note that Vim has some existing code that adds special handling for
'filetype', 'syntax', and misc dir options like 'backupdir'. This change
preserves them as they already work, instead of converting to the new
callback API for each option.

closes: vim/vim#13182

900894b09a

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-10-01 20:00:23 +08:00
9b3045103f Merge pull request #25455 from bfredl/highlight_namespace_getters
feat(ui): allow to get the highlight namespace. closes #24390
2023-10-01 10:39:31 +02:00
2da66f1f71 vim-patch:9.0.1967: xattr errors not translated (#25454)
Problem:  xattr errors not translated
Solution: mark for translation, consistently capitalize
          first letter.

closes: vim/vim#13236

7ece036d72
2023-10-01 16:29:55 +08:00
2615ed879e feat(ui): allow to get the highlight namespace 2023-10-01 10:02:36 +02:00
248305cf37 vim-patch:9.0.1964: xattr support fails to build on MacOS X (#25448)
Problem:  xattr support fails to build on MacOS X
Solution: Disable xattr support for MacOS X

MacOS X uses the same headers and functions sys/xattr.h but the function
signatures for xattr support are much different, so building fails.

So let's for now disable xattr support there.

closes: vim/vim#13230
closes: vim/vim#13232

a4dfbfed89

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-10-01 06:08:47 +08:00
386bc23e43 Merge pull request #25442 from zeertzjq/vim-9.0.1962
vim-patch:9.0.{1962,1963}: extended attributes
2023-09-30 22:38:09 +08:00
5c60fbe9db vim-patch:9.0.1963: Configure script may not detect xattr
Problem:  Configure script may not detect xattr correctly
Solution: include sys/xattr instead of attr/xattr,
          make Test_write_with_xattr_support() test
          xattr feature correctly

This also applies to the Smack security feature, so change the include
and configure script for it as well.

closes: vim/vim#13229

6de4e58cf2
2023-09-30 22:09:55 +08:00
f6e72c3dfe vim-patch:9.0.1962: No support for writing extended attributes
Problem:  No support for writing extended attributes
Solution: Add extended attribute support for linux

It's been a long standing issue, that if you write a file with extended
attributes and backupcopy is set to no, the file will loose the extended
attributes.

So this patch adds support for retrieving the extended attributes and
copying it to the new file. It currently only works on linux, mainly
because I don't know the different APIs for other systems (BSD, MacOSX and
Solaris).  On linux, this should be supported since Kernel 2.4 or
something, so this should be pretty safe to use now.

Enable the extended attribute support with normal builds.

I also added it explicitly to the :version output as well as make it
able to check using `:echo has("xattr")`, to have users easily check
that this is available.

In contrast to the similar support for SELINUX and SMACK support (which
also internally uses extended attributes), I have made this a FEAT_XATTR
define, instead of the similar HAVE_XATTR.

Add a test and change CI to include relevant packages so that CI can
test that extended attributes are correctly written.

closes: vim/vim#306
closes: vim/vim#13203

e085dfda5d

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-09-30 22:09:55 +08:00
a4132e1d62 test(unit): move statusline tests to statusline_spec.lua (#25441) 2023-09-30 20:38:04 +08:00
578d634176 Merge pull request #25386 from glepnir/toggle_float
feat(float): support toggle show float window
2023-09-30 13:40:35 +02:00
960170e446 vim-patch:9.0.1366: functions for setting options are in random order (#25440)
Problem:    Functions for setting options are in random order.
Solution:   Sort functions alphabetically. (Yegappan Lakshmanan,
            closes vim/vim#12082)

ad60898aa4

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-30 19:36:33 +08:00
4200a0f167 feat(float): support toggle show float window 2023-09-30 18:30:23 +08:00
2af9fac0a6 refactor: align set_chars_option() with Vim (#25438)
Needed for completion of 'listchars'/'fillchars' values.
2023-09-30 17:38:05 +08:00
dc6d0d2daf refactor: reorganize option header files (#25437)
- Move vimoption_T to option.h
- option_defs.h is for option-related types
- option_vars.h corresponds to Vim's option.h
- option_defs.h and option_vars.h don't include each other
2023-09-30 14:41:34 +08:00
cf8b2c0e74 build(iwyu): add a few more _defs.h mappings (#25435) 2023-09-30 12:05:28 +08:00
5f2d0b9329 test(old): don't check for $CLANG_SANITIZER (#25432)
Functional tests don't check for an environment variable before printing
ASAN logs, so oldtests shouldn't either.
2023-09-30 08:35:29 +08:00
dbfdb52ea8 vim-patch:9.0.1956: Custom completion skips orig cmdline if it invokes glob() (#25427)
Problem:  Custom cmdline completion skips original cmdline when pressing
          Ctrl-P at first match if completion function invokes glob().
Solution: Move orig_save into struct expand_T.

closes: vim/vim#13216

28a23602e8
2023-09-30 06:30:10 +08:00
be463e7643 Merge pull request #25418 from bfredl/no_attr2
refactor(message): remove more "attr" variants
2023-09-29 20:07:16 +02:00
54daf022ce docs(term): use tic -x for better compatibility with old ncurses (#25421)
Use `tic -x` instead of `tic` to include any unknown capabilities in a modern `terminfo.src` as user-defined ones, instead of dropping them. Modern ncurses behavior with `tic -x` will not change.
2023-09-29 10:57:02 -05:00
dd872cbb44 Merge pull request #25395 from bfredl/line_buf2
refactor(grid): unify the two put-text-on-the-screen code paths
2023-09-29 17:54:05 +02:00
9ed830a3ca refactor(lsp): deprecate util methods (#25400) 2023-09-29 17:37:14 +02:00
bc13bc154a refactor(message): smsg_attr -> smsg 2023-09-29 16:36:04 +02:00
8e11c18d49 refactor(message): msg_puts_attr_len -> msg_puts_len 2023-09-29 16:10:28 +02:00
b07fd0e988 refactor(message): msg_outtrans_long_len_attr -> msg_outtrans_long 2023-09-29 15:55:45 +02:00
e33269578b refactor(grid): unify the two put-text-on-the-screen code paths
The screen grid refactors will continue until morale improves.
Jokes aside, this is quite a central installment in the series.

Before this refactor, there were two fundamentally distinct codepaths
for getting some text on the screen:

- the win_line() -> grid_put_linebuf() -> ui_line() call chain used for
  buffer text, with linebuf_char as a temporary scratch buffer
- the grid_line_start/grid_line_puts/grid_line_flush() -> ui_line()
  path used for every thing else: statuslines, messages and the command line.
  Here the grid->chars[] array itself doubles as a scratch buffer.

With this refactor, the later family of functions still exist, however
they now as well render to linebuf_char just like win_line() did, and
grid_put_linebuf() is called in the end to calculate delta changes.
This means we don't need any duplicate logic for delta calculations anymore.

Later down the line, it will be possible to share more logic operating
on this scratch buffer, like doing 'rightleft' reversal and arabic
shaping as a post-processing step.
2023-09-29 15:38:25 +02:00
af7d317f3f refactor: remove long
long is 32-bits even on 64-bit windows which makes the type suboptimal
for a codebase meant to be cross-platform.
2023-09-29 14:56:34 +02:00
9afbfb4d64 fix(unittests): ignore __s128 and __u128 types in ffi
Linux added these types to their userspace headers in [6.5], which
causes unit tests to fail like

```
-------- Running tests from test/unit/api/private_helpers_spec.lua
RUN       vim_to_object converts true: 17.00 ms ERR
test/unit/helpers.lua:748: test/unit/helpers.lua:732: (string) '
test/unit/helpers.lua:264: ';' expected near '__s128' at line 194'
exit code: 256

stack traceback:
	test/unit/helpers.lua:748: in function 'itp_parent'
	test/unit/helpers.lua:784: in function <test/unit/helpers.lua:774>
```

Since we don't use these types, they can be ignored to avoid LuaJIT's C
parser choking on them.

[6.5]: 224d80c584
2023-09-28 22:36:14 -04:00
b917db062f vim-patch:02902b547bdb (#25406)
runtime(doc): text-objects: document how escaped delimiters are handled

02902b547b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-09-29 07:05:21 +08:00
7ec20a4082 vim-patch:9.0.1950: Vim9: error codes spread out (#25405)
Problem:  Vim9: error codes spread out
Solution: group them together and reserve 100
          more for future use

Reserve 100 error codes for future enhancements to the Vim9 class
support

closes: vim/vim#13207

413f83990f

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-29 06:52:02 +08:00
1117d29b20 Merge pull request #25398 from zeertzjq/vim-9.0.1946
vim-patch:9.0.{0607,1946,1947}: filename expansion using ** in bash may fail
2023-09-29 06:51:08 +08:00
3465e0daa0 vim-patch:9.0.1947: Bash Expansion test fails on Windows/MacOS
Problem:  Bash Expansion test fails on Windows/MacOS
Solution: Disable Test_glob_extended_bash for now

This test doesn't work on Windows even if bash can be executed, since
the globstar functionality has only been enabled in Unix builds of Vim
(Commit 9eb1ce531527a7177d16373b0f8689bbcd3d5f73, patch 9.0.1946).

closes: vim/vim#13205

03ca4002c1

Co-authored-by: Ken Takata <kentkt@csc.jp>
2023-09-29 06:07:27 +08:00
92e40f8d18 vim-patch:9.0.1946: filename expansion using ** in bash may fail
Problem:  filename expansion using ** in bash may fail
Solution: Try to enable the globstar setting

Starting with bash 4.0 it supports extended globbing using the globstar
shell option. This makes matching recursively below a certain directory
using the ** pattern work as expected nowadays.  However, we need to
explicitly enable this using the 'shopt -s globstar' bash command.

So let's check the bash environment variable $BASH_VERSINFO (which is
supported since bash 3.0 and conditionally enable the globstar option,
if the major version is at least 4. For older bashs, this at least
shouldn't cause errors (unless one is using really ancient bash 2.X or
something).

closes: vim/vim#13002
closes: vim/vim#13144

9eb1ce5315

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-09-29 06:07:27 +08:00
7f58b2bb6a vim-patch:9.0.0607: verbose echo message test fails on Mac OS
Problem:    Verbose echo message test fails on Mac OS.
Solution:   Skip the test on Mac OS.

f802767df7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-09-29 06:07:27 +08:00
28ffd96c9b test: decoration provider with wrapped lines (#25404) 2023-09-28 20:20:25 +08:00
1913041518 docs: Lua docstrings guidance #25345
Recommend adding a space after i.e. `--- @see`.

The "space" variant is common for the vast majority of docstring formats
such as doxygen, javadoc and typescript.
2023-09-27 21:57:22 -07:00
e46f5aab89 Merge pull request #25396 from bfredl/no_attr
refactor(messages): fold msg() functions with and without attr
2023-09-27 23:49:47 +02:00
86b7d8a9f5 vim-patch:5277cfaf8afe (#25397)
runtime(doc): mention mouse scrolling in scrollbind-quickadj (vim/vim#13190)

5277cfaf8a
2023-09-28 05:22:09 +08:00
448d4837be refactor(messages): rename msg_trunc_attr and msg_multiline_attr without attr 2023-09-27 23:05:14 +02:00
b85f1dafc7 refactor(messages): fold msg_attr into msg
problem: there are too many different functions in message.c
solution: fold some of the functions into themselves
2023-09-27 22:50:49 +02:00
1783023da7 vim-patch:54f70cf0780a
runtime(swayconfig): Update syntax file (vim/vim#13192)

54f70cf078

Co-authored-by: Josef Litoš <54900518+JosefLitos@users.noreply.github.com>
2023-09-27 22:20:03 +02:00
af1df3cb78 vim-patch:02774f99cebc
runtime(i3config): update i3config syntax (vim/vim#13191)

02774f99ce

Co-authored-by: Josef Litoš <54900518+JosefLitos@users.noreply.github.com>
2023-09-27 22:20:03 +02:00
555f492ec6 vim-patch:347459423903
runtime(rmd) Update ftplugin and syntax files (vim/vim#13193)

ftplugin/rmd.vim:

  - Set 'commentstring' dynamically according to code region.

syntax/rmd.vim:

  - Include syntax highlighting of fenced languages dynamically.
  - Add conceal char for line break.

3474594239

Co-authored-by: Jakson Alves de Aquino <jalvesaq@gmail.com>
2023-09-27 22:20:03 +02:00
f91cd31d7d refactor(messages): fold msg_outtrans_attr into msg_outtrans
problem: there are too many different functions in message.c
solution: fold some of the functions into themselves
2023-09-27 21:46:39 +02:00
a66b0fdfaa feat: NVIM_APPNAME supports relative paths #25233
Problem:
NVIM_APPNAME does not allow path separators in the name, so relative
paths can't be used:

    NVIM_APPNAME="neovim-configs/first-config" nvim
    NVIM_APPNAME="neovim-configs/second-config" nvim

Solution:
Let NVIM_APPNAME be a relative path. Absolute paths are not supported.

fix #23056
fix #24966
2023-09-27 10:09:55 -07:00
bfdec5b0e7 fix(clang): null pointer dereference in parse_msgpack #25389 2023-09-27 08:43:39 -07:00
26d6f03023 Merge pull request #25374 from bfredl/batchupdate
refactor(grid): use batched updates for more things
2023-09-27 13:21:29 +02:00
10e57ad4cb vim-patch:8.2.3467: CursorHoldI event interferes with "CTRL-G U" (#25383)
Problem:    CursorHoldI event interferes with "CTRL-G U". (Naohiro Ono)
Solution:   Restore the flag for "CTRL-G U" after triggering CursorHoldI.
            (closes vim/vim#8937)

5a9357d0bf

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-09-27 18:58:43 +08:00
b65f4151d9 vim-patch:8.2.3517: TextChanged does not trigger after TextChangedI (#25384)
Problem:    TextChanged does not trigger after TextChangedI.
Solution:   Store the tick separately for TextChangedI. (Christian Brabandt,
            closes vim/vim#8968, closes vim/vim#8932)

db3b44640d

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-09-27 18:51:40 +08:00
10cabf7877 refactor(grid): use batched updates for statusline and ruler 2023-09-27 11:31:45 +02:00
dfa8b582a6 fix(extmarks): draw TAB in virt_text properly with 'rl' (#25381) 2023-09-27 10:48:14 +08:00
0b2667ed36 refactor(grid): use batched updates for builtin tabline 2023-09-26 21:27:05 +02:00
3689bcb763 refactor(grid): use batched updates for horizontal wildmenu 2023-09-26 21:27:05 +02:00
de93489789 refactor(tutor): cleanup 2023-09-26 06:41:53 -07:00
bc6fc0123d fix(tutor): Tutor steps don't work on Windows #25251
Problem:
Some steps in :Tutor don't work on Windows.

Solution:
Add support for `{unix:...,win:...}` format and transform the Tutor contents
depending on the platform.
Fix https://github.com/neovim/neovim/issues/24166
2023-09-26 06:31:35 -07:00
fe95037cdb Merge pull request #25229 from glepnir/20323
fix(highlight): add force in nvim_set_hl
2023-09-26 14:20:10 +02:00
f8ea49cfe1 fix(highlight): add force in nvim_set_hl 2023-09-26 19:41:23 +08:00
4db77017fb fix(meta): add nil return types to lpeg functions 2023-09-26 09:43:44 +02:00
5198a2555d fix(meta): cleanup lpeg operators 2023-09-26 09:43:44 +02:00
ddc147da2f vim-patch:54e1f56cf2a5
runtime(sh): only invoke bash help in ftplugin if it has been detected to be bash (vim/vim#13171)

54e1f56cf2

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2023-09-26 09:37:47 +02:00
3387dc4a46 fix(runtime): add commentstring for D ftplugin (#25362)
Problem: No commentstring is set for D buffers after removing the
default C-style commentstring

Same solution than neovim#23039

Co-authored-by: Axel Ricard <axel.ricard@allegrodvt.com>
2023-09-26 06:13:58 +08:00
3a784bdc89 Merge pull request #25360 from bfredl/bigmess
refactor(options)!: graduate some more shortmess flags
2023-09-25 19:00:30 +02:00
c3d1d9445c refactor(options)!: graduate some more shortmess flags
A lot of updated places in the docs were already incorrect since long
since they did not reflect the default behaviour.

"[dos format]" could've been argued being better for discoverability
but that ship has already sailed as it is no longer displayed by default.
2023-09-25 18:23:15 +02:00
ed8b7aae85 Merge pull request #25359 from bfredl/longmess
refactor: remove 'shortmess' save/restore panic for ex commands
2023-09-25 18:16:25 +02:00
ef77180908 build(deps): bump luajit to HEAD - becf5cc65 2023-09-25 18:06:54 +02:00
68d425ac92 refactor: remove 'shortmess' save/restore panic for ex commands
This was only used to avoid the effect of SHM_OVERALL. This can easily
be handled in isolation, instead of clearing out all of 'shortmess' which
has unwanted side effects and mystifies what really is going on.
2023-09-25 14:54:20 +02:00
ccd1a84a96 Merge pull request #25344 from gpanders/doc-shortmess
docs: remove "f" from default 'shortmess' value
2023-09-25 11:34:05 +02:00
db51548036 docs: do not use deprecated functions #25334 2023-09-24 21:39:59 -07:00
b3be7b7413 fix(api): handle NUL in nvim_err_write() and nvim_out_write() (#25354) 2023-09-25 11:06:15 +08:00
fdcb74fc4b docs: remove more references to shm-f 2023-09-24 19:40:00 -05:00
9e7c4fe579 fix(exception): remember whether message is multiline (#25351) 2023-09-25 08:23:24 +08:00
8195c18006 Merge pull request #25349 from zeertzjq/vim-790f9a890cee
vim-patch:790f9a890cee,960822a11f70
2023-09-25 07:15:19 +08:00
2049e22f7f vim-patch:960822a11f70
runtime(doc): grammar fixes in doc (vim/vim#13164)

960822a11f

Co-authored-by: Dominique Pellé <dominique.pelle@gmail.com>
2023-09-25 06:39:35 +08:00
57b84f6d64 vim-patch:790f9a890cee
runtime(doc): Add a missing '<' to the help of strutf16len() (vim/vim#13168)

790f9a890c

Co-authored-by: a5ob7r <12132068+a5ob7r@users.noreply.github.com>
2023-09-25 06:38:38 +08:00
7d4967547b vim-patch:9.0.1938: multispace wrong when scrolling horizontally (#25348)
Problem:  multispace wrong when scrolling horizontally
Solution: Update position in "multispace" or "leadmultispace" also in
          skipped chars. Reorder conditions to be more consistent.

closes: vim/vim#13145
closes: vim/vim#13147

abc808112e
2023-09-25 06:31:52 +08:00
9154fc76b7 vim-patch:9.0.1937: missing test for mouse click + 'virtedit' (#25347)
Problem:  missing test for mouse click + 'virtedit'
Solution: Add test for clicking after eol with 'virtualedit' and wrapped
          line

closes: vim/vim#13157

46a0582ffa
2023-09-25 06:23:42 +08:00
9b8f65d03a Merge pull request #25346 from zeertzjq/vim-9.0.1931
vim-patch:9.0.{1931,1934}
2023-09-25 06:19:19 +08:00
dfa21316cd vim-patch:9.0.1934: :bwipe fails after switching window from aucmd_win.
Problem:  :bwipe fails after switching window from aucmd_win.
Solution: Decrement b_nwindows after switching back to aucmd_win.

closes: vim/vim#13160

46bdae036a
2023-09-25 05:54:38 +08:00
8728ba3951 vim-patch:9.0.1931: make test_compilers fails on ubuntu
Problem:  make test_compilers fails on ubuntu
Solution: set LC_ALL=C

fix: make test_compiler failed on xubuntu 22.04.3

Problem: 'make test_compiler' failed on Linux xubuntu 22.04.3 but
         succeeded on e.g. macOS. To reproduce:
```
$ ./configure --with-features=huge --enable-gui=no --enable-perlinterp=yes
$ make -j12
$ cd vim/src/testdir
$ make test_compiler
...snip...
Found errors in Test_compiler():
command line..script /home/dope/sb/vim/src/testdir/runtest.vim[601]..function RunTheTest[54]..Test_compiler line 24: command did not fail: clist
command line..script /home/dope/sb/vim/src/testdir/runtest.vim[601]..function RunTheTest[54]..Test_compiler line 30: Pattern '\\n \\d\\+ Xfoo.pl:3: Global symbol "$foo" requires explicit package name' does not match '\n19 Xfoo.pl:3: Global symbol "$foo" requires explicit package name (did you forget to declare "my $foo"?)'
make: *** [Makefile:70: test_compiler] Error 1
```
Solution: set `LC_ALL` to "C" in `Test_compiler()`

closes: vim/vim#13173

ca0ffc0d63

Co-authored-by: Dominique Pellé <dominique.pelle@tomtom.com>
2023-09-25 05:54:38 +08:00
f9944a78bc feat(meta): add types for vim.lpeg 2023-09-24 22:10:10 +02:00
d1bc6fca71 feat(health): list attached buffers in LSP report #23561
Problem:
Users using `vim.lsp.start` directly (instead of nvim-lspconfig) need
more visibility for troubleshooting. For example, troubleshooting
unnecesary servers or servers that aren't attaching to expected buffers.

Solution:
Mention attached buffers in the `:checkhealth lsp` report.

Example:

    vim.lsp: Active Clients ~
    - clangd (id=1, root_dir=~/dev/neovim, attached_to=[7])
    - lua_ls (id=2, root_dir=~/dev/neovim, attached_to=[10])
2023-09-24 11:43:16 -07:00
0592fd5e17 fix(ui): "resize -1" with cmdheight=0 #24758
Problem:
Crash from:

    set cmdheight=0 redrawdebug=invalid
    resize -1

Solution:
Do not invalidate first `p_ch` `msg_grid` rows in `update_screen` when
scrolling the screen down after displaying a message, because they may
be used later for drawing cmdline.
Fixes #22154
2023-09-24 11:15:33 -07:00
3bbb0aa399 fix: checkhealth warning even if init.lua exists #25306
Problem:
`:checkhealth nvim` warns about missing vimrc if `init.lua` exists but
`init.vim` does not.

Solution:
Check for any of: init.vim, init.lua, $MYVIMRC.
Fix #25291
2023-09-24 10:43:55 -07:00
6fb1e0d499 docs: remove "f" from default 'shortmess' value
The "f" flag was removed in f7da472257.
The value of the "f" flag is no longer listed in the 'shortmess'
description and it cannot be disabled, so having it in the default value
is pointless and confusing.
2023-09-24 09:09:18 -05:00
61ecb3e16c fix(provider/pythonx): import the correct module (#25342) 2023-09-24 22:04:29 +08:00
ed0d6536e3 test: only trim trailing spaces in swapfile tests (#25341) 2023-09-24 22:03:54 +08:00
9637b7dae4 fix(startup): stop TUI properly when quitting at swap dialog (#25337) 2023-09-24 16:29:07 +08:00
ac1c23442f test(old): don't set options to default before every test (#25335)
Oldtests clean up after themselves, and the options that need operators
to align with Vim all deny duplicates, so there is no need to set them
to default.

Also make the variable name that test_listchars.vim uses to align with
Vim more obvious.
2023-09-24 11:20:23 +08:00
9f58867935 refactor(clang-tidy): ignore warnings from clang-tidy 17 2023-09-24 04:58:49 +02:00
4d3a38ac07 fix(api, lua): handle setting v: variables properly (#25325) 2023-09-24 10:57:09 +08:00
046c9a83f7 fix(ui): always use stl/stlnc fillchars when drawing statusline (#25267) 2023-09-24 10:49:47 +08:00
cfb898cd8a test(tui_spec): small consistency fixes (#25332)
- Make indent consistent.
- Remove outdated "Only single integration test" comment.
- Don't use setup() as function name as it's used by busted.
2023-09-24 08:05:18 +08:00
bc0bf9d030 docs: fix type warnings 2023-09-23 23:46:45 +01:00
01be28b370 Merge pull request #25330 from bfredl/no_shm_f
refactor(options)!: graduate shortmess+=f flag
2023-09-23 21:18:06 +02:00
93d27ea578 Merge pull request #25268 from bfredl/grid_line
refactor(grid): properly namespace and separate stateful grid functions
2023-09-23 18:29:19 +02:00
f7da472257 refactor(options)!: graduate shortmess+=f flag
Not everything needs to be crazy overconfigurable.

Also fixes a warning in latest clang which didn't approve of
the funky math switch statement in  append_arg_number
2023-09-23 18:13:05 +02:00
fcdfbb4303 fix(float): fix some other crashes with :unhide or :all (#25328) 2023-09-23 22:33:44 +08:00
7bd6bd1ef7 fix(provider): cannot detect python3.12 #25316
PROBLEM: The builtin python3 provider cannot auto-detect python3.12
when g:python3_host_prog is not set. As a result, when python3 on $PATH
is currently python 3.12, neovim will fail to load python3 provider
and result in `has("python3") == 0`, e.g.,
"Failed to load python3 host. You can try to see what happened by ..."

ROOT CAUSE: the `system()` call from `provider#pythonx#DetectByModule`
does not ignore python warnings, and `pkgutil.get_loader` will print
a warning message in the very first line:
```
<string>:1: DeprecationWarning: 'pkgutil.get_loader' is deprecated and
slated for removal in Python 3.14; use importlib.util.find_spec() instead
```

SOLUTION:
- Use `importlib.util.find_spec` instead (python >= 3.4)
- Use `-W ignore` option to prevent any potential warning messages
2023-09-23 02:49:34 -07:00
b8103eece3 build(deps): bump luajit to HEAD - 97c75843c 2023-09-23 10:46:43 +02:00
5331d5772f fix(lua): show error message when failing to set variable (#25321) 2023-09-23 15:59:37 +08:00
c0a29931e2 fix(unhide): close floating windows first (#25318) 2023-09-23 14:42:59 +08:00
c88bb658ce vim-patch:8.2.4609: :unhide does not check for failing to close a window (#25317)
Problem:    :unhide does not check for failing to close a window.
Solution:   When closing a window fails continue with the next one.  Do not
            try closing the autocmd window. (closes vim/vim#9984)

6f2465d336

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-09-23 12:41:09 +08:00
c26b39a9aa fix(tui): make :cquit work properly with remote TUI (#25313) 2023-09-23 11:00:20 +08:00
c68c121f50 Merge pull request #25286 from rktjmp/doc-vim-schedule-wrap
docs: add more context to vim.schedule_wrap
2023-09-23 07:08:03 +08:00
dae6770b76 fix(meta): include vim.json 2023-09-22 23:02:45 +01:00
44f698bb1a docs: update vim.schedule param name and type
Per https://github.com/neovim/neovim/pull/25286#discussion_r1332861721
and https://github.com/neovim/neovim/pull/25286#discussion_r1334318352
2023-09-23 01:54:24 +10:00
e353c869ce fix(languagetree): don't treat unparsed nodes as occupying full range
This is incorrect in the following scenario:
1. The language tree is Lua > Vim > Lua.
2. An edit simultaneously wipes out the `_regions` of all nodes, while
   taking the Vim injection off-screen.
3. The Vim injection is not re-parsed, so the child Lua `_regions` is
   still `nil`.
4. The child Lua is assumed, incorrectly, to occupy the whole document.
5. This causes the injections to be parsed again, resulting in Lua > Vim
   > Lua > Vim.
6. Now, by the same process, Vim ends up with its range assumed over the
   whole document. Now the parse is broken and results in broken
   highlighting and poor performance.

It should be fine to instead treat an unparsed node as occupying
nothing (i.e. effectively non-existent). Since, either:
- The parent was just parsed, hence defining `_regions`
- The parent was not just parsed, in which case this node doesn't need
  to be parsed either.

Also, the name `has_regions` is confusing; it seems to simply
mean the opposite of "root" or "full_document". However, this PR does
not touch it.
2023-09-22 12:51:51 +01:00
3a7cb72dcb refactor(grid): properly namespace and separate stateful grid functions
This is a step in an ongoing refactor where the "grid_puts" and
"grid_put_linebuf" code paths will share more of the implementation (in
particular for delta calculation, doublewidth and 'arabicshape'
handling). But it also makes sense by its own as a cleanup, and is thus
committed separately.

Before this change many of the low level grid functions grid_puts,
grid_fill etc could both be used in a standalone fashion but also as
part of a batched line update which would be finally transmitted as a
single grid_line call (via ui_line() ). This was initially useful to
quickly refactor pre-existing vim code to use batched logic safely.

However, this pattern is not really helpful for maintainable and newly
written code, where the "grid" and "row" arguments are just needlessly
repeated. This simplifies these calls to just use grid and row as
specified in the initial grid_line_start(grid, row) call.

This also makes the intent clear whether any grid_puts() call is actually
part of a batch or not, which is better in the long run when more things
get refactored to use effective (properly batched) updates.
2023-09-22 13:48:46 +02:00
b7763d7f6b fix(api): get virtual text with multiple hl properly (#25307) 2023-09-22 17:56:05 +08:00
f413597f44 docs: clarify vim.schedule_wrap behaviour
- Remove the usage of the term "defer" to avoid confusion with
  `vim.defer_fn`, which also calls `vim.schedule_wrap` internally.
- Explicitly state that `vim.schedule_wrap` returns a function in the
  text.
- Mention that arguments are passed along.
- Include a usage example.
- Rename param to `fn`.
2023-09-22 18:38:28 +10:00
64e8a3c4d1 fix(ui): handle virtual text with multiple hl in more cases (#25304) 2023-09-22 15:36:24 +08:00
34a786bc49 fix(extmarks): inline virt_text support multiple hl groups (#25303) 2023-09-22 14:21:58 +08:00
fcfc87cb77 docs: small improvements to compl-autocomplete example (#25299)
- Don't complete when there is pending input.
- Use vim.list_contains() instead of vim.tbl_contains().
2023-09-22 06:51:47 +08:00
6555176f34 vim-patch:9.0.1923: curswant wrong on click with 've' and 'nowrap' set (#25293)
Problem:  curswant wrong on click with 've' and 'nowrap' set
Solution: Add w_leftcol to mouse click column.

closes: vim/vim#13142

db54e989b5
2023-09-22 05:44:45 +08:00
c1ff216668 build: actually export symbols on mac
If `-export_dynamic` is not passed to the linker, then Link Time
Optimization may inline and remove global functions even though
ENABLE_EXPORTS is set to true.

Closes https://github.com/neovim/neovim/issues/25295.
Closes https://github.com/kevinhwang91/nvim-ufo/issues/162.
Closes https://github.com/neovim/neovim/issues/25295.

Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
2023-09-21 22:08:13 +02:00
5e43a4ce4d Merge pull request #25288 from bfredl/tuiassert
fix(tui): don't overwrite an assertion faliure message on exit
2023-09-21 12:58:25 +02:00
345bd91db2 fix(lsp): handle absence of a trailing newline #25194
Fixes #24339

rust-analyzer sends "Invalid offset" error in such cases. Some other
servers handle it specially.

LSP spec mentions that "A range is comparable to a selection in an
editor". Most editors don't handle trailing newlines the same way
Neovim/Vim does, it's clearly visible if it's present or not. With that
in mind it's understandable why sending end position as simply the start
of the line after the last one is considered invalid in such cases.
2023-09-21 03:06:40 -07:00
911f3d9623 fix(tui): don't overwrite an assertion faliure message on exit
If nvim exited with nonzero status this is for one of the two reasons
- `:cquit` was invoked. This is used by users and plugins to communicate
  a result, like a nonzero status will fail a `git commit` operation
- There was an internal error or deadly signal. in this case an error
  message was likely written to stderr or to the screen.

In the latter case, the error message was often hidden by the TUI
exiting altscreen mode, which erases all visible terminal text.

This change prevents this in the latter case, while still cleaning up
the terminal properly when `:cquit` was deliberatily invoked.
Other cleanup like exiting mouse mode and raw mode is still done.
2023-09-21 10:18:37 +02:00
8bd6f7c20b fix(lsp): clear codelens on LspDetach (#24903)
Also fix incorrect parameters in on_detach callback.
2023-09-21 09:56:15 +02:00
f246cf029f Merge pull request #25270 from bfredl/indeterminism
fix(test): fix "indeterminism" warnings in UI tests
2023-09-21 09:36:41 +02:00
48410e8486 vim-patch:a7aba6ca5033 (#25285)
runtime(doc): format jumplist examples more consistently (vim/vim#13137)

a7aba6ca50
2023-09-21 15:06:06 +08:00
520ef606e9 build(deps): bump luajit to HEAD - d1a2fef8a 2023-09-21 08:16:44 +02:00
0aea8fad48 Merge pull request #25281 from zeertzjq/vim-9.0.1919
vim-patch:9.0.1919: Wrong curswant when clicking on empty line or with vsplits
2023-09-21 12:05:08 +08:00
e25cf47ad3 fix(mouse): click on empty line with 'foldcolumn' 2023-09-21 11:13:48 +08:00
acc32f20be test(ui/float_spec): click in bordered float sets correct curswant 2023-09-21 09:55:47 +08:00
adb73772d9 vim-patch:9.0.1919: Wrong curswant when clicking on empty line or with vsplits
Problem:  Wrong curswant when clicking on empty line or with vsplits.
Solution: Don't check for ScreenCols[] before the start of the window
          and handle empty line properly.

closes: vim/vim#13132

03cd697d63
2023-09-21 09:43:12 +08:00
f094db0e5c vim-patch:9.0.1921: not possible to use the jumplist like a stack (#25278)
Problem:  not possible to use the jumplist like a stack
Solution: Add the 'jumpoptions' setting to make the jumplist
          a stack.

Add an option for using jumplist like tag stack

related: vim/vim#7738
closes: vim/vim#13134

ported from NeoVim:

- https://neovim.io/doc/user/motion.html#jumplist-stack
- neovim/neovim@39094b3
- https://vi.stackexchange.com/questions/18344/how-to-change-jumplist-behavior

Based on the feedback in the previous PR, it looks like many people like
this option.

87018255e3

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Co-authored-by: butwerenotthereyet <58348703+butwerenotthereyet@users.noreply.github.com>
2023-09-21 07:37:03 +08:00
dc6c11394b fix(statuscolumn): update number hl for each screen line (#25277) 2023-09-21 07:03:26 +08:00
473d0aa3e6 vim-patch:9.0.1918
patch 9.0.1918: No filetype detection for Authzed filetypes

Problem:  No filetype detection for Authzed filetypes
Solution: Detect the *.zed file extension as authzed filetype

closes: vim/vim#13129

5790a54166

Co-authored-by: Matt Polzin <mpolzin@workwithopal.com>
2023-09-21 00:32:35 +02:00
380b634ac9 fix(test): fix "indeterminism" warnings in UI tests 2023-09-20 21:51:57 +02:00
23c21e7630 fix(extmarks): account for rightleft when drawing virt text (#25262)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-09-20 22:39:54 +08:00
818d7f6daf fix(extmarks): fix win_col virt_text drawn on wrong screen line (#25264) 2023-09-20 21:48:12 +08:00
877d04d0fb feat(lua): add vim.func._memoize
Memoizes a function, using a custom function to hash the arguments.

Private for now until:

- There are other places in the codebase that could benefit from this
  (e.g. LSP), but might require other changes to accommodate.
- Invalidation of the cache needs to be controllable. Using weak tables
  is an acceptable invalidation policy, but it shouldn't be the only
  one.
- I don't think the story around `hash_fn` is completely thought out. We
  may be able to have a good default hash_fn by hashing each argument,
  so basically a better 'concat'.
2023-09-20 13:42:41 +01:00
11865dbe39 fix(build): better deps for doc 2023-09-20 13:42:41 +01:00
1b55f51d0d docs: misc #24561
fix #24699
fix #25253
2023-09-20 04:15:23 -07:00
50d5fcc0bc Merge pull request #25261 from bfredl/nolinewrap
refactor(grid): unused grid->line_wraps delenda est
2023-09-20 12:17:10 +02:00
351dda5e26 Merge pull request #25244 from jedrzejboczar/fix-cursor-jump-win-separators
fix: avoid ui_grid_cursor_goto when drawing window separators
2023-09-20 11:11:52 +02:00
b6ef938c66 docs: document $XDG environment variables #25227 2023-09-20 02:04:30 -07:00
ee20e9e669 refactor(grid): unused grid->line_wraps delenda est
This is not used as part of the logic to actually implement TUI line wrapping
In vim (especially gvim) it is used to emulate terminal-style text
selection. But in nvim we don't do that, and have no plans to reintroduce it.
2023-09-20 10:24:07 +02:00
acde86d436 Merge pull request #25096 from glepnir/float_winnew
fix(float): trigger winnew event when float window create
2023-09-20 09:25:59 +02:00
c6cc56d69c Merge pull request #25155 from glepnir/fix_winhl
fix(highlight): winhl receive wrong argument
2023-09-20 09:18:59 +02:00
b2265bb72c test(lsp): add normalize_markdown tests 2023-09-20 07:00:52 +01:00
c4f4c7a356 vim-patch:9.0.1915: r_CTRL-C works differently in visual mode (#25248)
Problem:  r_CTRL-C works differently in visual mode
Solution: Make r_CTRL-C behave consistent in visual mode
          in terminal and Windows GUI

in visual mode, r CTRL-C behaves strange in Unix like environments. It
seems to end visual mode, but still is waiting for few more chars,
however it never seems to replace it by any characters and eventually
just returns back into normal mode.

In contrast in Windows GUI mode, r_CTRL-C replaces in the selected area
all characters by a literal CTRL-C.

Not sure why it behaves like this. It seems in the Windows GUI, got_int
is not set and therefore behaves as if any other normal character has
been pressed.

So remove the special casing of what happens when got_int is set and
make it always behave like in Windows GUI mode. Add a test to verify it
always behaves like replacing in the selected area each selected
character by a literal CTRL-C.

closes: vim/vim#13091
closes: vim/vim#13112

476733f3d0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-09-20 06:37:29 +08:00
5a363ccac8 fix(lsp)!: deprecate trim_empty_lines 2023-09-19 14:47:37 +01:00
cfd4a9dfaf feat(lsp): use treesitter for stylize markdown 2023-09-19 14:47:37 +01:00
592bc831ce fix: avoid ui_grid_cursor_goto when drawing window separators 2023-09-19 14:35:03 +02:00
c5abf487f1 fix(float): make "fixed" work with relative=win (#25243) 2023-09-19 18:45:11 +08:00
437ed3cee2 fix(float): trigger winnew event when float window create 2023-09-19 18:44:48 +08:00
1db45a9c1f Merge pull request #25214 from bfredl/glyphcache
refactor(grid): change schar_T representation to be more compact
2023-09-19 12:32:41 +02:00
ab92575753 fix(highlight): winhl receive wrong argument 2023-09-19 18:05:59 +08:00
2de5cddeb1 Merge pull request #25148 from glepnir/fixed_opt
fix(float): add fixed option
2023-09-19 11:49:59 +02:00
8da986ea87 refactor(grid): change schar_T representation to be more compact
Previously, a screen cell would occupy 28+4=32 bytes per cell
as we always made space for up to MAX_MCO+1 codepoints in a cell.

As an example, even a pretty modest 50*80 screen would consume

50*80*2*32 = 256000, i e a quarter megabyte

With the factor of two due to the TUI side buffer, and even more when
using msg_grid and/or ext_multigrid.

This instead stores a 4-byte union of either:
- a valid UTF-8 sequence up to 4 bytes
- an escape char which is invalid UTF-8 (0xFF) plus a 24-bit index to a
  glyph cache

This avoids allocating space for huge composed glyphs _upfront_, while
still keeping rendering such glyphs reasonably fast (1 hash table lookup
+ one plain index lookup). If the same large glyphs are using repeatedly
on the screen, this is still a net reduction of memory/cache
consumption. The only case which really gets worse is if you blast
the screen full with crazy emojis and zalgo text and even this case
only leads to 4 extra bytes per char.

When only <= 4-byte glyphs are used, plus the 4-byte attribute code,
i e 8 bytes in total there is a factor of four reduction of memory use.
Memory which will be quite hot in cache as the screen buffer is scanned
over in win_line() buffer text drawing

A slight complication is that the representation depends on host byte
order. I've tested this manually by compling and running this
in qemu-s390x and it works fine. We might add a qemu based solution
to CI at some point.
2023-09-19 11:25:31 +02:00
6405fa4b11 vim-patch:346ac1429c5a (#25239)
runtime(doc): add help tag describing object-selection

closes: vim/vim#13114

346ac1429c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-09-19 07:07:24 +08:00
bbde37fd64 vim-patch:9.0.1908: undefined behaviour upper/lower function ptrs (#25238)
Problem:  undefined behaviour upper/lower function ptrs
Solution: Fix UBSAN error in regexp and simplify upper/lowercase
          modifier code

The implementation of \u / \U / \l / \L modifiers in the substitute
command relies on remembering the state by setting function pointers on
func_all/func_one in the code. The code signature of `fptr_T` is
supposed to return void* (due to C function signatures not being able to
return itself due to type recursion), and the definition of the
functions (e.g. to_Upper) didn't follow this rule, and so the code tries
to cast functions of different signatures, resulting in undefined
behavior error under UBSAN in Clang 17. See vim/vim#12745.

We could just fix `do_Upper`/etc to just return void*, which would fix
the problem. However, these functions actually do not need to return
anything at all. It used to be the case that there was only one pointer
"func" to store the pointer, which is why the function needs to either
return itself or NULL to indicate whether it's a one time or ongoing
modification. However, c2c355df6f094cdb9e599fd395a78c14486ec697
(7.3.873) already made that obsolete by introducing `func_one` and
`func_all` to store one-time and ongoing operations separately, so these
functions don't actually need to return anything anymore because it's
implicit whether it's a one-time or ongoing operation. Simplify the code
to reflect that.

closes: vim/vim#13117

d25021cf03

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-09-19 06:41:59 +08:00
46402c16c0 docs(test): add more info on debugging with gdb #25230 2023-09-18 05:24:18 -07:00
fd08fd3de3 fix(float): add fixd option 2023-09-18 18:21:14 +08:00
9cadbf1d36 test(tui_spec): update cursor_address test for wrap flag (#25228) 2023-09-18 12:16:32 +08:00
508dda0e6c test(ui/fold_spec): more testing for clicking on 'foldcolumn' (#25225) 2023-09-18 07:07:54 +08:00
57ccd82417 fix(job-control): fix use after free (#25223) 2023-09-18 07:07:08 +08:00
9de5cb0b32 vim-patch:d8b86c937a41
runtime(netrw): fix filetype detection for remote editing files

closes: vim/vim#12990
closes: vim/vim#12992

this partially reverses commit 71badf9 by commenting out the line that
intentionally sets the filetype to an empty string.

d8b86c937a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-09-17 22:52:56 +02:00
1b74d2bf0a vim-patch:e30d8e4ce01d
runtime(kotlin): Add Kotlin runtime files (vim/vim#13110)

Closes udalov/kotlin-vimvim/vim#39

e30d8e4ce0

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-09-17 22:52:56 +02:00
ed45aa835c vim-patch:9.0.1907: No support for liquidsoap filetypes
Problem:  No support for liquidsoap filetypes
Solution: Add liquidsoap filetype detection code

closes: vim/vim#13111

6b5efcdd8e

Co-authored-by: Romain Beauxis <toots@rastageeks.org>
2023-09-17 22:26:10 +02:00
71d9b7d15c fix(treesitter): _trees may not be list-like
Problem:
With incremental injection parsing, injected languages' parsers parse
only the relevant regions and stores the result in _trees with the index
of the corresponding region. Therefore, there can be holes in _trees.

Solution:
* Use generic table functions where appropriate.
* Fix type annotations and docs.
2023-09-17 19:52:35 +01:00
f54677132b test(ui/fold_spec): click on multibyte "foldclosed" (#25216) 2023-09-17 21:31:51 +08:00
211edceb4f vim-patch:8.2.4173: cannot use an import in 'foldexpr' (#25215)
Problem:    Cannot use an import in 'foldexpr'.
Solution:   Set the script context to where 'foldexpr' was set. (closes vim/vim#9584)
            Fix that the script context was not set for all buffers.

e70dd11ef4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-09-17 21:01:19 +08:00
71530cc972 feat(folds): support virtual text format for 'foldtext' (#25209)
Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2023-09-17 20:29:18 +08:00
677df72e40 docs: remove joke from pronounce
N-Jim does not sounds like "Ninja", and the joke doesn't really land.
2023-09-17 12:33:01 +02:00
767b968647 build(deps): bump luajit to HEAD - e897c5743 2023-09-17 12:27:08 +02:00
a0c99755b8 Merge pull request #25190 from glepnir/echo_hl
fix(highlight): correct hi command output
2023-09-17 12:23:22 +02:00
5183651773 fix(highlight): correct hi command output 2023-09-17 17:47:51 +08:00
d70667a1c1 Merge pull request #25208 from zeertzjq/vim-8.2.2356 2023-09-17 11:40:31 +08:00
a1f0f0b2bc vim-patch:9.0.1633: duplicate code for converting float to string
Problem:    Duplicate code for converting float to string.
Solution:   Use tv_get_string(). (closes vim/vim#12521)

19dfa276c3
2023-09-17 11:07:35 +08:00
ac0fda2e46 vim-patch:8.2.2356: Vim9: ":put =expr" does not handle a list properly
Problem:    Vim9: ":put =expr" does not handle a list properly.
Solution:   Use the same logic as eval_to_string_eap(). (closes vim/vim#7684)

883cf97f10

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-09-17 11:07:32 +08:00
aac85b8d6b docs(tutor): clarify the meaning of ✗ and ✓ (#25204)
Also reformat tutor.tutor.json to use 2-space indent while at it.
2023-09-17 08:48:13 +08:00
4ab9c5fa46 fix(lua): not using global value in vim.opt_global (#25196) 2023-09-17 06:35:12 +08:00
054839437e test(plugin/man_spec): use pesc() on actual_file in pattern (#25199) 2023-09-17 06:07:53 +08:00
28f54a7878 feat(treesitter): add lang parameter to the query editor (#25181) 2023-09-16 19:05:59 +02:00
7e5ce42977 fix(treesitter): properly combine injection.combined regions
Problem:
It doesn't make much sense to flatten each region (= list of ranges).
This coincidentally worked for region with a single range.

Solution:
Custom function for combining regions.
2023-09-16 17:02:26 +01:00
f40a109716 fix(treesitter): fix trim predicate 2023-09-16 14:24:55 +01:00
b3342171d5 fix(typing): vim.fn.execute 2023-09-16 14:24:24 +01:00
883e2a1409 Merge pull request #25186 from llllvvuu/fix/preserve_marktree_orderinh
fix(marktree): preserve ordering in `marktree_move`
2023-09-16 14:59:20 +02:00
07080f67fe perf(treesitter): do not scan past given line for predicate match
Problem
---
If a highlighter query returns a significant number of predicate
non-matches, the highlighter will scan well past the end of the window.

Solution
---
In the iterator returned from `iter_captures`, accept an optional
parameter `end_line`. If no parameter provided, the behavior is
unchanged, hence this is a non-invasive tweak.

Fixes: #25113 nvim-treesitter/nvim-treesitter#5057
2023-09-16 13:52:42 +01:00
477458f7bf fix(test): more tests for marktree
Co-Authored-By: L Lllvvuu <git@llllvvuu.dev>
2023-09-16 05:32:45 -07:00
34be915f6b fix(marktree): preserve ordering in marktree_move
`marktree_move` is making the tree out of order at:

be10d65bfa/src/nvim/marktree.c (L1188)

Because `key` is at the new position, and `x->key[new_i]` is also at the
new position, this comparison spuriously returns true, which causes
`x->key[i]` to be updated in-place even when it needs to be moved.

This causes crashes down the line, since the ordering of `MTNode.key` is
an invariant that must be preserved.

Fixes: #25157
2023-09-16 04:56:12 -07:00
091b57d766 refactor(mapping.c): reduce scope of locals 2023-09-16 11:43:30 +01:00
908843df61 fix(languagetree): apply resolve_lang to metadata['injection.language']
`resolve_lang` is applied to `@injection.language` when it's supplied as a
capture:

f5953edbac/runtime/lua/vim/treesitter/languagetree.lua (L766-L768)

If we want to support `metadata['injection.language']` (as per #22518 and
[tree-sitter upstream](https://tree-sitter.github.io/tree-sitter/syntax-highlighting#language-injection))
then the behavior should be consistent.

Fixes: nvim-treesitter/nvim-treesitter#4918
2023-09-16 11:12:06 +01:00
40bfca744d Merge pull request #25183 from llllvvuu/fix/marktree_move
fix(marktree): off-by-one error in `marktree_move`
2023-09-16 10:39:54 +02:00
2d2cf150e1 Merge pull request #25078 from glepnir/au
fix(float): don't trigger au event when enter is false
2023-09-16 10:27:45 +02:00
585549625d fix(marktree): off-by-one error in marktree_move
If you would insert element X at position j, then if you are moving that
same element X from position i < j, you should move it to position j -
1, because you are losing an element.

This error caused a gap to be left in the array, so that it looked like
[x, null, y] instead of [x, y], where len = 2. This triggered #25147.

Fixes: #25147
2023-09-16 01:12:15 -07:00
be10d65bfa vim-patch:c1f8bb37c6a8
runtime(forth): Fix :unlet error in ftplugin (vim/vim#13090)

Fixes vim/vim#13089.

c1f8bb37c6

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-09-16 00:01:16 +02:00
6debb18523 refactor(treesitter): remove duplicated diagnostic code (#24976)
* refactor(treesitter): remove duplicated diagnostic code

* fixup!: fix type errors

* fixup!: add type namespace
2023-09-15 20:45:40 +01:00
73c71ed95c docs(MAINTAIN): Add note about deprecation policy exceptions (#25159)
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2023-09-15 09:32:47 -05:00
35e50d79c6 fix(extmarks): overlay virt_text position after 'showbreak' (#25175)
Also make virt_text_hide work properly.
2023-09-15 20:30:50 +08:00
a916523574 fix(ui): doesn't trigger au event when enter is false 2023-09-15 19:18:01 +08:00
f5a09f1b03 fix: invoke changed_bytes when rewriting <Tab> char #25125
When tabstop and shiftwidth are not equal, tabs are inserted as individual
spaces and then rewritten as tab characters in a second pass. That second pass
did not call changed_bytes which resulted in events being omitted.

Fixes #25092
2023-09-15 03:45:51 -07:00
28233bcb49 refactor(treesitter): rename "preview" => "edit" #25161
"Edit" more closely describes the generic application than "Preview", though
the buffer contents don't (yet) map to an actual file on disk.

https://github.com/neovim/neovim/pull/24703#discussion_r1321719133
2023-09-15 03:10:55 -07:00
2d9e7a33f4 test(windows): unskip working tests (#25153)
Also simplify home detection with os_homedir()
2023-09-15 16:33:26 +08:00
a6e4793baf fix(extmarks): draw virt_text below diff filler lines properly (#25170)
fix(extmarks): draw virt_text properly below diff filler lines
2023-09-15 15:56:52 +08:00
fe2fa98460 build(deps): bump luajit to HEAD - 7a77a3cd8 2023-09-15 09:10:00 +02:00
b65cd7ff1a fix(extmarks): fix wrong virt_text position after wrapped TAB (#25168) 2023-09-15 14:54:42 +08:00
b52bd8a2de fix(extmarks): properly handle virt_text on next screen line (#25166)
TODO: virt_text_hide doesn't work for the first char on a wrapped screen
line, and it's not clear how to fix that.
2023-09-15 12:35:27 +08:00
9ec0ecb222 refactor(drawline): remove unnecessary inline virt checks (#25163) 2023-09-15 07:17:13 +08:00
2e92065686 docs: replace <pre> with ``` (#25136) 2023-09-14 08:23:01 -05:00
LW
9fc321c976 refactor(treesitter): deprecate for_each_child #25118
The name for_each_child is misleading and caused bugs.
After #25111, #25115, there are no more usages of `for_each_child` in Nvim.

In the future if we want to restore this functionality we can consider a
generalized vim.traverse(node, key, visitor) function.
2023-09-14 03:36:16 -07:00
a4743487b7 fix(treesitter): language.add - only register parser if it exists
Fixes: #24531
2023-09-14 10:36:09 +01:00
eecddd2416 build(lint): use stylua without add_glob_target
add_glob_target is our custom method to figure out whether a work needs
to be done or not. This works as expected most of the time, but causes a
problem with stylua.

Stylua makes the decision that if a file is explicitly passed to be
formatted, then it will format the file even if the file is set to be
ignored in .styluaignore. This behavior breaks add_glob_target with
seemingly no easy workaround.
More information: https://github.com/JohnnyMorganz/StyLua/issues/751

Instead, what we can do is call stylua as you would in the command line.
This will make stylua work as expected. The downside is that we no
longer get a free "is this work necessary" detection, meaning that
stylua will be run each time `make lint` is called, regardless if it's
necessary or not. For longer lint tasks such as uncrustify and
clang-tidy this would be disastrous, but this is an acceptable tradeoff
since stylua is very quick.
2023-09-14 09:58:50 +02:00
a49924a318 feat(lsp): remove notify from vim.lsp.buf_detach_client (#25140)
Closes https://github.com/neovim/neovim/issues/19838
2023-09-14 08:40:53 +02:00
a6e74c1f0a docs: fix typos and other small fixes (#25005)
Co-authored-by: nuid64 <lvkuzvesov@proton.me>
Co-authored-by: Mike Smith <10135646+mikesmithgh@users.noreply.github.com>
Co-authored-by: XTY <xty@xty.io>
Co-authored-by: Empa <emanuel@empa.xyz>
Co-authored-by: kyu08 <49891479+kyu08@users.noreply.github.com>
2023-09-14 12:05:27 +08:00
f5953edbac fix(float): update position of anchored windows first (#25133) 2023-09-14 07:42:22 +08:00
77df96f3fb Merge pull request #25114 from bfredl/nohl
refactor(highlight): merge redundant attr_entries and attr_entry_ids
2023-09-13 22:18:51 +02:00
199cf5a526 vim-patch:8b2457a38198
runtime(swayconfig): improve syntax highlighting (vim/vim#13060)

* syntax(swayconfig): improved highlighting
* syntax(swayconfig): adapt to i3config structure

8b2457a381

Co-authored-by: Josef Litoš <54900518+JosefLitos@users.noreply.github.com>
2023-09-13 17:23:45 +02:00
2dd5e472df vim-patch:fc93594d562d
runtime(rust): sync rust runtime files with upstream (vim/vim#13075)

fc93594d56

Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
2023-09-13 17:23:45 +02:00
b1d24ca760 vim-patch:f5356bf6751f
runtime(i3config): syntax structure cleanup (vim/vim#13080)

* syntax(i3config): improved i3config highlighting
* syntax(i3config): refactor structure

f5356bf675

Co-authored-by: Josef Litoš <54900518+JosefLitos@users.noreply.github.com>
2023-09-13 17:23:45 +02:00
27a566f3f8 feat(vimdoc): support Markdown code blocks (#25127)
Support Markdown code blocks in addition to <pre> blocks in Doxygen doc
comments.

Update doc comments in iter.lua as a test.
2023-09-13 08:38:28 -05:00
a6d745865a refactor(highlight): merge redundant attr_entries and attr_entry_ids structs
An insert-only set now defines a monotonically increasing ordering by
itself. It can be used to both lookup the key from index, and vice versa.
2023-09-13 10:37:48 +02:00
4607807f9f fix(treesitter): don't update fold if tree is unchanged
Problem:
Folds are opened when the visible range changes even if there are no
modifications to the buffer, e.g, when using zM for the first time. If
the parsed tree was invalid, on_win re-parses and gets empty tree
changes, which triggers fold updates.

Solution:
Don't update folds in on_changedtree if there are no changes.
2023-09-13 08:51:54 +01:00
1f551e068f fix(treesitter): fixup for InspectTree
Fixes #25120
2023-09-12 15:55:40 +01:00
bc67cf3ccd feat(gen_help_html): add anchors to help tags #25112
Fixes #21911

Co-authored by: wispl
2023-09-12 04:51:38 -07:00
7a76fb8547 fix(treesitter): remove more double recursion
Do not call `for_each_child` in functions that are already recursive.
2023-09-12 12:21:42 +01:00
1c4a93b591 Merge pull request #13243 from bfredl/intersection
feat(extmark): support highlighting and querying multiline ranges
2023-09-12 11:16:35 +02:00
b04286a187 feat(extmark): support proper multiline ranges
The removes the previous restriction that nvim_buf_set_extmark()
could not be used to highlight arbitrary multi-line regions

The problem can be summarized as follows: let's assume an extmark with a
hl_group is placed covering the region (5,0) to (50,0) Now, consider
what happens if nvim needs to redraw a window covering the lines 20-30.
It needs to be able to ask the marktree what extmarks cover this region,
even if they don't begin or end here.

Therefore the marktree needs to be augmented with the information covers
a point, not just what marks begin or end there. To do this, we augment
each node with a field "intersect" which is a set the ids of the
marks which overlap this node, but only if it is not part of the set of
any parent. This ensures the number of nodes that need to be explicitly
marked grows only logarithmically with the total number of explicitly
nodes (and thus the number of of overlapping marks).

Thus we can quickly iterate all marks which overlaps any query position
by looking up what leaf node contains that position. Then we only need
to consider all "start" marks within that leaf node, and the "intersect"
set of that node and all its parents.

Now, and the major source of complexity is that the tree restructuring
operations (to ensure that each node has T-1 <= size <= 2*T-1) also need
to update these sets. If a full inner node is split in two, one of the
new parents might start to completely overlap some ranges and its ids
will need to be moved from its children's sets to its own set.
Similarly, if two undersized nodes gets joined into one, it might no
longer completely overlap some ranges, and now the children which do
needs to have the have the ids in its set instead. And then there are
the pivots! Yes the pivot operations when a child gets moved from one
parent to another.
2023-09-12 10:38:23 +02:00
6b5f44817e fix(languagetree): remove double recursion in LanguageTree:parse
`LanguageTree:parse` is recursive, and calls
`LanguageTree:for_each_child`, which is also recursive.

That means that, starting from the third level (child of child of root),
nodes will be parsed twice.

Which then means that if the tree is N layers deep, there will be ~2^N
parses even if the branching factor is 1.

Now, why was the tree deepening with each character inserted? And why
did this only regress in #24647? These are mysteries for another time.

Fixes: #25104
2023-09-12 09:12:53 +02:00
3849cc9c18 build(deps): bump luajit to HEAD - 8af63f992 2023-09-12 09:01:52 +02:00
6c1b7535fe build(deps): bump tree-sitter to HEAD - 46af27796 2023-09-12 09:01:38 +02:00
a9369e4b65 vim-patch:62145db91b10
syntax(i3config): improved i3config highlighting (vim/vim#13054)

62145db91b

Co-authored-by: Josef Litoš <54900518+JosefLitos@users.noreply.github.com>
2023-09-12 08:19:22 +02:00
aab06edc63 vim-patch:f787ee8451a1 (#25103)
runtime(doc): Add g:c_syntax_for_h to filetype-overrule docs

closes: vim/vim#13074

f787ee8451

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-09-12 07:48:40 +08:00
4b6023be7c vim-patch:596ad66d1ddb (#25102)
runtime(doc): documentation updates

This is a collection of various improvements to the help pages

closes vim/vim#12790

596ad66d1d

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Houl <anwoku@yahoo.de>
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Co-authored-by: Adri Verhoef <a3@a3.xs4all.nl>
2023-09-12 07:37:05 +08:00
65738202f8 fix(decorations): better approximation of botline #24794
Problem:
* The guessed botline might be smaller than the actual botline e.g. when
  there are folds and the user is typing in insert mode. This may result
  in incorrect treesitter highlights for injections.
* botline can be larger than the last line number of the buffer, which
  results in errors when placing extmarks.

Solution:
* Take a more conservative approximation. I am not sure if it is
  sufficient to guarantee correctness, but it seems to be good enough
  for the case mentioned above.
* Clamp it to the last line number.

Co-authored-by: Lewis Russell <me@lewisr.dev>
2023-09-11 12:29:39 -07:00
f859d16aea fix(tests): set SHELL=sh #24941
Problem:
Some tests fail with $SHELL=fish #6172
Related: https://github.com/neovim/neovim/pull/6176

Solution:
Replace "echo -n" with "printf", because "echo" in sh may be provided
as a shell builtin, which does not accept an "-n" flag to avoid a
trailing newline (e.g. on macos). "printf" is more portable (defined by
POSIX) and it does not output a trailing newline by itself.
Fixes #6172

TODO:
Other test failures may be related to "session leader" issue: https://github.com/neovim/neovim/issues/2354
Checked by running `:terminal ./build/bin/tty-test` from Nvim with
`shell=/bin/fish` (inherited from `$SHELL`) and it indeed complains
about "process does not own the terminal". With `shell=sh` it doesn't complain. And
unsetting `$SHELL` seems to make `nvim` to fall back to `shell=sh`.

    FAILED   test/functional/terminal/tui_spec.lua @ 1017: TUI paste: terminal mode
    test/functional/terminal/tui_spec.lua:1024: Row 1 did not match.
    Expected:
      |*tty ready                                         |
      |*{1: }                                                 |
      |*                                                  |
      |                                                  |
      |{5:^^^^^^^                                           }|
      |{3:-- TERMINAL --}                                    |
      |{3:-- TERMINAL --}                                    |
    Actual:
      |*process does not own the terminal                 |
      |*                                                  |
      |*[Process exited 2]{1: }                               |
      |                                                  |
      |{5:^^^^^^^                                           }|
      |{3:-- TERMINAL --}                                    |
      |{3:-- TERMINAL --}                                    |

    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.

    stack traceback:
        test/functional/ui/screen.lua:622: in function '_wait'
        test/functional/ui/screen.lua:352: in function 'expect'
        test/functional/terminal/tui_spec.lua:1024: in function <test/functional/terminal/tui_spec.lua:1017>

    FAILED   test/functional/terminal/tui_spec.lua @ 1551: TUI forwards :term palette colors with termguicolors
    test/functional/terminal/tui_spec.lua:1567: Row 1 did not match.
    Expected:
      |*{1:t}ty ready                                         |
      |                                                  |
      |*                                                  |
      |                                                  |
      |{2:^^^^^^^                                           }|
      |                                                  |
      |{3:-- TERMINAL --}                                    |
    Actual:
      |*{1:p}rocess does not own the terminal                 |
      |                                                  |
      |*[Process exited 2]                                |
      |                                                  |
      |{2:^^^^^^^                                           }|
      |                                                  |
      |{3:-- TERMINAL --}                                    |

    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.

    stack traceback:
        test/functional/ui/screen.lua:622: in function '_wait'
        test/functional/ui/screen.lua:352: in function 'expect'
        test/functional/terminal/tui_spec.lua:1567: in function <test/functional/terminal/tui_spec.lua:1551>
2023-09-11 10:01:00 -07:00
676e1d4900 refactor(usercmd.c): reduce scope of locals 2023-09-11 11:40:15 +01:00
1d259724a9 Merge pull request #25083 from bfredl/memlinetype
refactor(memline): cleanup typedefs for memline structs
2023-09-11 10:47:23 +02:00
616a9bac32 Merge pull request #24901 from faergeek/more-intuitive-cursor-update
fix(api): more intuitive cursor updates in nvim_buf_set_text
2023-09-11 10:45:45 +02:00
60e5d0fbcc vim-patch:9.0.1891: No runtime support for Mojo
Problem:  No runtime support for Mojo
Solution: Add basic filetype and syntax plugins

closes: vim/vim#13062
closes: vim/vim#13063

0ce2c594d0

Co-authored-by: Mahmoud Abduljawad <mahmoud@masaar.com>
2023-09-11 10:05:54 +02:00
60a39ada1b vim-patch:e7833e73471a
runtime(masm): add support for AVX-2 and AVX-512 (vim/vim#13061)

e7833e7347

Co-authored-by: Wu Yongwei <wuyongwei@gmail.com>
2023-09-11 10:05:54 +02:00
ba1db8751c vim-patch:066103307534
runtime(scala): Fix Scala highlighting string literal as type param (vim/vim#13070)

Since https://docs.scala-lang.org/sips/42.type.html which is implemented
in Scala 2.13 and in Scala 3 it possible to use string literals as
singleton types. So code like
```
someFunc["abc"]
```
is valid. Currently this code is not hightlighted correctly and worse if
there is an unclosed `(` in the string it breaks the formating in the
rest of the file.

I also submitted this patch to the mentioned project for this runtime
file: https://github.com/derekwyatt/vim-scala/pull/173 But there are no
commits there over the last 2 years and no response in the week since I
created it. Also the last change to the Scala syntax file:
https://github.com/vim/vim/pull/9594 is yet to be backported to that
repo. Therefore I am opening this PR as well to get some feedback on how
to proceed to get this fixed.

0661033075

Co-authored-by: Emil Ejbyfeldt <eejbyfeldt@liveintent.com>
2023-09-11 10:05:54 +02:00
4258f4d53c ci(cirrus): use FreeBSD 13.2 (#24684) 2023-09-11 12:41:53 +08:00
d22172f36b fix(api): more intuitive cursor updates in nvim_buf_set_text
Fixes #22526
2023-09-11 08:16:03 +04:00
c8c73b26f3 Merge pull request #25093 from zeertzjq/vim-9.0.1893
vim-patch:9.0.{1893,1894}
2023-09-11 11:46:40 +08:00
e8d25675a2 vim-patch:9.0.1894: CI: trailing whitespace in tests
Problem:  CI: trailing white space in tests
Solution: clean up the trailing white space

e5f7cd0a60

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-09-11 11:16:50 +08:00
6484f338a4 vim-patch:9.0.1893: CI: strptime test fails on BSD14
Problem:  CI: strptime test fails on BSD14
Solution: Skip the test

983d808674

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-09-11 11:16:50 +08:00
2b475cb5cc fix(mouse): click on 'statuscolumn' with 'rightleft' (#25090) 2023-09-11 08:29:33 +08:00
af0684f0d5 test: unignore test which froze sourcehut (#25067) 2023-09-11 05:53:05 +08:00
8d17e470f4 refactor(memline): cleanup typedefs for memline structs
These were used interchangedly by the struct name and the typedef name.
Use standard pattern type names and use these consistently
2023-09-10 19:15:04 +02:00
a03e00a353 Merge pull request #24875 from bfredl/memfilemap
refactor(memfile): change mf_trans and mf_hash from ad-hoc hashtable to Map
2023-09-10 19:10:29 +02:00
06d48f6aa6 ci(codeql): add concurrency to cancel unnecessary jobs early 2023-09-10 17:56:45 +02:00
b6b70ae199 ci: install stylua from their releases
It's quicker to grab the .zip file rather than using homebrew.
2023-09-10 16:23:21 +02:00
9f8f287c61 build: remove luarocks
Luarocks is no longer needed after
25e51d393a.
2023-09-10 15:32:47 +02:00
bf36b0f8ec refactor(mch): last mch_ function/macro hits the dust
Also remove some stray comments.
2023-09-10 13:09:44 +02:00
87cde88c41 refactor(memfile): change mf_trans and mf_hash from ad-hoc hashtable to Map
Memfile used a private implementation of an open hash table with intrusive collision chains, but there is
no reason to assume the standard khash_t based Map won't work just fine.

Yes, we are taking full ownership and maintenance over memline and memfile.
No one is going to maintain it for us.

Trust the plan.
2023-09-10 13:09:44 +02:00
e99a3fd25d build(deps): bump luajit to HEAD - 5a18d4582 2023-09-10 12:48:52 +02:00
59d9f2413b Merge pull request #25071 from bfredl/coxpcall
build(lua): vendor coxpcall
2023-09-10 12:35:32 +02:00
1027b2881a vim-patch:733bbcde776e
runtime(nasm): updated syntax file

733bbcde77

Co-authored-by: Andrii Sokolov <andriy145@gmail.com>
2023-09-10 11:52:48 +02:00
25e51d393a build(lua): vendor coxpcall
Do not require luarocks on PUC lua CI just because of this single lua file
2023-09-10 11:43:37 +02:00
5e3cf9fb4b feat(lsp): improve control over placement of floating windows (#24494) 2023-09-10 10:02:23 +02:00
bb38c066a9 fix: fix compiler warning from clang 2023-09-09 23:42:06 +02:00
87db6d894a fix(deps): make sure --force-config takes effect
Fixes #24881

--force-config passed to luarocks' configure script is only taken into
account in case "make install" is used afterwards.

But if "make bootstrap" is used then this flag has no effect. And it can
actually copy an existing config on the system to the new installation.
That existing config can have a different version of Lua set by default.
In which case luarocks will install packages for that version instead of
the one used in tests. And trying to run tests then will fail because of
missing packages.
2023-09-09 18:41:36 +02:00
6e26964e0e revert: "ci: trigger tests when pushing"
This reverts commit e71c7898ca.

Triggering jobs on users own fork turned out to be not that useful, and
only necessary in rare moments. It's easier to adjust the CI scripts if
the users wants CI results before creating a pull request. It also
reduces the complexity of the CI code.
2023-09-09 15:21:46 +02:00
5acd850117 ci(release): remove unnecessary full clone 2023-09-09 14:22:14 +02:00
c422722b2e fix(rpc): fix hang with channel closed while waiting for response 2023-09-09 19:40:09 +08:00
d4e80a051e Merge pull request #25039 from glepnir/fix_hl
fix(highlight): add create param in nvim_get_hl api function
2023-09-09 13:01:40 +02:00
420b94eeec Merge pull request #25058 from zeertzjq/vim-9.0.1886
vim-patch:9.0.{1877,partial:1886}
2023-09-09 18:33:38 +08:00
b9d9cd7742 vim-patch:partial:9.0.1886: Various Typos
Problem:  Various Typos
Solution: Fix Typos

This is a collection of typo related commits.

closes: vim/vim#12753
closes: vim/vim#13016

ee17b6f70d

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Adri Verhoef <a3@a3.xs4all.nl>
Co-authored-by: Viktor Szépe <viktor@szepe.net>
Co-authored-by: nuid64 <lvkuzvesov@proton.me>
Co-authored-by: Meng Xiangzhuo <aumo@foxmail.com>
Co-authored-by: Dominique Pellé <dominique.pelle@gmail.com>
2023-09-09 17:58:32 +08:00
bc09fc04b8 vim-patch:9.0.1877: missing test for patch 9.0.1873
Problem:  missing test for patch 9.0.1873
Solution: add a test trying to exchange windows

Add a test, making sure that switching windows is not allowed when
textlock is active, e.g. when running `:s/<pat>/\=func()/`

18d2709aa1

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-09-09 17:53:01 +08:00
8afb3a49c0 fix(highlight): add create param in nvim_get_hl 2023-09-09 17:15:58 +08:00
b7734c4ec8 ci: remove container solution for the linux runner
This will fix the failing release job.

Ubuntu 18.04 is incompatible with checkout action version 4, which
requires glibc 2.28+. This will bump the minimum glibc version required
to use the release versions to 2.31. People requring the older releases
can find them at https://github.com/neovim/neovim-releases.
2023-09-09 10:36:42 +02:00
294ded9cf2 vim-patch:86cfb39030eb
runtime(tohtml): Update TOhtml to version 9.0v2 (vim/vim#13050)

Modified behavior:
  - Change default value of g:html_use_input_for_pc from "fallback" to
    "none". This means with default settings, only the standards-based
    method to make special text unselectable is used. The old method
    relying on unspecified browser behavior for <input> tags is now only
    used if a user specifically enables it.
  - Officially deprecate g:use_xhtml option (in favor of
    g:html_use_xhtml) by issuing a warning message when used.

Bugfixes:
  - Fix issue vim/vim#8547: LineNr and other special highlight groups did not
    get proper style rules defined when using "hi link".
  - Fix that diff filler was not properly added for deleted lines at the
    end of a buffer.

Other:
  - Refactored function definitions from long lists of strings to use
    :let-heredoc variable assignment instead.
  - Corrected deprecated "." string concatenation operator to ".."
    operator in more places.

86cfb39030

Co-authored-by: fritzophrenic <fritzophrenic@gmail.com>
2023-09-09 08:29:50 +02:00
0bee75818e vim-patch:4e554d282c50
runtime(perl): Update ftplugin and indent files (vim/vim#13052)

4e554d282c

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-09-09 08:29:50 +02:00
82150ca51b vim-patch:9.0.1884: Wrong order of arguments for error messages (#25055)
Problem:  Wrong order of arguments for error messages
Solution: Reverse order or arguments for e_aptypes_is_null_nr_str

closes: vim/vim#13051

1bd2cb1169

Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
2023-09-09 07:15:41 +08:00
d0d4160dd1 feat(runtime): highlight hl groups in syntax.txt (#25050)
- Add runtime/lua/vim/vimhelp.lua, which is a translation of Vim's
  runtime/import/dist/vimhelp.vim.
- Unlike Vim, run the highlighting from an ftplugin file instead of a
  syntax file, so that it is run even if using treesitter.
2023-09-08 21:05:35 +08:00
cc3df63c3b Merge pull request #24985 from bfredl/hash2
refactor(map): enhanced implementation, Clean Code™, etc etc
2023-09-08 13:26:37 +02:00
5970157e1d refactor(map): enhanced implementation, Clean Code™, etc etc
This involves two redesigns of the map.c implementations:

1. Change of macro style and code organization

The old khash.h and map.c implementation used huge #define blocks with a
lot of backslash line continuations.

This instead uses the "implementation file" .c.h pattern. Such a file is
meant to be included multiple times, with different macros set prior to
inclusion as parameters. we already use this pattern e.g. for
eval/typval_encode.c.h to implement different typval encoders reusing a
similar structure.

We can structure this code into two parts. one that only depends on key
type and is enough to implement sets, and one which depends on both key
and value to implement maps (as a wrapper around sets, with an added
value[] array)

2. Separate the main hash buckets from the key / value arrays

Change the hack buckets to only contain an index into separate key /
value arrays
This is a common pattern in modern, state of the art hashmap
implementations. Even though this leads to one more allocated array, it
is this often is a net reduction of memory consumption. Consider
key+value consuming at least 12 bytes per pair. On average, we will have
twice as many buckets per item.
Thus old implementation:

  2*12 = 24 bytes per item

New implementation

  1*12 + 2*4 = 20 bytes per item

And the difference gets bigger with larger items.
One might think we have pulled a fast one here, as wouldn't the average size of
the new key/value arrays be 1.5 slots per items due to amortized grows?
But remember, these arrays are fully dense, and thus the accessed memory,
measured in _cache lines_, the unit which actually matters, will be the
fully used memory but just rounded up to the nearest cache line
boundary.

This has some other interesting properties, such as an insert-only
set/map will be fully ordered by insert only. Preserving this ordering
in face of deletions is more tricky tho. As we currently don't use
ordered maps, the "delete" operation maintains compactness of the item
arrays in the simplest way by breaking the ordering. It would be
possible to implement an order-preserving delete although at some cost,
like allowing the items array to become non-dense until the next rehash.

Finally, in face of these two major changes, all code used in khash.h
has been integrated into map.c and friends. Given the heavy edits it
makes no sense to "layer" the code into a vendored and a wrapper part.
Rather, the layered cake follows the specialization depth: code shared
for all maps, code specialized to a key type (and its equivalence
relation), and finally code specialized to value+key type.
2023-09-08 12:48:46 +02:00
6a8b48e24c build(vim-patch.sh): don't use control chars in command (#25044) 2023-09-08 07:51:53 +08:00
3d2c9102e9 build(vim-patch.sh): use older associative array syntax 2023-09-08 07:28:46 +08:00
acb868bf84 build(vim-patch.sh): dereference annotated tags when listing (#25042) 2023-09-08 06:56:57 +08:00
3afbf4745b Merge pull request #25024 from bfredl/luacheck2
refactor(build): derocksify luacheck
2023-09-07 16:08:01 +02:00
6985e12cae refactor(build): derocksify luacheck 2023-09-07 15:26:30 +02:00
131a1ee82d feat(lsp): add original LSP Location as item's user_data in locations_to_items (#23743) 2023-09-07 10:12:02 +02:00
ec753cf40d vim-patch:f7ac0ef50988
runtime: don't execute external commands when loading ftplugins

This is a followup to 816fbcc262687b81fc46f82f7bbeb1453addfe0c (patch
9.0.1833: [security] runtime file fixes)

It basically disables that external commands are run on loading of the
filetype plugin, **unless** the user has set the `g:plugin_exec = 1`
global variable in their configuration or for a specific filetype the
variable g:<filetype>_exec=1.

There are a few more plugins, that may execute system commands like
debchangelog, gitcommit, sh, racket, zsh, ps1 but those do at least
do not run those commands by default during loading of the filetype plugin
(there the command is mostly run as convenience for auto-completion or
to provide documentation lookup).

closes: vim/vim#13034

f7ac0ef509

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Tim Pope <vim@tpope.org>
2023-09-07 09:06:35 +02:00
5d1c1da3c9 vim-patch:67c951df4c95
runtime(ftplugin): allow to exec if curdir is in PATH

In case the current directory is present as valid $PATH entry, it is OK
to call the program from it, even if vim curdir is in that same
directory.

(Without that patch, for instance, you will not be able to open .zip
files while your current directory is /bin)

closes: vim/vim#13027

67c951df4c

Co-authored-by: Anton Sharonov <anton.sharonov@gmail.com>
2023-09-07 09:06:35 +02:00
d272143318 fix(diagnostic): always return copies of diagnostic items (#25010) 2023-09-06 12:54:18 -05:00
2ef7b6a433 Merge pull request #25030 from zeertzjq/vim-9.0.1874
vim-patch:9.0.{partial:0669,1874}
2023-09-06 06:59:28 +08:00
0909843647 vim-patch:9.0.1874: CI may fail in test_recover_empty_swap
Problem:  CI may fail in test_recover_empty_swap
Solution: Set directory option

Fix failing Test_recover_empty_swap test

:recover by default not only looks in the current directory, but also in
~/tmp for files to recover. If it finds some files to recover, it will
interactively prompt for a file to recover. However, prompting doesn't
work when running the test suite (and even if it would, there is no one
that can answer the prompt).

So it doesn't really make sense during testing, to inspect different
directories for swap files and prompt and wait (which will lead to a
timeout and therefore a failing test).

So set the 'directory' option temporarily to the current directory only
and reset it back once the test finishes.

closes: vim/vim#13038

1c7397f3f1

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-09-06 06:28:23 +08:00
3e5a7f258a vim-patch:partial:9.0.0669: too many delete() calls in tests
Problem:    Too many delete() calls in tests.
Solution:   Use deferred delete where possible.

db77cb3c08

Include test_recover.vim changes only.
Cherry-pick test_recover.vim change from patch 8.2.3637.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-09-06 06:28:23 +08:00
33d6cf70cc test(old): reorder test_quickfix.vim to match upstream (#25029) 2023-09-06 06:28:03 +08:00
4ce9875feb Merge pull request #25006 from lewis6991/fix/systemkill
`vim.system` fixes and improvements
2023-09-05 21:50:18 +01:00
be8b15200d fix: windows timeouts have exit code 1 2023-09-05 17:10:04 +01:00
80d1333b73 refactor(vim.system): factor out on_exit handling 2023-09-05 17:10:04 +01:00
6d5f12efd2 fix(vim.system): make timeout work properly
Mimic the behaviour of timeout(1) from coreutils.
2023-09-05 17:10:01 +01:00
c3e176f6e2 fix(options): correct condition for calling did_set_option() (#25026) 2023-09-05 20:03:25 +08:00
a44521f46e fix(vim.system): let on_exit handle cleanup after kill
Fixes #25000
2023-09-05 10:18:26 +01:00
6abc608445 vim-patch:282a94be990f
runtime: Fix problem of checking wrong cwd for ruby ftplugin (vim/vim#13026)

282a94be99

Co-authored-by: Anton Sharonov (ant0sha) <109120102+ant0sha@users.noreply.github.com>
Co-authored-by: Anton Sharonov <anton.sharonov@gmail.com>
2023-09-05 08:48:47 +02:00
109ff0a73f vim-patch:3170342af304
runtime(php): Update the php indent script to the 1.75 (from 1.70) (vim/vim#13025)

Changes:

1.75:
- Fix 2072/PHP-Indenting-for-VImvim/vim#87: The indent optimization was causing wrong indentation of lines
  preceded by a line ending with '}' when preceded by non white characters.
- Fix long standing non-reported regex escaping issue in cleaning end of line
  comments function. This should help fixing some other unreported issues when
  parts of codes are commented out at ends of lines...

1.74:
- Fix 2072/PHP-Indenting-for-VImvim/vim#86: Add support for `match` expression.

1.73:
- Fix 2072/PHP-Indenting-for-VImvim/vim#77 where multi line strings and true/false keywords at beginning of a
  line would cause indentation failures.

1.72:
- Fix vim/vimvim/vim#5722 where it was reported that the option PHP_BracesAtCodeLevel
  had not been working for the last 6 years.

1.71:
- Fix 2072/PHP-Indenting-for-VImvim/vim#75 where the indent script would hang on some multi-line quoted strings.

3170342af3

Co-authored-by: John Wellesz <john.wellesz@gmail.com>
2023-09-05 08:48:47 +02:00
65d3378009 vim-patch:9.0.1866: undo is synced after character find (#25021)
vim-patch:9.0.1866: undo is synced after character find

Problem:  Undo is synced after character find.
Solution: Set no_u_sync when calling gotchars_nop().

closes: vim/vim#13022
closes: vim/vim#13024

dccc29c228
2023-09-05 06:25:51 +08:00
cf7d37ad13 ci: bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [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/v3...v4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-04 23:20:30 +02:00
54d357dce0 build: bump lpeg to 1.1.0 (#25016)
Release notes indicates it has better UTF8 handling which is relevant
for us.
2023-09-04 22:42:47 +02:00
069fad6e2d vim-patch:9.0.1863: wrong format specifiers in e_aptypes_is_null_str_nr (#25015)
Problem:  wrong format specifiers in e_aptypes_is_null_str_nr
Solution: Fix the wrong format specifier

closes: vim/vim#13020

7db89bdc23
2023-09-04 15:55:16 +08:00
c431d820e7 vim-patch:9.0.1856: issues with formatting positional arguments (#25013)
Problem:  issues with formatting positional arguments
Solution: fix them, add tests and documentation

closes: vim/vim#12140
closes: vim/vim#12985

Tentatively fix message_test. Check NULL ptr.

aa90d4f031

Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
2023-09-04 08:49:50 +08:00
c50951a4d0 build: various fixes
- simplify lua interpreter search
- fix incorrect variable name in BuildLua.cmake
- build PUC Lua with -O2
- silence non-mandatory find_package search for libuv
- simplify Find modules
- Prefer using the explicitly set CI_BUILD over relying on the
  environment variable "CI".
2023-09-04 00:00:26 +02:00
af899971b9 Merge pull request #24974 from bfredl/memline2
fix(memline): more curbuf stuff
2023-09-03 12:08:23 +02:00
3bf2839dec ci: move external_deps job from cirrus-ci back to github actions
This partially reverts commit 7d0479c558.

The job has been particularly unstable when used with docker on
cirrus-ci, which is especially bad as it's meant to be a non-flaky and
simple test.
2023-09-03 12:06:32 +02:00
820522d685 refactor(ex_session.c): remove unnecessary char -> int -> char cast
The two calls to get_view_file() both pass a char in a string, and
get_view_file() assigns it to a char in a string.
2023-09-03 14:00:45 +08:00
bebdf1dab3 vim-patch:9.0.1848: [security] buffer-overflow in vim_regsub_both() (#25001)
Problem:  buffer-overflow in vim_regsub_both()
Solution: Check remaining space

ced2c7394a

The change to do_sub() looks confusing. Maybe it's an overflow check?
Then the crash may not be applicable to Nvim because of different casts.
The test also looks confusing. It seems to source itself recursively.
Also don't call strlen() twice on evaluation result.

N/A patches for version.c:
vim-patch:9.0.1849: CI error on different signedness in ex_cmds.c
vim-patch:9.0.1853: CI error on different signedness in regexp.c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-09-03 13:47:55 +08:00
0e11bf0e1a perf(substitute): don't reallocate new_start every time (#24997) 2023-09-03 12:32:58 +08:00
087ef52997 vim-patch:9.0.1840: [security] use-after-free in do_ecmd (#24993)
Problem:  use-after-free in do_ecmd
Solution: Verify oldwin pointer after reset_VIsual()

e1dc9a6275

N/A patches for version.c:
vim-patch:9.0.1841: style: trailing whitespace in ex_cmds.c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-09-03 11:15:43 +08:00
f32a69630d refactor(marks): don't set timestamp twice with :delmarks (#24994)
refactor(mark): don't set same timestamp twice
2023-09-03 11:12:53 +08:00
517dfdf0fc fix(shada): update marks when using delmarks! (#24978) 2023-09-03 10:34:09 +08:00
36cb3262b9 Merge pull request #24991 from zeertzjq/vim-9.0.1846
vim-patch:9.0.{1846,1847}
2023-09-03 10:05:45 +08:00
15298e7926 vim-patch:9.0.1847: [security] potential oob write in do_addsub()
Problem:  potential oob write in do_addsub()
Solution: don't overflow buf2, check size in for loop()

889f6af371

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-09-03 09:16:27 +08:00
b55010a539 vim-patch:9.0.1846: [security] crash in fullcommand
Problem:  crash in fullcommand
Solution: Check for typeval correctly

4c6fe2e2ea

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-09-03 09:14:30 +08:00
272c4fba83 vim-patch:9.0.1852: i_CTRL-O does not reset Select Mode (#24990)
Problem:  i_CTRL-O does not reset Select Mode
Solution: Reset select mode on CTRL-O in insert mode

closes: vim/vim#13001
closes: vim/vim#12115

d69aecf141

Co-authored-by: pierreganty <pierreganty@gmail.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-09-03 09:04:58 +08:00
f30844008b build: download busted from own neovim/deps repository
Downloading the necessary files all at once instead of doing dependency
handling with luarocks speeds up installation immensely. We speed up the
process even more by using luv as a replacement for the C modules in the
busted dependencies, which allows us to skip costly compilation times.

Co-authored-by: bfredl <bjorn.linse@gmail.com>
2023-09-03 00:38:10 +02:00
4ea4d72af8 docs(luv): correct uv.spawn options.args docs about the first argument
045bf29b6f
2023-09-02 16:58:19 +02:00
0c86828ac5 fix(ui): avoid ambiguity about chunk that clears part of line (#24982)
Co-authored-by: bfredl <bjorn.linse@gmail.com>
2023-09-02 18:50:12 +08:00
bb1df1221d Merge pull request #24310 from lewis6991/refactor/optionvalidate
refactor(option.c): misc
2023-09-02 10:37:15 +01:00
f02bfb6a2a vim-patch:acb91d3905cf
runtime(zserio): add zserio syntax (vim/vim#13005)

acb91d3905

Co-authored-by: Dominique Pellé <dominique.pelle@gmail.com>
2023-09-02 11:08:29 +02:00
61ccdb2db6 vim-patch:da16a1b471aa
runtime(ruby): Update syntax, indent and ftplugin files

While making changes to the ruby ftplugin, slightly change the exepath()
conditional from patch 9.0.1833 and move it after the :cd invocation.

closes: 12981
closes: 12994

da16a1b471

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Co-authored-by: Tim Pope <code@tpope.net>
2023-09-02 11:08:29 +02:00
bc43575c52 test(shada/marks_spec): load the file with the marks (#24979) 2023-09-02 10:23:43 +08:00
b028233991 fix(memline): more curbuf stuff 2023-09-01 19:28:26 +02:00
597355deae fix(lsp): wrong iterator in registerCapability handler (#24971) 2023-09-01 13:31:05 +02:00
7bf0963d48 vim-patch:9.0.1833: [security] runtime file fixes (#24969)
Problem:  runtime files may execute code in current dir
Solution: only execute, if not run from current directory

The perl, zig and ruby filetype plugins and the zip and gzip autoload
plugins may try to load malicious executable files from the current
working directory.  This is especially a problem on windows, where the
current directory is implicitly in your $PATH and windows may even run a
file with the extension `.bat` because of $PATHEXT.

So make sure that we are not trying to execute a file from the current
directory. If this would be the case, error out (for the zip and gzip)
plugins or silently do not run those commands (for the ftplugins).

This assumes, that only the current working directory is bad. For all
other directories, it is assumed that those directories were
intentionally set to the $PATH by the user.

816fbcc262

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-09-01 11:38:31 +08:00
592a8f1e90 vim-patch:9.0.1828: cursor wrong with virt text before double-width char (#24967)
Problem:  Wrong cursor position with virtual text before double-width
          char at window edge.
Solution: Check for double-width char before adding virtual text size.

closes: vim/vim#12977

ac2d8815ae
2023-09-01 06:45:27 +08:00
a1bec02c1e fix: use snprintf instead of sprintf
Clang 14 now reports sprintf as deprecated.
2023-08-31 15:12:35 +01:00
dd0e77d48a fix(query_error): multiline bug 2023-08-31 15:12:17 +01:00
90fd0864c4 refactor(option): add set_option() 2023-08-31 15:08:52 +01:00
038ac39b8e refactor(option): pass varp to set_string_option 2023-08-31 15:08:52 +01:00
af3c667ac1 refactor(option): option clearing 2023-08-31 15:08:52 +01:00
6a449a892b refactor(option): remove OPT_CLEAR 2023-08-31 15:08:52 +01:00
3a45a0db4d refactor(option): further align set_string_option with do_set_option_string (2) 2023-08-31 15:08:52 +01:00
ec0ca51886 refactor(option): further align set_string_option with do_set_option_string 2023-08-31 15:08:52 +01:00
9edd0f077e refactor(option): remove hidden option check 2023-08-31 15:08:50 +01:00
9a6b399cad refactor(option): remove redundant local 2023-08-31 15:08:02 +01:00
95c880ce31 refactor(option): change some int to bool 2023-08-31 15:07:05 +01:00
354a115442 refactor(option.c): call did_set_option for all types
set_option_value() only called did_set_option() for string options,
whereas do_set_option_value() called it for all types.

This change makes set_option_value() call did_set_option() for all types
and thus makes it more consistent with do_set_option_value().
2023-08-31 15:07:05 +01:00
804c828e68 fix(optionstr.c): incorrect use of curbuf/curwin 2023-08-31 15:07:05 +01:00
9fdc4cdb64 refactor(optionstr.c): remove redundant argument 2023-08-31 15:07:04 +01:00
3b02e1281a refactor(option.c): remove did_set_string_option alias 2023-08-31 15:07:04 +01:00
4b0b798eba refactor(option.c): move validation logic to function 2023-08-31 15:07:04 +01:00
845d5b8b64 feat(treesitter): improve query error message 2023-08-31 13:33:40 +01:00
4afd33e69f vim-patch:0b8b145bf8bf
runtime(optwin): Fix for 'splitkeep' option (vim/vim#12974)

'spk' was used as a boolean, rather than a string option.

0b8b145bf8

Co-authored-by: xrandomname <141588647+xrandomname@users.noreply.github.com>
2023-08-31 10:58:54 +02:00
2fad4c0b39 vim-patch:1610528cc305
runtime(forth): Update syntax and ftplugin files (vim/vim#12976)

1610528cc3

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-08-31 10:58:54 +02:00
0e7e25af20 refactor(lsp): add type annotation for lsp.Client.server_capabilities (#24925)
The class `lsp.Client` has a public member `server_capabilities`,
which is assumed to be non-nil once initialized, as documented in
`:help vim.lsp.client`. Due to the possibility that it may be nil
before initialization, `lsp.Client` was not having a proper lua type
annotations on the field `server_capabilities`.

Instead of having a nil `server_capabilities` until initialized in
the RPC response callback, we can have an initial value of empty table.
This CHANGES the behavior of the `server_capabilities` field in a way
that it is no longer `nil` until initialization. Note that, as
already documented, `server_capabilities` should never be nil when
it is once initialized and thus ready to be used in user configs.
2023-08-31 10:14:20 +02:00
c235959fd9 fix(lsp): only disable inlay hints / diagnostics if no other clients are connected (#24535)
This fixes the issue where the LspNotify handlers for inlay_hint /
diagnostics would end up refreshing all attached clients.

The handler would call util._refresh, which called
vim.lsp.buf_request, which calls the method on all attached clients.

Now util._refresh takes an optional client_id parameter, which is used
to specify a specific client to update.

This commit also fixes util._refresh's handling of the `only_visible`
flag. Previously if `only_visible` was false, two requests would be made
to the server: one for the visible region, and one for the entire file.

Co-authored-by: Stanislav Asunkin <1353637+stasjok@users.noreply.github.com>
Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
2023-08-31 10:00:24 +02:00
ee56daebb6 fix(shada): update deleted marks (#24936)
Fix #4295
Close #16067

Co-authored-by: chentau <tchen1998@gmail.com>
2023-08-31 10:15:49 +08:00
67fba9affa fix(runtime/tutor): don't try to close fold when there is none (#24953)
Problem: When double clicking a line starting with a #, the code assumes
there is a fold there and tries to close it, resulting in an error if
there isn't a fold.
Solution: Check foldlevel before performing "zc".
2023-08-31 09:18:39 +08:00
839d919098 vim-patch:9.0.1825: wrong cursor position with virt text and 'linebreak' (#24957)
Problem:  Wrong cursor position with virtual text before a whitespace
          character and 'linebreak'.
Solution: Always set "col_adj" to "size - 1" and apply 'linebreak' after
          adding the size of 'breakindent' and 'showbreak'.

closes: vim/vim#12956

6e55e85f92

N/A patches:
vim-patch:9.0.1826: keytrans() doesn't translate recorded key typed in a GUI
2023-08-31 08:35:08 +08:00
5d49542b56 vim-patch:9.0.1820: Rexx files may not be recognised (#24956)
Problem:  Rexx files may not be recognised
Solution: Add shebang detection and improve disambiguation of *.cls
	  files

closes: vim/vim#12951

e06afb7860

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-08-31 08:20:00 +08:00
7914881356 vim-patch:9.0.1797: Vimball/Visual Basic filetype detection conflict (#24947)
Problem:  Vimball/Visual Basic filetype detection conflict
Solution: runtime(vb): Improve Vimball and Visual Basic detection logic

Only run Vimball Archiver's BufEnter autocommand on Vimball archives.
Fixes vim/vim#2694.

closes: vim/vim#12899

f97f6bbf56

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-08-31 07:44:33 +08:00
6463116818 vim-patch:9.0.1807: runtime: crystal scripts not recognised (#24949)
Problem:  runtime: crystal scripts not recognised
Solution: Filetype detect Crystal scripts by shebang line

closes: vim/vim#12935

9b73902dbe

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-08-31 04:38:28 +08:00
497cf996eb vim-patch:9.0.1803: runtime(filetype): Add norg language detection (#24948)
runtime(filetype): Add norg markup language detection

closes: vim/vim#12913

03e44a1d70

Co-authored-by: NTBBloodbath <bloodbathalchemist@protonmail.com>
2023-08-31 04:38:01 +08:00
b2c3e9c72e vim-patch:9d8ef7cc4340
runtime: cleanup :Sman command via the undo_ftplugin mechanism (vim/vim#12967)

Regards to @dkearns as noticed in
2ac708b548

9d8ef7cc43

Co-authored-by: Enno <Konfekt@users.noreply.github.com>
2023-08-30 18:46:52 +02:00
670c7609c8 fix(filetype): make sure buffer is valid before call nvim_buf_call (#24922) 2023-08-30 10:14:58 -05:00
bec13cfcaf Merge pull request #24944 from bfredl/memline0
fix(api): nvim_buf_get_offset in a new buffer with zero or one lines
2023-08-30 13:14:29 +02:00
b051b131f5 fix(api): nvim_buf_get_offset in a new buffer with zero or one lines
fixes #24930
2023-08-30 12:01:35 +02:00
f85aa2e67f fix(treesitter.c): improve comments on fenv usage 2023-08-30 10:50:07 +01:00
62869da11c build(deps): bump luajit to HEAD - 41fb94def 2023-08-30 10:03:19 +02:00
3fcd6da5b0 vim-patch:2ac708b54866
runtime(sh): Update ftplugin (vim/vim#12950)

Remove :Help command via the undo_ftplugin mechanism.

2ac708b548

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-08-30 09:55:24 +02:00
c4c5178b8e vim-patch:a5eb6785efcc
runtime(doc): mention special case of i_CTRL-R_-

closes: vim/vim#12947

a5eb6785ef

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-30 09:55:24 +02:00
88bf4204ef vim-patch:3ac2d3da5fdf
runtime(heex): Add HEEX comments to match_words in ftplugin (vim/vim#12957)

3ac2d3da5f

Co-authored-by: Jason King <jk@handle.it>
2023-08-30 09:55:24 +02:00
da7178cbbf fix(builtin): fix incorrect optional fields for fn.sign_define
The field `icon` is not a mandatory field.
2023-08-30 07:51:26 +01:00
97cfee39ee Merge pull request #24926 from bfredl/tsfree
fix(treesitter): fix another TSNode:tree() double free
2023-08-29 17:34:07 +02:00
50a03c0e99 fix(treesitter): fix another TSNode:tree() double free
Unfortunately the gc=false objects can refer to a dangling tree if the
gc=true tree was freed first. This reuses the same tree object as the
node itself is keeping alive via the uservalue of the node userdata.
(wrapped in a table due to lua 5.1 restrictions)
2023-08-29 11:35:46 +02:00
ae7ab90159 vim-patch:0382f05dbd65
runtime: Set b:undo_indent where missing (vim/vim#12944)

0382f05dbd

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-08-29 11:32:46 +02:00
0e3ea0a262 vim-patch:f937ab32a1ac
runtime: Set b:undo_ftplugin where missing (vim/vim#12943)

f937ab32a1

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-08-29 11:32:46 +02:00
6e45567b49 fix(treesitter): fix TSNode:tree() double free (#24796)
Problem: `push_tree`, every time its called for the same TSTree with
`do_copy=false` argument, creates a new userdata for it. Each userdata,
when garbage collected, frees the same TSTree C object.

Solution: Add flag to userdata, which indicates, should C object,
which userdata points to, be freed, when userdata is garbage collected.
2023-08-29 10:48:23 +02:00
97badc9ac4 Merge pull request #24912 from bfredl/topline2
fix(api): better topline adjustments in nvim_buf_set_lines
2023-08-29 10:03:04 +02:00
ffb340bf63 fix(treesitter): update folds only once on InsertLeave
Problem:
With treesitter fold, InsertLeave can be slow, because a single session
of insert mode may schedule multiple fold updates in on_bytes and
on_changedtree.

Solution:
Don't create duplicate autocmds.
2023-08-29 10:02:02 +02:00
009c84322d build(deps): bump luajit to HEAD - 83954100d 2023-08-29 09:42:18 +02:00
0a81ec14a4 fix(api): better topline adjustments in nvim_buf_set_lines
Some more reasonable defaults for topline:
  - if topline was replaced with another line, that now becomes topline
  - if line was inserted just before topline, display it. This is more
    similar to the previous API behavior.
2023-08-29 09:26:15 +02:00
794981d9be vim-patch:9.0.1813: linebreak incorrect drawn with breakindent (#24917)
Problem: 'linebreak' is incorrectly drawn after 'breakindent'.
Solution: Don't include 'breakindent' size when already after it.

closes: vim/vim#12937
closes: vim/vim#12940

1d3e0e8f31
2023-08-29 09:36:55 +08:00
7c4d317a66 build(deps): bump tree-sitter to HEAD 2023-08-29 02:43:01 +09:00
cffdf102d4 feat(terminal): allow :terminal to take modifiers (#15427)
The following modifiers are all now supported:

    :tab term
    :vertical term
    :horizontal term
    :botright term
    :topleft term

Fixes: https://github.com/neovim/neovim/issues/11385
2023-08-28 07:22:19 -05:00
1ad13e07d2 Merge pull request #24913 from bfredl/lastline
fix(api): handle clearing out last line of non-current buffer
2023-08-28 13:05:18 +02:00
132bbd1cbd fix(api): handle clearing out last line of non-current buffer
fixes #24911
2023-08-28 12:39:02 +02:00
3a876bd41b vim-patch:535b9e12d02f
runtime(typescript): Fix highlighting symbols after number literal (vim/vim#12911)

fixes vim/vim#12831

535b9e12d0

Co-authored-by: Herrington Darkholme <2883231+HerringtonDarkholme@users.noreply.github.com>
2023-08-28 11:03:37 +09:00
656be8a591 vim-patch:9.0.1810: camel-case spelling has issues with digits (#24909)
Problem:  camel-case spelling has issues with digits
Solution: Improve the camCase spell checking by taking digits
          and caps into account

Rewrite the conditions to check for word boundaries by taking into
account the presence of digits and all-caps sequences such as acronyms.

closes: vim/vim#12644
closes: vim/vim#12933

d08745040b

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-08-28 07:16:15 +08:00
6b12eda220 vim-patch:9.0.1798: The 'syntax' option has no completion. (#24908)
Problem:  The 'syntax' option has no completion.
Solution: Add syntax option completion.

closes: vim/vim#12900

6dfdff3f27

N/A patches:
vim-patch:9.0.1795: Indentation issues

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-08-28 07:07:50 +08:00
d7d3d757c1 Merge pull request #24853 from zeertzjq/inline-virt-eol
fix(ui): wrong cursor position with left gravity inline virt text at eol
2023-08-28 06:36:51 +08:00
062db5c136 vim-patch:9.0.1802: Multiline regex with Visual selection fails with virtual text
Problem:  Multiline regex with Visual selection fails when Visual
          selection contains virtual text after last char.
Solution: Only include virtual text after last char when getting full
          line length.

closes: vim/vim#12908

e3daa06be1
2023-08-28 06:10:36 +08:00
c70aa84b2a vim-patch:9.0.1800: Cursor position still wrong with 'showbreak' and virtual text
Problem:  Cursor position still wrong with 'showbreak' and virtual text
          after last character or 'listchars' "eol".
Solution: Remove unnecessary w_wcol adjustment in curs_columns(). Also
          fix first char of virtual text not shown at the start of a screen
          line.

closes: vim/vim#12478
closes: vim/vim#12532
closes: vim/vim#12904

6a3897232a
2023-08-28 06:02:01 +08:00
128091a256 fix(ui): wrong cursor position with left gravity inline virt text at eol 2023-08-28 05:51:01 +08:00
abb8c2c453 fix(editorconfig): do not set 'endofline'
Problem:
  'endofline' can be used to detect if a file ends of <EOL>, however
  editorconfig can break this.

Solution:
  Set 'endofline' during BufWritePre

Fixes: #24869
2023-08-27 19:27:25 +01:00
63802a1dbf docs: update luvref.txt for version info
fixup: #24874
2023-08-27 23:40:09 +09:00
a79694a08e feat(issue_template): instruct not to include a package manager 2023-08-27 13:22:05 +01:00
d3d7d763f3 feat(builtin): improve types 2023-08-27 13:07:04 +01:00
1f49c98036 vim-patch:9.0.1792: problem with gj/gk/gM and virtual text (#24898)
Problem:  Normal mode "gM", "gj", "gk" commands behave incorrectly with
          virtual text.
Solution: Use linetabsize() instead of linetabsize_str().

closes: vim/vim#12909

d809c0a903
2023-08-27 20:04:44 +08:00
4c69279f97 Merge pull request #24889 from bfredl/topline
fix(api): fix issues with nvim_buf_set_lines refactor
2023-08-27 13:56:20 +02:00
840749d6c9 fix(undo): fix crash caused by checking undolevels in wrong buffer
fixes #24894
2023-08-27 12:08:11 +02:00
9b9030ff2c fix(api): fix inconsistent behavior of topline touched in recent refactor
The change in #24824 0081549 was not a regression, however it was an
incomplete change. Unfortunately some common plugins come to depend on
this exising self-inconsistent behavior. These plugins are going to need
to update for 0.10

nvim_buf_set_lines used to NOT adjust the topline correctly if a buffer
was displayed in just one window. However, if displayed in multiple
windows, it was correctly adjusted for any window not deemed the
current window for the buffer (which could be an arbitrary choice if the
buffer was not already current, as noted in the last rafactor)

This fixes so that all windows have their topline adjusted. The added
tests show this behavior, which should be the reasonable one.
2023-08-27 12:07:46 +02:00
b7d5b55f74 fix(types): add some return/parameter type annotations (#24867)
* fix(types): add some return/parameter type annotations

* fix(types): narrow stdpath parameter further
2023-08-27 09:41:32 +01:00
2bf3e82676 fix(treesitter): validate window before updating preview highlights 2023-08-27 09:40:26 +01:00
fec51229c4 feat(l10n): update Ukrainian translations (#24882)
* optwin
* synchronize with Vim
2023-08-27 13:29:12 +08:00
874b8172a6 build(deps): bump tree-sitter-python to v0.20.4 2023-08-27 10:03:24 +09:00
c4728a5c46 build(deps): bump luv to HEAD dcd1a1c 2023-08-27 10:02:43 +09:00
e8dd3fa280 refactor(buf_init_chartab): remove redundant loop (#24891) 2023-08-27 07:15:33 +08:00
a6d0535c15 Merge pull request #24739 from echasnovski/win-footer
feature: add floating window footer text
2023-08-26 19:41:52 +02:00
986bf7e78d feat(highlight): add FloatFooter highlight group
Problem: No clear separation of floating title and footer highlighting.

Solution: Add new `FloatFooter` highlight group.
2023-08-26 19:37:43 +03:00
35570e4a11 feat(float): implement footer
Problem: Now way to show text at the bottom part of floating window
  border (a.k.a. "footer").

Solution: Allows `footer` and `footer_pos` config fields similar to
  `title` and `title_pos`.
2023-08-26 19:37:43 +03:00
617fd5bdc6 refactor(float): extract "title" and "title_pos" handling 2023-08-26 19:37:18 +03:00
afd0c648a8 fix(statuscolumn): force full redraw when signcolumn is invalid (#24859)
Fix #24655
2023-08-26 21:10:04 +08:00
965ed579fe Merge pull request #24399 from lambdalisue/fix-messagepack-rpc
feat(msgpack_rpc): add a new `msgpack-rpc` client type to fix behavior with MessagePack-RPC compliant clients
2023-08-26 13:39:31 +02:00
362df0f793 fix(extmarks): wrong display when changing text with virt_lines (#24879) 2023-08-26 19:39:05 +08:00
1bdcb9aaf1 Merge pull request #24824 from bfredl/nocurbuf
refactor(change): do API changes to buffer without curbuf switch
2023-08-26 12:35:22 +02:00
b641fc3874 docs(megpack_rpc): add news entry for msgpack-rpc client type 2023-08-26 19:15:36 +09:00
b46e93c5fd docs(msgpack_rpc): add "msgpack-rpc" client type 2023-08-26 19:14:07 +09:00
01fe6b9e6a feat(msgpack_rpc): support out-of-order responses on msgpack-rpc
Added to support MessagePack-RPC fully compliant clients that do
not return responses in request order.

Although it is currently not an efficient implementation for full
compliance and full compliance cannot be guaranteed, the addition
of the new client type `msgpack-rpc` creates a situation where "if
the client type is `msgpack-rpc`, then backward compatibility is
ignored and full compliance with MessagePack- RPC compliance is
justified even if backward compatibility is ignored if the client
type is `msgpack-rpc`.
2023-08-26 19:14:06 +09:00
deb6fd6704 feat(msgpack-rpc): show actual request id in error message 2023-08-26 19:14:05 +09:00
0081549547 refactor(change): do API changes to buffer without curbuf switch
Most of the messy things when changing a non-current buffer is
not about the buffer, it is about windows. In particular, it is about
`curwin`.

When editing a non-current buffer which is displayed in some other
window in the current tabpage, one such window will be "borrowed" as the
curwin. But this means if two or more non-current windows displayed the buffers,
one of them will be treated differenty. this is not desirable.

In particular, with nvim_buf_set_text, cursor _column_ position was only
corrected for one single window. Two new tests are added: the test
with just one non-current window passes, but the one with two didn't.

Two corresponding such tests were also added for nvim_buf_set_lines.
This already worked correctly on master, but make sure this is
well-tested for future refactors.

Also, nvim_create_buf no longer invokes autocmds just because you happened
to use `scratch=true`. No option value was changed, therefore OptionSet
must not be fired.
2023-08-26 12:02:05 +02:00
5bb17958c5 build: fix "make iwyu" not working (#24873) 2023-08-26 17:20:40 +08:00
1635c9e75e refactor: move some structs out of buffer_defs.h (#24878) 2023-08-26 11:13:20 +08:00
b1cfb299df docs: various clarifications (#24876) 2023-08-26 08:35:05 +08:00
5d8ab32f38 feat(treesitter): add a query editor (#24703) 2023-08-25 13:17:36 -05:00
ecd99e7dd7 Merge pull request #24872 from zeertzjq/plines
some plines.c refactors
2023-08-25 20:55:13 +08:00
ff67bb3d05 refactor(plines.c): deduplicate code for virtual text cursor offset 2023-08-25 20:20:42 +08:00
93af6d9ed0 refactor: move virtcol functions to plines.c
Problem: Functions for virtcol and chartabsize are similar (both compute
horizontal size), but appear in two different source files.
Solution: Move virtcol functions to plines.c.
2023-08-25 20:17:26 +08:00
f08648182b refactor(plines.c): move vertical size functions to the bottom
Problem: It may be unclear what "below" in first comment refers to.
Solution: Move vertical size functions to the bottom so that it can be
changed to "above".
2023-08-25 20:17:23 +08:00
d4dc52a835 Merge pull request #24821 from seandewar/vim-9f2962141514
vim-patch:9f2962141514,f6fb52b667ee,19968fc4ec2c,a76f3221cdcf,2ae7ffe0bc3c,3d3a9152fa6d - Termdebug stuff
2023-08-25 11:59:51 +01:00
0bd82b540e refactor(termdebug): reindent some things
Mostly to make it more consistent and to match Vim more where applicable.
2023-08-25 11:24:52 +01:00
e3b385bed5 vim-patch:3d3a9152fa6d
runtime(termdebug): more termdebug fixes and improvements (vim/vim#12892)

- Fix and attempt to simplify :Frame/:Up/:Down documentation.

- Accept a count instead for :Up/:Down/+/-.

- Update the "Last Change" dates.

- Fix a missing :let (caused an error if gdb fails to start).

- Wipe the prompt buffer when ending prompt mode (if it exists and wasn't wiped
  by the user first). Avoids issues with stale prompt buffers (such as E95 when
  starting a new prompt mode session).

- Kill the gdb job if the prompt buffer is unloaded (similar to what's done for
  a terminal buffer). Fixes not being able to start a new termdebug session if
  the buffer was wiped by the user, for example.

3d3a9152fa
2023-08-25 11:05:18 +01:00
92ef2b2bcd vim-patch:2ae7ffe0bc3c
runtime(termdebug): add frame related commands (vim/vim#12511)

implementing `:Frame`, `:Up` and `:Down'

2ae7ffe0bc

Use maparg() for saving K as it's since been ported (and supports Lua callbacks
and the other API fields).

Use the 3 argument variant of mapset(), as the single argument one isn't ported
yet (v8.2.4861).

Co-authored-by: Simon Sobisch <simonsobisch@web.de>
2023-08-25 11:05:18 +01:00
8aad4b8425 fix(termdebug): send SIGINT when interrupting prompt mode
Unlike Vim's job_stop(), Nvim's jobstop() does not take a signal argument, and
always sends SIGTERM/KILL.

:Stop and Ctrl-C in prompt mode is supposed to interrupt the program like in
terminal mode, not kill GDB.

Also, maybe libuv's kill() works on Windows? If so, the logic above could be
removed, but I don't have a Windows machine available to test that.

Also "set nomodified" when ending prompt mode, like Vim (avoids E37).
2023-08-25 11:04:41 +01:00
21477bdb27 vim-patch:a76f3221cdcf
runtime(termdebug): Fix various Termdebug issues (vim/vim#12875)

* Fix some Termdebug issues after vim/vim#12403
* Fix :Asm in Termdebug prompt mode
* Fix Termdebug s:DecodeMessage escaping logic

a76f3221cd

Adjust disassembly message forwarding for Nvim, as its callback can receive
many lines at once.

Currently, just forward each disassembly line individually to s:CommOutput();
it's possible to do this in batch instead, but this is simpler.

I suggested moving to a GDB MI-based approach for the disassemble stuff
upstream, which should simplify the logic a lot if implemented (and possibly
allow for getting rid of the `&"disassemble ...` special-casing).

Also, correct "(gdb)" to include a trailing space; the stray GDB prompts were
being ignored by s:CommOutput() anyway, so this had caused no ill effects.
2023-08-25 11:01:09 +01:00
c413b42c45 fix(termdebug): prompt mode breaks with &splitbelow set
Unlike Vim, termopen() doesn't split, so you can't use the modifier like that.
Remove the fragile :wincmd shenanigans.
2023-08-25 10:59:57 +01:00
af78060b18 fix(termdebug): trim suffixed "\r" in CommOutput
Vim splits lines on "\r", then trims any prefixed "\n".

But in Nvim, job output lines are split on "\n" (like readfile() in binary
mode), so trim any suffixed "\r" instead.

This gets rid of the trailing "^M" character in messages parsed from the jobs.
2023-08-25 10:59:56 +01:00
ec97128826 vim-patch:19968fc4ec2c
runtime(termdebug): re-indent lines (vim/vim#12857)

19968fc4ec

Co-authored-by: Shane-XB-Qian <shane.qian@foxmail.com>
2023-08-25 10:59:56 +01:00
464472b4f7 vim-patch:f6fb52b667ee
runtime(termdebug): refactor error printing (vim/vim#12856)

// vs not act like exception from vim or termdebug

f6fb52b667

Co-authored-by: Shane-XB-Qian <shane.qian@foxmail.com>
2023-08-25 10:59:56 +01:00
949dd14d8b vim-patch:9f2962141514
Runtime(termdebug): Add support to view local and argument variables

closes: 12403

9f29621415

Rename the existing "s:running" (#16790) to "s:gdb_running" to not clash with
the "s:running" introduced in this patch (which instead relates to whether the
debugged program is currently running in gdb).

Keep the file `:retab`bed as before.

Co-authored-by: laburnumT <flo.striker@gmail.com>
2023-08-25 10:59:55 +01:00
0b0d912763 Merge pull request #24864 from gpanders/filetype-on-detect-order 2023-08-24 21:39:57 -05:00
5b4f1f56c3 Merge pull request #24862 from bfredl/ml_get_buf
refactor(memline): distinguish mutating uses of ml_get_buf()
2023-08-24 23:12:26 +02:00
cefd774fac refactor(memline): distinguish mutating uses of ml_get_buf()
ml_get_buf() takes a third parameters to indicate whether the
caller wants to mutate the memline data in place. However
the vast majority of the call sites is using this function
just to specify a buffer but without any mutation. This makes
it harder to grep for the places which actually perform mutation.

Solution: Remove the bool param from ml_get_buf(). it now works
like ml_get() except for a non-current buffer. Add a new
ml_get_buf_mut() function for the mutating use-case, which can
be grepped along with the other ml_replace() etc functions which
can modify the memline.
2023-08-24 22:40:56 +02:00
af38b46a25 fix(filetype): return on_detect function when matching by file contents 2023-08-24 13:04:04 -05:00
020d1f626a fix(filetype): call on_detect before setting buffer filetype
The on_detect functions returned by filetype.lua set buffer local
variables which are often used by filetype plugins. For example, the
on_detect function for shell buffers sets variables such as b:is_bash or
b:is_sh, which are used by the sh ftplugin.

When called after setting the buffer's filetype, these variables cannot
be used by the ftplugin (because they are not yet defined). Instead,
call on_detect before setting the buffer filetype so that any buffer
variables set by on_detect can be used in the ftplugin.
2023-08-24 12:48:21 -05:00
daf7abbc42 docs(builtin): small fixes (#24861)
Also make gen_eval_files.lua render vimdoc helpExamples properly if the line
begins with the `>` marker.
2023-08-24 13:29:40 +01:00
53170579ce Merge pull request #24702 from seandewar/vim-1688938dd5ac
vim-patch:1688938dd5ac,96d6c4aabed1,e8d6f03f6a61
2023-08-24 09:27:17 +01:00
cbadb39d16 fix(plines.c): initialize cts_max_head_vcol (#24855) 2023-08-24 11:46:07 +08:00
a9418ef8cf fix(ui): wrong display with 0-width inline virt_text at eol (#24854) 2023-08-24 11:28:10 +08:00
e2c10dea19 vim-patch:2f25e40b1f54
runtime: configure keywordpg for some file types (vim/vim#5566)

2f25e40b1f

Co-authored-by: Enno <Konfekt@users.noreply.github.com>
2023-08-24 11:33:06 +09:00
327e3fab9e vim-patch:3fc7a7e44abd
runtime: Fix typos in various files

closes: vim/vim#12836

3fc7a7e44a

Co-authored-by: Viktor Szépe <viktor@szepe.net>
2023-08-24 11:33:06 +09:00
1c961a9d62 vim-patch:e059fae10044
runtime(menu): define shortcut for File->Open Tab (vim/vim#12895)

Seems missing as noted by Antonio Giovanni Colombo. So add it and use
the 'T' as shortcut, which does not seem to be used in the File dialog.

Verified on Windows.

e059fae100

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Antonio Giovanni Colombo <azc100@gmail.com>
2023-08-24 11:33:06 +09:00
1c709f5a61 vim-patch:6e93689bde73
runtime(bindzone): updated syntax file

- Add support for APL type in runtime/syntax/bindzone.vim
- all values between 0- 4294967295 are valid serials

closes: vim/vim#9743
closes: vim/vim#8382

6e93689bde

vim-patch:544b209a2d4b

runtime(scala): Link Scala highlighting groups using 'hi def link' in syntax script (vim/vim#9594)

They were linked using 'hi link' which made it impossible for color
schemes to override highlight groups.

544b209a2d

Co-authored-by: Oskar Stenman <oskar@cetex.se>
Co-authored-by: Job Noorman <job@noorman.info>
2023-08-24 11:33:06 +09:00
660f9e6857 vim-patch:118f8e9da39e
runtime(cmake) Recognize add_compile_definitions in syntax script (vim/vim#10416)

118f8e9da3

Co-authored-by: MichaWiedenmann <mw-r1@gmx.de>
2023-08-24 11:33:06 +09:00
9ab5fda99e vim-patch:cdd934439d08
runtime(crontab): add support for BSD specifics in syntax script (vim/vim#11196)

* OpenBSD supports the use of `~` as alias for "random valid value"
* FreeBSD supports `@every_{minute,second}`

See:

* https://man.openbsd.org/crontab.5
* https://www.freebsd.org/cgi/man.cgi?query=crontab&sektion=5

cdd934439d

Co-authored-by: Moviuro <moviuro@users.noreply.github.com>
2023-08-24 11:33:06 +09:00
4ca8b90b14 vim-patch:b0d584d97ab6
runtime(go): Update Go syntax file with 1.21 builtins (vim/vim#12876)

* Update Go syntax file with 1.21 builtins

b0d584d97a

Co-authored-by: José-Paul D <fixed.combinator@gmail.com>
2023-08-24 11:33:06 +09:00
0b7e1730bc vim-patch:e34b51e95fd0
runtime(solidity): add new ftplugin (vim/vim#12877)

Set undo_{ftplugin,indent}

closes vim/vim#11240

e34b51e95f

Co-authored-by: dkearns <dougkearns@gmail.com>
Co-authored-by: cothi <jiungdev@gmail.com>
2023-08-24 11:33:06 +09:00
810428c4d5 vim-patch:c6d533b0ad56
runtime(gp): update gp.vim syntax file for the GP language (version 2.15) (vim/vim#12884)

- add missing defaults
- add missing control structures (incl. parallelism)
- add missing scope declarations
- whitespace edits (remove extra tabs)

c6d533b0ad

Co-authored-by: Karim Belabas <Karim.belabas@math.u-bordeaux.fr>
2023-08-24 11:33:06 +09:00
c6ec7fa8d7 feat(treesitter): add 'injection.self' and 'injection.parent'
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-08-24 09:05:44 +09:00
466c18b818 vim-patch:9.0.1785: wrong cursor position with 'showbreak' and lcs-eol (#24852)
Problem:  wrong cursor position with 'showbreak' and lcs-eol
Solution: Add size of 'showbreak' before when 'listchars' "eol" is used.
          Also fix wrong cursor position with wrapping virtual text on
          empty line and 'showbreak'.

closes: vim/vim#12891

1193951beb
2023-08-24 07:19:18 +08:00
23cc36bd99 vim-patch:e8d6f03f6a61
runtime: Remove Brams name from a few more runtime files (vim/vim#12780)

syntax/model.vim: minor wording improvement

e8d6f03f6a

Use the updated "Last Change" date for all.

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Adri Verhoef <a3@a3.xs4all.nl>
2023-08-23 20:36:16 +01:00
947e6d9346 vim-patch:96d6c4aabed1
runtime: Remove Brams email in indent/README.txt

96d6c4aabe

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-23 20:31:08 +01:00
a5565499c8 vim-patch:1688938dd5ac
runtime: Add a few more remarks about Bram and new runtime files

1688938dd5

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-23 20:31:07 +01:00
dc45fb4655 fix(editorconfig): only warn once on errors 2023-08-23 14:45:02 +01:00
32e69bd397 fix(luarc.json): ignore test directory to save memory
Cuts memory usage on startup from 600mb -> 200mb
2023-08-23 14:25:36 +01:00
08fa71fd27 vim-patch:9.0.1773: cannot distinguish Forth and Fortran *.f files (#24841)
Problem:  cannot distinguish Forth and Fortran *.f files
Solution: Add Filetype detection Code

Also add *.4th as a Forth filetype

closes: vim/vim#12251

19a3bc3add

Don't remove filetype files from Vim patches:
- filetype.vim, script.vim, ft.vim usually contain useful changes
- script.vim and ft.vim don't even have their paths spelled correctly

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-08-23 19:32:11 +08:00
2234b84a1b docs(generators): bake into cmake 2023-08-23 12:16:04 +01:00
21152f7905 fix(types): add more annotations to eval.lua 2023-08-23 12:16:04 +01:00
c2341df64a Merge pull request #24847 from zeertzjq/vim-9.0.1710
vim-patch:9.0.{1710,1781}
2023-08-23 19:12:01 +08:00
a1e5cef557 refactor(option.c): move paste_option_changed() into did_set_paste() 2023-08-23 18:24:14 +08:00
3f32cb88c2 vim-patch:9.0.1781: Problems when setting bin/paste option
Problem:  Problems when setting bin/paste option
Solution: When setting binary/paste, remember that this also affects
          depending options, so that :verbose set returns the right
          location.

Mention if depending options for 'binary' or 'paste' have been reset
indirectly. Add a test to verify it works.

Also noticed as small bug, that the global option value for expandtab
was not reset when paste option is set, so fix that while at it.

closes: vim/vim#12837
closes: vim/vim#12879

757593c07a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-23 18:24:14 +08:00
0ba27bb51d vim-patch:9.0.1710: scrolloff options work slightly different
Problem: sidescrolloff and scrolloff options work slightly
         different than other global-local options
Solution: Make it behave consistent for all global-local options

It was noticed, that sidescrolloff and scrolloff options behave
differently in comparison to other global-local window options like
'listchars'

So make those two behave like other global-local options. Also add some
extra documentation for a few special local-window options.

Add a few tests to make sure all global-local window options behave
similar

closes: vim/vim#12956
closes: vim/vim#12643

4a8eb6e7a9

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-23 18:24:14 +08:00
99265d099c Merge pull request #24844 from zeertzjq/vim-9.0.1783
vim-patch:9.0.1783: Display issues with virt text smoothscroll and showbreak
2023-08-23 13:44:53 +08:00
908f247c22 fix(plines): count 'showbreak' for virtual text at eol 2023-08-23 13:17:17 +08:00
a1d71ad55e vim-patch:9.0.1783: Display issues with virt text smoothscroll and showbreak
Problem:  Wrong display with wrapping virtual text or unprintable chars,
          'showbreak' and 'smoothscroll'.
Solution: Don't skip cells taken by 'showbreak' in screen lines before
          "w_skipcol". Combined "n_skip" and "skip_cells".

closes: vim/vim#12597

b557f48982
2023-08-23 13:17:17 +08:00
3e80b39a8e build(deps): bump luajit to HEAD - 03c31124c
Switch to a rolling release, so the `0-beta3` suffix is dropped in favor
of the date. Remove the custom UNIX command as the symlink is now
created by the LuaJIT Makefile.
2023-08-23 11:23:11 +09:00
6462ee1c10 vim-patch:9.0.1779: Need more state() tests (#24840)
Problem:  Need more state() tests
Solution: Add a few more tests for operater pending mode and register
          yank command

closes: vim/vim#12883

8dabccd295
2023-08-23 06:42:10 +08:00
20f76ebf2b test: fix state() test flakiness (#24839) 2023-08-23 00:00:57 +08:00
b84a67f50e vim-patch:9.0.0579: using freed memory when 'tagfunc' wipes out buffer (#24838)
Problem:    Using freed memory when 'tagfunc' wipes out buffer that holds
            'complete'.
Solution:   Make a copy of the option.  Make sure cursor position is valid.

0ff01835a4

Cherry-pick a cmdwin change from patch 9.0.0500.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-22 22:48:55 +08:00
e34eb4ccf9 test(old): reorder test_edit.vim to match upstream (#24837) 2023-08-22 20:57:10 +08:00
63094e0013 vim-patch:8.0.0571: negative line number when using :z^ in an empty buffer (#24836)
Problem:    The cursor line number becomes negative when using :z^ in an empty
            buffer. (neovim vim/vim#6557)
Solution:   Correct the line number.  Also reset the column.

a364cdb648

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-22 20:56:14 +08:00
3f1a12b8cc test(old): remove workaround for TSAN CI (#24834)
Now that TSAN CI no longer runs oldtests, match upstream better.
2023-08-22 20:03:03 +08:00
94f2da09e1 vim-patch:8.2.4611: typos in tests; one lua line not covered by test (#24835)
Problem:    Typos in tests; one lua line not covered by test.
Solution:   Fix typos. Add test case. (Dominique Pellé, closes vim/vim#9994)

81b573d7e5

Cherry-pick test_menu.vim change from patch 9.0.1453.

N/A patch:
vim-patch:8.2.3045: minor typos

Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
2023-08-22 20:02:50 +08:00
014b87646f Merge pull request #24833 from zeertzjq/vim-9.0.0391
vim-patch:9.0.{0380,0391,0415,0425,0428,0837}
2023-08-22 19:10:14 +08:00
09910d5b35 vim-patch:9.0.0837: append() reports failure when not appending anything
Problem:    append() reports failure when not appending anything.
Solution:   Only report failure when appending something. (closes vim/vim#11498)

cd9c8d400c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-22 18:56:43 +08:00
48722ec400 vim-patch:9.0.0428: autocmd test uses common file name
Problem:    Autocmd test uses common file name.
Solution:   Use unique name to reduce flakiness.

be9fc5b60c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-22 18:56:43 +08:00
1da705c433 vim-patch:9.0.0425: autocmd test is a bit flaky on MS-Windows
Problem:    Autocmd test is a bit flaky on MS-Windows.
Solution:   Add a bit more sleeping. (Ken Takata, closes vim/vim#11095)

ae04a6049b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-22 18:56:43 +08:00
10990eace2 vim-patch:9.0.0415: on MS-Windows some tests are flaky
Problem:    On MS-Windows some tests are flaky.
Solution:   Add sleeps, disable swapfile, mark test as flaky. (Ken Takata,
            closes vim/vim#11082)

0500e87eba

Co-authored-by: K.Takata <kentkt@csc.jp>
2023-08-22 18:56:43 +08:00
c170708023 vim-patch:9.0.0391: using separate delete() call instead of writefile() 'D' flag
Problem:    Using separate delete() call instead of writefile() 'D' flag.
Solution:   Use the writefile 'D' flag.

3411265a36

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-22 18:56:43 +08:00
50b069a8b9 vim-patch:9.0.0380: deleting files in tests is a hassle
Problem:    Deleting files in tests is a hassle.
Solution:   Use the new 'D' flag of writefile().

e1f3ab73bc

vim-patch:e1f3ab73bc7c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-22 18:56:43 +08:00
898ef1835d version.c: update [skip ci] (#24830)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2023-08-22 11:15:26 +08:00
0fd8eb8aae fix(terminal): set $COLORTERM unconditionally in :terminal (#24763)
$COLORTERM is set in the terminal emulator based on the value of
'termguicolors' ("truecolor" if &tgc is set, 256 otherwise), but ONLY if
$COLORTERM is also set in the parent terminal emulator.

This is an unnecessary restriction that can cause issues in some cases.
For instance, $COLORTERM is stripped by default by OpenSSH, so is not
present in an SSH session. The terminal emulator still supports 24 bit
color, so the lack of $COLORTERM is not a reliable indicator. When an
application runs in Nvim's :terminal it thus has no way to know whether
or not true color is supported.

Instead, setting it unconditionally based on 'termguicolors' uses the
user's own preferences to infer if 24-bit color is supported, rather
than depending on the (unreliable) presence of $COLORTERM. If
'termguicolors' is set in a terminal that does not support true color
then the colors in Nvim will already look bad. Enabling them for
applications in the terminal emulator will not make it any worse.

If 'termguicolors' is not set then the value of $COLORTERM from the
parent terminal (if any) is forwarded to Nvim's :terminal.

Fixes: https://github.com/neovim/neovim/issues/24717
2023-08-21 13:55:51 -05:00
d401b33314 fix(terminal): handle horizontal scrolling in another window (#24828) 2023-08-21 23:19:12 +08:00
d0717a7c4e vim-patch:9.0.0423: "for" and "while" not recognized after :vim9cmd and :legacy (#24825)
Problem:    "for" and "while" not recognized after :vim9cmd and :legacy.
            (Emanuele Torre)
Solution:   Recognize all the command modifiers. (closes vim/vim#11087)
            Add a test to check the list of modifiers.

9132426334

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 09:06:21 -05:00
319edce5d0 Merge pull request #24826 from zeertzjq/vim-9.0.0886
vim-patch:9.0.{0886,0902,.0906}: mouse scrolling refactors
2023-08-21 22:06:03 +08:00
042678a7b4 vim-patch:9.0.0906: mouse scroll code is not optimal
Problem:    Mouse scroll code is not optimal.
Solution:   Properly organise Normal mode, Insert mode and common code.
            (Christopher Plewright, closes vim/vim#11572)

ff95ce0930

Co-authored-by: Christopher Plewright <chris@createng.com>
2023-08-21 21:40:42 +08:00
1f9878a2e2 vim-patch:9.0.0902: some mouse scroll code is not in a good place
Problem:    Some mouse scroll code is not in a good place.
Solution:   Refactor the code. (Christopher Plewright, closes vim/vim#11561)

696d0a8625

Co-authored-by: Christopher Plewright <chris@createng.com>
2023-08-21 21:40:42 +08:00
bd3c1c7579 vim-patch:9.0.0886: horizontal mouse scroll only works in the GUI
Problem:    Horizontal mouse scroll only works in the GUI.
Solution:   Make horizontal mouse scroll also work in a terminal.
            (Christopher Plewright, closes vim/vim#11448)

44c2209352

Co-authored-by: Christopher Plewright <chris@createng.com>
2023-08-21 21:40:42 +08:00
b75659c8fb vim-patch:690963924956
runtime(dosini): save and restore cpo value in syntax script

Commit dd0ad2598898c2b4641c4acd5b70b6184fa698ed  introduced
line-continuation. However, to make sure this does not cause an error
when Vim is run in compatible mode, we need to set compatibility mode
temporarily and reset it back when finished reading the file.

This fixes: https://groups.google.com/g/vim_use/c/9zccgo_RIqM/m/xlUmhBktBgAJ

6909639249

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-21 22:34:48 +09:00
54ddf56589 vim-patch:6d626c41842e
runtime(sdc): Add underscore to sdc flags in syntax file (vim/vim#6201)

6d626c4184

Co-authored-by: Jordi Altayó <jordialtayo@gmail.com>
2023-08-21 20:32:28 +09:00
e2d3c1260e vim-patch:a0fddaa2f4b7
Runtime(javascript): add new document properties to completion file

closes: vim/vim#6536

a0fddaa2f4

Co-authored-by: Jay Sitter <jay@diameterstudios.com>
2023-08-21 20:32:28 +09:00
36404fea4a vim-patch:5e6e4042b1c9
runtime(haskell): Add single quote to `iskeyword` in ftplugin (vim/vim#8191)

The single quote `'` is a valid character in variable names, so it should be included in `iskeyword`; this, for instance, makes the <kbd>*</kbd> command behave predictably

5e6e4042b1

Co-authored-by: Enrico Maria De Angelis <enricomaria.dean6elis@gmail.com>
2023-08-21 20:32:28 +09:00
5b78a5c72a vim-patch:309ded19543c
runtime(css): Update pseudo-classes in syntax script (vim/vim#11595)

309ded1954

Co-authored-by: Adrian Heine né Lang <mail@adrianheine.de>
2023-08-21 20:32:28 +09:00
c9764bf331 vim-patch:9fa35b1c38b8
runtime(lua): fix lua indentation of non-lowercase "keywords" (vim/vim#11759)

9fa35b1c38

Co-authored-by: beardedsakimonkey <54521218+beardedsakimonkey@users.noreply.github.com>
2023-08-21 20:32:28 +09:00
60037feb56 vim-patch:e71e9d9ad368
runtime(javascript): fix default link of javaScriptNumber in syntax file (vim/vim#11788)

cool unused matching

e71e9d9ad3

Co-authored-by: Meqa <106783764+Meqativ@users.noreply.github.com>
2023-08-21 20:32:28 +09:00
3f877657dd vim-patch:6633611f4280
runtime(lua): indent curly bracket followed by line comment (vim/vim#12306)

fixes vim/vim#12305

6633611f42

Co-authored-by: champignoom <66909116+champignoom@users.noreply.github.com>
2023-08-21 20:32:28 +09:00
abc3721e4f vim-patch:478668013f06
runtime(rust): fix rust indent (vim/vim#12542)

478668013f

Co-authored-by: Raphael <glephunter@gmail.com>
2023-08-21 20:32:28 +09:00
4a36ecd238 vim-patch:72904d5fda0a
Runtime: Add nixInherit matcher in nix.vim syntax

Perform the lookahead in `nixInheritAttributeScope`, then hand over to a
new region called `nixInheritAttributeSubExpr`, which sets the match
start to one char after the opening bracket to avoid a double-match.

Finally, only do a lookahead to `)` in `nixInheritAttributeSubExpr` (and
thus make sure the region is closed to not get a match of `nixParen`
here) and let `nixInheritAttributeScope` close the bracket.

72904d5fda

Co-authored-by: James Fleming <james@electronic-quill.net>
2023-08-21 20:32:28 +09:00
4a1fb37108 Merge pull request #24820 from zeertzjq/vim-589edb340454
vim-patch:589edb340454,e46a44050562
2023-08-21 17:37:15 +08:00
6bdfb890fd vim-patch:e46a44050562
Runtime file updates

e46a440505

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 17:24:54 +08:00
0f48173ab5 vim-patch:589edb340454
Updte runtime files

589edb3404

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 17:16:10 +08:00
8cd0ca1ce7 Merge pull request #24819 from zeertzjq/vim-8.2.4208
vim-patch:8.2.{4208,4210,4211,4212},9.0.{0077,0313}
2023-08-21 16:54:11 +08:00
28c2e83fb4 vim-patch:9.0.0313: 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.

e7cda97b6b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 16:31:31 +08:00
00ad0c81b6 vim-patch:9.0.0077: wrong restored cursor position when switching window in autocmd
Problem:    When switching window in autocmd the restored cursor position may
            be wrong.
Solution:   Do not restore the cursor if it was not set. (closes vim/vim#10775)

b03950fafa

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 16:25:48 +08:00
bd9a9e63bc vim-patch:8.2.4212: window title test still fails in some configurations
Problem:    Window title test still fails in some configurations.
Solution:   Explicitly set the 'title' option.

1450112eef

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 16:17:01 +08:00
67edc0a772 vim-patch:8.2.4211: window title test still fails in some configurations
Problem:    Window title test still fails in some configurations.
Solution:   Use WaitForAssert().

3a8ad5918b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 16:16:53 +08:00
7fab06cb0c vim-patch:8.2.4210: window title test fails in some configurations
Problem:    Window title test fails in some configurations.
Solution:   Only run the test if the title can be obtained.

a6c09a7c20

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 16:16:43 +08:00
893437512c vim-patch:8.2.4208: using setbufvar() may change the window title
Problem:    Using setbufvar() may change the window title.
Solution:   Do not redraw when creating the autocommand window. (closes vim/vim#9613)

dff97e65eb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 16:16:22 +08:00
dc01d68f27 Merge pull request #24818 from zeertzjq/vim-8.2.0186
vim-patch:8.1.2403,8.2.{0186,0195,0310,0454,0533,2908,2910,3518,4339}
2023-08-21 16:08:48 +08:00
02ca31979b vim-patch:8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Problem:    CTRL-A does not work properly with the cmdline popup menu.
Solution:   Fix issues with CTRL-A.  Add more tests for the cmdline popup
            menu.  Remove TermWait() before VeriryScreenDump().  Refactor the
            cmdline popup code. (Yegappan Lakshmanan, closes vim/vim#9735)

560dff49c0

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-21 15:43:39 +08:00
00f92f086e vim-patch:8.2.3518: Test_xrestore sometimes fails
Problem:    Test_xrestore sometimes fails.
Solution:   Mark the test as flayky.  Move marking test as flaky to the test
            instead of listing them in runtest.

f08b0eb869

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:35:08 +08:00
7aa3f825cd vim-patch:8.2.2910: test for cmdline window and terminal fails on MS-Windows
Problem:    Test for cmdline window and terminal fails on MS-Windows.
Solution:   Skip the test on MS-Windows.

0b49648486

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:31:21 +08:00
d4b6a25e67 vim-patch:8.2.2908: crash when using a terminal popup window from cmdline window
Problem:    Crash when using a terminal popup window from the cmdline window.
Solution:   Instead of checking cmdwin_type call cmdwin_is_active().
            (closes vim/vim#8286)

e5b4486c42

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:31:21 +08:00
ff801ce7f7 vim-patch:8.2.0533: tests using term_wait() can still be flaky
Problem:    Tests using term_wait() can still be flaky.
Solution:   Increase the wait time when rerunning a test. (James McCoy,
            closes vim/vim#5899)  Halve the initial times to make tests run faster
            when there is no rerun.

6a2c5a7dd5

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:31:21 +08:00
ff37916b47 vim-patch:8.2.0454: some tests fail when the system is slow
Problem:    Some tests fail when the system is slow.
Solution:   Make the run number global, use in the test to increase the
            waiting time. (closes vim/vim#5841)

3ed9efc2b1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:31:21 +08:00
045cc185d5 vim-patch:8.2.0310: autocmd test fails on a slow system
Problem:    Autocmd test fails on a slow system.
Solution:   Adjust the expectations. (James McCoy, closes vim/vim#5685)

8fb1b47a5e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:31:21 +08:00
702a5f0cbb vim-patch:8.2.0195: some tests fail when run in the GUI
Problem:    Some tests fail when run in the GUI.
Solution:   Make sure the window width is enough.  In the GUI run terminal Vim
            in the terminal, if possible.

3180fe6c6d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:31:21 +08:00
e8df2a012b vim-patch:8.2.0186: a couple of tests may fail when features are missing
Problem:    A couple of tests may fail when features are missing.
Solution:   Check for features. (Dominique Pelle, closes vim/vim#5561)

705724e430

Just copy the two 'wincolor' test functions from Vim.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:31:21 +08:00
6f5ff5818a vim-patch:8.1.2403: autocmd test fails under valgrind
Problem:    Autocmd test fails under valgrind.
Solution:   Wait a bit longer.

3c47e8384d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:31:21 +08:00
cc35352f65 vim-patch:8.1.2062: the mouse code is spread out (#24817)
Problem:    The mouse code is spread out.
Solution:   Move all the mouse code to mouse.c. (Yegappan Lakshmanan,
            closes vim/vim#4959)

b20b9e14dd

Also move getmousepos() there.

N/A patches for version.c:

vim-patch:8.1.2070: mouse code is spread out

Problem:    Mouse code is spread out.
Solution:   Move mouse terminal code parsing to mouse.c. (Yegappan Lakshmanan,
            closes vim/vim#4966)

b8ff5c271e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:23:32 +08:00
3b0515e674 Merge pull request #24816 from zeertzjq/vim-8.1.2044
vim-patch:8.1.{2044,2046,2047,2048,2053,2066,2067,2068,2069,2099},8.2.4299: SafeState, state()
2023-08-21 14:40:43 +08:00
6aa29d0f01 test: add some tests for SafeState autocommand 2023-08-21 14:16:16 +08:00
4b0a13b455 vim-patch:8.2.4299: SafeState autocommand interferes with debugging
Problem:    SafeState autocommand interferes with debugging.
Solution:   Do not trigger SafeState while debugging. (closes vim/vim#9697)

46f3080e5c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 14:16:16 +08:00
71acb71043 vim-patch:8.1.2099: state() test fails on some Mac systems
Problem:    state() test fails on some Mac systems.
Solution:   Increase the wait time. (closes vim/vim#4983)

b7a97ef340

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 14:16:16 +08:00
e05031097c vim-patch:8.1.2069: test for SafeStateAgain may still fail
Problem:    Test for SafeStateAgain may still fail.
Solution:   Send another message to trigger SafeStateAgain.

0f6629a08a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 14:16:16 +08:00
0defbd38e4 vim-patch:8.1.2068: test for SafeState and SafeStateAgain may fail
Problem:    Test for SafeState and SafeStateAgain may fail.
Solution:   Accept more possible responses

513537bfff

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 14:16:16 +08:00
3e79afec54 vim-patch:8.1.2067: no tests for SafeState and SafeStateAgain
Problem:    No tests for SafeState and SafeStateAgain.
Solution:   Add tests.

cadbe1b1fb

This test is quite useless. Don't port to Lua.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 14:16:16 +08:00
6bf5b2428b vim-patch:8.1.2066: no tests for state()
Problem:    No tests for state().
Solution:   Add tests.  Clean up some feature checks.  Make "a" flag work.

c258549032

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 14:16:16 +08:00
7ce2acd59b vim-patch:8.1.2053: SafeStateAgain not triggered if callback uses feedkeys()
Problem:    SafeStateAgain not triggered if callback uses feedkeys().
Solution:   Check for safe state in the input loop.  Make log messages easier
            to find. Add 'S' flag to state().

d103ee7843

Include misc1.c change from patch 8.1.2062.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 14:16:16 +08:00
a0b912c6ec vim-patch:8.1.2048: not clear why SafeState and SafeStateAgain are not triggered
Problem:    Not clear why SafeState and SafeStateAgain are not triggered.
Solution:   Add log statements.

37d1807a80

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 14:16:16 +08:00
64ccfdaafe vim-patch:8.1.2047: cannot check the current state
Problem:    Cannot check the current state.
Solution:   Add the state() function.

0e57dd859e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 14:16:16 +08:00
4956f26744 vim-patch:8.1.2046: SafeState may be triggered at the wrong moment
Problem:    SafeState may be triggered at the wrong moment.
Solution:   Move it up higher to after where messages are processed.  Add a
            SafeStateAgain event to tigger there.

69198cb8c0

SafeStateAgain is N/A.
Move SafeState functions to state.c.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 14:16:16 +08:00
ab45d5bf6d vim-patch:8.1.2044: no easy way to process postponed work
Problem:    No easy way to process postponed work. (Paul Jolly)
Solution:   Add the SafeState autocommand event.

8aeec40207

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 14:16:15 +08:00
91d8f2ac53 vim-patch:9.0.1767: '.-' no allowed in highlight group names (#24814)
Problem:  '.-' no allowed in highlight group names
Solution: Allow dot and hyphen characters in highlight group names

Allow dots and hyphens in group names. There does not seem
to be any reason for these to be disallowed.

closes: vim/vim#12807

d4376dc3eb

Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
2023-08-21 10:25:41 +08:00
eaad2f7806 vim-patch:9.0.1768: Runtime: no support for bicep files
Problem:  Runtime: no support for bicep files
Solution: Add filetype support for bicepparam

closes: vim/vim#12784

2d0988ef93

Co-authored-by: Scott McKendry <scott.c.mckendry@gmail.com>
2023-08-21 10:13:44 +09:00
a5b6468e9b vim-patch:9.0.1766: Runtime: Missing QML support
Problem:  Runtime: Missing QML support
Solution: Add QML support to Vim

closes: vim/vim#12810

bedc69f9d6

Co-authored-by: ChaseKnowlden <haroldknowlden@gmail.com>
2023-08-21 10:13:44 +09:00
a2a226170d vim-patch:9.0.1772: Cursor may be adjusted in 'splitkeep'ed windows (#24811)
Problem:    Cursor is adjusted in window that did not change in size by
            'splitkeep'.
Solution:   Only check that cursor position is valid in a window that
            has changed in size.

closes: vim/vim#12509

16af913eee

Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
2023-08-21 08:58:18 +08:00
694814cdd5 vim-patch:9.0.1774: no support for custom cmdline completion (#24808)
Problem:  no support for custom cmdline completion
Solution: Add new vimscript functions

Add the following two functions:
- getcmdcompltype() returns custom and customlist functions

- getcompletion() supports both custom and customlist

closes: vim/vim#12228

92997dda78

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2023-08-21 07:29:49 +08:00
ac99e63d73 vim-patch:9.0.1763: crash when passing invalid buffer to undotree() (#24807)
Problem:  crash when passing invalid buffer to undotree()
Solution: Use get_buf_arg() instead of tv_get_buf_from_arg().

closes: vim/vim#12862
closes: vim/vim#12830

ab9f2ecfd4
2023-08-21 07:20:26 +08:00
d21e6285e9 vim-patch:9.0.1759: Visual highlight not working with cursor at end of screen line (#24806)
Problem:  Visual highlight not working with cursor at end of screen line
          and 'showbreak'.
Solution: Only update "vcol_prev" when drawing buffer text.

closes: vim/vim#12865

8fc6a1dae0
2023-08-21 07:18:39 +08:00
10459e1ed0 Merge pull request #24805 from zeertzjq/vim-9.0.1753
vim-patch:9.0.{1753,1761}: g<End>
2023-08-21 06:41:44 +08:00
0c91cb4f03 vim-patch:9.0.1761: g<kEnd> behaves different from g<end>
Problem:  g<kEnd> behaves different from g<end>
Solution: Make g<kEnd> behave like g<End>

closes: vim/vim#12861

654bdbbd32
2023-08-21 06:12:03 +08:00
7485fd0518 vim-patch:9.0.1753: can't move to last non-blank char
Problem: can't move to last non-blank char
Solution: Make g<end> behave like that

Make it possible to move to last non-blank char on a line

We can distinguish between g0 and g^ to move to the very first character
and the first non-blank char.

And while we can move to the last screen char, we cannot go to the last
non-blank screen char.

Since I think g$ is the more widely used and known movement command (and
g<end> is synonymous to it) change the behaviour of g<end> to move to
last non-screen char instead and don't have this be the same command as
the g$ command anymore.

If you want to keep the old behaviour, you can use:

```
nnoremap g<end> g$
```

Add a test to verify the behaviour.

closes: vim/vim#12593

b5f6fe9ca2

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-21 06:11:16 +08:00
18062f70d8 vim-patch:56bafd7a6a79
Runtime: add new sed ftplugin (vim/vim#12843)

56bafd7a6a

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-08-20 17:31:27 +09:00
b263c73b08 vim-patch:9.0.1747: screenpos() may cause unnecessary redraw (#24792)
Problem:  screenpos() may cause unnecessary redraw.
Solution: Don't unnecessarily reset VALID_WROW flag.

VALID_WROW flag is only used by two functions: validate_cursor() and
cursor_valid(), and cursor_valid() is only used once in ex_sleep().
When adjust_plines_for_skipcol() was first added in patch 9.0.0640, it
was called in two functions: comp_botline() and curs_rows().
- comp_botline() is called in two places:
  - onepage(), which resets VALID_WROW flag immediately afterwards.
  - validate_botline_win(), where resetting a VALID_ flag is strange.
- curs_rows() is called in two places:
  - curs_columns(), which sets VALID_WROW flag afterwards.
  - validate_cline_row(), which is only used by GUI mouse focus.

Therefore resetting VALID_WROW there doesn't seem to do anything useful.
Also, a w_skipcol check (which resets VALID_WROW flag) was added to
check_cursor_moved() in patch 9.0.0734, which seems to make more sense
than resetting that flag in the middle of a computation.

While at it make adjust_plines_for_skipcol() and textpos2screenpos() a
bit less confusing:
- Make adjust_plines_for_skipcol() return "off" instead of "n - off".
- Use 0-based "row" in textpos2screenpos() until W_WINROW is added.

closes: vim/vim#12832

6235a109c4
2023-08-19 20:54:55 +08:00
421713523e vim-patch:9.0.1745: Missing test coverage for blockwise Visual highlight (#24790)
Problem:  Missing test coverage for blockwise Visual highlight with
          virtual that starts with a double-width char.
Solution: Add a new virtual text to the test. Some other small fixes.

closes: vim/vim#12835

fc3058495d
2023-08-19 20:34:58 +08:00
c8e58bf09c vim-patch:9.0.1742: wrong curswant when clicking on second cell of double-width char (#24789)
Problem:  Wrong curswant when clicking and the second cell of a
          double-width char.
Solution: Don't copy virtcol of the first char to the second one.

closes: vim/vim#12842

9994160bfe
2023-08-19 19:40:26 +08:00
d9b0946609 Merge pull request #24787 from zeertzjq/vim-9.0.1515
vim-patch:9.0.{1515,1540,1738}
2023-08-19 18:33:44 +08:00
fcd729f22c vim-patch:9.0.1540: reverse() on string doesn't work in compiled function
Problem:    reverse() on string doesn't work in compiled function.
Solution:   Accept string in argument type check. (Yegappan Lakshmanan,
            closes vim/vim#12377)

f9dc278946

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-19 18:05:46 +08:00
4c7df98e4e vim-patch:9.0.1515: reverse() does not work for a String
Problem:    reverse() does not work for a String.
Solution:   Implement reverse() for a String. (Yegappan Lakshmanan,
            closes vim/vim#12179)

03ff1c2dde

vim-patch:9.0.1738: Duplicate code to reverse a string

Problem:  Duplicate code to reverse a string
Solution: Move reverse_text() to strings.c and remove string_reverse().

closes: vim/vim#12847

4dd266cb66

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-19 18:05:46 +08:00
d7ae9ae3e5 build(deps): bump tree-sitter to HEAD - ab09ae20d 2023-08-19 03:16:14 +02:00
7a3fef9e34 refactor(tui): check for out of bound access after snprintf (#24751)
Counterintuitively, snprintf returns the number of characters it _should
have written_ if it had not encoutered the length bound, thus leading to
a potential buffer overflow.

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-19 08:19:36 +08:00
5a6c7c805b fix(extmarks): make empty "conceal" respect &conceallevel = 1 (#24785)
This treats extmark conceal more like matchadd() conceal.
2023-08-19 03:55:11 +08:00
f0e6e2ae46 refactor(grid.c): remove duplicate assignments
They were removed from Vim in patch 9.0.0638.
2023-08-18 21:00:58 +08:00
b9e75e5751 Merge pull request #24780 from zeertzjq/vim-9.0.0048
vim-patch:9.0.{0048,0177,1705,1725}: mouse click after concealed text
2023-08-18 20:02:40 +08:00
1d3d50e8f0 test(ui/mouse_spec): mouse click with matchadd() concealed text 2023-08-18 19:34:25 +08:00
551998b7ee vim-patch:9.0.1725: cursor pos wrong after concealed text with 'virtualedit'
Problem:    Wrong cursor position when clicking after concealed text
            with 'virtualedit'.
Solution:   Store virtual columns in ScreenCols[] instead of text
            columns, and always use coladvance() when clicking.

This also fixes incorrect curswant when clicking on a TAB, so now
Test_normal_click_on_ctrl_char() asserts the same results as the ones
before patch 9.0.0048.

closes: vim/vim#12808

e500ae8e29

Remove the mouse_adjust_click() function.

There is a difference in behavior with the old mouse_adjust_click()
approach: when clicking on the character immediately after concealed
text that is completely hidden, cursor is put on the clicked character
rather than at the start of the concealed text. The new behavior is
better, but it causes unnecessary scrolling in a functional test (which
is an existing issue unrelated to these patches), so adjust the test.

Now fully merged:
vim-patch:9.0.0177: cursor position wrong with 'virtualedit' and mouse click
2023-08-18 19:34:16 +08:00
b0dda500e9 vim-patch:9.0.1705: cursor position wrong when clicking on an unprintable char
Problem:  cursor position wrong when clicking on an unprintable char
Solution: Don't update prev_ptr when wlv.n_extra is not zero.

closes: vim/vim#12664

b25dbb3f9b

Tests only. Code superseded by patch 9.0.1725.
2023-08-18 19:34:16 +08:00
5ff725fa94 vim-patch:9.0.0048: cursor in wrong column with mouse click after concealed text
Problem:    Cursor in wrong column with mouse click after concealed text.
Solution:   Store the text column when drawing text.

b90818867c

Tests only. Code changes moved to the port of patch 9.0.1725.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-18 19:34:07 +08:00
81d5550d77 vim-patch:9.0.1731: blockwise Visual highlight not working with virtual text (#24779)
Problem: blockwise Visual highlight not working with virtual text
Solution: Reset the correct variable at the end of virtual selection and
          Check for double-width char inside virtual text.

closes: vim/vim#12606

6e940d9a1d

Need to remove area_active and use wlv.fromcol and wlv.tocol directly.
2023-08-18 14:00:12 +08:00
8d7a2a1aea vim-patch:442d1746f4c6
bindzone runtime: add new DNS record types (vim/vim#7351)

Recognize some newer DNS record types - CAA (RFC8659, certificate authority authorization), OPENPGPKEY (RFC7929), SMIMEA (RFC8162). Sort SSHFP alphabetically while there.

442d1746f4

Co-authored-by: Stuart Henderson <sthen@users.noreply.github.com>
2023-08-18 07:48:42 +02:00
f65be8c5f5 vim-patch:817db406bb12
Add TODO, FIXME to Haskell syntax file (vim/vim#8055)

Adding TODO, XXX, FIXME to Haskell syntax file vim/vim#8054

817db406bb

Co-authored-by: Bruno-366 <81762173+Bruno-366@users.noreply.github.com>
2023-08-18 07:48:42 +02:00
f0b3defecb vim-patch:a5988f582e48
Keywords 'of' and 'yield' for Javascript. (vim/vim#7873)

* Keyword 'of' in for...of statement.

* Keyword 'yield' for generator function.

a5988f582e

Co-authored-by: Yuri Klimov <yuri@klimov.net>
2023-08-18 07:48:42 +02:00
71ad771ea4 fix(ui_compositor): only reset skipstart at first column (#24776)
Problem:    A double-width char in a floating window causes an extra
            space to be drawn to the left of its boundary.
Solution:   Only reset skipstart at the first column.

Fix #24775
2023-08-18 12:08:18 +08:00
c54682f75a vim-patch:9.0.1729: screenpos() wrong when w_skipcol and cpoptions+=n (#24773)
Problem:    screenpos() wrong result with w_skipcol and cpoptions+=n
Solution:   Use adjust_plines_for_skipcol() instead of subtracting
            w_skipcol.

closes: vim/vim#12625

bfe377b8f2
2023-08-18 09:01:50 +08:00
f8afa8023e vim-patch:9.0.1728: missing winid argument for virtcol() (#24770)
Problem: missing winid argument for virtcol()
Solution: Add a {winid} argument to virtcol()

Other functions col(), charcol() and virtcol2col() support a {winid}
argument, so it makes sense for virtcol() to also support than.

Also add test for virtcol2col() with 'showbreak' and {winid}.

closes: vim/vim#12633

825cf813fa
2023-08-18 08:42:45 +08:00
46163ddf5d vim-patch:9.0.1730: passing multiple patterns to runtime not working (#24771)
Problem: passing multiple patterns to runtime not working
Solution: prepend prefix to each argument separately

closes: vim/vim#12617

008c91537b
2023-08-18 08:24:49 +08:00
1d6c4ad073 vim-patch:9.0.1735: Rename completion specific findex var (#24769)
Problem: Rename completion specific findex var
Solution: Move "findex" static variable to xp_selected in expand_T

closes: vim/vim#12548

e9ef347c13
2023-08-18 07:23:43 +08:00
19d7fb8efe vim-patch:9.0.1734: :runtime completion fails for multiple args (#24767)
Problem: :runtime completion fails for multiple args
Solution: Make it work

closes: vim/vim#12616

be5cdd1d63
2023-08-18 06:20:06 +08:00
9f7e7455c0 vim-patch:9.0.1726: incorrect heights in win_size_restore() (#24765)
Problem: incorrect heights in win_size_restore()
Solution: avoid restoring incorrect heights in win_size_restore()

876f5fb570

I already merged this prior, so just replace the new test with the old one,
but add a test case for the global statusline.
2023-08-17 23:16:19 +01:00
7dcbe74234 Merge pull request #24766 from zeertzjq/vim-9.0.1722
vim-patch:9.0.{1722,1723}
2023-08-18 06:13:37 +08:00
bb29ef4008 vim-patch:9.0.1723: Fix regression in {func} argument of reduce()
Problem: Fix regression in {func} argument of reduce()
Solution: pass function name as string again

Before patch 9.0.0548, passing a string as {func} argument of reduce()
is treated as a function name, but after patch 9.0.0548 it is treated as
an expression instead, which is useless as reduce() doesn't set any v:
variables. This PR restores the behavior of {func} before that patch.

Also correct an emsg() call, as e_string_list_or_blob_required doesn't
contain format specifiers.

closes: vim/vim#12824

ad0c442f1f
2023-08-18 05:29:05 +08:00
ffb87f4dd9 vim-patch:9.0.1722: wrong error messages when passing wrong types to count()
Problem: wrong error messages when passing wrong types to count()
Solution: fix it

This fixes two problems:
1. When passing wrong type to {ic} argument of count(), two error
   messages are given, the second of which is misleading.
2. When passing wrong type to {comp} argument of count(), the error
   message doesn't mention that {comp} may be a String.

closes: vim/vim#12825

4f389e7c0f
2023-08-18 05:28:42 +08:00
88887a7be7 docs(builtin): fix some missing lines (#24759)
Some things got chopped off in the PR that removed method syntax examples.
These were all that I found.
2023-08-17 16:38:56 +01:00
de6b58f659 vim-patch:8.2.3867: implementation of some list functions too complicated (#24757)
Problem:    Implementation of some list functions too complicated.
Solution:   Refactor do_sort_uniq(), f_count() and extend() (Yegappan
            Lakshmanan, closes vim/vim#9378)

d92813a598

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-17 21:56:03 +08:00
5a564bf242 refactor: cast to int earlier when using 'so' and 'siso' (#24756) 2023-08-17 20:35:51 +08:00
4292575dfc Merge pull request #24752 from zeertzjq/vim-9.0.0548
vim-patch:9.0.{0359,0548,1416}
2023-08-17 17:36:30 +08:00
8ac9abd4fa vim-patch:9.0.1416: crash when collection is modified when using filter()
Problem:    Crash when collection is modified when using filter().
Solution:   Lock the list/dict/blob. (Ernie Rael, closes vim/vim#12183)

e6d40dcdc7

Co-authored-by: Ernie Rael <errael@raelity.com>
2023-08-17 17:03:10 +08:00
1ed12a2e10 vim-patch:9.0.0548: reduce() with a compiled lambda could be faster
Problem:    reduce() with a compiled lambda could be faster.
Solution:   Call eval_expr_typval() instead of call_func() directly.

f1c60d4bf1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-17 16:44:55 +08:00
1918e1ea6d vim-patch:9.0.0359: error message for wrong argument type is not specific
Problem:    Error message for wrong argument type is not specific.
Solution:   Include more information in the error. (Yegappan Lakshmanan,
            closes vim/vim#11037)

8deb2b30c7

Cherry-pick test_listdict.vim changes from patch 8.2.4809.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-17 16:40:51 +08:00
fb78c1983c Merge pull request #24750 from zeertzjq/vim-8.2.4450
vim-patch:8.2.{4450,4451,4455}
2023-08-17 16:39:08 +08:00
6267996f13 vim-patch:8.2.4455: accepting one and zero for second sort() argument is strange
Problem:    Accepting one and zero for the second sort() argument is strange.
Solution:   Disallow using one and zero in Vim9 script.

2007dd49f5

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-17 16:11:17 +08:00
0b1353c5a4 vim-patch:8.2.4451: sort() fails when ignoring case
Problem:    sort() fails when ignoring case.
Solution:   Accept a number one argument in sort().

9cd4c0fb98

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-17 16:06:51 +08:00
cda0abdb02 vim-patch:8.2.4450: list sort test fails
Problem:    List sort test fails.
Solution:   Pass a valid "how" argument.

2afeb40831

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-17 16:06:51 +08:00
200dafb8a5 Merge pull request #24749 from zeertzjq/vim-8.2.3848
vim-patch:8.2.{3848,partial:3849}: reduce() on a string
2023-08-17 16:06:29 +08:00
b193674b4a vim-patch:partial:8.2.3849: functions implementing reduce and map are too long
Problem:    Functions implementing reduce and map are too long.
Solution:   Use a function for each type of value.  Add a few more test cases
            and add to the help. (Yegappan Lakshmanan, closes vim/vim#9370)

389b72196e

Partial port as this doesn't include handling for non-materialized List.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-17 15:37:32 +08:00
c5576fcc80 vim-patch:8.2.3848: cannot use reduce() for a string
Problem:    Cannot use reduce() for a string.
Solution:   Make reduce() work with a string. (Naruhiko Nishino, closes vim/vim#9366)

0ccb5842f5

Omit tv_get_first_char() as it doesn't really save much code.

Co-authored-by: rbtnn <naru123456789@gmail.com>
2023-08-17 15:20:47 +08:00
7f51829cf7 Merge pull request #24748 from zeertzjq/vim-8.2.3818
vim-patch:8.2.{3818,3822,3908,3982}: filter()/map() on a string
2023-08-17 13:38:41 +08:00
acac1e19d3 vim-patch:8.2.3982: some lines of code not covered by tests
Problem:    Some lines of code not covered by tests.
Solution:   Add a few more test cases. (Dominique Pellé, closes vim/vim#9453)

8bfa0eb863

Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
2023-08-17 13:14:32 +08:00
db64280be5 vim-patch:8.2.3908: cannot use a script-local function for 'foldtext'
Problem:    Cannot use a script-local function for 'foldtext'.
Solution:   Expand "s:" and "<SID>". (Yegappan Lakshmanan, closes vim/vim#9411)

27708e6c7b

Cherry-pick test_filter_map.vim change from patch 8.2.3871.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-17 13:14:32 +08:00
faef577e90 vim-patch:8.2.3822: leaking memory in map() and filter(), no string in Vim9
Problem:    Leaking memory in map() and filter(), cannot use a string argument
            in Vim9 script.
Solution:   Fix the leak, adjust the argument check, also run the tests as
            Vim9 script. (Yegappan Lakshmanan, closes vim/vim#9354)

2d877599ee

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-17 13:14:32 +08:00
d9e7dad139 vim-patch:8.2.3818: cannot filter or map characters in a string
Problem:    Cannot filter or map characters in a string.
Solution:   Make filter() and map() work on a string. (Naruhiko Nishino,
            closes vim/vim#9327)

c479ce032f

Co-authored-by: rbtnn <naru123456789@gmail.com>
2023-08-17 13:14:32 +08:00
8861f2af72 Merge pull request #24747 from zeertzjq/vim-8.2.1969
vim-patch:8.2.{1969,1971,2075}: mapnew()
2023-08-17 11:47:40 +08:00
3117dc70f1 vim-patch:1b884a005398
Update runtime files.

1b884a0053

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-17 11:21:10 +08:00
90ad3c8f17 vim-patch:8.2.2075: error for const argument to mapnew()
Problem:    Error for const argument to mapnew().
Solution:   Don't give an error. (closes vim/vim#7400)

57cf4973a2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-17 11:21:10 +08:00
bc0c7dde17 vim-patch:8.2.1971: memory leak when map() fails
Problem:    Memory leak when map() fails.
Solution:   Clear the typval.

c56936e2ba

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-17 11:21:10 +08:00
8cbb2477cf vim-patch:8.2.1969: Vim9: map() may change the list or dict item type
Problem:    Vim9: map() may change the list or dict item type.
Solution:   Add mapnew().

ea696852e7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-17 11:21:10 +08:00
22d9338afc fix(api): disallow win_set_buf from changing cmdwin's old curbuf (#24745)
A command typed in the cmdwin and executed with `<CR>` is expected to be
executed in the context of the old curwin/buf, so it shouldn't be changed.
2023-08-17 00:53:10 +01:00
e928161bde vim-patch:8.2.3334: Vim9: not enough tests run with Vim9
Problem:    Vim9: not enough tests run with Vim9.
Solution:   Run a few more tests in Vim9 script and :def function. Fix
            islocked().  Fix error for locking local variable.

bd77aa9274

Omit GLV_NO_DECL: Vim9 script only.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-16 21:50:56 +08:00
56befb6fb3 vim-patch:8.2.3333: Vim9: not enough tests run with Vim9
Problem:    Vim9: not enough tests run with Vim9.
Solution:   Run a few more tests in Vim9 script and :def function.

3e9c0b9608

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-16 21:50:56 +08:00
e780177506 feat(diagnostic): filter diagnostics by specific severities (#24736)
Allow users to filter diagnostics by specifying severities
2023-08-16 08:49:14 -05:00
9cb7e00b97 feat(diagnostic): provide more control over virtual text display (#24724)
Allow users to pass virtual text options to nvim_buf_set_extmark through
the "virtual_text" table in vim.diagnostic.config().

Fixes: https://github.com/neovim/neovim/issues/16545
2023-08-16 08:21:32 -05:00
54be7d6b45 docs(lua): add missing fields to treesitter/_meta
According to `:h TSNode` docs, there's also `TSNode:sexpr()` and
`TSNode:has_error()` that is part of `TSNode` class, but this wasn't
documented in `treesitter/_meta.lua`.

Adding missing fields in so the types is similar to `:h TSNode`
2023-08-16 08:18:03 +01:00
0c23525b59 vim-patch:20b33b56ad5d
Update FreeBASIC syntax file (vim/vim#12781)

20b33b56ad

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-08-16 09:15:39 +02:00
f685303e6d vim-patch:636d32b32730
The keyboard layout "russian-typograph" has been updated to version 3.3 (vim/vim#12796)

Co-authored-by: RestorerZ <restorer@mail2k.ru>

636d32b327

Co-authored-by: Restorer <69863286+RestorerZ@users.noreply.github.com>
Co-authored-by: RestorerZ <restorer@mail2k.ru>
2023-08-16 09:15:39 +02:00
93f9bb5924 vim-patch:10f23e10a9f0
Update syntax/muttrc.vim to latest mutt (vim/vim#12797)

Nothing complicated, just lots of tedium keeping the lines wrapped at
reasonable lengths.

10f23e10a9

Co-authored-by: lunasophia <104850249+lunasophia@users.noreply.github.com>
2023-08-16 09:15:39 +02:00
36288578ee vim-patch:4868f637b84a
Update syntax/fortran.vim (vim/vim#12798)

Several small improvements including better discrimination of "real" used as a type and as an intrinsic

4868f637b8

Co-authored-by: Ajit-Thakkar <142174202+Ajit-Thakkar@users.noreply.github.com>
2023-08-16 09:15:39 +02:00
c0ac53e0d6 build(vim-patch.sh): use sed -E for portable regexp (#24734)
Also always use -e for consistency.
2023-08-16 08:50:11 +08:00
f92bda1dad vim-patch:9.0.1718: dict-completion does not respect region (#24733)
Problem: dict-completion does not respect region
Solution: respect selected region in dict completion

Set do_region to zero as we don't want a complete dump of the matching
words, we want the code to filter them according to the user's selected
region.

closes: vim/vim#12792
closes: vim/vim#7025

e98fb643ec

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-08-16 07:12:47 +08:00
a245dd79a2 vim-patch:9.0.1717: virtcol2col returns last byte of a multi-byte char (#24729)
Problem: virtcol2col returns last byte of a multi-byte char
Solution: Make it return the first byte for a multi-byte char

closes: vim/vim#12786
closes: vim/vim#12799

b209b86e66

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-16 06:28:52 +08:00
10c5f35a8d vim-patch:9.0.1715: duplicate test in message_test.c (#24728)
Problem: duplicate test in message_test.c
Solution: Remove duplicate test and make functions static

closes: vim/vim#12803

7772c93a3e
2023-08-16 06:11:05 +08:00
3cd5ef63fd vim-patch:9.0.1714: getcompletion() "cmdline" fails after :autocmd (#24727)
Problem:  getcompletion() "cmdline" fails after :autocmd
Solution: Use set_cmd_context() instead of set_one_cmd_context().

closes: vim/vim#12804

e4c79d3615
2023-08-16 06:07:01 +08:00
e72c0cd920 feat(highlight): Allow hyphens (-) in highlight group names (#24714)
Fixes: https://github.com/neovim/neovim/issues/23184
2023-08-15 09:25:51 -05:00
fc14928719 fix(printf): make positional %zd and %zu work (#24722) 2023-08-15 20:54:28 +08:00
842a47d6a4 vim-patch:9.0.1704: Cannot use positional arguments for printf() (#24719)
Problem: Cannot use positional arguments for printf()
Solution: Support positional arguments in string formatting

closes: vim/vim#12140

0c6181fec4

Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
2023-08-15 19:16:19 +08:00
7aad4643f9 fix(deps): remove stray conflict marker
fixup for 22d397c233
2023-08-15 12:32:20 +02:00
22d397c233 build(deps): bump tree-sitter-lua to v0.0.19 2023-08-15 11:43:17 +02:00
389165cac1 vim-patch:8.2.0066: some corners of vim_snprintf() are not tested (#24718)
Problem:    Some corners of vim_snprintf() are not tested.
Solution:   Add a test in C. (Dominique Pelle, closes vim/vim#5422)

d2c946bacf
2023-08-15 14:46:05 +08:00
6d93bdd458 build(deps): bump tree-sitter-c to v0.20.6 2023-08-14 09:53:25 +02:00
dd09630a21 vim-patch:9.0.1711: dead code in charset.c (#24706)
Problem: dead code in charset.c
Solution: remove it

linetabsize_col() calls init_chartabsize_arg() with 0 as "lnum", so
cts.cts_has_prop_with_text is always FALSE.

closes: #PR

d3515a1e88

N/A patches for version.c:
vim-patch:9.0.1702: Undo test is flaky
2023-08-14 06:47:51 +08:00
fbc644ba31 vim-patch:9.0.1708: getcompletion() failes for user-defined commands (#24707)
Problem: getcompletion() failes for user-defined commands
Solution: set context for completion function

closes: vim/vim#12681
closes: vim/vim#12680

8ef1fbc0c3

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-14 06:47:32 +08:00
06bce8bf5c test(terminal): fix scrollback test flakiness (#24708)
Problem:    Terminal scrollback test is flaky.
Solution:   Use INTERACT flag so the job doesn't exit immediately.
2023-08-14 06:47:09 +08:00
fc0ee871de fix(treesitter)!: remove deprecated legacy injection format 2023-08-14 00:14:35 +02:00
006152ff7a ci: run codeql on pull requests #24545
Also use cache to save 1 minute.
2023-08-13 12:11:39 -07:00
11590543eb Merge pull request #24681 from clason/update-c
feat(treesitter): update C parser and queries
2023-08-13 18:19:01 +02:00
017ff93b02 fix(keycodes): recognize <t_xx> as a key (#24700)
Problem:    The result of keytrans() sometimes can't be translated back.
Solution:   Recognize <t_xx> as a key.
2023-08-13 22:14:48 +08:00
cbf54ec2a5 vim-patch:e978b4534a5e (#24697)
Farewell to Bram and dedicate upcoming Vim 9.1 to him (vim/vim#12749)

e978b4534a

Also update the header for the following files that were converted to Vim9
script upstream:

- autoload/ccomplete.lua (vim9jitted)
- ftplugin.vim
- ftplugof.vim
- indent.vim
- indent/vim.vim
- makemenu.vim

This also updates the "Last Change" dates, even if some changes (due to rewrites
to Vim9 script) were not ported.

There's still a few other places where Bram is still mentioned as a maintainer
in the files we and Vim have:

- ftplugin/bash.vim
- indent/bash.vim
- indent/html.vim
- indent/mail.vim
- macros/accents.vim
- macros/editexisting.vim
- syntax/bash.vim
- syntax/shared/typescriptcommon.vim
- syntax/tar.vim
- syntax/typescript.vim
- syntax/typescriptreact.vim
- syntax/zimbu.vim

Maybe future patches will address that.

Also exclude changes to .po files that didn't apply automatically (the
`:messages` maintainer string isn't used in Nvim anyway).

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-13 13:25:10 +01:00
0fe921663f Merge #15440 close 'shell' :terminal automatically 2023-08-13 05:23:15 -07:00
3836eeb901 feat(treesitter): update C queries from upstream 2023-08-13 12:30:47 +02:00
c3dd84e76f build(deps): bump tree-sitter-c to v0.20.5 2023-08-13 12:30:47 +02:00
8179d68dc1 fix(treesitter): logger memory leak 2023-08-13 11:23:17 +01:00
e3ce025e55 build(deps): bump luajit to HEAD - 72efc42ef 2023-08-13 11:55:12 +02:00
380ffd6b7c vim-patch:9ad1bf7afd5c
runtime(pymanifest): fix mistake in syntax definition

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>

9ad1bf7afd

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-08-13 11:53:51 +02:00
a600ac5263 vim-patch:2f339aad6c80
Add syntax & ftplugin for pymanifest (vim/vim#12773)

2f339aad6c

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-08-13 11:53:51 +02:00
4a936ad2dc vim-patch:f9c4c2f97db9
Update iss syntax file (vim/vim#11890)

- Add 'ExternalSize:' parameter
- Add 'setntfscompression' files flag
- Fix escaped left brace highlight
- Fix 'String:' parameter highlight
- Remove trailing whitespace

f9c4c2f97d

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-08-13 11:53:51 +02:00
d8e330bcec fix(test): remove test/compat.lua 2023-08-13 10:20:05 +01:00
7b0123dd6a feat(remote): avoid --remote-ui infinite loop (#24465) 2023-08-13 14:14:08 +08:00
e551d623d2 build(vim-patch.sh): rename locale.c to os/lang.c (#24687) 2023-08-13 11:27:31 +08:00
3ce3218fb4 build(vim-patch.sh): group co-authors together (#24686) 2023-08-13 10:34:25 +08:00
165c4c9e57 vim-patch:cd4e4e169ab3 (#24685)
.cirrus.yml: skip pkg update for FreeBSD 13.1 (vim/vim#12767)

cd4e4e169a

Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2023-08-13 07:34:23 +08:00
d39361f5e0 vim-patch:9.0.1698: Test_map_restore_sid fails in GUI (#24682)
Problem: Test_map_restore_sid fails in GUI
Solution: Feed an unsimplified Ctrl-B

closes: vim/vim#12770

7fe1089904
2023-08-13 07:10:43 +08:00
7542286d6a vim-patch:9.0.1697: incsearch test not sufficient (#24683)
Problem: incsearch test not sufficient (after 9.0.1691)
Solution: add an additional test

73b8209266

Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
2023-08-13 07:10:24 +08:00
2ca076e45f feat(treesitter)!: incremental injection parsing
Problem:

Treesitter highlighting is slow for large files with lots of injections.

Solution:

Only parse injections we are going to render during a redraw cycle.

---

- `LanguageTree:parse()` will no longer parse injections by default and
  now requires an explicit range argument to be passed.

- `TSHighlighter` now parses injections incrementally during on_win
  callbacks for the line range being rendered.

- Plugins which require certain injections to be parsed must run
  `parser:parse({ start_row, end_row })` before using the tree.
2023-08-12 16:11:36 +01:00
5a25dcc5a4 fix(diff): filler lines for hunks bigger than linematch limit (#24676)
Apply linematch filler computation only if the hunk is actually
linematched.

Fixes #24580
2023-08-12 17:14:37 +08:00
04aed08157 vim-patch:d8f981138aa0
Add commentstring for nix file format (vim/vim#12696)

d8f981138a

Co-authored-by: Keith Smiley <keithbsmiley@gmail.com>
2023-08-12 11:01:05 +02:00
58a1ef8e6a fix(events): avoid unnecessary CursorMoved (#24675)
Problem:    Temporarily changing current window in a script causes
            CursorMoved to be triggerd.
Solution:   Don't trigger CursorMoved if neither curwin nor cursor
            changed between two checks.
2023-08-12 09:50:17 +08:00
6c07a189f2 vim-patch:9.0.1688: cannot store custom data in quickfix list (#24673)
Problem: cannot store custom data in quickfix list
Solution: add `user_data` field for the quickfix list

closes: vim/vim#11818

ca6ac99077

Co-authored-by: Tom Praschan <13141438+tom-anders@users.noreply.github.com>
2023-08-12 08:19:06 +08:00
72cf94fc0e vim-patch:9.0.1694: wrong mapping applied when replaying a char search (#24670)
Problem: wrong mapping applied when replaying a char search
Solution: Store a NOP after the ESC

closes: vim/vim#12708
closes: vim/vim#6350

bacc83009b
2023-08-12 06:50:52 +08:00
8c5d81997e vim-patch:9.0.1693: Ctrl-Q not handled like Ctrl-V in replace mode (#24669)
Problem: Ctrl-Q not handled like Ctrl-V in replace mode
Solution: Handle Ctrl-Q like Ctrl-V

closes: vim/vim#12686
closes: vim/vim#12684

2d63e4b3cc

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-12 06:41:23 +08:00
8f9c5ee5ef vim-patch:9.0.1691: wrong viewport restored for incsearch and smoothscroll (#24667)
Problem: wrong viewport restored for incsearch and smoothscroll
Solution: Save and restore skipcol as well

closes: vim/vim#12713

7b7b4cb6f2
2023-08-12 06:32:13 +08:00
713311be62 vim-patch:9.0.1687: mapset() not properly handling script ID (#24666)
Problem: mapset() not properly handling script ID
Solution: replace_termcodes() may accept a script ID

closes: vim/vim#12699
closes: vim/vim#12697

7e0bae024d
2023-08-12 06:08:07 +08:00
6e0c36ba0e vim-patch:9.0.1686: undotree() only works for the current buffer (#24665)
Problem:    undotree() only works for the current buffer
Solution:   Add an optional "buffer number" parameter to undotree().  If
            omitted, use the current buffer for backwards compatibility.

closes: vim/vim#4001
closes: vim/vim#12292

5fee111149

Co-authored-by: Devin J. Pohly <djpohly@gmail.com>
2023-08-12 05:51:49 +08:00
278805dfac vim-patch:21aaff3faa82
Update my name and email in runtime files (vim/vim#12763)

21aaff3faa

Co-authored-by: Lily Ballard <lily@ballards.net>
2023-08-11 22:06:37 +02:00
35c8ad1c80 vim-patch:dd0ad2598898
Update syntax/dosini.vim to the latest version (vim/vim#12764)

The latest version is in https://github.com/xuhdev/syntax-dosini.vim/blob/master/syntax/dosini.vim. I've sent the file to Bram at the end of June, unfortunately it wasn't able to make into the Vim repository. RIP!

dd0ad25988

Co-authored-by: Hong Xu <hong@topbug.net>
2023-08-11 22:06:37 +02:00
31c4ed26bc feat(treesitter): add injection language fallback (#24659)
* feat(treesitter): add injection language fallback

Problem: injection languages are often specified via aliases (e.g.,
filetype or in upper case), requiring custom directives.

Solution: include lookup logic (try as parser name, then filetype, then
lowercase) in LanguageTree itself and remove `#inject-language`
directive.

Co-authored-by: Lewis Russell <me@lewisr.dev>
2023-08-11 17:05:17 +02:00
72e64a1afe fix(lsp): extra "." when completing with tsserver #24646
Problem:
With tsserver LSP, omni completion after "." inserts an extra "."

Solution:
Apply adjust_start_col() regardless of `filterText`.
adjust_start_col() is explained here:
0ea8dfeb3d/runtime/lua/vim/lsp.lua (L2334-L2351)

The `filterText` field is used in the following situations rather than as
a condition for obtaining column values:
1. Real-time filtering: When the user types characters in the editor, the
   language server can use the filterText field to filter the list of
   suggestions and only return suggestions that match the typed characters. This
   helps to provide more precise recommendations.
2. Fuzzy matching: The filterText field can be used to perform fuzzy matching,
   allowing matching in the middle or beginning of input characters, not limited
   to prefix matching. This can provide a more flexible code completion
   experience.

Inspecting usage of `filtertext` in vim-lsp and coc and lsp-mode:
- vim-lsp uses a `refresh_pattern` to judge filterText as completionitem word
  (although I think this is not the correct usage).
- coc uses it for filtering.

Fix #22803
2023-08-11 05:20:05 -07:00
3fb372eba4 Use Lua autocommand and make TermClose autocommand global 2023-08-10 09:53:56 -05:00
6e703f778f fix: handle argv not present in nvim_get_chan_info 2023-08-10 09:08:26 -05:00
673ee213e9 test: update tests for auto-closing :term buffers
The terminal buffer closes automatically when using `:terminal` and the
command exits without an error. This messes up some tests that expect
the terminal buffer to still be open. We can force the buffer not to
close by passing an argument to `:terminal`. This can be anything, since
the shell-test stub simply prints whatever argument it's given.
2023-08-10 09:08:25 -05:00
0c89854da1 feat(terminal): close shell terminals automatically
When starting a terminal buffer that uses the default value of &shell
(e.g. when using `:terminal` or `termopen([&shell])`), automatically
close the buffer if the shell exits without an error.
2023-08-10 09:06:10 -05:00
3d948a4dc4 vim-patch:9.0.1683: Updated runtime files (#24638)
This is a collection of various PRs from github that all require a minor
patch number:

1) https://github.com/vim/vim/pull/12612

    Do not conflate dictionary key with end of block

2) https://github.com/vim/vim/pull/12729:

    When saving and restoring 'undolevels', the constructs `&undolevels` and
    `:set undolevels` are problematic.

    The construct `&undolevels` reads an unpredictable value; it will be the
    local option value (if one has been set), or the global option value
    (otherwise), making it unsuitable for saving a value for later
    restoration.

    Similarly, if a local option value has been set for 'undolevels',
    temporarily modifying the option via `:set undolevels` changes the local
    value as well as the global value, requiring extra work to restore both
    values.

    Saving and restoring the option value in one step via the construct
    `:let &undolevels = &undolevels` appears to make no changes to the
    'undolevels' option, but if a local option has been set to a different
    value than the global option, it has the unintended effect of changing
    the global 'undolevels' value to the local value.

    Update the documentation to explain these issues and recommend explicit
    use of global and local option values when saving and restoring.  Update
    some unit tests to use `g:undolevels`.

3) https://github.com/vim/vim/pull/12702:

    Problem:    Pip requirements files are not recognized.
    Solution:   Add a pattern to match pip requirements files.

4) https://github.com/vim/vim/pull/12688:

    Add indent file and tests for ABB Rapid

5) https://github.com/vim/vim/pull/12668:

    Use Lua 5.1 numeric escapes in tests and add to CI

    Only Lua 5.2+ and LuaJIT understand hexadecimal escapes in strings.  Lua
    5.1 only supports decimal escapes:

    > A character in a string can also be specified by its numerical value
    > using the escape sequence \ddd, where ddd is a sequence of up to three
    > decimal digits. (Note that if a numerical escape is to be followed by a
    > digit, it must be expressed using exactly three digits.) Strings in Lua
    > can contain any 8-bit value, including embedded zeros, which can be
    > specified as '\0'.

    To make sure this works with Lua 5.4 and Lua 5.1 change the Vim CI to
    run with Lua 5.1 as well as Lua 5.4

6) https://github.com/vim/vim/pull/12631:

    Add hurl filetype detection

7) https://github.com/vim/vim/pull/12573:

    Problem:   Files for haskell persistent library are not recognized
    Solution:  Add pattern persistentmodels for haskell persistent library

closes: vim/vim#12612
closes: vim/vim#12729
closes: vim/vim#12702
closes: vim/vim#12688
closes: vim/vim#12668
closes: vim/vim#12631
closes: vim/vim#12573

Already ported but wasn't marked: vim-patch:ad34abee2583

6efb198033

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: lacygoill <lacygoill@lacygoill.me>
Co-authored-by: Michael Henry <drmikehenry@drmikehenry.com>
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
Co-authored-by: KnoP-01 <knosowski@graeffrobotics.de>
Co-authored-by: James McCoy <jamessan@jamessan.com>
Co-authored-by: Jacob Pfeifer <jacob@pfeifer.dev>
Co-authored-by: Borys Lykah <lykahb@fastmail.com>
2023-08-10 17:45:36 +08:00
3e3eddc8e7 Merge pull request #24639 from zeertzjq/vim-6a500661a9cb
vim-patch:6a500661a9cb,81b8bf5b4a33
2023-08-10 17:43:35 +08:00
a51ab112a6 vim-patch:81b8bf5b4a33
Update the vimscript code for restoring cursor position

Using xxd(1) to filter and edit binary files causes the input files
to have dual nature, so to speak, which effectively makes restoring
the cursor position broken.  Fix that by ignoring the "xxd" file type
in the code that restores the cursor position.

Interactive rebasing in git causes files to be edited in vim, which,
similarly to commit messages, are rarely the same as the last one
edited.  Thus, also add "gitrebase" to the list of file types for
which the cursor position isn't restored.

While there, refactor the code a bit to possibly save a few CPU cycles
and to keep the line lengths in check, and use the long form of the
commands and variables, to make the code slightly more consistent and
more understandable to newcomers.

Update the relevant comments in the code and the associated parts of
the documentation, to keep them in sync with the updated code.

Remove some redundant trailing whitespace as well, as spotted.

81b8bf5b4a

Co-authored-by: Dragan Simic' via vim_dev <vim_dev@googlegroups.com>
2023-08-10 17:28:04 +08:00
5684c415b4 vim-patch:6a500661a9cb
Improve the vimscript code in ":h hex-editing"

Save and restore the view position before and after saving the buffer,
respectively, to keep the current view of the xxd(1)'s hex dump
unchanged after doing ":w", which previously caused the window to
scroll back to the very beginning of the buffer.  I believe it's
needless to say how annoying and counterproductive that was.

Get rid of the "Press ENTER or type command to continue" message, which
was previously displayed after opening larger binary files.  The use
of "silent" and "redraw" commands is tailored specifically to avoid
screen flickering, e.g. when doing ":w", which is caused by the buffer
being filtered by an external command.

Increase the number of octets per line, produced by xxd(1), from the
default value of 16 to 32.  This puts bigger chunks of the hex dump
on the screen and makes the whole thing much more usable.

While there, reformat the code to make it more readable, and use the
long form of the commands and variables to make the code slightly more
consistent and more understandable to newcomers.

6a500661a9

Co-authored-by: Dragan Simic' via vim_dev <vim_dev@googlegroups.com>
2023-08-10 17:28:02 +08:00
72e619ca92 vim-patch:8f566fdb1e34 (#24636)
update .wast files syntax highlighting (vim/vim#12741)

8f566fdb1e

Co-authored-by: Linda_pp <rhysd@users.noreply.github.com>
2023-08-10 07:13:23 +08:00
1d81d7a268 feat(defaults): treat "•" as a list item prefix #24623
Problem:
Nvim docs use "•" as a list item prefix but `gw{motion}` doesn't format
such lists by default.

Solution:
Change the 'comments' option to include "fb:•" by default.
2023-08-09 15:33:53 -07:00
e6947bb1e8 fix(types): make filetype.add parameters optional 2023-08-09 23:27:32 +01:00
1cf942204f vim-patch:bd76c89e31ac (#24630)
update matchit (vim/vim#12611)

bd76c89e31

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-09 23:44:16 +02:00
f060f03304 vim-patch:2eb413f89b97 (#24627)
* vim-patch:2eb413f89b97

detect filetype for `*.vsh` and `*.vv` files (vim/vim#12692)

Co-authored-by: Turiiya <34311583+tobealive@users.noreply.github.com>

2eb413f89b

Co-authored-by: Turiiya <34311583+ttytm@users.noreply.github.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-09 23:35:10 +02:00
2ee8ace217 fix(iter): make pipeline termination conditions consistent (#24614)
If an iterator pipeline stage returns nil as its first return value, the
other return values are ignored and it is treated as if that stage
returned only nil (the semantics of returning nil are different between
different stages). This is consistent with how for loops work in Lua
more generally, where the for loop breaks when the first return value
from the function iterator is nil (see :h for-in for details).
2023-08-09 15:41:45 -05:00
cc4540ebce vim-patch:92f076e53e22 (#24634)
Update krl and add rapid syntax files (vim/vim#12750)

92f076e53e

Co-authored-by: Patrick Meiser-Knosowski <31903021+KnoP-01@users.noreply.github.com>
2023-08-09 22:37:49 +02:00
3c929fd1c2 vim-patch:077ade4f6703 (#24629)
feat: recognize geojson extension as json filetype (vim/vim#12636)

077ade4f67

Co-authored-by: Dominique Pellé <dominique.pelle@gmail.com>
2023-08-09 22:35:57 +02:00
2e8f38690f vim-patch:b69b9d5e1753 (#24628)
Add filetype detection for eyaml files (vim/vim#12659)

https://github.com/voxpupuli/hiera-eyaml/ uses and produces the eyaml
format, which is simply yaml with some encrypted values.

It's convenient to edit the file without decrypting when not touching
encrypted values (or when you don't have access to the decryption key),
which is why vim should treat those files as yaml files.

b69b9d5e17

Co-authored-by: Max Gautier <mg@max.gautier.name>
2023-08-09 22:35:43 +02:00
1904e5060e vim-patch:8967f6c4b9e2 (#24626)
feat(heex): borrow matchit support from html (vim/vim#12717)

* feat(heex): borrow matchit support from html

Makes % support behave the same in heex as in html. For example, quickly moving the cursor between opening and closing tags.

* Remove unnecessary line; define b:undo_ftplugin first

* Remove b:html_set_match_words

8967f6c4b9

Co-authored-by: Chris Vincent <chris.vincent@hey.com>
2023-08-09 22:34:54 +02:00
90ed7ee112 vim-patch:44ff25d5243b (#24625)
* vim-patch:44ff25d5243b

PyPA manifest files are not recognized (vim/vim#12707)

Problem:    PyPA manifest files are not recognized.
Solution:   Add a pattern to match PyPA manifest files.

44ff25d524

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-08-09 22:34:39 +02:00
aaeb1a8cd1 vim-patch:7159ac7fec28 (#24624)
Unison support (vim/vim#12715)

7159ac7fec

Co-authored-by: Anton Parkhomenko <chuwy@users.noreply.github.com>
2023-08-09 22:34:02 +02:00
ceb501c1c6 vim-patch:a13eb2b14791 (#24622)
Add WebGPU Shading Language (WGSL) filetype (vim/vim#12723)

The current W3C Working Draft for the WebGPU Shading Language (WGSL) specifies
'text/wgsl' media type for WGSL modules with the '.wgsl' file extension:
https://www.w3.org/TR/WGSL/#text-wgsl-media-type

It has also been registered at the Internet Assigned Numbers Authority (IANA):
https://www.iana.org/assignments/media-types/text/wgsl

Neovim's nvim-lspconfig already associates wgsl language servers
with 'filetype wgsl':
https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#wgsl_analyzer

However currenly setting 'filetype wgsl' for *.wgsl files by defalut in Neovim
is blocked by adding this filetype to the vim project first:
https://github.com/neovim/neovim/pull/23331

This commit adds this missing wgsl filetype.

a13eb2b147

Co-authored-by: Gergő Sályi <87373293+gergo-salyi@users.noreply.github.com>
2023-08-09 22:33:41 +02:00
bad71a4ca7 Merge pull request #24631 from clason/vim-c2bd205254c8
vim-patch:{c2bd205254c8,0401933a5be3}: typo fixes
2023-08-10 03:20:56 +08:00
8f9b2652fb Merge pull request #24633 from bfredl/luabool2
fix(api): revert unintended change of optional bool params
2023-08-09 21:15:03 +02:00
f81645abd2 vim-patch:0401933a5be3
Fix alignment in filetype.txt (vim/vim#12618)

There are three spaces because the "<" is concealed.

0401933a5b

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-09 20:44:12 +02:00
164370a4cb vim-patch:c2bd205254c8
Change "the" to "then" under ':help bufload()' (vim/vim#12662)

c2bd205254

N/A commits:
vim-patch:64dea84bb05a (we have our own manpager at home)
vim-patch:958e15bb1c7d (we have our own editorconfig syntax file)
vim-patch:c41b3c9f95ac (we don't have defaults.vim)

Co-authored-by: Daniel Steinberg <dstein64@users.noreply.github.com>
2023-08-09 20:43:45 +02:00
dbcba26bf1 fix(api): revert unintended change of optional bool params
Currently (as of nvim 0.9), the behavior of boolean params in
vim.api lua wrappers is inconsistent for optional parameters
(part of an `opts` dict) compared to positional parameters.

This was inadvertently changed in #24524 . While cleaning up this
inconsistency is something we might want eventually, it needs
to be discussed separately and the impact of existing code considered.
2023-08-09 20:34:07 +02:00
68f12e7fcb fix(lua): annotate that TSNode functions can return nil (#24621) 2023-08-09 18:06:42 +01:00
977f9659a7 docs(MAINTAIN): update deprecation policy (#24619)
docs(MAINTAIN.md): update deprecation policy

Refine a deprecation policy and add another deprecation period in which
a feature is only deprecated via documentation and does not issue a
warning.
2023-08-09 16:49:52 +01:00
c43c745a14 fix(lua): improve annotations for stricter luals diagnostics (#24609)
Problem: luals returns stricter diagnostics with bundled luarc.json
Solution: Improve some function and type annotations:

* use recognized uv.* types 
* disable diagnostic for global `vim` in shared.lua
* docs: don't start comment lines with taglink (otherwise LuaLS will interpret it as a type)
* add type alias for lpeg pattern
* fix return annotation for `vim.secure.trust`
* rename local Range object in vim.version (shadows `Range` in vim.treesitter)
* fix some "missing fields" warnings
* add missing required fields for test functions in eval.lua
* rename lsp meta files for consistency
2023-08-09 11:06:13 +02:00
8afdc1f386 ci(labeler): run "type-scope" after "triage"
Problem:    When "triage" job is run after "type-scope" job, it may
            remove labels added by the "type-scope" job.
Solution:   Run "type-scope" job after "triage" job.
2023-08-09 09:27:51 +08:00
fdb11888f5 vim-patch:9.0.1679: Cleanup Tests from leftover files (#24617)
Problem:    Tests may leave leftover files around
Solution:   Clean up tests and remove files

There were a few failures in 'linux (huge, gcc, testgui, true, true)'
e.g. here: https://github.com/vim/vim/actions/runs/5497376153/jobs/10018060156

,----
| Error detected while processing command line..script /home/runner/work/vim/vim/src/testdir/runtest.vim[585]..function RunTheTest[54]..Test_lvimgrep_crash[16]..TestTimeout[12]..VimLeavePre Autocommands for "*"..function EarlyExit[7]..FinishTesting:
| line   70:
| E445: Other window contains changes
| E937: Attempt to delete a buffer that is in use: Xtest_stable_xxd.txt
| E937: Attempt to delete a buffer that is in use: Xtest_stable_xxd.txt
| E937: Attempt to delete a buffer that is in use: Xtest_stable_xxd.txtmalloc(): unsorted double linked list corrupted
`----

Which is puzzling, because the Xtest_stable_xxd file should have been
long gone after test_crypt.vim is run (and definitely no longer be
staying around in test_quickfix.vim).

So try to clean up properly after a test script is run, just in case any
X<file> is still around. During testing, a found a few leftover files,
which I also fixed in the relevant test-file.

Unfortunately, the test workflow 'linux (huge, gcc, testgui, true,
true)' now seems to fail with 'E1230: Encryption: sodium_mlock()' in
test_crypt.vim. Hopefully this is only temporary.

84bc00e9b5

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-09 06:07:23 +08:00
4134cebb17 docs(builtin): fix some missing lines (#24615)
These two functions seem to have previously had their docs start on the same
line as the signature, which I guess contributed to the lines being lost (though
I checked all other such functions from before again and these were the only
two).
2023-08-08 21:25:22 +01:00
c6c21db82b fix(filetype): add typing and dry (#24573) 2023-08-08 16:36:06 +01:00
61ed45486d docs: Bram farewell #24589
ref #24579
2023-08-08 06:41:55 -07:00
2e824e89c1 build(deps): bump tree-sitter to HEAD - 0a1c4d846 (#24607)
adapt to breaking change in `ts_query_cursor_set_max_start_depth`
https://github.com/tree-sitter/tree-sitter/pull/2278
2023-08-08 14:57:06 +02:00
37c58226a8 fix(lua): vim.fs typing (#24608) 2023-08-08 11:58:29 +01:00
11ad8fa4cd Merge pull request #24606 from bfredl/keysetnil
docs(lua): the keyset nilocalypse
2023-08-08 11:51:38 +02:00
628763fbd8 docs(lua): the keyset nilocalypse
This is needed to give recent LuaLS the right idea about optional fields.
2023-08-08 10:42:59 +02:00
0211f889b9 fix(treesitter): make sure injections don't return empty ranges (#24595)
When an injection has not set include children, make sure not to add
the injection if no ranges are determined.

This could happen when there is an injection with a child that has the
same range as itself. e.g. consider this Makefile snippet

```make
foo:
  $(VAR)
```

Line 2 has an injection for bash and a make variable reference. If
include-children isn't set (default), then there is no range on line 2
to inject since the variable reference needs to be excluded.

This caused the language tree to return an empty range, which the parser
now interprets to mean the full buffer. This caused makefiles to have
completely broken highlighting.
2023-08-07 18:22:36 +01:00
ce792db5b8 vim-patch:9.0.1678: blade files are not recognized (#24601)
Problem:    Blade files are not recognized.
Solution:   Add a pattern for Blade files. (closes vim/vim#12650)

ad34abee25

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-07 18:44:52 +02:00
c0beb8173f feat: add .luarc.json (#24592) 2023-08-07 16:27:53 +01:00
832459219b docs(lsp): fix references to protocol.constants #24578 2023-08-07 06:35:06 -07:00
369f58797d fix(treesitter): escape quotes in :InspectTree view #24582
Problem: Anonymous nodes containing double quotes break the highlighting.
Solution: Escape double quotes in anonymous nodes.
2023-08-07 06:16:12 -07:00
3a21c3afe6 Merge pull request #24524 from bfredl/typed_keys
refactor(api): use typed keysets
2023-08-07 14:42:25 +02:00
51c754b62e feat(lua): use keyset type information 2023-08-07 13:18:12 +02:00
0b351c3740 test(api): update tests to new error messages 2023-08-07 13:18:11 +02:00
6c0812d92e feat(lua): specific error messages for type checking opts params 2023-08-07 13:18:11 +02:00
7bc93e0e2f refactor(api): use typed keysets
Initially this is just for geting rid of boilerplate,
but eventually the types could get exposed as metadata
2023-08-07 13:11:15 +02:00
ef44e59729 fix(inccommand): don't set an invalid 'undolevels' value (#24575)
Problem:    Cannot break undo by setting 'undolevels' to itself in
            'inccommand' preview callback.
Solution:   Don't set an invalid 'undolevels' value.

Co-authored-by: Michael Henry <drmikehenry@drmikehenry.com>
2023-08-05 22:42:34 +08:00
42630923fc refactor(lsp): use protocol.Methods instead of strings #24570 2023-08-05 02:03:57 -07:00
1f252a8ac0 docs(options): fix mistakes (#24568) 2023-08-05 07:55:45 +08:00
6fa17da39b docs(options): take ownership of options.txt (#24528)
* docs(options): take ownership of options.txt

- `src/nvim/options.lua` is now the source of truth
- generate runtime/lua/vim/_meta/options.lua

* fixup! zeer comments

* fixup! zeer comments (2)

* fixup! re-enable luacheck

* fixup! regen
2023-08-04 21:26:53 +01:00
c01e624b07 feat(lua): more specific error messages for vim.api type checking 2023-08-04 08:45:19 +02:00
cc87dda31a fix(lsp): do not assume client capability exists in watchfiles check (#24550)
PR #23689 assumes `client.config.capabilities.workspace.didChangeWatchedFiles`
exists when checking `dynamicRegistration`, but thats's true only if it was
passed to `vim.lsp.start{_client}`.

This caused #23806 (still an issue in v0.9.1; needs manual backport), but #23681
fixed it by defaulting `config.capabilities` to `make_client_capabilities` if
not passed to `vim.lsp.start{_client}`.

However, the bug resurfaces on HEAD if you provide a non-nil `capabilities` to
`vim.lsp.start{_client}` with missing fields (e.g: not made via
`make_client_capabilities`).

From what I see, the spec says such missing fields should be interpreted as an
absence of the capability (including those indicated by missing sub-fields):
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#clientCapabilities

Also, suggest `vim.empty_dict()` for an empty dict in
`:h vim.lsp.start_client()` (`{[vim.type_idx]=vim.types.dictionary}`
no longer works anyway, probably since the cjson switch).
2023-08-04 08:10:54 +02:00
3d3ec27d51 test(options/defaults_spec): fix NVIM_APPNAME test flakiness (#24553)
Also avoid leaving directories behind.
2023-08-04 10:37:47 +08:00
21d466c1b9 fix(terminal): forward horizontal mouse scrolling (#24552) 2023-08-04 10:24:27 +08:00
0a7fda6fa0 fix(terminal): include modifiers when forwarding mouse (#24549) 2023-08-04 09:34:13 +08:00
c4f775fa57 build(deps): bump libvterm to 0.3.3 (#24547)
Fix #21106
2023-08-04 07:08:43 +08:00
b034378cf5 docs: luaref cleanup #24541
- drop "luaref-" prefix in favor of "lua-" or nothing, where possible.
- remove redundant "luaref--lang…" and "luaref-api…" tags.
2023-08-03 08:35:10 -07:00
4d859d00d1 Merge #24351 docs 2023-08-03 06:14:15 -07:00
b1fb04475e docs: remove "#" comment char in @return
Everything after a "#" char is a "description" comment, i.e. luals won't
treat it as a type, name, etc. But "#" should not be present in the
generated docs (such as :help docs).
https://github.com/LuaLS/lua-language-server/wiki/Annotations#return
2023-08-03 14:01:53 +02:00
d2f8133024 docs: misc
Co-authored-by: Kevin Pham <keevan.pham@gmail.com>
2023-08-03 14:01:53 +02:00
f1772272b4 refactor(lsp): use protocol.Methods instead of strings #24537 2023-08-03 04:03:48 -07:00
214b125132 fix(gen_lsp.lua): no notifications in lsp.Methods #24530
Problem:
- Notifications are missing from `lsp.Methods`.
- Need a way to represent `$/` prefixed methods.

Solution:
- Generate notifications.
- Use "dollar_" prefix for `$/` methods.
2023-08-03 02:52:21 -07:00
4a06de40e7 docs(lua): fix generated fname param annotations #24533 2023-08-02 11:22:44 -07:00
1ee905a63a docs(builtin): fix alignment of comments in code blocks (#24529) 2023-08-02 22:14:32 +08:00
d086bc1e85 docs: drop "Can also be used as a method" #24508
Now that we "own" builtin.txt, we cant remove the repetitive mention of
Vimscript's UFCS syntax. It's noisy to mention this for each function,
and it's also not a Vimscript feature that should be encouraged.

Also change the builtin.txt heading to "NVIM REFERENCE MANUAL", which
indicates when a help file is Nvim-owned.
2023-08-01 16:17:26 -07:00
6425869771 feat(lua): add meta file for vim submodules (#24525) 2023-08-01 18:03:33 +01:00
0804034c07 fix(loader): cache path ambiguity #24491
Problem: cache paths are derived by replacing each reserved/filesystem-
path-sensitive char with a `%` char in the original path. With this
method, two different files at two different paths (each containing `%`
chars) can erroneously resolve to the very same cache path in certain
edge-cases.

Solution: derive cache paths by url-encoding the original (path) instead
using `vim.uri_encode()` with `"rfc2396"`. Increment `Loader.VERSION` to
denote this change.
2023-08-01 08:28:28 -07:00
dfe19d6e00 Merge #24504 feat(lsp): protocol.Methods 2023-08-01 07:36:57 -07:00
f41496ce74 feat(gen_lsp.lua): sort by name, handle failure #24504 2023-08-01 16:13:22 +02:00
da09f9b551 feat(gen_lsp.lua): protocol.Methods #24504 2023-08-01 16:05:06 +02:00
48d533272e feat(lua-types): types for vim.api.* (#24523) 2023-08-01 14:20:44 +01:00
e55e80d51c fix(lsp): inlay hints: "Failed to delete autocmd" when closing buffer #24469
Problem:
"Failed to delete autocmd" error when deleting LspNotify autocmd. #24456

Solution:
Change a few things in the inlay_hint and diagnostic LSP code:
1. Re-introduce the `enabled` flag for the buffer state tables. Previously I was
   relying on the presence of an autocmd id in the state table to track whether
   inlay_hint / diagnostic was enabled for a buffer. There are two reasons why
   this doesn't work well:
  - Each time inlay_hint / diagnostic is enabled, we call `nvim_buf_attach` on
    the buffer, resulting in multiple `on_reload` or `on_detach` callbacks being
    registered.
  - Commands like `bwipeout` delete buffer local autocmds, sometimes before our
    `on_detach` callbacks have a chance to delete them first. This causes the
  - Use module local enabled state for diagnostic as well. bwipeout can race
    with on_detach callbacks for deleting autocmds. Error referenced in #24456.
2. Change the `LspDetach` autocmd to run each time (i.e., remove the `once`
   flag). Since we're only registering autocmds once per buffer now, we
   need to make sure that we set the enabled flag properly each time the LSP
   client detaches from the buffer.
  - Remove `once` from the LspDetach autocmds for inlay_hint and diagnostic.
    We only set up the autocmd once now. Gets removed when buffer is deleted.
3. Have the `LspNotify` handler also refresh the inlay_hint / diagnostics when
   receiving the `textDocument/didOpen` event. Before this point, the LSP
   backend doesn't have the contents of the buffer, so can't provide inlay hints
   or diagnostics.

Downsides of this approach:
* When inlay_hint / diagnostics are disabled on a buffer, it will continue to
  receive `LspNotify` events for that buffer. The callback exits early since the
  `enabled` flag is false.

Alternatives:
* Can we wrap the call to `nvim_del_autocmd` in `pcall` to swallow any errors
  resulting from trying to delete the autocmd?

Fixes #24456

Helped-by: Maria José Solano <majosolano99@gmail.com>
2023-08-01 05:13:52 -07:00
20bfdbe832 docs(builtin): right align tags (#24522) 2023-08-01 11:12:00 +01:00
ccb5a76e5a fix(defaults): don't use nvim_feedkeys in default mappings (#24520)
Problem:    Using nvim_feedkeys in default mappings makes it hard to use
            them as a part of another mapping.
Solution:   Use an expression mapping and stop Visual mode later.

Fix #24518.
2023-08-01 18:07:02 +08:00
9b5f58185e docs(builtin): fix and annotate language blocks (#24506) 2023-08-01 09:57:52 +01:00
12ccea5967 build: fix --luamod-dev not working properly (#24519)
Fixes a regression from #23112.
2023-08-01 11:57:46 +08:00
996dd36c77 feat(lsp): add actionable advice to lsp client quit error msg (#24510)
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2023-07-29 16:10:40 +02:00
2736cb3adf docs(lua): vim.str_utf_{start,end,pos} #24424
Closes #24422
2023-07-29 07:08:32 -07:00
42333ea98d feat(docs): generate builtin.txt (#24493)
- eval.lua is now the source of truth.

- Formatting is much more consistent.

- Fixed Lua type generation for polymorphic functions (get(), etc).

- Removed "Overview" section from builtin.txt
  - Can generate this if we really want it.

- Moved functions from sign.txt and testing.txt into builtin.txt.

- Removed the *timer* *timers* tags since libuv timers via vim.uv should be preferred.

- Removed the temp-file-name tag from tempname()

- Moved lueval() from lua.txt to builtin.txt.

* Fix indent

* fixup!

* fixup! fixup!

* fixup! better tag formatting

* fixup: revert changes no longer needed

* fixup! CI

---------

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-07-28 14:48:41 +01:00
c1c2a1b5dd fix(inccommand): don't save information of a buffer twice (#24501)
Problem:    'inccommand' doesn't restore 'undolevels' properly for a
            buffer shown in multiple windows.
Solution:   Don't save information of a buffer twice.
2023-07-28 15:41:58 +08:00
df2f5e3912 fix(editorconfig): highlight properties with dashes (#24407)
also add metadata comment and update Lua code in syntax file
2023-07-27 14:39:05 +02:00
41cefe5130 build(deps): bump tree-sitter-c to v0.20.4 (#24495) 2023-07-27 12:45:08 +02:00
8fe9f41f7f Merge pull request #24457 from seandewar/relax-cmdwin
feat(api): relax cmdwin restrictions for a few functions
2023-07-26 21:27:35 +01:00
a47be0b2d9 fix(window): prevent win_size_restore from changing cmdheight
Currently it only skips if `Rows` changed, but it's possible for the height of
the usable area for windows to change (e.g: via `&ch`, `&stal` or `&ls`), which
can cause the value of `&cmdheight` to change when the sizes are restored.

This is a Vim bug, so I've submitted a PR there too. No telling when it'll be
merged though, given the current lack of activity there.

`ROWS_AVAIL` is convenient here, but also subtracts the `global_stl_height()`.
Not ideal, as we also care about the height of the last statusline for other
values of `&ls`. Meh.

Introduce `last_stl_height` for getting the height of the last statusline and
use it in `win_size_save/restore` and `last_status` (means
`last_status_rec`'s `statusline` argument will now be true if `&ls` is 3,
but that does not change the behaviour).

Also corrects the logic in `comp_col` to not assume there's a last statusline
if `&ls` is 1 and the last window is floating.
2023-07-26 20:44:46 +01:00
472271199e feat(api): allow win_hide to close cmdwin or non-previous windows
This aligns its behaviour better with `nvim_win_close`.

Note that `:hide` is actually incapable of closing the cmdwin, unlike `:close`
and `:quit`, so this is a bit of a difference in behaviour.
2023-07-26 20:44:46 +01:00
5d921e28c1 feat(api): allow win_close in cmdwin to close wins except previous
Disallow closing the previous window from `nvim_win_close`, as this will cause
issues.

Again, no telling how safe this is. It also requires exposing old_curwin. :/

Also note that it's possible for the `&cmdheight` to change if, for example,
there are 2 tabpages and `nvim_win_close` is used to close the last window in
the other tabpage while `&stal` is 1. This is addressed in a later commit.
2023-07-26 20:44:46 +01:00
6b4970f6e0 feat(api): allow open_win/win_set_buf in the cmdwin in some cases
Problem: As discussed on Matrix, there was some interest in having
`nvim_open_win` again be able to open floats in the cmdwin (e.g: displaying a
hover doc related to what's in the cmdwin). After #23228, this was disallowed.

Solution: Allow `nvim_open_win` in the cmdwin as long as `!enter` and
`buffer != curbuf` (the former can cause all sorts of issues, and the latter
can crash Nvim after closing cmdwin). Also allow `nvim_win_set_buf` in a similar
fashion.

Note that we're not *entirely* sure if this is 100% safe (cmdwin is a
global-state-using-main-loop-calling beast), but this seems to work OK..?

Also:
  - Check the buffer argument of `nvim_open_win` earlier, and abort if it's
    invalid (it used to still open a window in this case).

  - Untranslate `e_cmdwin` errors in the API (other errors in the API are not
    translated: although not detailed in the API contract yet, errors are
    supposed to be stable).
2023-07-26 20:44:46 +01:00
ccf328172b fix(gen_vimfn_types): don't include tag before signature's line (#24492)
When signature is a bit long or there are too many tags, the tags appear
before the signature's line. Don't include the line with tags in the
previous function' docs.

Also fix lint warnings.
2023-07-26 21:07:39 +08:00
fd089c8e50 feat(lua): typing for vim.fn.* (#24473)
Problem:
  No LSP information for `vim.fn.*`

Solution:
  Add meta file for `vim.fn.*`.
2023-07-26 09:50:54 +01:00
b8b7782037 vim-patch:partial:8.1.1981: the evalfunc.c file is too big (#24490)
Problem:    The evalfunc.c file is too big.
Solution:   Move undo functions to undo.c.  Move cmdline functions to
            ex_getln.c.  Move some container functions to list.c.

08c308aeb5

Undo functions only. Cmdline functions have already been moved.
A lot of container functions have been added to eval/funcs.c instead of
list.c in previously ported Vim 8.2.x patches, so deal with that later.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-07-26 15:18:09 +08:00
14d047ad2f test(inccommand): add a test for #20248 (#24489) 2023-07-26 11:58:26 +08:00
643bea31b8 fix(inccommand): restrict cmdpreview undo calls (#24289)
Problem:
The cmdpreview saved undo nodes on cmdpreview_prepare() from ex_getln.c may
become invalid (free) if the preview function makes undo operations, causing
heap-use-after-free errors.

Solution:
Save the buffer undo list on cmdpreview_prepare)_ and start a new empty one. On
cmdpreview_restore_state(), undo all the entries in the new undo list and
restore the original one. With this approach, the preview function will be
allowed to undo only its own changes.

Fix #20036
Fix #20248
2023-07-26 11:22:57 +08:00
74bd4aba57 fix(lsp): fix multi client handling workspace_folder methods (#18839)
`buf_notify` sends the notification to all clients of a buffer, calling
that inside a loop over clients multiplies the amount of notifications.
2023-07-25 16:57:19 +02:00
aba3ceccb7 vim-patch:9.0.1335: no test for bad use of spaces in help files (#24483)
Problem:    No test for bad use of spaces in help files.
Solution:   Add checks for use of spaces in help files.  Ignore intentional
            spaces. (Hirohito Higashi, closes vim/vim#11952)

d950984489

Cherry-pick changes from patch 9.0.1604.

Co-authored-by: h-east <h.east.727@gmail.com>
Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-07-25 20:58:09 +08:00
20c331915f fix(lsp): SignatureHelp docstring is not escaped #16702
Problem:
Nvim LSP client always treats signature.documentation as markdown, even
if the server returns a plain string.
Per https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#signatureInformation
in a SignatureInformation response, the documentation field can be
either "string" or "MarkupContent".

Solution:
If signature.documentation is a string, treat it as "plaintext".

Closes #16563
2023-07-25 05:40:13 -07:00
898384ac69 test(core/startup_spec): use retry() instead of jobwait() (#24481)
This should work on Windows.
2023-07-25 20:32:59 +08:00
aaa151d506 docs: remove trailing spaces #24455 2023-07-25 05:07:13 -07:00
4d0f4c3de9 fix(lsp): E403 if doc contains multiple codeblocks #24458
Problem:
Content that has codeblocks with different languages, results in
multiple calls to:
    syntax include vim syntax/vim.vim
which raises error:
    E403: syntax sync: line continuations pattern specified twice
Before ba8f19ebb6, this was avoided by
using pcall() to ignore the error.

Solution:
Restore the use of pcall() to ignore the error.
We plan to replace this logic with a treesitter approach, so this is
good enough for now.

Fix #24431
2023-07-25 04:38:48 -07:00
c0fa721ade fix(startup): make recovery mode work without --headless (#24477) 2023-07-25 19:02:39 +08:00
7668f89d5b fix(lsp): replace @private with @nodoc for public client functions (#24415)
* fix(lsp): replace @private with @nodoc for public client functions

To prevent lua-ls warnings in plugins which use the functions.

* fix(lsp): remove duplicate type annotations/class definitions

These annotations became duplicate with https://github.com/neovim/neovim/pull/23750
2023-07-24 20:21:35 +02:00
966eb8e0b3 fix(lsp): announce publishDiagnostics.dataSupport (#24442)
Neovim already passed `data` element from published diagnostic to code action, but failed to announce it in client capabilities.

Here is the test that shows that `data` element is returned by `vim.lsp.diagnostic.get_line_diagnostics()`:

f56c184809/test/functional/plugin/lsp/diagnostic_spec.lua (L103-L115)

and then `get_line_diagnostics()` is used to construct the context for code action request:

f56c184809/runtime/lua/vim/lsp/buf.lua (L742)
2023-07-24 19:26:17 +02:00
a37d568082 fix(lsp): send empty "added" list when removing workspace folder #24440
When adding `workspace/didChangeWorkspaceFolders` support to my [language server](https://github.com/elixir-tools/next-ls), I noticed that when neovim removes a workspace, it sends an empty table (which is serialized to an empty JSON array) for the value in the `added` field.

This does not follow the spec; the `added` table should just be empty.

The following error led me to this discovery. Note the payload includes `"added" => [[]]`:

```
22:46:48.476 [error] LSP Exited.

Last message received: handle_notification %{"jsonrpc" => "2.0", "method" => "workspace/didChangeWorkspaceFolders", "params" => %{"event" => %{"added" => [[]], "removed" => [%{"name" => "/Users/mitchell/src/gen_lsp", "uri" => "file:///Users/mitchell/src/gen_lsp"}]}}}

** (MatchError) no match of right hand side value: {:error, %{"params" => %{"event" => %{"added" => [error: "expected a map"]}}}}
    (gen_lsp 0.4.0) lib/gen_lsp.ex:265: anonymous fn/4 in GenLSP.loop/3
    (gen_lsp 0.4.0) lib/gen_lsp.ex:292: GenLSP.attempt/3
    (stdlib 5.0.2) proc_lib.erl:241: :proc_lib.init_p_do_apply/3
```
2023-07-24 09:09:53 -07:00
add7e106d5 fix(lsp): noisy warning about offset_encodings #24441
In the case you hit this warning in a buffer (like with C++ and clangd),
this message potentially fires over and over again making it difficult
to use the editor at all.
2023-07-24 08:58:59 -07:00
6a486c44e6 fix(gx): move to to _init_default_mappings #24420
Problem:
netrw may conflict with the Nvim default "gx" mapping.

Solution:
Initialize keymapping earlier by moving it to vim._init_default_mappings().
That also avoids needing to check maparg().
2023-07-24 08:35:19 -07:00
48085e40bb fix(treesitter): stop() should treat 0 as current buffer #24450 2023-07-24 07:26:38 -07:00
78b56b21b4 docs(vim_diff): fixed inconsistent autocmds behavior #24453 2023-07-24 07:10:55 -07:00
5fb4c397a1 fix(mouse): drag vsep of window with 'statuscolumn' (#24462)
Problem:    Cannot drag a vertical separator to the right of a window
            whose 'statuscolumn' is wider than itself.
Solution:   Never treat a click on a vertical separator as a click on
            'statuscolumn'.
2023-07-24 18:16:53 +08:00
01e273c340 fix(statuscolumn): don't update clicks if current width is 0 (#24459) 2023-07-24 15:18:24 +08:00
f2ce31d3dc fix(terminal): call validate_cursor() before screen update (#24425)
Problem:
When the CurSearch highlight group is set, and a search is active and
you are listening to the remote UI "win_viewport" events, then typing is
very unresponsive, because "win_viewport" is not sent as soon as the
character is typed. On the other hand if you refresh the screen on
"flush", the screen will scroll with a delay since "win_viewport" comes
too late. I estimate this delay be up to one second, but it varies. 

Solution:
Call validate_cursor() before drawing the screen, just like other modes.
No tests have been added because only the intermediate state is wrong.
2023-07-23 23:01:51 +08:00
59289fb987 fix(highlight): make CurSearch work properly with 'winhl' (#24448) 2023-07-23 21:36:32 +08:00
183147a906 build(deps): bump tree-sitter to HEAD - 3f44b8968 (#24447) 2023-07-23 11:39:45 +02:00
011166438d build(deps): bump tree-sitter-python to v0.20.3 (#24446) 2023-07-23 11:17:13 +02:00
ce56ad2ba7 test: reduce flakiness (#24443)
Avoid consecutive RPC requests involving :startinsert or :stopinsert,
because consecutive RPC requests may be processed together, before the
:startinsert or :stopinsert takes effect.

Also change some feed_command() to command() to make tests faster.
2023-07-23 12:46:56 +08:00
f56c184809 test: fix VimResume test flakiness (#24438) 2023-07-23 10:03:05 +08:00
f0d618667a test: check that TextChangedT cannot delete terminal buffer (#24437) 2023-07-23 08:53:59 +08:00
cdb758ef44 test: check real cursor position in Terminal mode (#24436) 2023-07-23 08:23:07 +08:00
a8cfdf43bc fix(events): trigger VimResume on next UI request (#24426) 2023-07-23 07:16:41 +08:00
ad95b36985 fix(treesitter): update markdown parser and queries (#24429) 2023-07-22 19:57:58 +02:00
d2efcbf2dc refactor: remove some (const char **) casts (#24423) 2023-07-22 18:00:55 +08:00
4b57ff77fe refactor(lsp): use LspNotify for inlay_hint (#24411) 2023-07-22 11:00:17 +02:00
24e3ee9d07 fix(api/options): validate buf and win
Fixes #24398
2023-07-22 09:52:13 +01:00
cfcda91827 docs(lua): add missing word in docs for vim.empty_dict (#24401) 2023-07-22 15:42:25 +08:00
b74262a336 fix(terminal): send Shift-Home Shift-End Ctrl-Home Ctrl-End (#24418) 2023-07-22 08:00:42 +08:00
02d859a073 Merge #24392 from mrshmllow/gx_win
fix(ui.open): some URLs fail on Windows
2023-07-21 06:37:34 -07:00
7907b1fca5 test(vim.ui.open): mock failure on Windows
Problem:
On Windows, `rundll32` exits zero (success) even when given
a non-existent file.

Solution:
Mock vim.system() on Windows to force a "failure" case.
2023-07-21 14:38:17 +02:00
4448f594d3 docs(lsp): clean up LSP event documentation #24413
Alphabetize LSP events, and make formatting consistent.
2023-07-21 04:42:47 -07:00
519b9929e9 fix(ui.open): some URLs fail on Windows
Problem:
On Windows, `explorer.exe` fails to open some URLs, for example:

    :lua vim.ui.open('https://devdocs.io/#q=lua%20lua_call')

https://github.com/neovim/neovim/pull/23401#issuecomment-1641015704

Solution:
Use rundll32 instead.
2023-07-21 13:36:57 +02:00
ca9f4a7cb1 docs: also change "vimL" and "viml" to "Vimscript" (#24414) 2023-07-21 16:30:05 +08:00
58f9486144 fix(folds): update folds in Insert mode with fdm=indent (#24402)
Previously, when using foldmethod=indent, inserting an unindented line
would inadvertently open closed folds below it.
As a performance improvement, folds were only updated once, across all
lines, after Insert mode was exited.

Now, the performance improvement is no longer being used when
foldmethod=indent, so folds are updated multiple times during Insert
mode, but only across the lines that are changing, which preserves the
folds (and their open/close states) instead of recreating them.
2023-07-21 08:56:08 +08:00
60d320dea3 fix(decoration_provider): don't leak memory on error (#24410) 2023-07-21 08:21:46 +08:00
63b3408551 feat(lsp): implement textDocument/diagnostic (#24128) 2023-07-20 09:03:48 +02:00
86ce3878d6 docs(lua): clarify fs.find() documentation #24394 2023-07-19 09:55:35 -07:00
30a5c28c87 feat(decoration_provider): log errors as error messages 2023-07-19 16:56:25 +01:00
2f22ed6a00 feat(lsp): handle multiple clients in omnifunc (#24381)
Also fixes https://github.com/neovim/neovim/issues/24369 by adding an
extra `vim.schedule` to ensure the `vim.fn.complete` call happens
outside of a luv callback
2023-07-19 07:10:11 +02:00
ab5cdbd167 test(startup_spec): add a test for #18315 (#24391) 2023-07-19 07:14:32 +08:00
be74807eef docs(lua): more improvements (#24387)
* docs(lua): teach lua2dox how to table

* docs(lua): teach gen_vimdoc.py about local functions

No more need to mark local functions with @private

* docs(lua): mention @nodoc and @meta in dev-lua-doc

* fixup!

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>

---------

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2023-07-18 15:42:30 +01:00
d0ae529861 build(scripts): allow a git ref for lsp_types #24377
USAGE:
nvim -l scripts/lsp_types.lua gen
nvim -l scripts/lsp_types.lua gen --build/new_lsp_types.lua
nvim -l scripts/lsp_types.lua gen --out runtime/lua/vim/lsp/types/protocol.lua --ref 2023.0.0a2
2023-07-18 06:00:44 -07:00
9fcb0a64ee refactor(lua2dox): overhaul (#24386) 2023-07-18 12:24:53 +01:00
e4da418ba8 fix(fs.lua): normalize slash truncation (#23753)
Preserve last slash in windows' root drive directories
2023-07-18 14:36:04 +08:00
80cf0f3d29 Merge pull request #24363 from lewis6991/docs/luatypes
docs(lua): move some function docs to lua files
2023-07-17 17:40:14 +01:00
1b9ccd38a1 feat(lsp)!: rename vim.lsp.get_active_clients to get_clients (#24113) 2023-07-17 18:27:16 +02:00
6e9b204afb fix: doc errors 2023-07-17 17:09:16 +01:00
69d49727d7 fix: luacheck 2023-07-17 16:32:56 +01:00
e6e0bc225b refactor(gen_vimdoc): put defgroup handling in a function 2023-07-17 16:25:29 +01:00
c2d7c2826c docs(lua): change *lua-foo* -> *vim.foo* 2023-07-17 16:25:29 +01:00
0ac3c4d631 docs(lua): move function docs to lua files 2023-07-17 16:25:28 +01:00
d0d132fbd0 fix(terminal): don't send unknown special keys to terminal (#24378)
Special keys are negative integers, so sending them to terminal leads to
strange behavior.
2023-07-17 21:42:55 +08:00
881d17a113 feat(options)!: remove compatible behaviours for vim 5.0 and earlier 2023-07-17 14:27:21 +01:00
3fd504dbec docs: handle whitespace in emmycomments 2023-07-17 12:59:10 +01:00
a54f88ea64 docs(lua): do not render self args 2023-07-17 12:59:06 +01:00
d0b612f360 refactor: rename _meta.lua to _options.lua 2023-07-17 12:59:04 +01:00
98b22867c3 test(fs): vim.loop was renamed to vim.uv (#24376)
test(fs): vim.loop has been replaced with vim.uv
2023-07-17 19:27:55 +08:00
b60a2ab4cb fix(inccommand): block errors when parsing command line again (#24374)
Revert the change to ex_getln.c from a741c7fd04
2023-07-17 10:15:45 +08:00
f660b79480 test(fs): get tmpdir robustly #23021
Problem:
helpers.tmpname() may create a local file, depending on circumstances.

Solution:
Only use helpers.tmpname() for its parent directory (the "temp root").
Use fs_mkdtemp() to actually get a unique name.
2023-07-16 05:50:10 -07:00
c3de6524a5 fix(clipboard): ignore exit caused by signal #23378
Problem:
If clipboard job exits by signal, the exit code is >=128:
939d9053bd
xclip 0.13 often exits with code 143, which spams unhelpful messages:

    clipboard: error invoking xclip: Waiting for selection requests,
    Control-C to quit   Waiting for selection request number 1

Solution:
Don't show a warning if the clipboard tool exit code is >=128.
Fixes: #7054
2023-07-16 04:15:30 -07:00
047c22a28c docs(term.txt): reorder paragraphs about TUI input (#24367)
Make |tui-modifyOtherKeys| and |tui-csiu| tags appear at a better place.
Also adapt the |<Tab>| help update from dad4473f02
2023-07-16 18:39:45 +08:00
251ca45ac9 fix(lsp): markdown code fence should allow space before info string #24364
Problem:
Bash language server returns "hover" markdown content that starts with
a code fence and info string of `man` preceded by whitespace, which Nvim
does not render properly.

See 0ee73c53ce/server/src/server.ts (L821C15-L821C15)
```typescript
function getMarkdownContent(documentation: string, language?: string): LSP.MarkupContent {
  return {
    value: language
      ? // eslint-disable-next-line prefer-template
        ['``` ' + language, documentation, '```'].join('\n')
      : documentation,
    kind: LSP.MarkupKind.Markdown,
  }
}
```

For example,
```
    ``` man
    NAME
       git - the stupid content tracker
    ```
```

If I remove the white space, then it is properly formatted. 
```    
    ```man instead of ``` man
```

Per CommonMark Spec https://spec.commonmark.org/0.30/#info-string
whitespace is allowed before and after the `info string` which
identifies the language in a codeblock.
> The line with the opening code fence may optionally contain some text
> following the code fence; this is trimmed of leading and trailing
> spaces or tabs and called the [info
> string](https://spec.commonmark.org/0.30/#info-string). If the [info
> string](https://spec.commonmark.org/0.30/#info-string) comes after
> a backtick fence, it may not contain any backtick characters. (The
> reason for this restriction is that otherwise some inline code would
> be incorrectly interpreted as the beginning of a fenced code block.)

 Solution:
 Adjust stylize_markdown() to allow whitespace before codeblock info.
2023-07-16 03:11:45 -07:00
abe39f2b24 feat(api)!: change return type of nvim_win_text_height to Dict (#24365) 2023-07-16 18:02:53 +08:00
622ae2f53e feat(tui): support Super and Meta modifiers (#24357) 2023-07-15 15:03:01 +08:00
33e1a8cd70 feat(lsp): map K to hover by default #24331
Related: https://github.com/neovim/neovim/issues/24252
2023-07-14 09:47:18 -07:00
fd9ac5aa8e build(makefile): remove a phony target uninstall (#24349)
`uninstall` target was removed from makefile
2023-07-14 15:51:15 +02:00
2ecba65b4b fix(lsp): remove unknown LSP protocol property (#24345)
'hierarchicalWorkspaceSymbolSupport' is not part of the LSP Specification
2023-07-14 07:36:10 +02:00
9176b5e10a fix(runtime): respect 'fileignorecase' when sourcing (#24344) 2023-07-14 07:57:13 +08:00
dbb840da01 fix(runtime): respect 'rtp' order for all runtime files (#24335) 2023-07-14 06:46:16 +08:00
a3f4598226 docs(lua): adds links to related keymap functions to keymap.set (#24337)
Might help with discovery, given that there is no `keymap.get()`
2023-07-13 14:43:36 +02:00
516b173780 perf(rtp): reduce rtp scans (#24191)
* perf(rtp): reduce rtp scans

Problem:
  Scanning the filesystem is expensive and particularly affects
  startuptime.

Solution:
  Reduce the amount of redundant directory scans by relying less on glob
  patterns and handle vim and lua sourcing lower down.
2023-07-13 10:17:19 +01:00
998bebc15e build(deps): bump luajit to HEAD - 8635cbabf (#24301) 2023-07-13 09:35:36 +02:00
0ce3910868 fix(ui): cursor pos with left gravity inline virt_text at eol (#24329)
Problem:    Cursor is not after inline virtual text with left gravity
            when inserting after the end of the line.
Solution:   Add width of inline virtual text with left gravity to cursor
            virtcol in Insert mode even if on a NUL.
2023-07-13 08:32:17 +08:00
9359701eae test(extmarks): add test for virt_text_win_col with cpo+=n (#24328) 2023-07-13 07:02:06 +08:00
317c80f460 feat(lsp): add method filter to get_active_clients (#24319) 2023-07-12 14:48:21 +02:00
ef94fb69c6 perf(extmarks): don't handle inline virt_text if there is none (#24322)
Extreme testcase:
```lua
vim.fn.setline(1, 'foobar')
local ns = vim.api.nvim_create_namespace('')
for _ = 1, 100000 do
  vim.api.nvim_buf_set_extmark(0, ns, 0, 3, {})
end
local start_time = vim.loop.hrtime()
vim.fn.virtcol('$')
local stop_time = vim.loop.hrtime()
print(stop_time - start_time)
```
Before #20130: 31696
On master branch: 26191344
After this PR: 37692
2023-07-12 10:38:53 +08:00
bf52fb7193 fix(mouse): copy the line before syntax matching (#24320) 2023-07-12 08:50:34 +08:00
bf5703042b fix(tutor): don't use concealed text in expected lines #24316 2023-07-11 10:09:44 -07:00
06694203e5 fix(drawline): fix missing Visual hl on double-width fold char (#24308) 2023-07-11 13:16:31 +08:00
19fb573ad9 perf(extmarks): avoid unnecessary marktree traversal with folds (#24306)
Extreme testcase:
```lua
vim.cmd([[
  call setline(1, ['', '', ''])
  2,3fold
]])
local ns = vim.api.nvim_create_namespace('')
for _ = 1, 100000 do
  vim.api.nvim_buf_set_extmark(0, ns, 1, 0, { virt_lines = {{{ '' }}} })
end
local start_time = vim.uv.hrtime()
vim.api.nvim_win_text_height(0, {})
local stop_time = vim.uv.hrtime()
print(stop_time - start_time)
```
Before this PR: 21542011
After this PR: 43874
2023-07-11 08:57:55 +08:00
db8fe63a93 feat(api): add nvim_win_text_height (#24236)
It uses the same code as "scroll_delta" of "win_viewport" UI event to
calculate text height, but is more flexible.
2023-07-11 07:15:46 +08:00
3750e5ed9c vim-patch:9.0.1673: cannot produce a status 418 or 503 message (#24287)
Problem:    Cannot produce a status 418 or 503 message.
Solution:   Add err_teapot().

80adaa8ae8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-07-10 11:55:12 -05:00
766f4978d6 fix(lint): lint warnings #24226 2023-07-10 04:38:15 -07:00
fbeef0d4ef fix(completion): don't add backslashes to runtime pattern (#24296)
Problem:    Bashslashes added as regexp in runtime completion may be
            treated as path separator with some 'isfname' value.
Solution:   Make curly braces work for runtime completion and use it.
2023-07-08 23:29:24 +08:00
b9a0e762f1 fix(defaults): visual star (*) on text with "?"
regression from 6318edadc3
2023-07-08 16:55:27 +02:00
0a90e4b05a fix(docs): match DocSearch style with site theme
ref 2b4f9e4780
2023-07-08 16:06:46 +02:00
6318edadc3 fix(defaults): visual hash (#) on text with "?"
Problem:
The default "#" mapping fails on the following example after v$h# with
cursor at start of the first line:

    aa?/\bb
    aa
    aa?/\bb

Solution:
Also escape "?".
2023-07-08 15:33:28 +02:00
7c077a3c2b Merge #24295 from justinmk/doc2
docs: "Return (multiple)", condense @notes
2023-07-08 06:29:48 -07:00
d2e44da516 docs: gather @notes items into one section
related: 21eacbfef3
2023-07-08 15:06:36 +02:00
3a721820c3 docs: "Return (multiple)" heading
Problem:
Lua functions that return multiple results are declared by using
multiple `@return` docstring directives. But the generated docs don't
make it obvious what this represents.

Solution:
- Generate a "Return (multiple)" heading for multiple-value functions.
- Fix `@note` directives randomly placed after `@return`.
2023-07-08 15:06:36 +02:00
00d2f4b96e docs: MAINTAIN.md, nvim_get_mark 2023-07-08 15:06:36 +02:00
8c9e37cc09 test(tui): add test for overriding argv[0] (#24293) 2023-07-08 18:27:53 +08:00
21fa19f3e8 fix(lsp): don't use hl_mode = combine for inlay hints #24276
Problem: `hl_mode` for inlay hints is `combine`, causing bugs like
inlay hints using highlights from the previous character
(#24152, #24068)

Solution: Don't use hl_mode=combine for inlay hints.
2023-07-08 00:14:52 -07:00
c4df2f08b6 fix(extmarks): fix wrong highlight after "combine" virt_text (#24281) 2023-07-08 09:53:30 +08:00
559c4cfd52 fix(startup): run embedded Nvim with real path (#24282)
fix(startup): run embedded process with real path
2023-07-08 08:27:39 +08:00
c379d72c49 feat(lua): allow vim.wo to be double indexed (#20288)
* feat(lua): allow vim.wo to be double indexed

Problem: `vim.wo` does not implement `setlocal`
Solution: Allow `vim.wo` to be double indexed

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2023-07-07 16:37:36 +01:00
804108af6c docs: CONTRIBUTING.md updates (#24280) 2023-07-07 13:52:30 +01:00
c44d819ae1 fix(treesitter): update folds in all relevant windows (#24230)
Problem: When using treesitter foldexpr,
* :diffput/get open diff folds, and
* folds are not updated in other windows that contain the updated
  buffer.

Solution: Update folds in all windows that contain the updated buffer
and use expr foldmethod.
2023-07-07 11:12:46 +01:00
811140e276 fix(folds): fix missing virt_lines above when fold is hidden (#24274) 2023-07-07 09:49:58 +08:00
36941942d6 fix(drawline): inline virt_text hl_mode inside syntax/extmark hl (#24273) 2023-07-07 07:21:12 +08:00
06c4edf46b Merge #21677 fix(defaults): visual star (*,#) is fragile 2023-07-06 04:05:13 -07:00
f39ca5df23 refactor(defaults): use vim.region for visual star (*,#)
Problem:
The parent commit added a new vim.get_visual_selection() function to
improve visual star. But that is redundant with vim.region(). Any
current limitations of vim.region() should be fixed instead of adding
a new function.

Solution:
Delete vim.get_visual_selection().
Use vim.region() to get the visual selection.
TODO: fails with visual "block" selections.
2023-07-06 12:18:55 +02:00
abd380e28d fix(defaults): visual mode star (*,#) is fragile
Problem:
Visual mode "*", "#" mappings don't work on text with "/", "\", "?", and
newlines.

Solution:
Get the visual selection and escape it as a search pattern.
Add functions vim.get_visual_selection and _search_for_visual_selection.

Fix #21676
2023-07-06 10:29:50 +02:00
4e34ca8ae7 docs(luaref): remove parentheses from tags for typedefs (#24271)
And fix alignment.
2023-07-06 14:57:46 +08:00
2afb04758c fix(vim.system): close check handle (#24270)
Fix hang after running vim.system() with sanitizers.
2023-07-06 12:56:19 +08:00
25e62697c3 fix(column): fix wrong cursor with 'statuscolumn' and cpo+=n (#24268) 2023-07-06 11:07:23 +08:00
a0c9c04f00 refactor(plines.c): update outdated comments (#24264) 2023-07-06 04:36:22 +08:00
1de82e16c1 fix(ui): delay win_viewport until screen update #24182
Problem:
Sometimes, when nvim sends the `win_viewport` event, for example when scrolling
with visible folds on the screen, it reports the `scroll_delta` value one batch
into "future". So when the client application is trying to show the new viewport
it's not yet updated, resulting in temporary corruption / screen flickering.

For more details see #23609, and starting from [this comment](
https://github.com/neovide/neovide/pull/1790#issuecomment-1518697747) in
https://github.com/neovide/neovide/pull/1790,, where the issue was first
detected. Note that some of the conclusions in those are not fully accurate, but
the general observations are.

Solution:
When there are pending updates to a Window, delay the `win_viewport` UI event
until the updates are sent. This ensures that there's no flush between sending
the viewport and updating of the lines corresponding to the new viewport.

Document the existing viewport behaviour (for cases where there are no
extra flushes), give a hint about how applications can deal with the slightly
surprising behaviour of the viewport event being sent after the updates.

Fixes https://github.com/neovim/neovim/issues/23609
2023-07-05 06:31:34 -07:00
8a788e2daa Merge pull request #23228 from seandewar/cmdwin-jail
fix(api): use `text_locked()` to check for textlock
2023-07-05 17:04:17 +08:00
df297e3c2b fix(runtime): don't set gx mapping if already mapped (#24262)
This matches netrw's use of maparg().
2023-07-05 16:31:45 +08:00
317038e7cb fix(plines): don't return very large height on very long line (#24260) 2023-07-05 16:30:23 +08:00
aa4e47f704 fix(api): disallow some more functions during textlock
Problem: nvim_buf_set_text(), nvim_open_term() and termopen() all change buffer
text, which is forbidden during textlock. Additionally, nvim_open_term() and
termopen() may be used to convert the cmdwin buffer into a terminal buffer,
which is weird.

Solution: Allow nvim_buf_set_text() and nvim_open_term() in the cmdwin, but
disallow nvim_open_term() from converting the cmdwin buffer into a terminal
buffer. termopen() is not allowed in the cmdwin (as it always operates on
curbuf), so just check text_locked().

Also happens to improve the error in #21055: nvim_buf_set_text() was callable
during textlock, but happened to check textlock indirectly via u_save();
however, this caused the error to be overwritten by an unhelpful "Failed to
save undo information" message when msg_list == NULL (e.g: an `<expr>` mapping
invoked outside of do_cmdline()).
2023-07-05 08:33:32 +01:00
77118d0da8 fix(api): use text_locked() to check textlock
Problem: some API functions that check textlock (usually those that can change
curwin or curbuf) can break the cmdwin.

Solution: make FUNC_API_CHECK_TEXTLOCK call text_locked() instead, which already
checks for textlock, cmdwin and `<expr>` status.

Add FUNC_API_TEXTLOCK_ALLOW_CMDWIN to allow such functions to be usable in the
cmdwin if they can work properly there; the opt-in nature of this attribute
should hopefully help mitigate future bugs.

Also fix a regression in #22634 that made functions checking textlock usable in
`<expr>` mappings, and rename FUNC_API_CHECK_TEXTLOCK to FUNC_API_TEXTLOCK.
2023-07-05 08:31:52 +01:00
5936a88f18 Merge #23401 vim.ui.open: "gx" without netrw 2023-07-05 00:30:05 -07:00
b2e8c0df20 fix(edit): fix K_EVENT interfering with 'digraph' (#24258) 2023-07-05 12:06:14 +08:00
e644e7ce0b fix(vim.ui.open): return (don't show) error message
Problem:
Showing an error via vim.notify() makes it awkward for callers such as
lsp/handlers.lua to avoid showing redundant errors.

Solution:
Return the message instead of showing it. Let the caller decide whether
and when to show the message.
2023-07-05 00:49:10 +02:00
67b2ed1004 fix(gx): visual selection, expand env vars
---
Rejected experiment: move vim.ui.open() to vim.env.open()

Problem:
`vim.ui` is where user-interface "providers" live, which can be
overridden. It would also be useful to have a "providers" namespace for
platform-specific features such as "open", clipboard, python, and the other
providers listed in `:help providers`. We could overload `vim.ui` to
serve that purpose as the single "providers" namespace, but
`vim.ui.nodejs()` for example seems awkward.

Solution:
`vim.env` currently has too narrow of a purpose. Overload it to also be
a namespace for `vim.env.open`.

diff --git a/runtime/lua/vim/_meta.lua b/runtime/lua/vim/_meta.lua
index 913f1fe20348..17d05ff37595 100644
--- a/runtime/lua/vim/_meta.lua
+++ b/runtime/lua/vim/_meta.lua
@@ -37,8 +37,28 @@ local options_info = setmetatable({}, {
   end,
 })

-vim.env = setmetatable({}, {
-  __index = function(_, k)
+vim.env = setmetatable({
+  open = setmetatable({}, {
+      __call = function(_, uri)
+        print('xxxxx'..uri)
+        return true
+      end,
+      __tostring = function()
+        local v = vim.fn.getenv('open')
+        if v == vim.NIL then
+          return nil
+        end
+        return v
+      end,
+    })
+  },
+  {
+  __index = function(t, k, ...)
+    if k == 'open' then
+      error()
+      -- vim.print({...})
+      -- return rawget(t, k)
+    end
     local v = vim.fn.getenv(k)
     if v == vim.NIL then
       return nil
2023-07-04 23:45:35 +02:00
af6e6ccf3d feat(vim.ui): vim.ui.open, "gx" without netrw
Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Co-authored-by: ii14 <59243201+ii14@users.noreply.github.com>
2023-07-04 23:45:00 +02:00
3ecd45ded0 fix(api): allow negative column arguments for nvim_buf_set_text (#23501) 2023-07-04 22:07:55 +08:00
cf5f1492d7 fix(lsp): revert change to buf.clear_references() #24238
Problem: in #24046 the signature of buf.clear_references() changed, which
indirectly breaks callers that were passing "ignored" args.

Solution: because util.buf_clear_references() already defaulted to "current buffer",
the change to buf.clear_references() isn't actually needed, so just revert it.
2023-07-04 05:30:31 -07:00
cebc00603e feat(l10n): update Turkish translations #24246 2023-07-04 05:20:19 -07:00
a76b689b47 perf(ui-ext): approximate scroll_delta when scrolling too much (#24234) 2023-07-04 16:48:53 +08:00
e8b3ed74bc fix(ui-ext): "scroll_delta" handle topfill and skipcol (#24249) 2023-07-04 14:14:09 +08:00
92760a7f42 fix(api, lua): make blank lines in a message work properly (#24244) 2023-07-04 07:19:02 +08:00
35c3275b48 fix(plines): handle inline virtual text after last char (#24241)
Also remove dead code in win_lbr_chartabsize().
2023-07-03 22:57:45 +08:00
6da110d617 docs(gen_help_html): accept "~/" in file/dir params #24240 2023-07-03 05:04:43 -07:00
5f442e1a4a Merge pull request #23167 from dundargoc/refactor/long
refactor: remove long
2023-07-03 13:17:37 +02:00
fcf3519c65 refactor: remove long
long is 32-bits even on 64-bit windows which makes the type suboptimal
for a codebase meant to be cross-platform.
2023-07-03 12:49:09 +02:00
f771d62471 Merge pull request #23891 from rickyz/grid_line_flags
fix(ui): propagate line flags on grid_line events
2023-07-03 09:53:27 +02:00
4fd852b8cb perf(treesitter): cache fold query (#24222)
perf(treesitter): cache vim.treesitter.query.get

Problem:
vim.treesitter.query.get searches and reads query files every time it's
called, if user hasn't overridden the query. So this can incur slowdown
when called frequently.

This can happen when using treesitter foldexpr. For example, when using
`:h :range!` in markdown file to format fenced codeblock, on_changedtree
in _fold.lua is triggered many times despite that the tree doesn't have
syntactic changes (might be a bug in LanguageTree). (Incidentally, the
resulting fold is incorrect due to a bug in `:h range!`.) on_changedtree
calls vim.treesitter.query.get for each tree changes. In addition, it
may request folds queries for injected languages without fold queries,
such as markdown_inline.

Solution:
* Cache the result of vim.treesitter.query.get.
* If query file was not found, fail quickly at later calls.
2023-07-02 16:44:21 +01:00
2d40f5e843 build(deps): bump luv to 1.45.0-0 (#24228)
https://github.com/luvit/luv/releases/tag/1.45.0-0
2023-07-02 11:17:23 +02:00
2031812348 build(nix): fix markdown parser #24225 2023-07-01 21:09:30 -07:00
54807231c0 test: check for ASAN properly (#24224)
Follow-up to #24195.
2023-07-02 08:05:02 +08:00
bbaee29add vim-patch:9.0.1672: tabline highlight wrong after truncated double width label (#24223)
Problem:    Tabline highlight wrong after truncated double width label.
Solution:   Fill up half a double width character later. (closes vim/vim#12614)

d392a74c5a
2023-07-02 07:42:49 +08:00
db590e96d5 fix(startup)!: "nvim -l" message does not end with newline #24215
Close #24180
2023-07-01 14:48:12 -07:00
ff8e3c6039 Merge pull request #24219 from clason/ts-hoon
feat(treesitter): add python, bash parser and queries
2023-07-01 17:29:16 +02:00
a741c7fd04 fix(api): nvim_parse_cmd error message in pcall() #23297
Problem:
nvim_parse_cmd() in pcall() may show an error message (side-effect):

    :lua pcall(vim.api.nvim_parse_cmd, vim.fn.getcmdline(), {})
    E16: Invalid range

Solution:
Avoid emsg() in the nvim_parse_cmd() codepath.

- refactor(api): add error message output parameter to get_address()
- fix: null check emsg() parameter
- refactor: remove emsg_off workaround from do_incsearch_highlighting()
- refactor: remove emsg_off workaround from cmdpreview_may_show()
- refactor: remove remaining calls to emsg() from parse_cmd_address() and get_address()
- (refactor): lint set_cmd_dflall_range()
- refactor: addr_error() - move output parameter to return value

Fix #20339

TODO:

These are the functions called by `get_address()`:

```
nvim_parse_cmd() -> parse_cmdline() -> parse_cmd_address() -> get_address()
    skipwhite()
    addr_error()
    qf_get_cur_idx()
    qf_get_cur_valid_idx()
    qf_get_size()
    qf_get_valid_size()
    mark_get()
    mark_check()
    assert()
    skip_regexp()
    magic_isset()
>   do_search()
>   searchit()
    ascii_isdigit()
    getdigits()
    getdigits_int32()
    compute_buffer_local_count()
    hasFolding()
```

From these functions, I found at least two that call emsg directly:
- do_search()
  - seems to be simple to refactor
- searchit()
  - will be more challenging because it may generate multiple error messages,
    which can't be handled by the current `errormsg` out-parameter.
    For example, it makes multiple calls to `vim_regexec_multi()` in a loop that
    possibly generate error messages, and later `searchit()` itself may generate
    another one:
    - c194acbfc4/src/nvim/search.c (L631-L647)
    - c194acbfc4/src/nvim/search.c (L939-L954)

---------

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2023-07-01 06:33:51 -07:00
43ded8d358 feat(version): unverbose ":version", ":verbose version" #24195
Problem:
`nvim -v` and `:version` prints system vimrc, fallback files, and compilation
info by default, which most people don't care about and just clutters up the
output.

Solution:
Omit extra info unless 'verbose' is set.
2023-07-01 03:45:45 -07:00
ba8f19ebb6 fix(lsp): lint warnings, default offset_encoding #24046
- fix lint / analysis warnings
- locations_to_items(): get default offset_encoding from active client
- character_offset(): get default offset_encoding from active client
2023-07-01 03:42:37 -07:00
cb0a1a10b2 feat(treesitter): add bash parser and queries 2023-07-01 11:28:32 +02:00
88c8803aa1 feat(treesitter): add python parser and queries 2023-07-01 11:28:32 +02:00
11844dde81 feat(treesitter): bundle markdown parser and queries (#22481)
* bundle split Markdown parser from https://github.com/MDeiml/tree-sitter-markdown
* add queries from https://github.com/nvim-treesitter/nvim-treesitter/tree/main
* upstream `#trim!` and `#inject-language!` directives

Co-authored-by: dundargoc <gocdundar@gmail.com>
2023-07-01 11:08:06 +02:00
538b6c3853 build(deps): bump libuv to v1.46.0 (#24218)
https://github.com/libuv/libuv/releases/tag/v1.46.0
2023-07-01 11:07:54 +02:00
628f6cce80 fix(startup): don't truncate when printing with -l (#24216) 2023-07-01 08:16:34 +08:00
2493815290 refactor: fix clang/PVS warnings (#24213) 2023-06-30 21:13:08 +08:00
d191bdf9d5 fix(lsp): fix attempt to call non existent function (#24212)
Commit 37079fc moved inlay_hint to vim.lsp() but in the process did
missed converting a call to disable/enable which are now local.

Fixes the below error when trying to toggle inlay hints.

E5108: Error executing lua /usr/local/share/nvim/runtime/lua/vim/lsp/inlay_hint.lua:248: attempt to call field 'disable' (a nil value)
stack traceback:
        /usr/local/share/nvim/runtime/lua/vim/lsp/inlay_hint.lua:248: in function 'toggle'
        /usr/local/share/nvim/runtime/lua/vim/lsp/inlay_hint.lua:310: in function 'inlay_hint'
        [string ":lua"]:1: in main chunk
2023-06-30 13:42:58 +02:00
751b9d73fd Merge pull request #24147 from clason/fix/ftplugin
fix(ftplugin): respect runtimepath ordering
2023-06-30 18:22:02 +08:00
37079fca58 feat(lsp): move inlay_hint() to vim.lsp (#24130)
Allows to keep more functions hidden and gives a path forward for
further inlay_hint related functions - like applying textEdits.

See https://github.com/neovim/neovim/pull/23984#pullrequestreview-1486624668
2023-06-30 11:33:28 +02:00
6cceef6d4c test(lua/runtime_spec): add test for ftplugin ordering 2023-06-30 17:09:43 +08:00
d55d7646c1 docs(luaref): fix tags for constants (#24203) 2023-06-30 09:38:28 +08:00
d7bb19e013 fix(statusline): fill for double-width char after moving items (#24207) 2023-06-30 08:36:09 +08:00
8758c6fb87 feat(defaults): set g:netrw_use_errorwindow = 0 #24179
Problem:
netrw uses a bespoke window to show messages.

Solution:
change the default so that netrw uses normal vim :echoerr
2023-06-29 14:14:14 -07:00
7968322e7a fix(lsp): inlay_hint nil reference error #24202
Problem:
vim_lsp_inlayhint: Error executing lua: .../lsp/_inlay_hint.lua:249: attempt to index field 'applied' (a nil value)

Solution:
Assign {} to bufstates.applied in on_reload

fixes #24172
2023-06-29 07:26:29 -07:00
aa362a2af8 refactor: remove some casts to char * (#24200) 2023-06-29 15:48:42 +08:00
7d0a23973b fix(column): handle unprintable chars in 'statuscolumn' (#24198) 2023-06-29 11:37:55 +08:00
d90f5ab9ac test(statusline): add test with control characters (#24197) 2023-06-29 11:18:56 +08:00
421c66f741 vim-patch:9.0.1671: Termdebug: error with more than 99 breakpoints (#24194)
Problem:    Termdebug: error with more than 99 breakpoints.
Solution:   Use a different sign for breakpoint 100 and over. (closes vim/vim#12589,
            closes vim/vim#12588)

e7d9ca2b3b

Co-authored-by: skywind3000 <skywind3000@163.com>
2023-06-29 07:04:46 +08:00
a878e02d5d fix(column): use maxwidth to allocate/fill 'statuscolumn' click defs #24190
Use the actual width of the 'statuscolumn' to allocate and fill its click definition array.
The returned width of the built statuscolumn string may be shorter (and is padded later).
2023-06-28 14:16:03 -07:00
e0453d7f57 fix(api): nvim_cmd{cmd="win_getid"} parsed as :winsize #24181
Problem:
`:lua vim.cmd.win_getid(30,10)` is interpreted as `:win[size] 30 10`.
User intention was to call `vim.fn.win_getid(30,10)`.

Solution:
Check that the `cmd` actually matches the resolved command.
2023-06-28 04:51:55 -07:00
42f9573e5d vim-patch:9.0.1670: resetting local option to global value is inconsistent (#24185)
Problem:    Resetting local option to global value is inconsistent.
Solution:   Handle "<" specifically for 'scrolloff' and 'sidescrolloff'.
            (closes vim/vim#12594)

bf5f189e44

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-28 08:13:14 +08:00
e85e7fc7bc fix(treesitter): handle empty region when logging (#24173) 2023-06-27 19:05:44 +01:00
c7e7f1d4b4 fix(treesitter): make foldexpr work without highlighting (#24167)
Problem: Treesitter fold is not updated if treesitter hightlight is not
active. More precisely, updating folds requires `LanguageTree:parse()`.

Solution: Call `parse()` before computing folds and compute folds when
lines are added/removed.

This doesn't guarantee correctness of the folds, because some changes
that don't add/remove line won't update the folds even if they should
(e.g. adding pair of braces). But it is good enough for most cases,
while not introducing big overhead.

Also, if highlighting is active, it is likely that
`TSHighlighter._on_buf` already ran `parse()` (or vice versa).
2023-06-27 19:05:09 +01:00
ab65a98adb fix(docs): ignore_invalid #24174
Regex bug in scripts/gen_help_html.lua:ignore_invalid()
2023-06-27 10:21:27 -07:00
929e4865d1 docs(diagnostic): return value of get() #24144 2023-06-27 08:14:17 -07:00
8ea9a70d05 vim-patch:9.0.1668: PEM files are not recognized (#24169)
Problem:    PEM files are not recognized.
Solution:   Add patterns to match PEM files. (closes vim/vim#12582)

0256d76a33
2023-06-27 09:14:34 +02:00
2e055e49a3 Merge pull request #24170 from zeertzjq/vim-9.0.1664
vim-patch:9.0.{1664,1667}: divide by zero when scrolling with 'smoothscroll' set
2023-06-27 08:55:59 +08:00
116b09ac04 vim-patch:9.0.1667: regression test doesn't fail when fix is reverted
Problem:    Regression test doesn't fail when fix is reverted.
Solution:   Add "n" to 'cpoptions' instead of using :winsize. (closes vim/vim#12587,
            issue vim/vim#12528)

e429893741
2023-06-27 08:26:11 +08:00
3b6fb3fefd vim-patch:9.0.1664: divide by zero when scrolling with 'smoothscroll' set
Problem:    Divide by zero when scrolling with 'smoothscroll' set.
Solution:   Avoid using a negative width. (closes vim/vim#12540, closes vim/vim#12528)

8154e642aa

Co-authored-by: fullwaywang <fullwaywang@tencent.com>
2023-06-27 08:26:10 +08:00
0ca2d11c1f vim-patch:9.0.1632: not all cabal config files are recognized (#24025)
Problem:    Not all cabal config files are recognized.
Solution:   Add a couple of patterns. (Marcin Szamotulski, closes vim/vim#12463)

166cd7b801

Also:
- Do not expand Lua patterns in environment variables used in file patterns.
- Test $XDG_CONFIG_HOME on Windows, as it can be used by Nvim (and the runner
  sets it).

Co-authored-by: Marcin Szamotulski <coot@coot.me>
2023-06-26 11:19:13 +01:00
7578144cbd Merge #24153 from justinmk/doc 2023-06-26 02:56:42 -07:00
aa65bd478a fix(startup): "nvim -l foo.lua" may not set arg0 #24161
Problem:
Using "nvim -l args.lua" without passing extra script args, does not set `_G.arg[0]`.

Steps to reproduce:
```
cat > args.lua<<EOF
vim.print(_G.arg, '')
vim.print(vim.v.argv, '')
EOF

nvim --clean -l args.lua
```

Solution:
Fix condition in command_line_scan.
2023-06-26 02:38:48 -07:00
17c59e417f fix(docs): vimdoc syntax errors
Prepare for https://github.com/neovim/tree-sitter-vimdoc/pull/108 which improves
`{arg}` highlighting in many common cases:

    vim.foo({bar})
    vim.foo( {bar})
    nvim_foo({bar})
    nvim_foo({bar},{baz})
    nvim_foo({bar}, {baz})
    foo[{buf}]

The tradeoff is that things like `"[{"` are flagged as parse errors.
We could avoid if we drop support for `foo[{buf}]`, but that is rather common
(see `builtin.txt`).
2023-06-26 11:29:12 +02:00
99cb1f0c37 build(deps): tree-sitter-vimdoc v2.0.1 2023-06-26 11:29:12 +02:00
b6878f5d63 docs: fix misparsed headings (#24162)
Problem: vimdoc parser requires space between column heading and `~`.

Solution: Add space to docs (and mention it). Also edit `luaref.txt`
headings for consistency.
2023-06-26 11:16:55 +02:00
b697c0cd4f fix(treesitter): update lua parser and queries (#24148) 2023-06-26 09:25:46 +02:00
cd6458123f fix(charset): fix wrong display of 0xffff (#24158) 2023-06-26 11:52:52 +08:00
91aeaeef64 Merge pull request #24154 from zeertzjq/vim-9.0.1665
vim-patch:8.2.3833,9.0.1665
2023-06-26 07:55:49 +08:00
dc3ee122dc vim-patch:9.0.1665: empty CmdlineEnter autocommand causes errors in Ex mode
Problem:    Empty CmdlineEnter autocommand causes errors in Ex mode.
Solution:   Save and restore ex_pressedreturn. (Christian Brabandt,
            closes # 12581, closes vim/vim#12578)

590aae3557

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-06-26 07:19:36 +08:00
7966020f70 vim-patch:8.2.3833: error from term_start() not caught by try/catch
Problem:    Error from term_start() not caught by try/catch.
Solution:   save and restore did_emsg when applying autocommands. (Ozaki
            Kiichi, closes vim/vim#9361)

c3f91c0648

Co-authored-by: ichizok <gclient.gaap@gmail.com>
2023-06-26 07:18:54 +08:00
957d05d16b fix(docs): too much whitespace around <pre> blocks #24151
Problem:
In the generated docs HTML there is too much whitespace before/after `<pre>`
blocks.
- In the old layout (fixed-width), all text in `.old-help-para` is formatted as
  `white-space:pre`.
- In the new layout, when `<pre>` is at the end of a `<div>`, the margins of
  both are redundant, causing too much space.

Solution:
- In the old layout, always remove `<pre>` margin.
- In the new layout, disable `<pre>` margin if it is the last child.
2023-06-25 12:29:56 -07:00
5ceb2238d3 Merge #24116 from justinmk/doc 2023-06-25 09:17:47 -07:00
49a7585981 docs: autocmds, misc 2023-06-25 17:25:47 +02:00
036da0d079 fix(docs): vimdoc syntax errors
gen_help_html: truncate parse-error sample text
2023-06-25 17:14:28 +02:00
502a7a0558 fix(ftplugin): respect runtimepath ordering
Problem: bundled `ftplugin/foo/*.vim` are sourced before user
`ftplugin/foo.vim`.

Solution: call `runtime!` once on all patterns to be sourced.

Followup to #23801. Fixes #24003.
2023-06-25 12:34:30 +02:00
e59cf3b3a9 vim-patch:9.0.1663: Termdebug on MS-Windows: some file names are not recognized (#24145)
Problem:    Termdebug on MS-Windows: some file names are not recognized.
Solution:   Do not always change \t and \n. (Christian Brabandt,
            closes vim/vim#12565, closes vim/vim#12560, closes vim/vim#12550)

c9a4a8ab28

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-06-25 08:12:41 +08:00
cc624fac68 vim-patch:9.0.1661: BUCK files are not recognized (#24142)
Problem:    BUCK files are not recognized.
Solution:   Recognize BUCK files as "bzl". (Son Luong Ngoc, closes vim/vim#12564)

b46e0f3263

Co-authored-by: Son Luong Ngoc <sluongng@gmail.com>
2023-06-24 20:04:30 +02:00
8182384205 test(extmarks): add a test for #23848 (#24140) 2023-06-24 22:15:13 +08:00
57fda7688b vim-patch:9.0.1659: Termdebug: default highlight cleared if changing colorscheme (#24139)
Problem:    Termdebug: default highlight cleared when changing colorscheme.
Solution:   Use a ColorScheme autocommand. (Christian Brabandt, closes vim/vim#12566,
            closes vim/vim#12555)

279de0cd1f

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-06-24 22:14:57 +08:00
c2d696f009 Merge pull request #24082 from smjonas/fix_24064
fix(filetype): correctly detect bash-fc-{id} files as "sh" (vim-patch:9.0.1644)
2023-06-24 13:41:50 +02:00
31a51acdc3 fix(extmarks): fix heap buffer overflow caused by inline virtual text (#23851)
also fixes an edge case where the extends character would not be drawn if the real text exactly fits the grid.
2023-06-24 11:39:16 +01:00
fa0a25dcb3 fix(lsp): error in reset_timer on second detach #24117
Problem:
On running `zig fmt` manually, the on_lines callback and the
server both detach (for some reason), and both of them call
`clear()`. This fixes it, otherwise the second one to detach
has an error in `reset_timer` since the bufstate doesn't exist

Solution:
* exit early in clear if `bufstates[bufnr]` is nil
* set bufstatte.enabled to true on reload instead of making bufstate nil
2023-06-23 16:33:15 -07:00
46e95909bf ci: introduce CI_LINT option
This will abort if lint programs are not found, and is meant primarily
for the lint job in CI. Supersedes the REQUIRED argument in
add_glob_target as it's a superior replacement by being a built-in
solution.
2023-06-24 00:29:53 +02:00
fdf5013e21 fix(filetype): correctly detect bash-fc-{id} files as "sh" 2023-06-23 18:18:33 +02:00
771dad7a05 vim-patch:9.0.1644: not all filetype file name matches are tested
Problem:    Not all filetype file name matches are tested.
Solution:   Add more file names to test with. (Jonas Strittmatter,
            closes vim/vim#12569)

bd087ae8f0

Co-authored-by: smjonas <jonas.strittmatter@gmx.de>
2023-06-23 18:18:33 +02:00
4dc86477b6 build(luarc.json): disable luadoc-miss-see-name #24108 2023-06-23 04:54:47 -07:00
94a904b453 fix(lsp): reapplying already-applied hints #24114
Problem:
The decoration provider clears the whole buffer then redraws all the hints every
time the window was redrawn. This may lead to an infinite loop.

Solution:
Store the last applied version for a line and only clear and redraw the line if
the buffer version has changed.
2023-06-23 04:49:54 -07:00
3688735c2b fix(cmdline): don't redraw 'tabline' in Ex mode (#24123)
Redrawing of 'statusline' and 'winbar' are actually already inhibited by
RedawingDisabled in Ex mode.

In Vim there is a check for `msg_scrolled == 0` (which is false in Ex
mode) since Vim doesn't have msgsep. Add a `!exmode_active` check here
in Nvim instead.
2023-06-23 06:40:26 +08:00
12c2c16acf feat(lsp): opt-in to dynamicRegistration for inlay hints (#24102)
Since https://github.com/neovim/neovim/pull/23681 there is dynamic
registration support. We should use that for new features unless there
is a good reason to turn it off.
2023-06-22 19:39:57 +02:00
904ad5458d vim-patch:9.0.1645: zserio files are not recognized (#24120)
Problem:    zserio files are not recognized.
Solution:   Add a pattern for zserio files. (Dominique Pellé,
            closes vim/vim#12544)

2b994da57a

Co-authored-by: =?UTF-8?q?Dominique=20Pell=C3=A9?= <dominique.pelle@gmail.com>
2023-06-22 19:38:49 +02:00
f0884f21fa feat(extmarks): support hl_mode "combine" for inline virt_text (#24099) 2023-06-22 20:39:35 +08:00
134b9ec483 feat(lsp): soft deprecate vim.lsp.for_each_buffer_client (#24104)
There is no need for two ways to access all clients of a buffer.

This doesn't add a `vim.deprecate` call yet, as the function is probably
used a lot, but removes it from the documentation and annotates it with
`@deprecated`
2023-06-22 13:54:35 +02:00
2f17ef1fc4 fix(messages): use "Vimscript" instead of "VimL" #24111
followup to #24109
fix #16150
2023-06-22 04:09:14 -07:00
4e6356559c test: spellcheck :help (vimdoc) files #24109
Enforce consistent terminology (defined in
`gen_help_html.lua:spell_dict`) for common misspellings.

This does not spellcheck English in general (perhaps a future TODO,
though it may be noisy).
2023-06-22 03:44:51 -07:00
f4f1ce1d16 fix(extmarks): hide inline virt_text properly with 'smoothscroll' (#24106) 2023-06-22 18:15:04 +08:00
958cc22836 fix(extmarks): empty inline virt_text interfering with DiffText (#24101) 2023-06-22 17:48:53 +08:00
130b8c801a Merge #24087 from justinmk/doc
docs: lsp, fix errors, gen_help_html features
2023-06-22 01:51:20 -07:00
4d3a04279d perf(lsp): remove grouping logic from lsp.status (#24096)
With the title carry-over logic in the `$/progress` handler it's not
necessary to group again in vim.lsp.status
2023-06-22 10:18:49 +02:00
b0cf9c5fee feat(gen_help_html): ignore pi_netrw.txt errors
IDGAF about netrw
2023-06-22 10:18:24 +02:00
81d8fce8f9 feat(gen_help_html): non-default vimdoc.so parser
Callers can specify a non-default vimdoc.so file path.
2023-06-22 10:18:24 +02:00
d931b829e9 fix(docs): vimdoc syntax errors
Since https://github.com/neovim/tree-sitter-vimdoc/pull/97
the many cases of *.foo cause parser errors. But even before that, these
were erroneously highlighted as (argument), so fixing them is good.
2023-06-22 10:18:24 +02:00
5c73b1bb4c docs: lsp, vim_diff
- quickstart
- mark lsp.txt as `new_layout`
- remove lsp-handler documentation for notifications: they don't have
  handlers because they don't have server responses.
2023-06-22 10:18:17 +02:00
a41883bfbe Merge pull request #24098 from zeertzjq/fix-extmark
Fix two extmark bugs
2023-06-22 15:37:32 +08:00
43e76cc346 fix: tostring(vim.version()) fails if build is NIL #24097
Problem:
Since #23925, Version.build may be vim.NIL, which causes tostring() to fail:
    E5108: Error executing lua E5114: Error while converting print argument #1: …/version.lua:129:
    attempt to concatenate field 'build' (a userdata value)
    stack traceback:
            [C]: in function 'print'
            [string ":lua"]:1: in main chunk

Solution:
Handle vim.NIL in Version:__tostring().
2023-06-22 00:36:38 -07:00
a9cd8467cb fix(api): wrong nvim_buf_set_extmark error for invalid hl_mode 2023-06-22 15:04:46 +08:00
0534ad8ca5 fix(extmarks): empty inline virt_text interfering with Visual highlight 2023-06-22 15:04:46 +08:00
08db61b19b feat(man): respect 'wrapmargin' when wrapping man pages (#24091) 2023-06-21 14:42:23 -05:00
e27377e33e Merge #24086 LSP ctx.version, report full Nvim version 2023-06-21 03:36:39 -07:00
59048814fd docs(lsp): mention ctx.version
Since 643546b82b the request handler
context (`ctx`) includes a `version` field.
2023-06-21 12:32:54 +02:00
ded01a819a fix(folds): don't show search or match highlighting on fold (#24084) 2023-06-21 18:28:12 +08:00
21b074feb0 refactor(lsp): report full Nvim version string in clientInfo 2023-06-21 12:16:26 +02:00
8d4a53fe6e fix(vim.json)!: remove global options, "null", "array_mt" #24070
Problem:
- `vim.json` exposes various global options which:
  - affect all Nvim Lua plugins (especially the LSP client)
  - are undocumented and untested
  - can cause confusing problems such as: cc76ae3abe
- `vim.json` exposes redundant mechanisms:
  - `vim.json.null` is redundant with `vim.NIL`.
  - `array_mt` is redundant because Nvim uses a metatable
    (`vim.empty_dict()`) for empty dict instead, which `vim.json` is
    configured to use by default (see `as_empty_dict`).
    Example:
    ```
    :lua vim.print(vim.json.decode('{"bar":[],"foo":{}}'))
    --> { bar = {},  foo = vim.empty_dict() }
    ```
    Thus we don't need to also decorate empty arrays with `array_mt`.

Solution:
Remove the functions from the public vim.json interface.
Comment-out the implementation code to minimize drift from upstream.

TODO:
- Expose the options as arguments to `vim.json.new()`
2023-06-21 01:10:32 -07:00
e42fdaad21 fix(lsp): add spacing for inlay hints separately #24079
Problem:
Spacing around inlay hints has the same highlight as the hint itself.
The LSP spec for inlay hints specifically mentions the padding should not be
coloured:

    /**
    Render padding before the hint.
    Note: Padding should use the editor's background color, not the
    background color of the hint itself. That means padding can be used
    to visually align/separate an inlay hint.
    */
    paddingLeft?: boolean;
    /**
    Render padding after the hint.
    Note: Padding should use the editor's background color, not the
    background color of the hint itself. That means padding can be used
    to visually align/separate an inlay hint.
    */
    paddingRight?: boolean;

Solution:
Add the space as separate parts of the virtual text, don't add the space to the
text itself.
2023-06-21 00:55:19 -07:00
1b679ac192 fix(lsp): define LspInlayHint highlight group #24073
fixes #24068

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2023-06-21 00:33:56 -07:00
3bf887f6e0 fix(lsp): always return boolean in lsp.buf_client_attach (#24077)
Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2023-06-20 21:17:13 +02:00
1f0b2dc6cd Merge pull request #24069 from famiu/refactor/options/varp
refactor(option): use `void *` for pointer to option value
2023-06-20 19:33:11 +02:00
d3e0352574 fix(lsp): check if inlay hints are enabled for a buffer before disabling (#24074)
disabling before enabling throws an error otherwise, because bufstate[bufnr]
doesn't exist
2023-06-20 18:36:31 +02:00
64f2691a98 refactor(lsp): extract common execute command functionality (#24065) 2023-06-20 18:36:18 +02:00
3681b7bb3b refactor(option): use void * for pointer to option value
Option related code uses `char *` for pointer to option value, which is not the best way of representing a type-agnostic pointer.

Solution: Make pointers to option value use `void *` instead.
2023-06-20 20:38:15 +06:00
19eef8156b docs(lsp): LspInlayHint highlight group #24071 2023-06-20 03:20:17 -07:00
96b94f8d77 fix(lsp): duplicate on_detach, on_reload callbacks #24067
M.enable already clears bufstate[bufnr] and the namespace,
the duplicate callbacks cause an error (indexing bufstate[bufnr] fails)
2023-06-20 02:36:06 -07:00
ca5de9306c feat(lsp): inlay hints #23984
Add automatic refresh and a public interface on top of #23736

 * add on_reload, on_detach handlers in `enable()` buf_attach, and
  LspDetach autocommand in case of manual detach
* unify `__buffers` and `hint_cache_by_buf`
* use callback bufnr in `on_lines` callback, bufstate: remove __index override
* move user-facing functions into vim.lsp.buf, unify enable/disable/toggle

Closes #18086
2023-06-19 23:06:54 -07:00
72a6643b13 docs #24061
- nvim requires rpc responses in reverse order. https://github.com/neovim/neovim/issues/19932
- NVIM_APPNAME: UIs normally should NOT set this.

ref #23520
fix #24050
fix #23660
fix #23353
fix #23337
fix #22213
fix #19161
fix #18088
fix #20693
2023-06-19 08:40:33 -07:00
91f57723ad Merge pull request #24063 from bfredl/ceci-nest-pas-rtp
fix(docs): the runtimepath is not the runtime path
2023-06-19 16:14:28 +02:00
0d149bb186 fix(docs): the runtimepath is not the runtime path 2023-06-19 14:43:36 +02:00
dcf8a71b85 docs: deprecation policy #23138 2023-06-19 03:43:32 -07:00
cee981bf09 docs #22363
Co-authored by: zeertzjq <zeertzjq@outlook.com>
Co-authored by: Steven Todd McIntyre II <114119064+stmii@users.noreply.github.com>
Co-authored by: nobe4 <nobe4@users.noreply.github.com>

- docs: mention --luadev-mod to run with lua runtime files
  When changing a lua file in the ./runtime folder, a new contributor
  might expect changes to be applied to the built Neovim binary.
2023-06-19 02:24:44 -07:00
8c9dab3e0d fix(treesitter): use vim.highlight.priorities instead of hardcoded 100 (#24052)
Problem: Treesitter highlighting base priority cannot be customized.

Solution: Use `vim.highlight.priorities.treesitter` instead of hard-coded value.
2023-06-18 16:42:17 +02:00
8a7e3353eb fix(fs): make normalize() work with '/' path (#24047)
Problem: Current implementation of "remove trailing /" doesn't
account for the case of literal '/' as path.
Solution: Remove trailing / only if it preceded by something else.

Co-authored by: notomo <notomo.motono@gmail.com>
2023-06-18 06:49:33 -05:00
7e301ed5b9 vim-patch:9.0.1638: crypt tests hang and cause memory errors (#24053)
Problem:    crypt tests hang and cause memory errors
Solution:   Move variable to start of function.

438d0c5e58

N/A patches for version.c:

vim-patch:9.0.1639: build failure without the crypt feature

Problem:    Build failure without the crypt feature.
Solution:   Adjust #ifdefs

bc385a150f

vim-patch:9.0.1640: compiler warning for unused variables without crypt feature

Problem:    Compiler warning for unused variables without the crypt feature.
Solution:   Adjust #ifdefs

7f29122c8c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-18 07:08:31 +08:00
c07dceba33 fix(lsp): allow Lua pattern chars in code action filter (#24041)
Previously, filtering code actions with the "only" option failed
if the code action kind contained special Lua pattern chars such as "-"
(e.g. the ocaml language server supports a "type-annotate" code action).

Solution: use string comparison instead of string.find
2023-06-17 08:01:31 +02:00
4e63104c47 vim-patch:9.0.1637: compiler warning for uninitialized variable (#24042)
Problem:    Compiler warning for uninitialized variable.
Solution:   Move the variable to an inner block and initialize it. (Christian
            Brabandt, closes vim/vim#12549)

54f50cbf6a

The "eof" variable is not present in Nvim because it is only used by
FEAT_CRYPT.

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-06-17 06:23:07 +08:00
8376e8700b Merge pull request #24037 from zeertzjq/vim-9.0.1634
vim-patch:9.0.{1634,1635}: message is cleared when removing mode message
2023-06-16 09:20:41 +08:00
11060793d6 vim-patch:9.0.1635: error message is cleared when removing mode message
Problem:    Error message is cleared when removing mode message.
Solution:   Also reset flags when the message is further down.

da51ad51bf

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-16 08:55:05 +08:00
cba07dad49 vim-patch:9.0.1634: message is cleared when removing mode message
Problem:    Message is cleared when removing mode message (Gary Johnson).
Solution:   Do not clear the command line after displaying a message.

800cdbb7ca

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-16 08:55:03 +08:00
ddba917efe vim-patch:9.0.1636: expanding a pattern interferes with cmdline completion (#24034)
Problem:    Expanding a pattern interferes with command line completion.
Solution:   Set the file index only when appropriate. (closes vim/vim#12519)

094dd152fe
2023-06-16 07:02:21 +08:00
1f8fb7c000 fix(:let): fix error when applying operator to boolean option (#24030) 2023-06-15 12:36:21 +08:00
d81f78713b test(decorations_spec): add test for extmark case of #21486 (#24028) 2023-06-15 11:14:50 +08:00
a05bbc60ea fix(extmarks): don't position overlay virt_text halfway a char (#24027) 2023-06-15 09:03:39 +08:00
78d77c03de vim-patch:9.0.1631: passing wrong variable type to option gives multiple errors (#24026)
Problem:    Passing a wrong variable type to an option gives multiple errors.
Solution:   Bail out early on failure. (closes vim/vim#12504)

4c7cb372c1
2023-06-15 08:05:26 +08:00
cf6cffda89 docs(ex_cmds): migration from "behave xterm" #24024 2023-06-14 15:23:15 -07:00
bbb934e775 vim-patch:9.0.1629: having utf16idx() rounding up is inconvenient (#24019)
Problem:    Having utf16idx() rounding up is inconvenient.
Solution:   Make utf16idx() round down. (Yegappan Lakshmanan, closes vim/vim#12523)

95707037af

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-06-14 20:54:11 +08:00
79a5b89d66 perf(lsp): reduce polling handles for workspace/didChangeWatchedFiles (#23500)
Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2023-06-14 12:40:11 +02:00
0ce065a332 fix(tui): v:argv does not report the original argv[0] #24015
Problem:
Since TUI was moved to another process 2448816956
v:argv and v:progname don't report the original argv[0].
    ["/usr/bin/nvim", "--embed", ...]

Solution:
Use argv[0] instead of VV_PROGPATH in ui_client_start_server().
Fix #23953
2023-06-14 02:39:14 -07:00
bc67bbe446 fix(codelens): add buffer and line checks before displaying codelens (#23887)
Co-authored-by: Rohit Sukumaran <rohit.sukumaran@kredx.com>
2023-06-13 16:17:35 +01:00
91f67fabe6 fix(lsp): handle stale bufnr on LspRequest autocmd trigger (#24013)
Fixes a `Invalid buffer id: 123` race when the buffer gets deleted before
the callback triggered.

Alternative to https://github.com/neovim/neovim/pull/23981
2023-06-13 16:53:13 +02:00
a9968912b7 fix(api): redundant error when using nvim_cmd (#24010)
`nvim_cmd` shows multiple errors when attempting to edit another buffer
through a command when `curbuf->b_ro_locked` is set. This PR fixes that
by removing a redundant error in `execute_cmd`.
2023-06-13 13:55:20 +01:00
4c7cec4e29 fix(extmarks): handle inline virt_text with empty chunk (#24005) 2023-06-13 11:30:19 +08:00
a7e5d4238a vim-patch:8.2.4600: Vim9: not enough test coverage for executing :def function (#24001)
Problem:    Vim9: not enough test coverage for executing :def function.
Solution:   Add a few more tests.  Fix inconsistencies.

6b8c7ba062

Cherry-pick a blank line in test_listdict.vim from patch 8.2.3842.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 21:58:40 +08:00
564d2d20a3 Merge pull request #24000 from zeertzjq/vim-8.2.3332
vim-patch:8.2.{3332,3338}
2023-06-12 21:33:24 +08:00
d86acfa149 vim-patch:8.2.3338: Vim9: no type check when assigning a list range
Problem:    Vim9: no type check when assigning a list range. (Naohiro Ono)
Solution:   Check the member type. (closes vim/vim#8750)

89071cb6a1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 21:05:56 +08:00
aa92a04bee vim-patch:8.2.3332: Vim9: cannot assign to range in list
Problem:    Vim9: cannot assign to range in list.
Solution:   Implement overwriting a list range.

4f0884d6e2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 21:05:22 +08:00
0eb02ea90a docs: various clarifications (#23999)
Close #18907
Close #20314
Close #23749
2023-06-12 20:08:08 +08:00
758c418d12 Merge pull request #23998 from zeertzjq/vim-8.2.3852
vim-patch:8.2.{3852,3853}
2023-06-12 18:46:35 +08:00
aa7c4b88dc vim-patch:8.2.3853: Vim9: not enough tests
Problem:    Vim9: not enough tests.
Solution:   Run more existing tests for Vim9 script.

700e6b1662

Cherry-pick test_listdict.vim change from patch 8.2.3854.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 18:17:40 +08:00
d83a196716 vim-patch:8.2.3852: Vim9: not enough tests
Problem:    Vim9: not enough tests.
Solution:   Also run existing tests for Vim9 script.  Make errors more
            consistent.

f47c5a8e2d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 18:14:20 +08:00
b867f6c7c5 Merge pull request #23996 from zeertzjq/vim-8.2.3191
vim-patch:8.2.{2533,3191,3202,partial:3335}
2023-06-12 17:50:34 +08:00
4058f95d9d vim-patch:partial:8.2.3335: Vim9: not enough tests run with Vim9
Problem:    Vim9: not enough tests run with Vim9.
Solution:   Run a few more tests in Vim9 script and :def function.  Fix that
            items(), keys() and values9) return zero for a NULL dict.
            Make join() return an empty string for a NULL list.  Make sort()
            return an empty list for a NULL list.

ef98257593

Skip f_reverse() change for consistency with other functions.
Skip Test_null_list() and Test_null_dict() because of missing patches.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 17:20:55 +08:00
8d8ac15ed9 vim-patch:8.2.3202: Vim9: tests are only executed for legacy script
Problem:    Vim9: tests are only executed for legacy script.
Solution:   Run more tests also for Vim9 script.  Fix uncovered problems.

5dd839ce20

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 17:20:55 +08:00
a73118df0e vim-patch:8.2.3191: Vim9: not enough code is tested
Problem:    Vim9: not enough code is tested.
Solution:   Use CheckLegacyAndVim9Success() in more places.  Fix uncovered
            problems.

63cb6567f0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 17:20:55 +08:00
a0cb53eca7 vim-patch:8.2.2533: Vim9: cannot use a range with :unlet
Problem:    Vim9: cannot use a range with :unlet.
Solution:   Implement ISN_UNLETRANGE.

5b5ae29bd3

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 17:20:55 +08:00
551cc3a2a3 Merge pull request #23995 from zeertzjq/vim-8.2.1524
vim-patch:8.2.{1524,2948,2949}: Float to String conversion
2023-06-12 14:41:19 +08:00
41ee7bc7db test(unit/eval/typval_spec): adjust for Float to String conversion
Adjust relevant Lua tests. Refactor testing logic for tv_get_string_*
functions into test_string_fn().

Note that vim_snprintf(), which is used for stringifying floats, always
calls xfree(tofree), even if tofree is NULL, so we need to expect that
in the alloc log.
2023-06-12 14:08:27 +08:00
7abfb1f86e vim-patch:8.2.2949: tests failing because no error for float to string conversion
Problem:    Tests failing because there is no error for float to string
            conversion.
Solution:   Change the check for failure to check for correct result.  Make
            some conversions strict in Vim9 script.

3cfa5b16b0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 13:27:16 +08:00
1ffd20a26e test(unit/eval/typval_spec): don't dereference NULL last_msg_hist
If last_msg_hist is NULL, check_emsg will cause the running test process
to SIGSEGV from trying to access the msg member.
2023-06-12 13:27:16 +08:00
7f8c1e53a6 vim-patch:8.2.2948: substitute() accepts a number but not a float expression
Problem:    Substitute() accepts a number but not a float expression.
Solution:   Also accept a float. (closes vim/vim#8331)

7a2217bedd

Vim9script is N/A. No need to port the strict argument and
tv_get_string_buf_chk_strict(), as it's only used for Vim9script.

Like the patch, use vim_snprintf over snprintf, as the "%g" specifier in
snprintf removes the ".0" from integer floats.

This means similiar to numbers, floats are (mostly) convertable to
strings.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 13:27:07 +08:00
c690f10194 vim-patch:8.2.1524: no longer get an error for string concatenation with float
Problem:    No longer get an error for string concatenation with float.
            (Tsuyoshi Cho)
Solution:   Only convert float for Vim9 script. (closes vim/vim#6787)

2e0866128b

Vim9script is N/A.

Required for v8.2.2949.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 13:27:04 +08:00
3c4890d1ef test(old): reorder test_substitute.vim to match upstream (#23994) 2023-06-12 11:44:01 +08:00
6e1fa16dde Merge #23954 vim.version() returns Version object 2023-06-11 16:32:37 -07:00
e688793253 feat: tostring(vim.version())
Problem:
tostring(vim.version()) returns "table: 0x…".

Solution:
Modify vim.version() to return a string prerelease instead of a boolean.

Fix #23863
2023-06-12 01:14:33 +02:00
d3b9feccb3 docs: fix vim.tbl_get type annotations #23992 2023-06-11 15:48:13 -07:00
ecdb6465e2 feat: vim.version() returns a Version object
- vim.version() returns a Version object.
  Makes it printable and removes the need of workarounds when passing it
  to other vim.version methods.
2023-06-12 00:09:10 +02:00
46fab3831b refactor: remove WINGUI_URL
nvim-qt was removed in 0370e4def0
2023-06-12 00:06:30 +02:00
199a990c9e feat: report "build" in vim.version() #23925
Problem:
Nvim version string typically has a "build" component
but vim.version() doesn't report it.

Solution:
Add the "build" field to vim.version().

Closes #23863
2023-06-11 14:57:23 -07:00
385a1facf2 docs: semantic token methods in :h lsp-method #23991 2023-06-11 14:48:57 -07:00
ceb37ff1d8 refactor(treesitter): use npcall in _query_linter.lua #23985 2023-06-11 14:46:22 -07:00
bde59e8147 fix(remote): restore previous --remote-expr output formatting (#23988)
- Use tostring() as that's what print() uses internally.
- Do not append trailing new line.
2023-06-11 22:12:32 +08:00
dcb341315a Merge pull request #23968 from figsoda/bundle
build(nix): use the correct versions of the bundled treesitter parsers
2023-06-11 15:38:30 +02:00
72de8fdeeb vim-patch:f1dcd14fc5d4 (#23986)
Update runtime files

f1dcd14fc5

:autocmd-block is N/A (Vim9 script)

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-11 20:04:59 +08:00
473a216a21 vim-patch:10e8ff9b2607 (#23977)
Update runtime files

10e8ff9b26

Also:
- fix a missing `<` in builtin.txt.
- edit `:function` `{name}` wording to match the change made for the docs above
  by Justin in #10619.
- link to `*vimrc*` rather than `*init.vim*` in repeat.txt change (as `init.lua`
  may also be used).

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-11 12:40:22 +01:00
643546b82b feat(lsp): add handlers for inlay hints (#23736)
initial support; public API left for a follow-up PR
2023-06-11 11:53:37 +02:00
cce9460524 fix(remote): make --remote-expr print to stdout (#23980) 2023-06-11 15:29:51 +08:00
4229bbe514 fix(helptags): make multibyte help tags work properly (#23975) 2023-06-11 12:23:11 +08:00
2237b384e4 vim-patch:9.0.1626: Visual area not shown when using 'showbreak' (#23978)
Problem:    Visual area not shown when using 'showbreak' and start of line is
            not visible. (Jaehwang Jung)
Solution:   Adjust "fromcol" for the space taken by 'showbreak'.
            (closes vim/vim#12514)

f578ca2c8f

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-11 11:29:39 +08:00
302d3cfb96 feat(lua): use callable table as iterator in vim.iter (#23957)
A table passed to `vim.iter` can be a class instance with a `__call`
implementation for the iterator protocol.
2023-06-10 20:33:23 +02:00
b302da9ad2 fix(lsp): use percentage format on lsp.status (#23971) 2023-06-10 20:32:41 +02:00
c53953b400 ci: add runner image version to cache key
This will ensure the cache isn't used when an image upgrade changes the
compiler version, causing the build to fail.
2023-06-10 16:36:37 +02:00
b6d2f49b45 test: more tests for nvim_{set,del}_keymap with abbreviation (#23970) 2023-06-10 10:44:31 +08:00
7154f0c986 docs: fix typos (#23917) 2023-06-10 09:37:05 +08:00
5959b3c922 vim-patch:9.0.1622: filetype name t32 is a bit obscure (#23967)
Problem:    Filetype name t32 is a bit obscure.
Solution:   Rename t32 to trace32. (Christoph Sax, closes vim/vim#12512)

740df76c90

Co-authored-by: Christoph Sax <christoph.sax@mailbox.org>
2023-06-09 23:48:31 +02:00
8df3381202 build(nix): use the correct versions of the bundled treesitter parsers 2023-06-09 16:51:26 -04:00
9eef2b111d build(nix): update flake.lock
Flake lock file updates:

• Updated input 'flake-utils':
    'github:numtide/flake-utils/5aed5285a952e0b949eb3ba02c12fa4fcfef535f' (2022-11-02)
  → 'github:numtide/flake-utils/a1720a10a6cfe8234c0e93907ffe81be440f4cef' (2023-05-31)
• Added input 'flake-utils/systems':
    'github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e' (2023-04-09)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/abe7316dd51a313ce528972b104f4f04f56eefc4' (2023-04-14)
  → 'github:nixos/nixpkgs/a64b73e07d4aa65cfcbda29ecf78eaf9e72e44bd' (2023-06-08)
2023-06-09 16:51:10 -04:00
aaec9cdd85 Merge pull request #23803 from bfredl/luaabbr
feat(api): support abbreviations in nvim_set_keymap
2023-06-09 22:00:03 +02:00
42bbc4fabc feat(api): support abbreviations in nvim_set_keymap
closes #19198
2023-06-09 21:25:43 +02:00
49019da86e vim-patch:9.0.1621: FILETYPE_FILE is defined to the same value multiple times (#23965)
Problem:    FILETYPE_FILE is defined to the same value multiple times.  Same
            for a few similar macros.
Solution:   Define FILETYPE_FILE and others in feature.h only

c81dfaa69c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-09 21:30:29 +08:00
106922898a vim-patch:9.0.1617: charidx() result is not consistent with byteidx() (#23963)
Problem:    charidx() and utf16idx() result is not consistent with byteidx().
Solution:   When the index is equal to the length of the text return the
            lenght of the text instead of -1. (Yegappan Lakshmanan,
            closes vim/vim#12503)

577922b917

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-06-09 17:43:46 +08:00
e5e0bda41b feat(lsp)!: add vim.lsp.status, client.progress and promote LspProgressUpdate (#23958)
`client.messages` could grow unbounded because the default handler only
added new messages, never removing them.

A user either had to consume the messages by calling
`vim.lsp.util.get_progress_messages` or by manually removing them from
`client.messages.progress`. If they didn't do that, using LSP
effectively leaked memory.

To fix this, this deprecates the `messages` property and instead adds a
`progress` ring buffer that only keeps at most 50 messages. In addition
it deprecates `vim.lsp.util.get_progress_messages` in favour of a new
`vim.lsp.status()` and also promotes the `LspProgressUpdate` user
autocmd to a regular autocmd to allow users to pattern match on the
progress kind.

Also closes https://github.com/neovim/neovim/pull/20327
2023-06-09 11:32:43 +02:00
f31dba93f9 vim-patch:9.0.1620: Nix files are not recognized from the hashbang line (#23961)
Problem:    Nix files are not recognized from the hashbang line.
Solution:   Add a hashbang check. (issue vim/vim#12507)

19548c6a74

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-09 08:59:28 +02:00
be539f5fa8 vim-patch:9.0.1618: Trace32 files are not recognized (#23960)
Problem:    Trace32 files are not recognized.
Solution:   Add patterns for the t32 filetype. (Christoph Sax, closes vim/vim#12505)

7fbcee6f92

Co-authored-by: Christoph Sax <christoph.sax@mailbox.org>
2023-06-08 21:53:16 +02:00
7c661207cc feat(lua): add ringbuffer (#22894)
https://en.wikipedia.org/wiki/Circular_buffer
2023-06-08 12:11:24 +02:00
38b0bb3c93 vim-patch:9.0.1616: quickfix text field is truncated (#23951)
Problem:    Quickfix text field is truncated.
Solution:   Fix output of text field after pattern field in quickfix buffer.
            (Shane Harper, closes vim/vim#12498)

5bf042810b

Co-authored-by: Shane Harper <shane@shaneharper.net>
2023-06-08 07:03:22 +08:00
0329f5c2f4 vim-patch:9.0.1615: URL shortcut files are not recognized (#23950)
Problem:    URL shortcut files are not recognized.
Solution:   Add a pattern for URL shortcut files. (closes vim/vim#12474)

cdb7b4c508

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-06-07 20:53:02 +02:00
c0952e62fd feat(lua): add vim.system()
feat(lua): add vim.system()

Problem:

  Handling system commands in Lua is tedious and error-prone:
  - vim.fn.jobstart() is vimscript and comes with all limitations attached to typval.
  - vim.loop.spawn is too low level

Solution:

  Add vim.system().
  Partly inspired by Python's subprocess module
  Does not expose any libuv objects.
2023-06-07 13:52:23 +01:00
4ecc71f6fc fix(lsp): reduce diagnostics and add more types (#23948) 2023-06-07 13:39:41 +01:00
0381f5af5b feat(diff): grouping optimization for linematch algorithm 2023-06-07 13:29:23 +01:00
5f4895200a feat(scripts): add lsp_types.lua (#23750) 2023-06-07 12:32:39 +01:00
a217675a67 refactor(options): use slash separator for option_get_valid_types() (#23945)
`option_get_valid_types()` currently uses a comma separator for
multi-type options which does not fit well with the changed error
message for invalid option value type. A slash seperator is much more
suited for its current use-case.
2023-06-07 10:51:24 +08:00
fcaf0d5f38 Merge pull request #23943 from zeertzjq/autocmd-fname
fix(events): don't expand non-file as file name
2023-06-07 10:17:19 +08:00
dd24ea8195 fix(events): don't expand non-file as file name 2023-06-07 09:49:17 +08:00
971049f318 revert: "refactor: eliminate autocmd_fname_full global"
This reverts commit 82cd0be2ea.
2023-06-07 09:26:46 +08:00
0e0a166a0c refactor(api): adjust errors for setting options (#23942) 2023-06-07 09:00:55 +08:00
b3d5138fd0 refactor(options): remove getoption_T and introduce OptVal (#23850)
Removes the `getoption_T` struct and also introduces the `OptVal` struct
to unify the methods of getting/setting different option value types.
This is the first of many PRs to reduce code duplication in the Vim
option code as well as to make options easier to maintain. It also
increases the flexibility and extensibility of options. Which opens the
door for things like Array and Dictionary options.
2023-06-07 08:05:16 +08:00
0370e4def0 build!: remove neovim qt
Neovim QT was originally bundled on Windows as a response to the then
lackluster terminal options. The situation has dramatically changed,
with viable options such as Windows terminal, Alacritty and Wezterm to
name a few. The Windows build no longer needs this special treatment for
neovim to be usable.

Pros:
  - Release builds will be smaller.
  - Less maintenance burden.
  - Clearer separation of responsibility (neovim issues go to the neovim
    repo and neovim-qt issues to the neovim-qt repo).
  - More consistent treatment between platforms.

Cons:
  - Users who've come to expect neovim-qt to be bundled with nvim will
    need to adjust and download neovim-qt from
    https://github.com/equalsraf/neovim-qt instead.
  - Similarly, build scripts will need to be adjusted to reflect this
    change.

Closes https://github.com/neovim/neovim/issues/21209.
2023-06-06 19:19:00 +02:00
fcfe535e98 refactor(defaults): do not use C specific default values for options (#22500)
The options 'path', 'include', and 'define' all use C-specific default
values. This may have made sense a long time ago when Vim was mostly
used just for writing C, but this is no longer the case, and we have
ample support for filetype specific configuration. Make the default
values of these options empty and move the C-specific values into a
filetype plugin where they belong.

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-06-06 11:26:29 -05:00
4382d2ed56 feat(health): fold successful healthchecks #22866
Problem:
checkhealth can be noisy, but we don't want to omit info.

Solution:
Fold OK results by default, if 'foldenable' is enabled.
Resolves #22796
2023-06-06 08:42:26 -07:00
9d9af4fe27 vim-patch:9.0.1614: strlen() called too often for :spellrepall (#23940)
Problem:    strlen() called too often for :spellrepall.
Solution:   Store the result in a variable. (closes vim/vim#12497)

59f7038536
2023-06-06 23:31:29 +08:00
c48b1421af refactor!: rename "playground" => "dev" #23919
Problem:
"playground" is new jargon that overlaps with existing concepts:
"dev" (`:help dev`) and "view" (also "scratch" `:help scratch-buffer`) .

Solution:
We should consistently use "dev" as the namespace for where "developer
tools" live. For purposes of a "throwaway sandbox object", we can use
the name "view".
- Rename `TSPlayground` => `TSView`
- Rename `playground.lua` => `dev.lua`
2023-06-06 08:23:20 -07:00
175e5c8b96 refactor(api): remove BOOL macro #23936
Remove redundant `BOOL` macro that does the same thing as `BOOLEAN_OBJ`.
2023-06-06 07:18:55 -07:00
ca887b80a9 fix: version-range < and <= #23539
vim.version.range() couldn't parse them correctly.
For example, vim.version.range('<0.9.0'):has('0.9.0') returned `true`.

fix: range:has() accepts vim.version()
So that it's possible to compare a range with:

    vim.version.range(spec):has(vim.version())
2023-06-06 06:38:45 -07:00
f5d12889e8 refactor: adjust headers according to the style guide (#23934)
System headers should be included first to prevent naming conflicts.
2023-06-06 20:00:32 +08:00
7b973c71ea fix(statusline): redraw when VIsual_mode changes (#23933) 2023-06-06 19:24:42 +08:00
981acc2922 fix(ui): propagate line wrapping state on grid_line events
This fixes the TUI's line-wrapping behavior, which was broken with the
migration to the msgpack-based UI protocol (see
https://github.com/neovim/neovim/issues/7369#issuecomment-1571812273).
2023-06-05 22:34:55 -07:00
780ab11b90 vim-patch:partial:8.2.4950: text properties position wrong after shifting text (#23930)
Problem:    Text properties position wrong after shifting text.
Solution:   Adjust the text properties when shifting a block of text.
            (closes vim/vim#10418)

4b93674159

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-06-06 11:15:27 +08:00
eceb2dffce fix(spell): splice extmarks on :spellrepall (#23929) 2023-06-06 10:32:30 +08:00
43f3209b07 vim-patch:9.0.1613: some make output gets picked up by 'errorformat' (#23926)
Problem:    Some make output gets picked up by 'errorformat'.
Solution:   Ignore make output by default. (Gregory Anders, closes vim/vim#12481)

d1911a8e2b
2023-06-05 20:36:21 -05:00
9deef1aa22 vim-patch:9.0.1612: "skipcol" not reset when using multi-byte characters (#23928)
Problem:    "skipcol" not reset when using multi-byte characters.
Solution:   Compare with w_virtcol instead of w_cursor.col. (closes vim/vim#12457)

15d4747ffd

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-06 07:13:08 +08:00
30e9ddfd05 Merge pull request #23927 from zeertzjq/vim-9.0.1603
vim-patch:9.0.{1603,1610}: display wrong if scrolling multiple lines with 'smoothscroll'
2023-06-06 06:59:48 +08:00
fc908b5006 vim-patch:9.0.1610: display is wrong when 'smoothscroll' is set
Problem:    Display is wrong when 'smoothscroll' is set and scrolling multiple
            lines.
Solution:   Redraw with UPD_NOT_VALID when "skipcol" is or was set.
            (closes vim/vim#12490, closes vim/vim#12468)

d9a92dc70b
2023-06-06 06:37:27 +08:00
9978a9996d vim-patch:9.0.1603: display wrong if scrolling multiple lines with 'smoothscroll'
Problem:    Display wrong when scrolling multiple lines with 'smoothscroll'
            set.
Solution:   Redraw when w_skipcol changed. (closes vim/vim#12477, closes vim/vim#12468)

3c80227760
2023-06-06 06:37:23 +08:00
c1ee187f82 fix: vim.loop in luv threads (#23924)
Fixes #23914
2023-06-05 19:08:01 +01:00
cbbda3bcd7 fix(editorconfig): check that buffer is valid (#23922)
Fixes: https://github.com/neovim/neovim/issues/23921
2023-06-05 11:53:13 -05:00
f959753e5c vim-patch:9.0.1608: update_topline() is called twice (#23920)
Problem:    update_topline() is called twice.
Solution:   Do not call update_topline() before curs_columns(). (Luuk van
            Baal, closes vim/vim#12495)

5c606846b9
2023-06-05 22:45:33 +08:00
ca26ec3438 fix(lsp): use only utf-16 in default client positionEncodings (#23903)
The Nvim client does not yet support multiple offset encodings for
clients in the same buffer. Until it does, stick to utf-16 by default.
2023-06-05 08:21:23 -05:00
21187e1c73 defaults: shortmess+=C #23907
Problem:
Completion messages such as "scanning tags" are noisy and generally not
useful on most systems. Most users probably aren't aware that this is
configurable.

Solution:
Set `shortmess+=C`.
2023-06-05 02:19:05 -07:00
a3fba5cafc fix(mouse): handle folded lines with virt_lines attached to line above (#23912) 2023-06-05 17:11:58 +08:00
16561dac39 test(core/startup_spec): add a test for #13720 (#23910) 2023-06-05 14:09:25 +08:00
416fe8d185 refactor(lsp): use LPeg for watchfiles matching (#23788) 2023-06-05 07:19:31 +02:00
3c6d971e54 fix(lsp): set extra info only when it has a value (#23868) 2023-06-05 07:17:38 +02:00
cc41697775 Merge pull request #23908 from zeertzjq/vim-9.0.1600
vim-patch:9.0.{1600,1607}: screenpos() fixes
2023-06-05 09:19:09 +08:00
7955c90621 fix(plines): folded lines with virt_lines attached to line above 2023-06-05 08:45:32 +08:00
57fef392d2 vim-patch:9.0.1607: screenpos() returns wrong row with diff filler lines
Problem:    screenpos() returns wrong row with diff filler lines.
Solution:   Only add filler lines when appropriate.  Also don't add the
            'smoothscroll' marker when w_skipcol is zero. (closes vim/vim#12485,
            closes vim/vim#12484)

55daae3921
2023-06-05 07:49:44 +08:00
49ede0a68f vim-patch:9.0.1600: screenpos() does not take w_skipcol into account
Problem:    screenpos() does not take w_skipcol into account.
Solution:   Subtract w_skipcol from column. (closes vim/vim#12486, closes vim/vim#12476)

f0e68c0e2a
2023-06-05 07:49:44 +08:00
5282d3299c fix(lsp): restore marks after apply_text_edits() #14630
PROBLEM:
Whenever any text edits are applied to the buffer, the `marks` part of those
lines will be lost. This is mostly problematic for code formatters that format
the whole buffer like `prettier`, `luafmt`, ...

When doing atomic changes inside a vim doc, vim keeps track of those changes and
can update the positions of marks accordingly, but in this case we have a whole
doc that changed. There's no simple way to update the positions of all marks
from the previous document state to the new document state.

SOLUTION:
* save marks right before `nvim_buf_set_lines` is called inside `apply_text_edits`
* check if any marks were lost after doing `nvim_buf_set_lines`
* restore those marks to the previous positions

TEST CASE:
* have a formatter enabled
* open any file
* create a couple of marks
* indent the whole file to the right
* save the file
Before this change: all marks will be removed.
After this change: they will be preserved.

Fixes #14307
2023-06-04 16:45:01 -07:00
67827edeef vim-patch:9.0.1606: using freed memory when 'foldcolumn' is set (#23906)
Problem:    Using freed memory when 'foldcolumn' is set.
Solution:   Save extra pointer to free it later. (closes vim/vim#12492)

58e1e01045
2023-06-05 06:58:14 +08:00
fdc8e966a9 fix(ui): don't send empty grid_line with redrawdebug=compositor (#23899) 2023-06-04 10:49:02 +08:00
700cab0068 fix(events)!: trigger CursorMoved later on switching window (#23711) 2023-06-04 09:09:22 +08:00
96e19533f6 feat(lsp): set kind in select call for codelens #23889 2023-06-03 18:03:25 -07:00
53f30de2be vim-patch:9.0.1602: stray character visible if marker on top of double-wide char (#23897)
Problem:    Stray character is visible if 'smoothscroll' marker is displayed
            on top of a double-wide character.
Solution:   When overwriting a double-width character with the 'smoothscroll'
            marker clear the second half. (closes vim/vim#12469)

ecb87dd7d3
2023-06-04 07:39:05 +08:00
0a439e3863 vim-patch:9.0.1601: filetype detection fails for *.conf file without comments (#23896)
Problem:    Filetype detection fails for *.conf file without comments.
            (Dmitrii Tcyganok)
Solution:   Use "conf" filetype as a fallback for an empty .conf file.
            (closes vim/vim#12487, closes vim/vim#12483)

664fd12aa2

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-06-04 00:39:46 +02:00
72300feecf Merge pull request #23864 from folke/nvim_win_set_height
fix(api): dont change curwin for nvim_win_set_height
2023-06-03 18:12:24 +02:00
0e01e81552 fix(folds): allow overlay virtual text on folded line (#23892)
Also always check for fi_level before fi_lines.
2023-06-03 18:44:08 +08:00
40db569014 perf(iter): make ListIter.totable more efficient (#23714) 2023-06-03 12:06:10 +02:00
2db719f6c2 feat(lua): rename vim.loop -> vim.uv (#22846) 2023-06-03 12:06:00 +02:00
c65e2203f7 docs(iter): add emmylua type to iter module (#23845) 2023-06-03 09:18:05 +02:00
a8ee4c7a81 build(deps): bump luajit to HEAD - 51fb2f2c3 (#23886) 2023-06-02 19:41:47 +02:00
c45a111e35 vim-patch:9.0.1599: Cursor not adjusted when 'splitkeep' is not "cursor" (#23884)
Problem:    Cursor not adjusted when near top or bottom of window and
            'splitkeep' is not "cursor".
Solution:   Move boundary checks to outer cursor move functions, inner
            functions should only return valid cursor positions. (Luuk van
            Baal, closes vim/vim#12480)

a109f39ef5
2023-06-02 23:26:41 +08:00
aa130d0c7e docs: small fixes (#23619)
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: Gustavo Ferreira <gustavo.ferreira@imaginecurve.com>
Co-authored-by: Kai Moschcau <mail@kmoschcau.de>
Co-authored-by: Lampros <hauahx@gmail.com>
2023-06-02 22:59:58 +08:00
4b60267f82 feat(:source): source current ft=lua buffer as Lua code (#23802) 2023-06-02 21:00:55 +08:00
36fd2fcaae docs(html): define anchors for search engine #23879
Problem:
Selecting a search result from the Algolia Docsearch widget does not
navigate to a page anchor. The docs HTML provides `<a name=…>` anchors
_near_ the `<h1>`/`<h2>`/… headings, but Algolia Docsearch expects the
anchors to be _defined on_ the headings. That's also "semantically"
nicer. https://docsearch.algolia.com/docs/manage-your-crawls/

Solution:
Set `id` on the heading element instead of placing `<a name=…>` nearby.

related: 3913ebbfcd #23839
2023-06-02 02:45:23 -07:00
80814d1535 ci: remove ci/ from cache key (#23878)
The ci/ directory is now only used for Cirrus, not for GitHub Actions.
2023-06-02 17:38:42 +08:00
843c1bed95 fix(health): stop job properly on timeout (#23877) 2023-06-02 17:23:45 +08:00
9f3c4c1526 vim-patch:9.0.1597: cursor ends up below the window after a put (#23873)
Problem:    Cursor ends up below the window after a put.
Solution:   Mark w_crow and w_botline invalid when changing the cursor line.
            (closes vim/vim#12465)

8509014add

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-02 08:48:49 +08:00
a0375b68c1 vim-patch:9.0.1598: screenchar() and others are wrong with DBCS 'encoding' (#23872)
Problem:    screenchar(), screenchars() and screenstring() do not work
            properly when 'encoding' is set to a double-byte encoding.
Solution:   Fix the way the bytes of the characters are obtained.
            (issue vim/vim#12469)

47eec6716b
2023-06-02 04:31:17 +08:00
7ade44fefe Merge pull request #23871 from gpanders/lsp-position-encoding
Add support for LSP positionEncoding capability
2023-06-01 12:10:48 -05:00
15641f38cf feat(lsp): include positionEncodings in default client capabilities 2023-06-01 11:46:37 -05:00
fb54e6980e feat(lsp): set client offset_encoding if server supports positionEncoding
If the server sends the positionEncoding capability in its
initialization response, automatically set the client's offset_encoding
to use the value provided.
2023-06-01 11:34:23 -05:00
afb70eba8c Merge pull request #23789 from luukvbaal/spell
vim-patch:9.0.{1585,1595}
2023-06-01 21:29:14 +08:00
51fd328184 refactor(drawscreen): avoid spell check on folded or filler lines 2023-06-01 20:51:02 +08:00
ac1ad9651e vim-patch:9.0.1595: line pointer becomes invalid when using spell checking
Problem:    Line pointer becomes invalid when using spell checking.
Solution:   Call ml_get() at the right places. (Luuk van Baal, closes vim/vim#12456)

e84c773d42
2023-06-01 14:30:21 +02:00
316c877034 vim-patch:9.0.1585: weird use of static variables for spell checking
Problem:    Weird use of static variables for spell checking.
Solution:   Move the variables to a structure and pass them from win_update()
            to win_line(). (Luuk van Baal, closes vim/vim#12448)

30805a1aba
2023-06-01 14:30:15 +02:00
7801091062 vim-patch:9.0.1596: :registers command does not work in sandbox (#23866)
Problem:    :registers command does not work in sandbox.
Solution:   Add flag to the command. (closes vim/vim#12473)

eb43b7f053

Co-authored-by: Julio B <julio.bacel@gmail.com>
2023-06-01 20:28:16 +08:00
1ff4562502 fix(api): dont change curwin for nvim_win_set_width 2023-06-01 12:42:06 +02:00
68e7a6a6dc test: added tests for set_height with winminheight=0 and a winbar 2023-06-01 12:23:42 +02:00
a3751f5de2 fix(api): dont change curwin for nvim_win_set_height 2023-06-01 11:44:08 +02:00
2bdef6dd2a fix(column): don't overflow sign column with extmark signs (#23854) 2023-06-01 16:20:31 +08:00
be5e361154 fix(lsp): add param assert in client_is_stopped (#23857) 2023-06-01 08:38:38 +02:00
68e2d72295 ci(issue-open-check): don't add "doc" label
"doc" label doesn't exist and mentioning "doc" doesn't mean anything.
2023-05-31 08:54:35 +08:00
3913ebbfcd docs(html): algolia docsearch #23839
Need to manually include this in the generated docs html because it
doesn't use the website's (jekyll) layout template.

Maintenance notes:
https://github.com/neovim/neovim.github.io/#maintenance

Related: ce9aef12eb
2023-05-30 17:32:38 -07:00
7e3ff8afa4 test(extmarks): folding inline virt_text on empty line (#23847) 2023-05-31 06:50:37 +08:00
58618d208a feat(lsp)!: promote LspRequest to a full autocmd and enrich with additional data (#23694)
BREAKING CHANGE: LspRequest is no longer a User autocmd but is now a
first class citizen.

LspRequest as a User autocmd had limited functionality. Namely, the only
thing you could do was use the notification to do a lookup on all the
clients' requests tables to figure out what changed.

Promoting the autocmd to a full autocmd lets us set the buffer the
request was initiated on (so people can set buffer-local autocmds for
listening to these events).

Additionally, when used from Lua, we can pass additional metadata about
the request along with the notification, including the client ID, the
request ID, and the actual request object stored on the client's
requests table. Users can now listen for these events and act on them
proactively instead of polling all of the requests tables and looking
for changes.
2023-05-30 20:56:29 +02:00
dd3fa64573 fix(lsp): fix dynamic registration of code actions (#23826) 2023-05-30 19:15:07 +02:00
f215a2aeaa vim-patch:8.2.3689: ex_let_one() is too long (#23830)
Problem:    ex_let_one() is too long.
Solution:   Split into multiple functions.

3ccb579516

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-30 22:56:27 +08:00
70da793c5e fix(statusline): corrupted screen with minwid sign item in 'statuscolumn' (#23823) 2023-05-30 20:56:12 +08:00
55f6a1cab0 vim-patch:9.0.1588: Incsearch not triggered when pasting clipboard register (#23817)
Problem:    Incsearch not triggered when pasting clipboard register on the
            command line.
Solution:   Also set "literally" when using a clipboard register. (Ken Takata,
            closes vim/vim#12460)

9cf6ab1332

Co-authored-by: K.Takata <kentkt@csc.jp>
2023-05-30 07:18:12 +08:00
e8776074f5 vim-patch:9.0.1591: some "gomod" files are not recognized (#23820)
Problem:    Some "gomod" files are not recognized.
Solution:   Check for "go.mod" file name before checking out the contents.
            (Omar El Halabi, closes vim/vim#12462)

c9fbd2560f
2023-05-30 06:44:23 +08:00
2028d1e2bc vim-patch:9.0.1586: error for using two messages with ngettext() differing in "%" (#23816)
Problem:    Checking translations gives an error for using two messages with
            ngettext() that differ in "%" items.
Solution:   Adjust the check script to tolerate omitting one "%" item.

78ee62563e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-29 22:14:01 +08:00
b8a2220f5e vim-patch:9.0.1587: Corn config files are not recognized (#23807)
Problem:    Corn config files are not recognized.
Solution:   Add a pattern for Corn config files. (Jake Stanger, closes vim/vim#12449)

05843e8960

Co-authored-by: Jake Stanger <mail@jstanger.dev>
2023-05-29 10:25:05 +02:00
9dd48f7832 fix(substitute): properly check if preview is needed (#23809) 2023-05-29 08:44:52 +08:00
c48f94d1f3 build: remove LOG_LIST_ACTIONS option and related code
It has not been used for a long time and the likelihood of it still working is
low.
2023-05-28 16:34:47 +02:00
5a3752889c fix(NVIM_APPNAME): show error message if $NVIM_APPNAME is invalid
Closes https://github.com/neovim/neovim/issues/23056.
2023-05-28 16:04:54 +02:00
d561830a52 build: align .clang-format rules with uncrustify config
Difference can be seen e.g. in qf_add_entry(), where clang-format
previously would want to place each parameter declaration on its own
line (BinPackParameter: false), while uncrustify behaves if as
BinPackParameters was set to true.

Same goes for BinPackArguments.

See
https://clang.llvm.org/docs/ClangFormatStyleOptions.html#BinPackParameters
and
https://clang.llvm.org/docs/ClangFormatStyleOptions.html#binpackarguments
2023-05-28 15:39:43 +02:00
8206954a67 build: remove LOG_DEBUG option
Its usecase is too specific to warrant an option. The same effect can be
achieved by passing `-DCMAKE_C_FLAGS=-DNVIM_LOG_DEBUG` in the command
line when building neovim.
2023-05-28 15:28:53 +02:00
03a2c5b772 fix(ftplugin): source Lua files after Vimscript files per directory (#23801)
Problem: Lua ftplugins in runtime take precedence over Vimscript
ftplugins in user configs (even in `after/`).
Solution: Source ftplugins separately per directory, first Vimscript
then Lua.
2023-05-28 15:13:44 +02:00
8e17054a23 vim-patch:9.0.1584: not all meson files are recognized (#23797)
Problem:    Not all meson files are recognized.
Solution:   Add "meson.options". (Liam Beguin, closes vim/vim#12444)

1ba0b9e36f

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-28 11:47:07 +02:00
9c41a81dec fix(extmarks): fix virt_text_hide off-by-one hiding (#23795) 2023-05-28 17:29:44 +08:00
4dd43e31db fix(extmarks): don't show virt lines for end mark (#23792) 2023-05-28 17:22:25 +08:00
f29acc5073 test(extmarks): add tests for #14201 #20004 #20885 (#23794) 2023-05-28 16:28:10 +08:00
ddd92a70d2 feat(lsp): initial support for dynamic capabilities (#23681)
- `client.dynamic_capabilities` is an object that tracks client register/unregister
- `client.supports_method` will additionally check if a dynamic capability supports the method, taking document filters into account. But only if the client enabled `dynamicRegistration` for the capability
- updated the default client capabilities to include dynamicRegistration for:
    - formatting
    - rangeFormatting
    - hover
    - codeAction
    - hover
    - rename
2023-05-28 07:51:28 +02:00
e41b2e34b4 test(extmarks): add test for virt_text_hide with 'smoothscroll' (#23791) 2023-05-28 11:09:25 +08:00
7a8402ac31 vim-patch:9.0.1583: get E304 when using 'cryptmethod' "xchacha20v2" (#23790)
Problem:    Get E304 when using 'cryptmethod' "xchacha20v2". (Steve Mynott)
Solution:   Add 4th crypt method to block zero ID check.  Avoid syncing a swap
            file before reading the file. (closes vim/vim#12433)

3a2a60ce4a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-28 08:06:30 +08:00
b46f61ac05 vim-patch:9.0.1582: :stopinsert may not work in a popup close handler (#23785)
Problem:    :stopinsert may not work in a popup close handler. (Ben Jackson)
Solution:   Restore stop_insert_mode when appropriate. (closes vim/vim#12452,
            closes vim/vim#12434)

a40c0bcc83
2023-05-27 22:15:22 +08:00
510e1f131b fix(extmarks): make right_align and win_col work on wrapped line (#23759) 2023-05-27 21:36:16 +08:00
2d289589b7 ci: remove reviewdog for uncrustify
Now that uncrustify is bundled it is no longer necessary.
2023-05-27 13:27:29 +02:00
8e69716953 fix(tui): restore title before exiting alternate screen (#23776)
Since title stack is now saved after entering alternate screen, it makes
more sense to restore title before exiting alternate screen.
2023-05-27 10:13:51 +08:00
44d4ae448d fix: function was renamed (#23772) 2023-05-26 21:51:18 +02:00
d3a22ff242 build(vim-patch.sh): use bundled uncrustify (#23770) 2023-05-26 22:22:56 +08:00
a24dd0392b vim-patch:9.0.1580: CI: indent test hangs on FreeBSD (#23768)
Problem:    CI: indent test hangs on FreeBSD.
Solution:   Set 'nomore' when running the indent tests. (Ozaki Kiichi,
            closes vim/vim#12446)

9f3afe7a70

Co-authored-by: ichizok <gclient.gaap@gmail.com>
2023-05-26 22:13:42 +08:00
5a08b5be3c fix(tui): don't set tty background if &bg was set before VimEnter (#23701) 2023-05-26 11:51:02 +02:00
68da87d2e7 Merge pull request #23742 from bfredl/neolight
fix(drawline): combine extmark highlight with area hl correctly
2023-05-26 11:48:05 +02:00
a92d78d201 Merge pull request #23583 from zeertzjq/ui-attach-title
fix(ui-ext): send title to newly-attached UI
2023-05-26 11:29:56 +02:00
ad62bd471d Merge pull request #23523 from 3N4N/fix/api-info
fix(windows): set stdout to binary mode for "--api-info"
2023-05-26 11:16:27 +02:00
d31f7648ec fix(mkspell): prevent Unicode character overflow (#23760)
introduced in: bd22585061
fixes #23758
2023-05-26 12:13:00 +08:00
a6dd67f5b6 fix(extmarks): fix virt_text_hide with 'nowrap' and multibyte (#23757) 2023-05-26 10:41:19 +08:00
f733595e79 vim-patch:9.0.1578: SpellCap highlight not always updated when needed (#23755)
Problem:    SpellCap highlight not always updated when needed.
Solution:   Handle updating line below closed fold and other situations where
            only part of the window is redrawn. (Luuk van Baal, closes vim/vim#12428,
            closes vim/vim#12420)

2ac6497f0e
2023-05-26 08:08:18 +08:00
43d66c0ebb fix(ui-ext): send title to newly-attached UI 2023-05-26 07:46:24 +08:00
455bca1ba8 fix(drawline): combine extmark highligh with area hl correctly
fixes #23734

Get rid of the weird attr_pri dance which always seemed like a kludge:

    if (!attr_pri) {
      wlv.char_attr = hl_combine_attr(wlv.char_attr, extmark_attr);
    } else {
      wlv.char_attr = hl_combine_attr(extmark_attr, wlv.char_attr);
    }

Instead combine extmark attrs with (old-skool) syntax attrs in a consistent way and then combine that with attr_pri and the rest in an _unified_ code path

fixes #23722

Co-authored-by: luukvbaal <luukvbaal@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-05-25 18:40:26 +02:00
ee986ee044 fix(folds): combined Folded and Visual highlights (#23752)
Also combine high-priority CursorLine with Folded.
2023-05-25 22:14:12 +08:00
aa9d46b672 Merge pull request #23744 from luukvbaal/spell
vim-patch:9.0.{0175,0590,0608,0664}
2023-05-25 18:01:06 +08:00
50efdd6ccf vim-patch:9.0.0664: bad redrawing with spell checking, using "C" and "$" in 'cpo'
Problem:    Bad redrawing with spell checking, using "C" and "$" in 'cpo'.
Solution:   Do not redraw the next line when "$" is in 'cpo'. (closes vim/vim#11285)

f3ef026c98

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-25 11:24:22 +02:00
d2dc7cfa5b vim-patch:9.0.0608: with spelling, deleting a full stop does not update next line
Problem:    With spell checking, deleting a full stop at the end of a line
            does not update SpellCap at the start of the next line.
Solution:   Update the next line when characters have been deleted.  Also when
            using undo.

26f09ea54b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-25 11:24:22 +02:00
ad7cded1f3 vim-patch:9.0.0590: after exiting Insert mode spelling not checked in next line
Problem:    After exiting Insert mode spelling is not checked in the next
            line.
Solution:   When spelling is enabled redraw the next line after exiting Insert
            mode in case the spell highlight needs updating.

ee09fcc9b6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-25 11:24:19 +02:00
bff67c9fbe vim-patch:9.0.0175: spell checking for capital not working with trailing space
Problem:    Spell checking for capital not working with trailing space.
Solution:   Do not calculate cap_col at the end of the line. (Christian
            Brabandt, closes vim/vim#10870, issue vim/vim#10838)

afa23d1b99

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-05-25 01:13:47 +02:00
ebb10d6248 build: remove functionaltest-lua target
It's not needed anymore as it does the exact same thing as
functionaltest. The functionaltest target will test the lua type neovim
was built with, which can be toggled with the PREFER_LUA option.
2023-05-24 21:14:47 +02:00
678548a2b4 fix(folds): show Folded highlight in Visual selection (#23741)
Note: CursorLine highlight is now combined with Folded.
2023-05-24 21:25:39 +08:00
c855eee919 feat(term): enable reflow by default (#21124)
libvterm v0.3 supports reflow of terminal buffer when Nvim is resized
Since v0.3 is now a required dependency, enable it by default to find
(and fix) possible issues.

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.
2023-05-24 10:04:49 +02:00
6661cdf2bd vim-patch:9.0.1575: "file N of M" message is not translated (#23737)
Problem:    "file N of M" message is not translated.
Solution:   Make argument count message translatable. (close vim/vim#12429)

a8490a4952

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-24 07:09:31 +08:00
599cf6f60c ci: remove api-docs-check workflow
Having a workflow that creates a PR with the necessary changes on master
is redundant as this check is enforced for each PR anyway.
2023-05-24 00:14:42 +02:00
d4dc884012 fix(deps): restore functionality of USE_EXISTING_SRC_DIR
fix(deps): restore functionality of USE_EXISTING_SRC_DIR
2023-05-24 00:13:03 +02:00
677e02be4e refactor: fix clang/PVS warnings (#23731) 2023-05-23 18:11:03 +08:00
30c02781ca Merge pull request #23730 from famiu/refactor/api/helpers
refactor(api): new helper macros for cstrings as objects
2023-05-23 12:01:20 +02:00
cfd4fdfea4 refactor(api): new helper macros
Adds new API helper macros `CSTR_AS_OBJ()`, `STATIC_CSTR_AS_OBJ()`, and `STATIC_CSTR_TO_OBJ()`, which cleans up a lot of the current code. These macros will also be used extensively in the upcoming option refactor PRs because then API Objects will be used to get/set options. This PR also modifies pre-existing code to use old API helper macros like `CSTR_TO_OBJ()` to make them cleaner.
2023-05-23 15:20:41 +06:00
62e0e0349c fix(colorscheme): try .lua files in 'rtp' before .vim files in 'pp' (#23727)
This ensures that colorschemes in 'rtp' are tried before ones in 'pp',
because some colorschemes in 'pp' may not work if not added to 'rtp'.

This also match the current documentation better.
2023-05-23 16:12:16 +08:00
8a6716682e fix(deps): restore functionality of USE_EXISTING_SRC_DIR
30a0299bc removed the USE_EXISTING_SRC_DIR hack which broke building the
nightly PPA since ExternalProject tried to download the sources.
2023-05-22 19:24:36 -04:00
a1d885dbef ci: add check to ensure USE_EXISTING_SRC_DIR=ON builds work 2023-05-22 19:21:05 -04:00
07883940b2 Merge pull request #20130 from bfredl/inline
feat(ui): inline virtual text
2023-05-22 14:16:42 +02:00
6eeb28845a refactor(drawline): move inline text code to its own function 2023-05-22 13:49:42 +02:00
c5528e7fd8 fix(test): clean up inline virtual text tests a little 2023-05-22 13:49:42 +02:00
a78fd18ed9 fix(extmark): fix cursor position with both left and right gravity inline text 2023-05-22 13:49:42 +02:00
29da1a9cf0 docs: update api.txt and add inline virtual text to news.txt 2023-05-22 13:49:42 +02:00
584319cb03 vim-patch:9.0.0210: 'list' mode does not work properly with virtual text
Problem:    'list' mode does not work properly with virtual text.
Solution:   Show the "$" at the right position. (closes vim/vim#10913)

c3a483fc3c (diff-15009492c2b1d0a2629908b4618ad51c99d16746f238a0e6451dfe32355ed32fR1653)

This commit only contains the seemingly refactored portion (not entirely
sure what it does)

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-22 13:49:42 +02:00
a37c990483 fix(ui): fix overflowing nowrap virtual text not displaying if tab follows 2023-05-22 13:49:42 +02:00
34d862942c fix(ui): fix virtual text not displaying when two overlapping inlines (nowrap) 2023-05-22 13:49:42 +02:00
5547b16c40 vim-patch:9.0.1067: in diff mode virtual text is highlighted incorrectly
Problem:    In diff mode virtual text is highlighted incorrectly. (Rick Howe)
Solution:   Do not use diff attributes for virtual text. (closes vim/vim#11714)

d097af7779

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-22 13:49:42 +02:00
75f350aac6 fix(ui): fix incorrect highlighting when virtual text next to match 2023-05-22 13:49:42 +02:00
332b70d2ed fix(ui): fix incorrect highlighting when virtual text wraps with number 2023-05-22 13:49:42 +02:00
ecf225df57 vim-patch:9.0.0944: 'cursorline' causes virtual text highlight to continue
Problem:    'cursorline' causes virtual text highlight to continue.
Solution:   Save and restore line_attr. (closes vim/vim#11588)

6ac16f0c0f

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-22 13:49:42 +02:00
5d7afb2e9f fix(ui): fix tabs not being spaced properly after virtual text with no wrap
also fixes incorrect skipping of multibyte characters
2023-05-22 13:49:42 +02:00
7423d3479d vim-patch:9.0.0716: with 'nowrap' virtual text "after" does not scroll left
Problem:    With 'nowrap' virtual text "after" does not scroll left.
Solution:   Skip part of the virtual text that is left of the window.
            (closes vim/vim#11320)  Fix going beyond the last column of the window.

cd105417a5

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-22 13:49:42 +02:00
1936285d98 fix(ui): fixes incorrect rendering when virtual text is not visable and nowrap 2023-05-22 13:49:42 +02:00
be273c3a23 vim-patch:9.0.0205: cursor in wrong position when inserting after virtual text
Problem:    Cursor in wrong position when inserting after virtual text. (Ben
            Jackson)
Solution:   Put the cursor after the virtual text, where the text will be
            inserted. (closes vim/vim#10914)

28c9f89571

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-22 13:49:42 +02:00
c5bf838f8a fix(ui): fix visual and search highlighting interfering with virtual text
vim-patch:9.0.0193: search and match highlgith interfere with virtual text

Problem:    Search and match highlgith interfere with virtual text highlight.
            (Ben Jackson)
Solution:   Check for match highlight after text properties.  Reset and
            restore search highlight when showing virtual text.
            (closes vim/vim#10892)

e38fc86180

vim-patch:9.0.0452: Visual highlighting extends into virtual text prop

Problem:    Visual highlighting extends into virtual text prop.
Solution:   Do not highlight what isn't actually selected.  Fix ordering of
            stored text props.

6eda17d881

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-22 13:49:42 +02:00
e12b5882af vim-patch:9.0.0183: extra space after virtual text when 'linebreak' is set
Problem:    Extra space after virtual text when 'linebreak' is set.
Solution:   Do not count virtual text when getting linebreak value.
            (closes vim/vim#10884)

52de3a8d39

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-22 13:49:42 +02:00
dee3af2122 vim-patch:9.0.0178: cursor position wrong with virtual text before Tab
Problem:    Cursor position wrong with virtual text before Tab.
Solution:   Use the byte length, not the cell with, to compare the column.
            Correct tab size after text prop. (closes vim/vim#10866)

e428fa04a7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-22 13:49:42 +02:00
43c2eaada2 vim-patch:9.0.0179: cursor pos wrong with wrapping virtual text in empty line
Problem:    Cursor position wrong with wrapping virtual text in empty line.
Solution:   Adjust handling of an empty line. (closes vim/vim#10875)

49a90792d9

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-22 13:49:42 +02:00
8eaf3c4f8c vim-patch:9.0.0143: cursor positioned after virtual text in empty line
Problem:    Cursor positioned after virtual text in empty line.
Solution:   Keep cursor in the first column. (closes vim/vim#10786)

afd2aa79ed
2023-05-22 13:49:42 +02:00
0c7fa3bdcc fix(ui): fix multi-byte characters highlight in virtual text
This also fixes insert cursor position around virtual text

vim-patch:9.0.0132: multi-byte characters in virtual text not handled correctly

Problem:    Multi-byte characters in virtual text not handled correctly.
Solution:   Count screen cells instead of bytes.

09ff4b54fb
2023-05-22 13:49:42 +02:00
389f5ca39d fix(ui): adjust the cursor when inserting virtual text
Credit to: Jesse Bakker

https://github.com/neovim/neovim/pull/20130#issuecomment-1369652743

Co-authored-by: Jesse Bakker <github@jessebakker.com>
2023-05-22 13:49:42 +02:00
0e1f3b5acf vim-patch:9.0.0130: cursor position wrong when inserting around virtual text
Problem:    Cursor position wrong when inserting around virtual text.
Solution:   Update the cursor position properly.

1f4ee19eef

Co-authored-by: tom-anders <13141438+tom-anders@users.noreply.github.com>
2023-05-22 13:49:42 +02:00
a38d7f9984 fix(ui): fix cursor position with multiple inline virtual text
vim-patch9.0.0121: cannot put virtual text after or below a line

Problem:    Cannot put virtual text after or below a line.
Solution:   Add "text_align" and "text_wrap" arguments.

b7963df98f

This only patches the fix, not the whole thing.
2023-05-22 13:49:42 +02:00
efa9b299a7 feat(ui): inline virtual text
vim-patch:9.0.0067: cannot show virtual text

Problem:    Cannot show virtual text.
Solution:   Initial changes for virtual text support, using text properties.

7f9969c559

vim-patch:9.0.0116: virtual text not displayed if 'signcolumn' is "yes"

Problem:    Virtual text not displayed if 'signcolumn' is "yes".
Solution:   Set c_extra and c_final to NUL.
711483cd13

Co-authored-by: bfredl <bjorn.linse@gmail.com>
2023-05-22 13:49:42 +02:00
cb34d0ddd0 fix(redraw): overwrite double-width char with virt_text properly (#23708) 2023-05-22 18:22:47 +08:00
b11a8c1b5d fix(highlight): remove unnecessary assignment to char_attr for 'spell' (#23713) 2023-05-22 17:07:55 +08:00
b7708eac24 fix(api): nvim_get_hl should return default flag 2023-05-22 09:49:01 +01:00
4f1d75daf8 ci: enable colors by default when testing
Test colors were disabled in be7290d214
due to color codes interfering with the logs. I believe the solution to
disable colors is too aggressive. Reading raw logs isn't common compared
to reading CI results from the github UI. We should optimize the most
common use case.

It is also possible to interpret the colors codes in logs from neovim
with a plugin that interprets ansi escape sequences.
2023-05-22 09:47:40 +01:00
01ea42c32a refactor(vim.secure): move to lua/secure.c 2023-05-22 09:24:36 +01:00
62a80c36c1 Merge pull request #23712 from famiu/refactor/test/buf0
test: don't unnecessarily specify win/buf for nvim_(get|set)_option_value
2023-05-22 10:19:47 +02:00
576dddb461 test: don't unnecessarily specify win/buf for nvim_(get|set)_option_value
`nvim_(get|set)_option_value` pick the current buffer / window by default for buffer-local/window-local (but not global-local) options. So specifying `buf = 0` or `win = 0` in opts is unnecessary for those options. This PR removes those to reduce code clutter.
2023-05-22 13:02:07 +06:00
8b8e607284 build: move luarocks and rocks installation to main build
This will ensure luacheck and busted are only installed when they're
actually needed. This cuts total build time by over 50%.

Closes https://github.com/neovim/neovim/issues/22797.
2023-05-21 20:57:39 +02:00
384a3bc308 Merge pull request #23670 from famiu/refactor/deprecate_opt_api
refactor(options): deprecate nvim[_buf|_win]_[gs]et_option
2023-05-21 20:16:05 +02:00
edf9a897f0 fix(treesitter): update highlights for query (#23699)
captures for `; extends` and `; inherits`
2023-05-21 19:22:28 +02:00
60f69014a8 fix(redraw): multibyte characters are wrapped at the end of a line (#23696)
Problem:    Multibyte characters may be wrapped at the end of a line
            when 'statuscolumn' and 'spell' are set.
Solution:   Update line pointerdiff "v" before fetching the line pointer
            after evaluating 'statuscolumn'.
2023-05-21 19:00:37 +08:00
387c8ceb28 Merge pull request #23697 from clason/bump-luv
build(deps): bump luv to HEAD - c1497c0
2023-05-21 12:06:35 +02:00
3b66f92d0e docs(luv): update to HEAD 2023-05-21 11:29:47 +02:00
1fe1bb084d refactor(options): deprecate nvim[_buf|_win]_[gs]et_option
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: famiu <famiuhaque@protonmail.com>
2023-05-21 15:14:01 +06:00
bbedbc347f build(deps): bump luv to HEAD - c1497c0ff 2023-05-21 10:52:50 +02:00
e3e6fadfd8 feat(fs): expose join_paths as vim.fs.joinpath (#23685)
This is a small function but used a lot in some plugins.
2023-05-20 17:30:48 +02:00
073035a030 fix(lsp): don't register didChangeWatchedFiles when capability not set (#23689)
Some LSP servers (tailwindcss, rome) are known to request registration
for `workspace/didChangeWatchedFiles` even when the corresponding client
capability does not advertise support. This change adds an extra check
in the `client/registerCapability` handler not to start a watch unless
the client capability is set appropriately.
2023-05-20 07:45:39 +02:00
413d57ae71 vim-patch:partial:9.0.1570: some tests are slow (#23688)
Problem:    Some tests are slow.
Solution:   Make a few test cases faster.

bf63011a52

Cherry-pick related test_cmdline.vim changes from patch 9.0.0418.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-20 08:21:48 +08:00
d86a737df1 Merge pull request #23686 from luukvbaal/smoothscroll
vim-patch:9.0.{1564,1568}
2023-05-20 08:21:04 +08:00
cf0f83ebf0 vim-patch:9.0.1568: with 'smoothscroll' cursor may move below botline
Problem:    With 'smoothscroll' cursor may move below botline.
Solution:   Call redraw_later() if needed,  Compute cursor row with adjusted
            condition. (Luuk van Baal, closes vim/vim#12415)

d49f646bf5
2023-05-19 19:28:01 +02:00
02ef104d5b vim-patch:9.0.1564: display moves up and down with 'incsearch' and 'smoothscroll'
Problem:    Display moves up and down with 'incsearch' and 'smoothscroll'.
Solution:   Do not check if w_skipcol changed. (Luuk van Baal, closes vim/vim#12410,
            closes vim/vim#12409)

0222c2d103
2023-05-19 18:42:23 +02:00
4c05b1a6ab build(deps): bump libuv to v1.45.0 (#23684) 2023-05-19 14:15:24 +02:00
201f366b37 vim-patch:9.0.1565: json lines files are not recognized (#23677)
Problem:    Json lines files are not recognized.
Solution:   Add a pattern to detect "jsonl" files. (issue vim/vim#7520)

6fadbc1e8c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-19 09:11:22 +02:00
3ae62c4706 fix(tui): make disabling title restore old title from stack (#23585)
This makes setting 'notitle' in Nvim behave more like Vim in terminals
that support title stacking.
2023-05-19 07:30:22 +08:00
24b60b0f71 build: don't format deleted files
Trying to format deleted files will otherwise throw an error.
2023-05-18 16:28:46 +02:00
826b95203a build: bundle uncrustify
Uncrustify is sensitive to version changes, which causes friction for
contributors that doesn't have that exact version. It's also simpler to
download and install the correct version than to have bespoke version
checking.
2023-05-18 16:27:47 +02:00
c40872acbd build: remove duplicate include directories in --version output
Having the same directory listed multiple times makes the --version
output needlessly complicated to visualize. This deduplication will only
work for cmake version 3.15 and above, which should be the majority of
neovim builds by now. For older cmake versions we default to the
previous behavior of listing duplicate include directories.
2023-05-18 16:27:05 +02:00
ef64e225f6 fix(treesitter): allow foldexpr without highlights (#23672)
Ref nvim-treesitter/nvim-treesitter#4748
2023-05-18 10:52:01 +01:00
c9f47fca8b fix(messages): ensure msg_grid is at top at more prompt (#23584) 2023-05-17 21:06:27 +08:00
67176c3f20 Merge pull request #15534 from bfredl/monomap
refactor(map): avoid duplicated khash_t implementations for values and support sets
2023-05-17 13:00:32 +02:00
189fb62032 feat(treesitter): improved logging (#23638)
- Add bindings to Treesitter ts_parser_set_logger and ts_parser_logger
- Add logfile with path STDPATH('log')/treesitter.c
- Rework existing LanguageTree loggin to use logfile
- Begin implementing log levels for vim.g.__ts_debug
2023-05-17 11:42:18 +01:00
e2fdd53d8c refactor(map): avoid duplicated khash_t types for values
This reduces the total number of khash_t instantiations from 22 to 8.

Make the khash internal functions take the size of values as a runtime
parameter. This is abstracted with typesafe Map containers which
are still specialized for both key, value type.

Introduce `Set(key)` type for when there is no value.

Refactor shada.c to use Map/Set instead of khash directly.
This requires `map_ref` operation to be more flexible.
Return pointers to both key and value, plus an indicator for new_item.
As a bonus, `map_key` is now redundant.

Instead of Map(cstr_t, FileMarks), use a pointer map as the FileMarks struct is
humongous.

Make `event_strings` actually work like an intern pool instead of wtf it
was doing before.
2023-05-17 12:26:21 +02:00
6b19170d44 fix(treesitter): correctly calculate bytes for text sources (#23655)
Fixes #20419
2023-05-16 16:41:47 +01:00
d36dd2bae8 refactor: use xstrl{cpy,cat} on IObuff (#23648)
Replace usage of STR{CPY,CAT} with xstrl{cpy,cat} when using on IObuff

Co-authored-by: ii14 <ii14@users.noreply.github.com>
2023-05-16 11:33:03 +08:00
66b7f62542 vim-patch:8.2.2858: test fails because of changed error message (#23647)
Problem:    Test fails because of changed error message.
Solution:   Adjust the expected error message.

6b02b38ed0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-16 10:00:40 +08:00
5887ecab6d vim-patch:9.0.1561: display wrong when moving cursor to above the top line (#23644)
Problem:    Display wrong when moving cursor to above the top line and
            'smoothscroll' is set.
Solution:   Call adjust_skipcol() in more places and make it work better.
            (Luuk van Baal, closes vim/vim#12395)

798fa76dbf
2023-05-16 07:56:06 +08:00
bd247d835f ci: remove redundant asan and ubsan options
We now have default options for ASAN and UBSAN (#23259)
2023-05-15 23:21:04 +02:00
8e3124493c Merge pull request #23606 from clason/bump-tree-sitter-lua
fix(treesitter): update parser and queries
2023-05-15 19:46:47 +02:00
88a202a010 Merge pull request #23259 from ii14/build/ubsan_default_options
build: add asan and ubsan default options
2023-05-15 17:24:00 +02:00
4cc69f45b4 build: add ubsan default options
Use print_stacktrace=1 for UBSAN by default.
2023-05-15 16:50:58 +02:00
9ff59517cb fix(treesitter): update c queries 2023-05-15 14:13:42 +02:00
c97de026e3 fix(treesitter): update vimdoc and vimscript queries 2023-05-15 14:13:31 +02:00
0dbed7132b build(deps): update lua parser and queries 2023-05-15 14:13:31 +02:00
33687f5e87 build(deps): bump libuv to HEAD - 30fc896cc (#23636) 2023-05-15 11:22:34 +02:00
c11986ed1a vim-patch:b7398fe41c9e (#23627)
Update runtime files

b7398fe41c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-15 09:38:32 +02:00
189e21ae50 vim-patch:9.0.1554: code for handling 'switchbuf' is repeated (#23632)
Problem:    Code for handling 'switchbuf' is repeated.
Solution:   Add a function to handle 'switchbuf'. (Yegappan Lakshmanan,
            closes vim/vim#12397)

e42c27d9e8

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-05-15 08:13:33 +08:00
4a0005aee9 vim-patch:9.0.1555: setcharsearch() does not clear last searched char properly (#23631)
Problem:    setcharsearch() does not clear last searched char properly.
Solution:   Do not accept lastc_bytelen smaller than one. (closes vim/vim#12398)

e5d91ba1de
2023-05-15 08:04:23 +08:00
e71c7898ca ci: trigger tests when pushing
This will allow contributors to test changes in their own fork when
pushing without needing to make a pull request. This can be useful when
wanting to test out an idea before initiating a review process.

Make the following assumptions when defining concurrency:
- Pull request will work the same.
- Pushes to the neovim repo will work the same: each unique commit will
  trigger a test run that won't cancel each other.
- Pushes to forks will cancel older CI runs on the same branch, similar
  to how pull requests work.

This will create duplicate CI runs when doing a pull request, one in the
neovim repo for the pull request event and one in the fork for the push
event. This is an acceptable trade as the runs in the fork doesn't count
towards the CI limit of neovim. Contributors are also free to disable
these actions in their own fork if they wish.
2023-05-15 00:08:57 +02:00
ecd6d679a0 test: skip flaky test on Windows 2023-05-14 14:29:18 +02:00
0124b02490 docs(if_pyth): make it work with Python 3 instead of Python 2 (#23620) 2023-05-14 19:18:49 +08:00
a9a2751f65 ci: bump uncrustify to 0.77.1 2023-05-14 13:08:18 +02:00
edfa8d6f2f vim-patch:9.0.1551: position of marker for 'smoothscroll' not computed correctly (#23617)
Problem:    Position of marker for 'smoothscroll' not computed correctly.
Solution:   Take 'list' and other options into account. (Luuk van Baal,
            closes vim/vim#12393)

24b62ec825
2023-05-14 06:03:03 +08:00
08991b0782 docs: small fixes
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: HiPhish <hiphish@posteo.de>
Co-authored-by: Julio B <julio.bacel@gmail.com>
Co-authored-by: T727 <74924917+T-727@users.noreply.github.com>
Co-authored-by: camoz <camoz@users.noreply.github.com>
Co-authored-by: champignoom <66909116+champignoom@users.noreply.github.com>
2023-05-13 21:33:22 +02:00
1f33b2b1e8 build(deps): bump tree-sitter to HEAD - 91e4d9401 (#23616) 2023-05-13 19:50:42 +02:00
79d5f06f79 Merge pull request #23612 from zeertzjq/vim-9.0.0064
vim-patch:9.0.{0064,0218,0249,0490,0492,0598}: cmdwin fixes
2023-05-13 23:08:01 +08:00
cd9ca700e5 vim-patch:9.0.0598: using negative array index with negative width window
Problem:    Using negative array index with negative width window.
Solution:   Make sure the window width does not become negative.

8279af514c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-13 22:45:59 +08:00
2de3362ce3 vim-patch:9.0.0492: cmdwin test fails on MS-Windows
Problem:    Cmdwin test fails on MS-Windows.
Solution:   Skip test on MS-Windows.

312af65d1a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-13 22:45:59 +08:00
7eea6b12f9 vim-patch:9.0.0490: using freed memory with cmdwin and BufEnter autocmd
Problem:    Using freed memory with cmdwin and BufEnter autocmd.
Solution:   Make sure pointer to b_p_iminsert is still valid.

1c3dd8ddcb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-13 22:45:59 +08:00
f80cf0f84f vim-patch:9.0.0249: no test for what 9.0.0234 fixes
Problem:    No test for what 9.0.0234 fixes.
Solution:   Add a test. (issue vim/vim#10950)

3a7ad904d2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-13 22:45:59 +08:00
4111530806 vim-patch:9.0.0218: reading before the start of the line
Problem:    Reading before the start of the line.
Solution:   When displaying "$" check the column is not negative.

e98c88c44c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-13 22:45:59 +08:00
c8dc34795b vim-patch:9.0.0064: confusing error when using "q:" in command line window
Problem:    Confusing error when using "q:" in command line window.
Solution:   Check for the situation and give a better error message.
            (closes vim/vim#10756)

c963ec31a0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-13 22:45:57 +08:00
6f29c68928 vim-patch:9.0.1549: USD filetype is not recognized (#23608)
Problem:    USD filetype is not recognized.
Solution:   Add patterns for USD filetype. (Colin Kennedy, closes vim/vim#12370)

b848ce6b7e

Co-authored-by: Colin Kennedy <colinvfx@gmail.com>
2023-05-13 15:00:08 +02:00
32dc484ec9 fix(treesitter): support subfiletypes in get_lang (#23605) 2023-05-13 13:29:11 +02:00
1086016477 build: cmake cleanup
- Simplify error checking when using execute_process.
- Set BUILD_SHARED_LIBS to OFF when building dependencies.
  This is normally not needed, but msgpack interprets an unset
  BUILD_SHARED_LIBS to build a shared library, which is the opposite of
  the cmake behavior.
- Move function check_lua_module to Util.cmake.
- Remove unnecessary code.
- Make variable naming more consistent
2023-05-13 12:12:29 +02:00
ed8c44f767 ci(deps): update bump_deps script (#23604)
* consistent capitalization (lower-case) of dependency names
* add bundled tree-sitter parsers
2023-05-13 11:44:56 +02:00
512a90520e refactor(lsp): mark server_ready function as deprecated (#23520) 2023-05-13 11:27:05 +02:00
6a273af105 refactor: remove typval.h from most header files (#23601)
Because typval_defs.h is enough for most of them.
2023-05-13 10:40:53 +08:00
f76e1ac92e vim-patch:9.0.1546: some commands for opening a file don't use 'switchbuf' (#23600)
Problem:    Some commands for opening a file don't use 'switchbuf'.
Solution:   Use 'switchbuf' for more commands. (Yegappan Lakshmanan,
            closes vim/vim#12383, closes vim/vim#12381)

54be5fb382

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-05-13 08:40:06 +08:00
a6d63591f1 vim-patch:9.0.1545: text not scrolled when cursor moved with "g0" and "h" (#23599)
Problem:    Text not scrolled when cursor moved with "g0" and "h".
Solution:   Adjust w_skipcol when needed. (Luuk van Baal, closes vim/vim#12387)

8667a5678f
2023-05-13 08:15:01 +08:00
2835b0daad build: bump uncrustify to version 0.77 2023-05-12 09:51:36 +02:00
5825d2f6ca test(scroll_opt): fix typo in porting oldtest (#23593) 2023-05-12 08:17:38 +08:00
d6e898b44f Merge pull request #23558 from luukvbaal/smoothscroll
vim-patch:9.0.{1530,1533,1542,1543}
2023-05-12 07:24:13 +08:00
6f41eaa2b5 vim-patch:9.0.1543: display errors when making topline shorter
Problem:    Display errors when making topline shorter and 'smoothscroll' is
            set.
Solution:   Reset w_skipcol when the topline becomes shorter than its current
            value. (Luuk van Baal, closes vim/vim#12367)

5d01f86d99
2023-05-11 20:57:36 +02:00
15c684b358 vim-patch:9.0.1542: line not fully displayed if it doesn't fit in the screen
Problem:    Line not fully displayed if it doesn't fit in the screen.
Solution:   Do not reset s_skipcol if not needed. (Luuk van Baal,
            closes vim/vim#12376)

6c018680be
2023-05-11 20:57:31 +02:00
30a0299bc6 build: make dependency URL variables non-cached (#23577)
Cmake won't rebuild with the new URL when bumping dependency version.
This is because the old URL is still cached, and won't be removed
automatically. The workaround for using non-cached variables, but also
let users specify an alternative URL is to only set the defined
variables in deps.txt if the corresponding variable hasn't already been
set by the user from the command line.

Also apply the CMAKE_CONFIFGURE_DEPENDS property to deps.txt, as we want
cmake to rebuild when changing this file.
2023-05-11 20:17:15 +02:00
e124672ce9 fix(treesitter): reset cursor max_start_depth 2023-05-11 12:08:33 +01:00
af040c3a07 feat(treesitter): add support for setting query depths 2023-05-11 11:13:32 +01:00
e90b506903 vim-patch:9.0.1539: typst filetype is not recognized (#23578)
Problem:    Typst filetype is not recognized.
Solution:   Distinguish between sql and typst. (Gaetan Lepage, closes vim/vim#12363)

4ce1bda869
2023-05-11 15:43:02 +08:00
9d306ac6b7 vim-patch:9.0.1538: :wqall does not trigger ExitPre (#23574)
Problem:    :wqall does not trigger ExitPre. (Bart Libert)
Solution:   Move preparations for :qall to a common function. (closes vim/vim#12374)

411da64e77

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-11 08:09:13 +08:00
ac1aee99bc build(deps): bump LibUV to HEAD (#22833)
* build(deps): bump libuv to HEAD - 15e81386b
2023-05-10 19:14:39 +02:00
03ca36d1f8 fix(highlight): apply 'winblend' to NormalNC (#23555) 2023-05-10 23:46:50 +08:00
5ac2e47acc fix(redo): make redo of Lua mappings in op-pending mode work (#23566) 2023-05-10 17:42:14 +08:00
d5780e133a vim-patch:9.0.1533: test for 'smoothscroll' is ineffective
Problem:    Test for 'smoothscroll' is ineffective.
Solution:   Change the order of testing "zb" and "zt". (Luuk van Baal,
            closes vim/vim#12366)

6f37e530d3
2023-05-09 22:53:08 +02:00
1caad791b4 vim-patch:9.0.1530: cursor moves to wrong line when 'foldmethod' is "diff"
Problem:    Cursor moves to wrong line when 'foldmethod' is "diff". (Rick
            Howe)
Solution:   Adjust logic for scrolling. (Luuk van Baal, closes vim/vim#12364,
            closes vim/vim#12218)

aa6ba308a1
2023-05-09 22:40:24 +02:00
4e5061dba7 docs(lsp): fix config.cmd argument for vim.lsp.start_client (#23560) 2023-05-09 21:00:29 +02:00
36baaf7c1a test: move most title tests to a separate file (#23557)
This avoids running title tests twice unnecessarily.
2023-05-10 00:14:54 +08:00
075a72d5ff fix(lsp): fix relative patterns for workspace/didChangeWatchedFiles (#23548) 2023-05-09 18:12:54 +02:00
82bb7bbc48 build: add luajit runtime files when installing (#23514)
Closes https://github.com/neovim/neovim/issues/15543.
2023-05-09 17:25:49 +02:00
02f92978fe docs(lsp): fix type of config.cmd argument for vim.lsp.start_client (#23550) 2023-05-09 17:24:49 +02:00
84378c4dd5 test(old): remove python2 tests (#23547)
Because python2 provider is no longer supported.
2023-05-09 09:18:21 +08:00
44fc2a6d7e vim-patch:9.0.1525: 'smoothscroll' does not always work properly (#23544)
Problem:    'smoothscroll' does not always work properly.
Solution:   Do not reset w_skipcol after it was intentionally set.  (Luuk van
            Baal, closes vim/vim#12360, closes vim/vim#12199, closes vim/vim#12323)

3ce8c38915
2023-05-09 07:44:31 +08:00
7ed4274f69 vim-patch:9.0.1526: condition is always true (#23541)
Problem:    Condition is always true.
Solution:   Remove unnecessary condition. (closes vim/vim#12359)

d619d6a9c6
2023-05-08 23:29:02 +08:00
88366641ad build: remove USE_BUNDLED_BUSTED option
The previous logic made it possible to install bundled luarocks, but
also use external rocks, making the luarocks installation unnecessary.
Instead, let's assume that if the user wants to use the bundled
luarocks, then they also want to use it to install necessary rocks.
2023-05-08 17:24:19 +02:00
71424a8a0e Merge pull request #23540 from zeertzjq/vim-9.0.1522
vim-patch:9.0.{1522,1524}: some functions give two error messages
2023-05-08 23:17:28 +08:00
9753cda591 fix(syntax): use correct diagnostic group for checkhealth (#23538) 2023-05-08 17:02:53 +02:00
625926f729 vim-patch:9.0.1524: passing -1 for bool is not always rejected
Problem:    Passing -1 for bool is not always rejected.
Solution:   Check for error in a better way. (closes vim/vim#12358)

8cf51376b8
2023-05-08 22:53:43 +08:00
d745433817 vim-patch:9.0.1522: some functions give two error messages
Problem:    Some functions give two error messages.
Solution:   Do not give a second error message. (closes vim/vim#12352)

e4098457ab

It seems that tv_get_bool() is actually not exactly the same as
tv_get_number(), so change it to a function instead.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-08 22:49:32 +08:00
4ecf6fdfd8 fix(statusline): bail out properly on negative row (#23535) 2023-05-08 16:25:03 +08:00
a961bb7101 Merge pull request #23486 from msva/patch-1
fix(man.lua): return support of all sections
2023-05-08 16:09:33 +08:00
3001d86aea test: add more tests for :Man section extraction 2023-05-08 15:46:21 +08:00
057a5bc78d docs: add some missing changes from Vim runtime updates (#23533) 2023-05-08 13:57:24 +08:00
01f81ed89e Merge pull request #23532 from zeertzjq/vim-8.2.4073
vim-patch:8.2.{4073,4075}
2023-05-08 11:43:07 +08:00
03828536fa vim-patch:8.2.4075: test failures
Problem:    Test failures.
Solution:   Change check for NULL pointer.

78a70533c3

:export is N/A.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-08 11:11:52 +08:00
c2441a8fb9 vim-patch:8.2.4073: Coverity warns for using NULL pointer
Problem:    Coverity warns for using NULL pointer.
Solution:   Bail out when running out of memory. Check for running over end of
            a string.

54598066ca

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-08 11:11:46 +08:00
ca344b715b vim-patch:8.2.2459: Coverity reports dead code (#23531)
Problem:    Coverity reports dead code.
Solution:   Remove the dead code.

8bead9a058

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-08 09:49:40 +08:00
e64db1d284 vim-patch:9.0.1523: some error messages are not marked for translation (#23529)
Problem:    Some error messages are not marked for translation.
Solution:   Surround the messages in _(). (closes vim/vim#12356)

276410e78f
2023-05-08 08:26:00 +08:00
13e7e4e67a Merge pull request #23527 from zeertzjq/vim-8.2.1978
vim-patch:8.2.{1978,2062,3887},9.0.{1516,1521}
2023-05-08 01:34:38 +08:00
5844af0d52 vim-patch:9.0.1521: failing redo of command with control characters
Problem:    Failing redo of command with control characters.
Solution:   Use AppendToRedobuffLit() for colon commands. (closes vim/vim#12354)

30b6d6104c
2023-05-08 01:12:09 +08:00
3233137813 vim-patch:9.0.1516: cannot use special keys in <Cmd> mapping
Problem:    Cannot use special keys in <Cmd> mapping.
Solution:   Do allow for special keys in <Cmd> and <ScriptCmd> mappings.
            (closes vim/vim#12326)

3ab3a86481
2023-05-08 01:12:09 +08:00
29c228dc10 vim-patch:8.2.3887: E1135 is used for two different errors
Problem:    E1135 is used for two different errors.
Solution:   Renumber one error.

806da5176e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-08 01:12:09 +08:00
f7c1e460f8 vim-patch:8.2.2062: <Cmd> does not handle CTRL-V
Problem:    <Cmd> does not handle CTRL-V.
Solution:   Call get_literal() after encountering CTRL-V. (closes vim/vim#7387)

4a44120e3d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-08 01:12:09 +08:00
a2b9117ca8 vim-patch:8.2.1978: making a mapping work in all modes is complicated
Problem:    Making a mapping work in all modes is complicated.
Solution:   Add the <Cmd> special key. (Yegappan Lakshmanan, closes vim/vim#7282,
            closes 4784, based on patch by Bjorn Linse)

957cf67d50

Change docs to match Vim if it's wording is better.
Change error numbers to match Vim.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-08 01:12:08 +08:00
4bfc7802f0 fix(windows): set stdout to binary mode for --api-info
Problem:  --api-info output is binary.  Not setting the mode may cause
the OS to impose unexpected eof.  For Windows, it scatters extra '0d0a'
words in the output.

Solution:  On Windows, set stdout to binary mode for --api-info.

Fixes #20977
2023-05-07 20:58:20 +06:00
1cbfed03c2 ci(response): use pagination for timeline events
GitHub paginates responses with many results, which needs to be taken
into account as the number of events in an issue can be large.
2023-05-07 16:46:24 +02:00
416f03010e ci: auto-add labels on issues based on title
This is similar to the pull request labeler. We search for certain key words in
the issue title and add them if they are present.
2023-05-07 14:55:31 +02:00
209ed16f57 fix(man.lua): return support of all sections
Current behaviour of `:Man` is to only work with "number" sections.
This is caused by wrong assumptions about man sections naming.

Also, there was similar assumption about length of section dirs
in `paths` variable.

fixes #23485

Signed-off-by: Vadim Misbakh-Soloviov <git@mva.name>
2023-05-07 17:31:33 +07:00
fa1baa9a47 vim-patch:9.0.1520: completion for option name includes all bool options (#23518)
Problem:    Completion for option name includes all bool options.
Solution:   Do not recognize the "noinv" prefix.  Prefix "no" or "inv" when
            appropriate.

048d9d2521

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-07 08:00:08 +08:00
9e34aa76c1 vim-patch:9.0.1518: search stats not always visible when searching backwards (#23517)
Problem:    Search stats not always visible when searching backwards.
Solution:   Do not display the top/bot message on top of the search stats.
            (Christian Brabandt, closes vim/vim#12322, closes vim/vim#12222)

34a6a3617b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-05-07 07:57:29 +08:00
e218965338 vim-patch:9.0.1514: test waits unnecessarily long before checking screendump (#23516)
vim-patch:9.0.1514: test waits unnecessarily long before checking screendump

Problem:    Test waits unnecessarily long before checking screendump.
Solution:   Remove TermWait() call.

45fcb7928a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-07 07:20:10 +08:00
408a7c2dac Merge pull request #23510 from luukvbaal/smoothscroll
vim-patch:9.0.{1512,1513}
2023-05-07 07:04:49 +08:00
1bf29a0ae1 build: add system lua include dir for lpeg
Problem: Lpeg requires Lua headers.  Currently the include directories
for Lpeg are set only to the bundled deps folder, so if the user wants
to use system Lua/Luajit, Lpeg will not find the system headers and will
fail to build.

Solution: Add system Lua/Luajit include directories when USE_BUNDLED_LUA
and USE_BUNDLED_LUAJIT are turned off.

Fixes #23469
2023-05-07 00:47:45 +02:00
8e74569d7e vim-patch:9.0.1513: text scrolls unnecessarily when splitting
Problem:    Text scrolls unnecessarily when splitting and 'splitkeep' is not
            "cursor".
Solution:   Avoid resetting w_skipcol. (Luuk van Baal, closes vim/vim#12334)

b926bf47d6
2023-05-07 00:38:45 +02:00
3b2bd8d69e vim-patch:9.0.1512: inserting lines when scrolling with 'smoothscroll' set
Problem:    Inserting lines when scrolling with 'smoothscroll' set.
Solution:   Adjust line height computation for w_skipcol. (Luuk van Baal,
            closes vim/vim#12350)

c8502f9b88
2023-05-07 00:38:40 +02:00
9248dd77ac feat(lua): add hl priority opts on yank (#23509)
feat(lua): add hl priority opts on_yank

Signed-off-by: marcoSven <me@marcosven.com>
2023-05-06 21:53:36 +02:00
d48cd9a0aa Merge pull request #23508 from clason/yeet-snap
build(snap): remove obsolete snapcraft.yaml
2023-05-06 21:37:47 +02:00
ca5a810c4a vim-patch:9.0.1511: crash when using wrong arg types to assert_match() (#23507)
Problem:    Crash when using wrong arg types to assert_match().
Solution:   Check for NULL pointer. (closes vim/vim#12349)

12e7a1fe75
2023-05-06 20:00:17 +08:00
bfb81e1a85 build(snap): remove obsolete snapcraft.yaml
now lives in https://github.com/neovim/neovim-snap
2023-05-06 13:36:21 +02:00
a67b76943a build(deps): point dependencies to specific commit
This way older neovim builds will work if we bump the dependency
versions.
2023-05-06 12:14:23 +02:00
d94db80227 Merge pull request #23415 from zeertzjq/sigwinch-redraw
fix(tui): redraw on SIGWINCH even if size didn't change
2023-05-06 11:48:33 +02:00
5abba97d77 build: download dependencies with unreliable mirrors from deps repo
Closes https://github.com/neovim/neovim/issues/23493.
2023-05-06 11:40:03 +02:00
a72e795eda Merge pull request #23499 from zeertzjq/vim-8.2.2610
vim-patch:8.2.{2249,2610}: mouse click test fails over ssh
2023-05-06 11:15:13 +08:00
f6cc0f614f vim-patch:8.2.2610: mouse click test fails when using remote connection
Problem:    Mouse click test fails when using remote connection.
Solution:   Use a larger 'mousetime'. (Dominique Pellé, closes vim/vim#7968)

1e448465e1
2023-05-06 10:03:40 +08:00
4a4b10d9b6 vim-patch:8.2.2249: termcodes test is flaky when used over ssh
Problem:    Termcodes test is flaky when used over ssh with X forwarding.
Solution:   Set 'mousetime' to a larger value. (Dominique Pellé, closes vim/vim#7576,
            closes vim/vim#7563)

2a5c61a019
2023-05-06 10:03:39 +08:00
e8661133c5 vim-patch:9.0.0904: various comment and indent flaws (#23498)
Problem:    Various comment and indent flaws.
Solution:   Improve comments and indenting.

88456cd3c4

Omit test_function_lists.vim change as that file is likely not
applicable to Nvim due to the existence of Nvim-only functions.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-06 09:34:29 +08:00
b99f13385c vim-patch:8.2.1746: Vim9: cannot use "fina" for "finally" (#23497)
Problem:    Vim9: Cannot use "fina" for "finally". (Naruhiko Nishino)
Solution:   Specifically check for "fina". (closes vim/vim#7020)

373863ed48

:final is N/A.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-06 08:56:00 +08:00
b97d2abb21 Merge pull request #23488 from zeertzjq/vim-8.2.2094
vim-patch:8.2.{2094,2141},9.0.1508
2023-05-06 08:17:14 +08:00
6b912dec8e vim-patch:9.0.1508: catch does not work when lines are joined with a newline
Problem:    Catch does not work when lines are joined with a newline.
Solution:   Set "nextcmd" appropriately. (closes vim/vim#12348)

f2588b6fc9
2023-05-06 07:47:43 +08:00
ad7f9a701c vim-patch:8.2.2141: a user command with try/catch may not catch an expression error
Problem:    A user command with try/catch may not catch an expression error.
Solution:   When an expression fails check for following "|". (closes vim/vim#7469)

8143a53c53

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-06 07:47:43 +08:00
aa5f3a7962 vim-patch:8.2.2094: when an expression fails getting next command may be wrong
Problem:    When an expression fails getting the next command may be wrong.
Solution:   Do not check for a next command after :eval fails. (closes vim/vim#7415)

d0fe620cbb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-06 07:47:40 +08:00
22205f36a6 fix(api): don't change title when setting buffer in a window (#23492) 2023-05-06 07:46:07 +08:00
c8ebb04e92 fix(health): replace healthFoo with DiagnosticFoo (#23475)
This replaces the custom `health{Error,Warning,Success}` highlight
groups with `Diagnostic{Error,Warning,Ok}`, which are defined by
default. Removes the link for `healthHelp`, which was no longer
actually used after #20879.
2023-05-05 18:15:44 +02:00
c14aa66cce Merge pull request #23487 from zeertzjq/vim-8.2.1953
vim-patch:8.2.1953,9.0.{0213,0404,0543,0846,0854,1507}: assert fixes
2023-05-05 20:05:18 +08:00
c11417b3d7 vim-patch:9.0.1507: assert message is confusing with boolean result
Problem:    Assert message is confusing with boolean result.  assert_inrange()
            replaces message instead of adding it.
Solution:   Don't put quotes around expected boolean value.  Append message
            for assert_inrange(). (closes vim/vim#12342, closes vim/vim#12341)

53f5e51628

Move assert_type_T to testing.c and remove ASSERT_INRANGE.
2023-05-05 19:43:16 +08:00
49c3eb01ab vim-patch:9.0.0854: no proper test for what 9.0.0846 fixes
Problem:    No proper test for what 9.0.0846 fixes.
Solution:   Run test in a terminal so that the hit-enter prompt can show up.
            (closes vim/vim#11523)

7265851b2b
2023-05-05 19:43:13 +08:00
49a2bb9117 vim-patch:9.0.0846: using assert_fails() may cause hit-enter prompt
Problem:    Using assert_fails() may cause hit-enter prompt.
Solution:   Set no_wait_return. (closes vim/vim#11522)

f220643c26

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-05 19:43:13 +08:00
050b24cbcc vim-patch:9.0.0543: insufficient testing for assert and test functions
Problem:    Insufficient testing for assert and test functions.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#11190)

e24b5e0b0f

Cherry-pick E1219 from patch 8.2.3229.
Cherry-pick test_assert.vim change from patch 9.0.0491.
Cherry-pick the whole Test_refcount() function and skip it.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-05-05 19:43:13 +08:00
5fb6b3431a vim-patch:9.0.0404: crash when passing invalid arguments to assert_fails()
Problem:    Crash when passing invalid arguments to assert_fails().
Solution:   Check for NULL string.

1540d334a0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-05 19:43:13 +08:00
17c8e39f88 vim-patch:9.0.0213: using freed memory with error in assert argument
Problem:    Using freed memory with error in assert argument.
Solution:   Make a copy of the error.

249e1b903a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-05 19:43:13 +08:00
0a3a2132d4 vim-patch:8.2.1953: Vim9: extra "unknown" error after other error
Problem:    Vim9: extra "unknown" error after other error.
Solution:   Restore did_emsg count after EXEC instruction. (closes vim/vim#7254)
            Improve error message from assert_fails()

631e8f9345

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-05 19:43:10 +08:00
d9f0d2da4d Merge pull request #23482 from zeertzjq/do-cmdline-verbose
fix(excmd): append original command to error message
2023-05-05 19:33:06 +08:00
3a1e17e3a1 test: add tests for executing commands with backwards range 2023-05-05 19:07:56 +08:00
648f777931 perf(lsp): load buffer contents once when processing semantic tokens responses (#23484)
perf(lsp): load buffer contents once when processing semantic token responses

Using _get_line_byte_from_position() for each token's boundaries was a
pretty huge bottleneck, since that function would load individual buffer
lines via nvim_buf_get_lines() (plus a lot of extra overhead). So each
token caused two calls to nvim_buf_get_lines() (once for the start
position, and once for the end position).

For semantic tokens, we only attach to buffers that have already been
loaded, so we can safely just get all the lines for the entire buffer at
once, and lift the rest of the _get_line_byte_from_position()
implementation directly while bypassing the part that loads the buffer
line.

While I was looking at get_lines (used by _get_line_byte_from_position),
I noticed that we were checking for non-file URIs before we even looked
to see if we already had the buffer loaded. Moving the buffer-loaded
check to be the first thing done in get_lines() more than halved the
average time spent transforming the token list into highlight ranges vs
when it was still using _get_line_byte_from_position. I ended up
improving that loop more by not using get_lines, but figured the
performance improvement it provided was worth leaving in.
2023-05-05 07:41:36 +02:00
4a098b97e5 fix(excmd): append original command to error message
Revert the change to do_cmdline_cmd() from #5226.

This function is used in many places, so making it different from Vim
leads to small differences from Vim in the behavior of some functions
like execute() and assert_fails(). If DOCMD_VERBOSE really needs to be
removed somewhere, a do_cmdline() call without DOCMD_VERBOSE is also
shorter than a do_cmdline() call with DOCMD_VERBOSE.
2023-05-05 10:43:28 +08:00
9ded4c1275 Merge pull request #23483 from zeertzjq/vim-8.2.3135
vim-patch:8.2.{3135,4890,4892},9.0.0250: error message improvements
2023-05-05 09:50:36 +08:00
bdaaf2e8e1 vim-patch:9.0.0250: slightly inconsistent error messages
Problem:    Slightly inconsistent error messages.
Solution:   Make it "Using a Float". (closes vim/vim#10959)

dde77a7c4d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-05 09:20:30 +08:00
15c502d8be vim-patch:8.2.4892: test failures because of changed error messages
Problem:    Test failures because of changed error messages.
Solution:   Adjust the exptected error messages.

ec89223478

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-05 09:20:30 +08:00
88cfb49bee vim-patch:8.2.4890: inconsistent capitalization in error messages
Problem:    Inconsistent capitalization in error messages.
Solution:   Make capitalization consistent. (Doug Kearns)

cf030578b2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-05 09:20:30 +08:00
b8d5586d5b refactor: using a different error number for 'mousescroll'
Because E548 is linked to 'guicursor' in help.
2023-05-05 09:19:06 +08:00
75119fcc86 vim-patch:8.2.3135: Vim9: builtin function arguments not checked at compile time
Problem:    Vim9: builtin function arguments not checked at compile time.
Solution:   Add more type checks. (Yegappan Lakshmanan, closes vim/vim#8539)

5b73992d8f

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-05-05 09:19:05 +08:00
d79e726212 vim-patch:8.2.4397: crash when using many composing characters in error message (#23481)
Problem:    Crash when using many composing characters in error message.
Solution:   Use mb_cptr2char_adv() instead of mb_ptr2char_adv().

34f8117dec

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-05 06:22:37 +08:00
f6299e9d6e vim-patch:8.2.3221: Vim9: argument types are not checked at compile time (#23480)
Problem:    Vim9: argument types are not checked at compile time.
Solution:   Add several more type checks. (Yegappan Lakshmanan, closes vim/vim#8632)

a764e73d4f

Cherry-pick test_assert.vim change from patch 8.2.3229.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-05-05 06:22:18 +08:00
b16729f816 vim-patch:8.2.1697: inconsistent capitalization of error messages (#23476)
Problem:    Inconsistent capitalization of error messages.
Solution:   Always start with a capital.

7707228aac

Most of these errors are Vim9 script only.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-04 23:17:43 +08:00
fe7cdc7cc0 vim-patch:9.0.0601: too much indent (#23472)
Problem:    Too much indent.
Solution:   Return out early from a funtion. (Yegappan Lakshmanan,
            close vim/vim#11238)

368aa69088

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-05-04 19:07:54 +08:00
7ae57435be Merge pull request #23470 from zeertzjq/vim-8.2.2344
vim-patch:8.2.{1461,1462,1466,2344,2607,2756}
2023-05-04 18:29:18 +08:00
8752da89b8 vim-patch:8.2.2756: Vim9: blob index and slice not implemented yet
Problem:    Vim9: blob index and slice not implemented yet.
Solution:   Implement blob index and slice.

cfc3023cb6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-04 17:59:21 +08:00
3724e65c30 vim-patch:8.2.2607: strcharpart() cannot include composing characters
Problem:    strcharpart() cannot include composing characters.
Solution:   Add the {skipcc} argument.

02b4d9b18a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-04 17:49:56 +08:00
b441dafdf5 vim-patch:8.2.2344: using inclusive index for slice is not always desired
Problem:    Using inclusive index for slice is not always desired.
Solution:   Add the slice() method, which has an exclusive index. (closes
            vim/vim#7408)

6601b62943

Cherry-pick a line in docs added later.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-04 17:40:29 +08:00
62351ff3d2 vim-patch:8.2.1466: Vim9: cannot index or slice a variable with type "any"
Problem:    Vim9: cannot index or slice a variable with type "any".
Solution:   Add runtime index and slice.

cc673e746a

Missing changes from the last PR.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-04 17:30:18 +08:00
f5cefd70e4 vim-patch:8.2.1462: Vim9: string slice not supported yet
Problem:    Vim9: string slice not supported yet.
Solution:   Add support for string slicing.

11107bab7e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-04 17:20:53 +08:00
dd3d857c39 vim-patch:8.2.1461: Vim9: string indexes are counted in bytes
Problem:    Vim9: string indexes are counted in bytes.
Solution:   Use character indexes. (closes vim/vim#6574)

e3c37d8ebf

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-04 17:16:23 +08:00
38f9ee6366 Merge pull request #23468 from zeertzjq/vim-8.2.1466
vim-patch:8.2.{1466,3336}
2023-05-04 16:42:20 +08:00
47132823ab vim-patch:8.2.3336: behavior of negative index in list change changed
Problem:    Behavior of negative index in list change changed. (Naruhiko
            Nishino)
Solution:   Only change it for Vim9 script. (closes vim/vim#8749)

92f05f21af

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-04 16:14:43 +08:00
7ac63906ea vim-patch:8.2.1466: Vim9: cannot index or slice a variable with type "any"
Problem:    Vim9: cannot index or slice a variable with type "any".
Solution:   Add runtime index and slice.

cc673e746a

Omit E1024 and E1062: Vim9 script only.
Omit string_slice() and char_idx2byte(): Vim9 script only.
Remove the first tv_is_luafunc() check because it always returns false.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-04 16:10:17 +08:00
b9e34571f9 Merge pull request #23467 from zeertzjq/vim-8.2.0987
vim-patch:8.2.{0987,1463}
2023-05-04 15:09:50 +08:00
f4043e290e vim-patch:8.2.1463: Vim9: list slice not supported yet
Problem:    Vim9: list slice not supported yet.
Solution:   Add support for list slicing.

ed5918771f

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-04 14:44:38 +08:00
1659cd15be vim-patch:8.2.0987: Vim9: cannot assign to [var; var]
Problem:    Vim9: cannot assign to [var; var].
Solution:   Assign rest of items to a list.

9af78769ee

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-04 14:44:38 +08:00
24d4a82569 Merge pull request #23466 from zeertzjq/vim-9.0.0138
vim-patch:9.0.{0138,0240}: two spell fixes
2023-05-04 14:44:13 +08:00
7ddf235d7e vim-patch:9.0.0240: crash when using ":mkspell" with an empty .dic file
Problem:    Crash when using ":mkspell" with an empty .dic file.
Solution:   Check for an empty word tree.

6669de1b23

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-04 13:51:01 +08:00
7e70a1e44b vim-patch:9.0.0138: not enough characters accepted for 'spellfile'
Problem:    Not enough characters accepted for 'spellfile'.
Solution:   Add vim_is_fname_char() and use it for 'spellfile'.

bc49c5f48f

Cherry-pick related doc update from Vim runtime.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-04 13:48:52 +08:00
a1bd31e601 Merge pull request #23464 from zeertzjq/vim-9.0.0609
vim-patch:9.0.{0609,0612}
2023-05-04 13:09:43 +08:00
ecfca812d6 vim-patch:9.0.0612: blockedit test passes with wrong result
Problem:    Blockedit test passes with wrong result.
Solution:   Add a "vim9script" line to make indenting work.

47da934844

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-04 12:29:07 +08:00
dd8ebea01e vim-patch:9.0.0609: blockedit test fails because of wrong indent
Problem:    Blockedit test fails because of wrong indent.
Solution:   Adjust the expected text temporarily

66000ff9af

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-04 12:28:57 +08:00
143a178332 fix(editorconfig): add missing root validation (#23462) 2023-05-03 12:26:40 -06:00
39caf86e8a Merge pull request #23428 from luukvbaal/gridclear
fix(tui): grid_clear properly clears the screen
2023-05-03 15:49:25 +02:00
197827321a fix(tui): grid_clear properly clears the screen
Problem:    When setting a shell size smaller than the containing
            terminal window through `:winsize` or `:set lines/columns`
            the screen is not properly cleared.
Solution:   Clear the tui dimensions rather than the grid dimensions.
2023-05-03 14:58:25 +02:00
dc394b9641 fix(mouse): fix popup menu position check with winbar (#23456) 2023-05-03 10:29:19 +08:00
a4bb8c37db vim-patch:9.0.1028: mouse shape test is flaky, especially on Mac OS (#23455)
Problem:    Mouse shape test is flaky, especially on Mac OS.
Solution:   Instead of starting all timers at the same time, start the next
            one in the callback of the previous one. (Yee Cheng Chin,
            closes vim/vim#11673)  Also use "bwipe!" instead of "close!" to avoid
            swap files remaining.

1881abfc34

Cherry-pick test_normal.vim changes from patch 8.2.3795.

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-05-03 08:15:07 +08:00
1975062d3c vim-patch:9.0.0662: concealed characters do not work correctly (#23454)
Problem:    Concealed characters do not work correctly.
Solution:   Subtract boguscols instead of adding them. (closes vim/vim#11273)

7500866182

Code change is N/A as Nvim has a draw_col variable instead.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-03 07:54:17 +08:00
62ecb05957 vim-patch:9.0.1506: line number not displayed when using 'smoothscroll' (#23453)
Problem:    Line number not displayed when using 'smoothscroll'.
Solution:   Adjust condition for showing the line number. (closes vim/vim#12333)

88bb3e0a48
2023-05-03 07:21:09 +08:00
9909668111 build: create a text file for specifying dependency information
The cmake.deps build will read this file and set the left part of the
text as the variable name and the right part as the variable value. The
benefit of doing this is that it becomes much easier to parse which
dependencies are required, as well as to bump dependencies with
scripts/bump_deps.lua.

Adjust bump_deps.lua script to work with this new format.
2023-05-03 00:31:07 +02:00
540941ef83 fix(pum): don't position too far with resized parent grid (#23442) 2023-05-03 06:17:53 +08:00
3ba930844c perf(treesitter): insert/remove items efficiently (#23443) 2023-05-02 22:27:14 +01:00
8bc973c6f5 fix(pum): fix missing scrollbar with 'rightleft' (#23448) 2023-05-03 01:13:03 +08:00
bff3f4fa8b vim-patch:9.0.1505: error when heredoc content looks like heredoc (#23446)
Problem:    Error when heredoc content looks like heredoc.
Solution:   Handle curly expressions. (closes vim/vim#12325)

a93d9cdc74
2023-05-03 00:05:46 +08:00
f186224dfc fix(pum): fix missing rightmost column with 'rightleft' (#23445) 2023-05-02 23:55:14 +08:00
808752f1b0 Merge pull request #23320 from luukvbaal/smoothscroll
feat(ui): add 'smoothscroll' option
2023-05-02 19:42:31 +08:00
5b111a8f00 fix(ui): adjust 'smoothscroll' for inner dimensions 2023-05-02 13:11:47 +02:00
3b906af27f test: 'smoothscroll' <<< marker shows with tabline, winbar and splits 2023-05-02 13:11:47 +02:00
3b1d31197c vim-patch:9.0.1502: no test for deleting the end of a long wrapped line
Problem:    No test for deleting the end of a long wrapped line.
Solution:   Add a test to check the right text is displayed. (Luuk van Baal,
            closes vim/vim#12318)

5b10a14098

Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
2023-05-02 13:11:47 +02:00
f78130b2d8 test: 'smoothscroll' works with virt_lines above and below 2023-05-02 13:11:47 +02:00
35ed79a915 vim-patch:9.0.1435: scrolling too many lines when 'wrap' and 'diff' are set
Problem:    Scrolling too many lines when 'wrap' and 'diff' are set.
Solution:   Only scroll by screenlines for 'diff' when 'wrap' is not set.
            (closes vim/vim#12211)

38d867f041

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:47 +02:00
7d5673b18b vim-patch:9.0.1367: divide by zero in zero-width window
Problem:    Divide by zero in zero-width window.
Solution:   Check the width is positive.

e0f8691969

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:47 +02:00
4e4383ffa2 vim-patch:9.0.1247: divide by zero with 'smoothscroll' set and a narrow window
Problem:    Divide by zero with 'smoothscroll' set and a narrow window.
Solution:   Bail out when the window is too narrow.

870219c58c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:47 +02:00
9b9ccac625 vim-patch:9.0.1121: cursor positioning and display problems with 'smoothscroll'
Problem:    Cursor positioning and display problems with 'smoothscroll' and
            using "zt", "zb" or "zz".
Solution:   Adjust computations and conditions. (Yee Cheng Chin,
            closes vim/vim#11764)

db4d88c2ad

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:47 +02:00
6fd7e3bea4 vim-patch:9.0.1000: with 'smoothscroll' skipcol may be reset unnecessarily
Problem:    With 'smoothscroll' skipcol may be reset unnecessarily.
Solution:   Check the line does actually fit in the window.

b21b8e9ed0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:47 +02:00
c25fd85c2e vim-patch:9.0.0998: "gk" may reset skipcol when not needed
Problem:    "gk" may reset skipcol when not needed.
Solution:   Only reset skipcol if the cursor column is less.

1b73edd9ee

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:47 +02:00
5ba11087b6 vim-patch:9.0.0911: with 'smoothscroll' set mouse click position may be wrong
Problem:    With 'smoothscroll' set mouse click position may be wrong.
Solution:   Adjust computations for w_skipcol. (Yee Cheng Chin, closes vim/vim#11514)

e6392b1021

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-05-02 13:11:47 +02:00
46646a9bb8 vim-patch:9.0.0908: with 'smoothscroll' cursor may end up in wrong position
Problem:    With 'smoothscroll' cursor may end up in wrong position.
Solution:   Correct the computation of screen lines. (Yee Cheng Chin,
            closes vim/vim#11502)

361895d2a1

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-05-02 13:11:47 +02:00
26a9f0e94e vim-patch:9.0.0901: setting w_leftcol and handling side effects is confusing
Problem:    Setting w_leftcol and handling side effects is confusing.
Solution:   Use a function to set w_leftcol() and handle side effects.

0c34d56264

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:47 +02:00
3621604029 vim-patch:9.0.0900: cursor moves too far with 'smoothscroll'
Problem:    Cursor moves too far with 'smoothscroll'.
Solution:   Only move as far as really needed. (Yee Cheng Chin, closes vim/vim#11504)

81ba26e9de

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-05-02 13:11:47 +02:00
0bcf2a6382 vim-patch:9.0.0898: with 'smoothscroll' cursor is one screen line too far down
Problem:    With 'smoothscroll' cursor is one screen line too far down. (Ernie
            Rael)
Solution:   Add a test that currently has the wrong result so that a fix can
            be made. (issue vim/vim#11436)

75ac25b496

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:47 +02:00
a2f3855291 vim-patch:9.0.0893: 'smoothscroll' cursor calculations wrong when 'number' is set
Problem:    'smoothscroll' cursor calculations wrong when 'number' is set.
Solution:   Correct the code that computes the width. (closes vim/vim#11492)

01ee52bab6

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-05-02 13:11:47 +02:00
5e4df766f6 vim-patch:9.0.0892: may redraw when not needed
Problem:    May redraw when not needed, causing slow scrolling.
Solution:   Do not redraw when w_skipcol doesn't change.  When w_skipcol
            changes only redraw from the top. (issue vim/vim#11559)

f32fb93e43

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:47 +02:00
88d13d2778 vim-patch:9.0.0807: with 'smoothscroll' typing "0" may not go to the first column
Problem:    With 'smoothscroll' typing "0" may not go to the first column.
Solution:   Recompute w_cline_height when needed.  Do not scroll up when it
            would move the cursor.

d5337efece

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:47 +02:00
0588329c85 vim-patch:9.0.0760: display test for 'listchars' "precedes" fails
Problem:    Display test for 'listchars' "precedes" fails.
Solution:   Correct the expected result.

297164cb79

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:47 +02:00
72c525d567 vim-patch:9.0.0758: "precedes" from 'listchars' overwritten by <<<
Problem:    "precedes" from 'listchars' overwritten by <<< for 'smoothscroll'.
Solution:   Keep the "precedes" character.

13cdde3952

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:47 +02:00
6146400605 vim-patch:9.0.0757: line number not visisble with 'smoothscroll', 'nu' and 'rnu'
Problem:    Line number not visisble with 'smoothscroll', 'nu' and 'rnu'.
Solution:   Put the ">>>" after the line number instead of on top.

eb4de62931

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:47 +02:00
c426f7a622 vim-patch:9.0.0751: 'scrolloff' does not work well with 'smoothscroll'
Problem:    'scrolloff' does not work well with 'smoothscroll'.
Solution:   Make positioning the cursor a bit better.  Rename functions.

c9121f798f

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:47 +02:00
223c7173ee vim-patch:9.0.0746: breakindent test cases are commented out
Problem:    Breakindent test cases are commented out.
Solution:   Adjust expected result to slightly different behavior.  Correct
            computations for cursor position.

856c5d2bc7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:47 +02:00
e8dfff5f28 vim-patch:9.0.0745: wrong cursor position when using "gj" and "gk" in a long line
Problem:    Wrong cursor position when using "gj" and "gk" in a long line.
Solution:   Adjust computations for the cursor position and skipcol. Re-enable
            tests that pass now, disable failing breakindent test.

4b6172e108

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:47 +02:00
9189c2d162 vim-patch:9.0.0735: breakindent and scrolloff tests fail
Problem:    Breakindent and scrolloff tests fail.
Solution:   Temporarily skip the assertions.

e42033e735

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:47 +02:00
bf12a85a69 vim-patch:9.0.0734: cursor position invalid when scrolling with 'smoothscroll'
Problem:    Cursor position invalid when scrolling with 'smoothscroll' set.
            (Ernie Rael)
Solution:   Add w_valid_skipcol and clear flags when it changes.  Adjust
            w_skipcol after moving the cursor.

2fbabd238a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:47 +02:00
36c98b47a3 vim-patch:9.0.0707: with 'smoothscroll' cursor position not adjusted in long line
Problem:    With 'smoothscroll' and 'scrolloff' non-zero the cursor position
            is not properly adjusted in a long line.
Solution:   Move the cursor further up or down in the line.

118c235112

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:47 +02:00
f3de7f4468 vim-patch:9.0.0701: with 'smoothscroll' cursor position not adjusted in long line
Problem:    With 'smoothscroll' the cursor position s not adjusted in a long
            line.
Solution:   Move the cursor further up or down in the line.

8cf3459878

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:46 +02:00
2918720add vim-patch:9.0.0681: "<<<" shows for 'smoothscroll' even when 'showbreak is set
Problem:    "<<<" shows for 'smoothscroll' even when 'showbreak is set.
Solution:   When 'showbreak' is set do not display "<<<".

0937b9fb24

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:46 +02:00
34a4f3729c vim-patch:9.0.0680: tests failing with 'breakindent', 'number' and "n" in 'cpo'
Problem:    Tests failing with 'breakindent', 'number' and "n" in 'cpo'.
Solution:   Do count the number column in topline if 'breakindent' is set.

3725116f6e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:46 +02:00
1757ffad4b vim-patch:9.0.0679: tests failing with 'smoothscroll', 'number' and "n" in 'cpo'
Problem:    Tests failing with 'smoothscroll', 'number' and "n" in 'cpo'.
Solution:   Do not count number column in topline if columns are skipped.

35b251d2c2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:46 +02:00
7dc2c087e7 vim-patch:9.0.0677: breakindent test accepts wrong result
Problem:    Breakindent test accepts wrong result.
Solution:   Fix the number column and adjust the expected text.

06618f94f1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:46 +02:00
d95697d6d4 vim-patch:9.0.0673: first line wong with 'smoothscroll' and 'scrolloff' zero
Problem:    First line not scrolled properly with 'smoothscroll' and
            'scrolloff' zero and using "k".
Solution:   Make sure the cursor position is visible.

46b54747c5

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:46 +02:00
3a1973debc vim-patch:9.0.0672: line partly shows with 'smoothscroll' and 'scrolloff' zero
Problem:    Cursor line only partly shows with 'smoothscroll' and 'scrolloff'
            zero.
Solution:   Do not use 'smoothscroll' when adjusting the bottom of the window.
            (closes vim/vim#11269)

9bab7a0243

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:46 +02:00
8e4a4629ca vim-patch:9.0.0671: negative topline using CTRL-Y with 'smoothscroll' and 'diff'
Problem:    Negative topline using CTRL-Y with 'smoothscroll' and 'diff'.
            (Ernie Rael)
Solution:   Only use 'smoothscroll' when 'wrap' is set.

1a58e1d97c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:46 +02:00
181097e443 vim-patch:9.0.0654: breakindent test fails
Problem:    Breakindent test fails.
Solution:   Temporarily accept wrong result.

ec32c781a2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:46 +02:00
f3b44cf23d vim-patch:9.0.0652: 'smoothscroll' not tested with 'number' and "n" in 'cpo'
Problem:    'smoothscroll' not tested with 'number' and "n" in 'cpo'.
Solution:   Add tests, fix uncovered problem.

b6aab8f44b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:46 +02:00
e9b1df21bc vim-patch:9.0.0650: some tests are failing
Problem:    Some tests are failing.
Solution:   Adjust for "<<<" showing up.

0466d398a5

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:46 +02:00
a43b28a34c vim-patch:9.0.0649: no indication the first line is broken for 'smoothscroll'
Problem:    No indication when the first line is broken for 'smoothscroll'.
Solution:   Show "<<<" in the first line.

406b5d89e1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:46 +02:00
d6050e9bda vim-patch:9.0.0646: with 'smoothscroll' CTRL-E is wrong when 'foldmethod' set
Problem:    with 'smoothscroll' set CTRL-E does not work properly when
            'foldmethod' is set to "indent". (Yee Cheng Chin)
Solution:   Merge the code for scroling with folds and 'smoothscroll'.
            (closes vim/vim#11262)

6b2d4ff714

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:46 +02:00
69af5e8782 vim-patch:9.0.0645: CTRL-Y does not stop at line 1
Problem:    CTRL-Y does not stop at line 1. (John Marriott)
Solution:   Stop at line 1 when 'smoothscroll' is not set. (closes vim/vim#11261)

8df9748edb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:46 +02:00
9128fc79f0 vim-patch:9.0.0644: 'smoothscroll' is not copied to a new window on :split
Problem:    'smoothscroll' is not copied to a new window on :split.
Solution:   Copy the option value.  Add a test.

b1fd26d208

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:46 +02:00
e51e63c9ba vim-patch:9.0.0643: smoothscroll test fails
Problem:    Smoothscroll test fails.
Solution:   Check if skipcol changed.

b34c4b7863

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:46 +02:00
7cc3062e9c vim-patch:9.0.0642: breakindent test fails
Problem:    Breakindent test fails.
Solution:   Correct logic for resetting need_showbreak.

693729ae58

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:46 +02:00
be11f80d01 vim-patch:9.0.0640: cannot scroll by screen line if a line wraps
Problem:    Cannot scroll by screen line if a line wraps.
Solution:   Add the 'smoothscroll' option.  Only works for CTRL-E and CTRL-Y
            so far.

f6196f4244

vim-patch:9.0.0641: missing part of the new option code

Problem:    Missing part of the new option code.
Solution:   Add missing WV_SMS.

bbbda8fd81

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:26 +02:00
fba18a3b62 fix(treesitter): do not calc folds on unloaded buffers
Fixes #23423
2023-05-02 10:07:18 +01:00
bfb19a110d docs(html): right-align inline tags (#23403) 2023-05-02 09:45:44 +02:00
7c1921e9d6 fix(mouse): fix popup_setpos position check with ext_multigrid (#23436) 2023-05-02 15:25:41 +08:00
86c9d8b53c fix(gen_vimvim): correctly add aliases to vimAutoEvent (#23429)
close #23424
2023-05-02 15:16:52 +08:00
22170efb47 Merge pull request #23430 from zeertzjq/multigrid-resized
Fix bugs with ext_multigrid resized grid
2023-05-02 12:28:26 +08:00
088cdf69e3 fix(normal): make "g$" work properly with resized grid 2023-05-02 12:04:49 +08:00
37b73cf14b fix(drawline): make cursorlineopt=screenline work with resized grid 2023-05-02 12:04:49 +08:00
03e8b5fc91 fix(float): make bufpos work properly with resized parent grid 2023-05-02 12:04:48 +08:00
26cc946226 fix(treesitter): foldexpr tweaks
Some small general fixes found working on developing async parsing.
2023-05-01 10:32:29 +01:00
37dd818722 vim-patch:9.0.1503: Luau files are not recognized (#23412)
Problem:    Luau files are not recognized.
Solution:   Add a patter for Luau files. (Amaan Qureshi, closes vim/vim#12317)

2dcfe9ae1d

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-05-01 10:55:51 +02:00
5e31f53457 docs(lsp): remove vim.lsp.sync (#23416)
The module is used internally and not intended to be used by plugins or
users.
2023-05-01 10:54:37 +02:00
37bc73e9bc build: change dependency URLs to cache variables
This makes it possible to specify a different URL or file path from the
command line.

Closes https://github.com/neovim/neovim/issues/23366.
2023-05-01 07:52:23 +02:00
e7da49d5bf ci: don't install unnecessary dependencies 2023-05-01 07:39:27 +02:00
0f1b511f23 fix(tui): redraw on SIGWINCH even if size didn't change 2023-05-01 13:17:03 +08:00
edf05b005f perf(lsp): process semantic tokens response in a coroutine that yields every 5ms (#23375) 2023-05-01 07:15:32 +02:00
a803bff89c fix(spell): extmark with spell=false should disable spell (#23400) 2023-05-01 12:30:55 +08:00
9f9cef1b56 build: make lpeg an imported library
Cmake truncates the full link path to a shared library if it is missing
an SONAME in some undocumented scenarios. This causes builds in some
systems to fail if "lpeg" isn't a library on the system path.

The path of imported libraries aren't modified by cmake, so we can use
that as a workaround until a proper solution for this has been
identified.

Closes https://github.com/neovim/neovim/issues/23395.
2023-04-30 23:57:15 +02:00
066db5e7cd vim-patch:9.0.1500: The falsy operator is not tested properly (#23407)
Problem:    The falsy operator is not tested properly.
Solution:   Add a few more test cases. (closes vim/vim#12319)

58a44751ce
2023-04-30 23:24:16 +08:00
19a793545f fix(treesitter): redraw added/removed injections properly (#23287)
When injections are added or removed make sure to:
- invoke 'changedtree' callbacks for when new trees are added.
- invoke 'changedtree' callbacks for when trees are invalidated
- redraw regions when languagetree children are removed
2023-04-30 17:11:38 +02:00
7e3d6ff405 build(deps): bump LuaJIT to HEAD - 224129a8e (#23405) 2023-04-30 15:36:17 +02:00
064bf39c46 docs: fix erroneous nvim_buf_set_extmark example (#23404) 2023-04-30 14:36:54 +02:00
JP
4f3f81ed86 docs(api): document nvim_buf_add_highlight vs nvim_buf_set_extmark (#23310) 2023-04-30 11:02:38 +02:00
668f16bac7 feat(treesitter): upstream query omnifunc from playground (#23394)
and set by default in `ftplugin/query.lua`
2023-04-30 11:01:54 +02:00
fa20c12ba3 version.c: update [skip ci] (#23388)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2023-04-30 12:40:01 +08:00
2d54f5e903 Merge pull request #23382 from gpanders/iter-benchmark
Add vim.iter benchmark to benchmark test suite
2023-04-29 20:33:27 -06:00
ab7dcefbeb vim-patch:9.0.1499: using uninitialized memory with fuzzy matching (#23399)
Problem:    Using uninitialized memory with fuzzy matching.
Solution:   Initialize the arrays used to store match positions.

caf642c25d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-30 08:27:38 +08:00
c194acbfc4 feat(treesitter): add query_linter from nvim-treesitter/playground (#22784)
Co-authored-by: clason <clason@users.noreply.github.com>
Co-authored-by: lewis6991 <lewis6991@users.noreply.github.com>
2023-04-29 18:22:26 +02:00
933fdff466 ci: make install_deps.sh more flexible
This will allow us to use it in containers as well as specify whether we
want to install test dependencies.
2023-04-29 15:43:54 +02:00
13a24b905e ci: run lintcommit with cmake target
This increases CI time, but prevents situations where it works on CI but
not locally.
2023-04-29 14:30:54 +02:00
65fdd019b3 vim-patch:9.0.1497: the ruler percentage can't be localized (#23389)
Problem:    The ruler percentage can't be localized.
Solution:   Use a string that can be translated. (Emir Sari, closes vim/vim#12311)

971cd2b8bc

Co-authored-by: Emir SARI <emir_sari@icloud.com>
2023-04-29 19:46:47 +08:00
9f2fd89948 ci: install uncrustify through homebrew
It will result in less CI code, and the additional CI time is
negligible.
2023-04-29 13:39:36 +02:00
3287fc2ba9 Merge pull request #23386 from zeertzjq/vim-8.2.0551
vim-patch:8.2.{0551,0578,0672}: heredoc for interfaces does not support "trim"
2023-04-29 10:07:51 +08:00
7b6d041bae fix(heredoc): allow missing end marker for scripts
Also do not crash when getting heredoc fails.
2023-04-29 09:39:55 +08:00
2eb1f62e29 vim-patch:8.2.0672: heredoc in scripts does not accept lower case marker
Problem:    Heredoc in scripts does not accept lower case marker.
Solution:   Allow lower case only in non-Vim scripts. (Ken Takata,
            closes vim/vim#6019)

6ab0953fef
2023-04-29 09:20:52 +08:00
4bcf8c15b3 vim-patch:8.2.0578: heredoc for interfaces does not support "trim"
Problem:    Heredoc for interfaces does not support "trim".
Solution:   Update the script heredoc support to be same as the :let command.
            (Yegappan Lakshmanan, closes vim/vim#5916)

6c2b7b8055
2023-04-29 09:20:52 +08:00
291fd767e3 vim-patch:8.2.0551: not all code for options is tested
Problem:    Not all code for options is tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5913)

1363a30cef
2023-04-29 09:07:10 +08:00
1290121722 build: add CMakePresets for deps build to reduce verbosity 2023-04-29 01:48:36 +02:00
057af3203b ci: replace stylua action with our own lint target
This will prevent situations where the linting works on CI but not
locally, at the cost of increased CI time.

Also manually ignore `runtime/vim/lua/re.lua`, as the .styluaignore
isn't respected when specifying a file instead of a directory.
2023-04-29 01:48:14 +02:00
ef1801cc7c perf(iter): reduce number of table allocations
Packing and unpacking return values impairs performance considerably.
In an attempt to avoid creating tables as much as possible we can
instead pass return values between functions (which does not require
knowing the number of values a function might return). This makes the
code more complex, but improves benchmark numbers non-trivially.
2023-04-28 15:38:50 -06:00
5a0250c9a7 test: add benchmark for vim.iter 2023-04-28 15:38:50 -06:00
4720f4379a Merge pull request #23377 from zeertzjq/vim-9.0.1336
vim-patch:9.0.{1336,1372}
2023-04-28 23:58:31 +08:00
dfb2808d1a vim-patch:9.0.1372: test for 'toolbariconsize' may fail
Problem:    Test for 'toolbariconsize' may fail.
Solution:   Only test 'toolbariconsize' when it is supported. (James McCoy,
            closes vim/vim#12095)

db1887ce40

Co-authored-by: James McCoy <jamessan@jamessan.com>
2023-04-28 23:48:44 +08:00
e9fa6f10a0 vim-patch:9.0.1336: functions without arguments are not always declared properly
Problem:    Functions without arguments are not always declared properly.
Solution:   Use "(void)" instead of "()". (Yegappan Lakshmanan, closes vim/vim#12031)

a23a11b5bf

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-04-28 23:48:32 +08:00
233b858f2a Merge pull request #23162 from lewis6991/vimpatch/option_cb
vim-patch:9.0.{1330,1345,1353,1359,1369,1374}: handling new value of an option has a long "else if" chain
2023-04-28 23:40:34 +08:00
ca7e488cfe feat: add link in issue template to minimal config template 2023-04-28 16:09:05 +01:00
2722bff0f3 refactor(option.c): make did_set callbacks static 2023-04-28 23:04:12 +08:00
0d1ae6e1b7 vim-patch:9.0.1374: function for setting options not used consistently
Problem:    Function for setting options not used consistently.
Solution:   Use a function for 'encoding' and terminal options. (Yegappan
            Lakshmanan, closes vim/vim#12099)

c727b19e9f
2023-04-28 23:04:12 +08:00
d04770a543 vim-patch:9.0.1369: still some "else if" constructs for setting options
Problem:    Still some "else if" constructs for setting options.
Solution:   Add a few more functions for handling options. (Yegappan
            Lakshmanan, closes vim/vim#12090)

c6ff21e876
2023-04-28 23:04:12 +08:00
5cda9c267a vim-patch:9.0.1359: too many "else if" statements in handling options
Problem:    Too many "else if" statements in handling options.
Solution:   Add more functions for handling option changes. (Yegappan
            Lakshmanan, closes vim/vim#12060)

5da901bb68
2023-04-28 23:04:12 +08:00
bb7371ad82 vim-patch:9.0.1353: too many "else if" statements to handle option values
Problem:    Too many "else if" statements to handle option values.
Solution:   Add more functions to handle option value changes. (Yegappan
            Lakshmanan, closes vim/vim#12058)

6d611de58c
2023-04-28 23:04:12 +08:00
46022a6b38 vim-patch:9.0.1345: too many "else if" statements for handling options
Problem:    Too many "else if" statements for handling options.
Solution:   Add more functions to handle options. (Yegappan Lakshmanan,
            closes vim/vim#12051)

8ad862a1f9
2023-04-28 23:04:12 +08:00
ff34c91194 vim-patch:9.0.1330: handling new value of an option has a long "else if" chain
Problem:    Handling new value of an option has a long "else if" chain.
Solution:   Use a function pointer. (Yegappan Lakshmanan, closes vim/vim#12015)

af93691b53
2023-04-28 23:04:09 +08:00
715587f8e4 vim-patch:8.2.3509: undo file is not synced (#23371)
Problem:    Undo file is not synced. (Sami Farin)
Solution:   Sync the undo file if 'fsync' is set. (Christian Brabandt,
            closes vim/vim#8879, closes vim/vim#8920)

340dd0fbe4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 21:07:00 +08:00
4f235e3caf fix(tui): position cursor at bottom-left before stopping (#23369)
Fix #23361
2023-04-28 20:26:02 +08:00
727ec8d59d Merge pull request #23367 from zeertzjq/vim-8.2.1108
vim-patch:8.2.{1108,partial:1235},9.0.1084
2023-04-28 18:20:26 +08:00
f60551f387 vim-patch:9.0.1084: code handling low level MS-Windows events cannot be tested
Problem:    Code handling low level MS-Windows events cannot be tested.
Solution:   Add test_mswin_event() and tests using it. (Christopher Plewright,
            closes vim/vim#11622)

20b795e0eb
2023-04-28 17:55:46 +08:00
c0e76fcc44 vim-patch:partial:8.2.1235: Not all mouse codes covered by tests
Problem:    Not all mouse codes covered by tests.
Solution:   Add more tests for the mouse. (Yegappan Lakshmanan, closes vim/vim#6472)

2764d06ab7

Cherry-pick typo fixes from patch 8.2.0020.
2023-04-28 17:55:44 +08:00
0c5b03d83a vim-patch:8.2.1108: mouse left-right scroll is not supported in terminal window
Problem:    Mouse left-right scroll is not supported in terminal window.
Solution:   Implement mouse codes 6 and 7. (Trygve Aaberge, closes vim/vim#6363)

d58d4f90ae
2023-04-28 17:55:41 +08:00
d8cc98caae Merge pull request #23364 from zeertzjq/vim-8.1.1155
vim-patch:8.1.{partial:1155,1160,1165,1167,1175,1176,1178,1179,1181,1216,1223,1244,1247,1248,.2106,2148,2306},9.0.0825
2023-04-28 17:07:48 +08:00
45c9b10afc vim-patch:9.0.0825: cannot drag an entry in the tabpage line
Problem:    Cannot drag an entry in the tabpage line.
Solution:   Clear dragwin instead of got_click. (closes vim/vim#11483,
            closes vim/vim#11482)

8e0ccb6bc2
2023-04-28 16:43:38 +08:00
552632c959 vim-patch:8.1.2306: double and triple clicks are not tested
Problem:    Double and triple clicks are not tested.
Solution:   Test mouse clicks to select text. (closes vim/vim#5226)

f36a2c7e60

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 16:43:38 +08:00
b947beb058 vim-patch:8.1.2148: no test for right click extending Visual area
Problem:    No test for right click extending Visual area.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#5018)

6aa7523b96

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 16:43:38 +08:00
dda5cddbef vim-patch:8.1.2106: no tests for dragging the mouse beyond the window
Problem:    No tests for dragging the mouse beyond the window.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#5004)

b4367b7fb6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 16:43:38 +08:00
d857448466 vim-patch:8.1.1248: no test for dec mouse
Problem:    No test for dec mouse.
Solution:   Add some tests for dec mouse.  Add "no_query_mouse".

92fd599e0d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 16:43:38 +08:00
bc8549f818 vim-patch:8.1.1247: urxvt mouse codes are not tested
Problem:    Urxvt mouse codes are not tested.
Solution:   Also set 'ttymouse' to "urxvt" in the termcodes test.

d0621d85a6

Use code from latest tests instead.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 16:43:38 +08:00
458633071a vim-patch:8.1.1244: no tests for CTRL-mouse-click
Problem:    No tests for CTRL-mouse-click.
Solution:   Add a few tests. (Dominique Pelle, closes vim/vim#4323)

1ee36d6ff5

Use usr_toc.txt instead of help.txt.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 16:43:27 +08:00
2a84e20ff5 vim-patch:8.1.1223: middle mouse click test fails without a clipboard
Problem:    Middle mouse click test fails without a clipboard.
Solution:   Check if the clipboard can be used. (Dominique Pelle, Christian
            Brabandt)  Also use WorkingClipboard() instead of checking for the
            "clipboard" feature.

564344ace9

Use CheckFeature clipboard_working from latest test instead.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 16:42:26 +08:00
f6f96c972a vim-patch:8.1.1216: mouse middle click is not tested
Problem:    Mouse middle click is not tested.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#4310)

c1b8160b44

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 16:42:26 +08:00
6f56d5317e vim-patch:8.1.1181: tests for mouse clicks are a bit flaky
Problem:    Tests for mouse clicks are a bit flaky when run in an interactive
            terminal.
Solution:   Use "xterm2" instead of "xterm" for 'ttymouse' to avoid spurious
            drag events.

2b00b9b0f3

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 16:42:26 +08:00
2be868ab5e vim-patch:8.1.1179: no test for mouse clicks in the fold column
Problem:    No test for mouse clicks in the fold column.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#4261)

696d637728

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 16:42:26 +08:00
355ccaeb04 vim-patch:8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Problem:    When mouse click tests fails value of 'ttytype' is unknown.
Solution:   Add a message to the assert.

4945219b99

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 16:42:26 +08:00
3895def46c vim-patch:8.1.1176: test for dragging a tab is flaky
Problem:    Test for dragging a tab is flaky.
Solution:   Add a brief sleep.

7f27976589

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 16:42:26 +08:00
a8d9f0a2d5 vim-patch:8.1.1175: no test for dragging a tab and double click for new tab
Problem:    No test for dragging a tab with the mouse and for creating a new
            tab by double clicking in the tabline.
Solution:   Add two tests. (Dominique Pelle, closes vim/vim#4258)

e3e3828f93

Set 'mousetime' to 0 instead.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 16:42:26 +08:00
5f710789f9 vim-patch:8.1.1167: no test for closing tab by click in tabline
Problem:    No test for closing tab by click in tabline.
Solution:   Add a test.  Also fix that dragging window separator could fail in
            a large terminal. (Dominique Pelle, closes vim/vim#4253)

39f76c6ac0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 16:42:26 +08:00
b26e242dd3 vim-patch:8.1.1165: no test for mouse clicks in the terminal tabpage line
Problem:    No test for mouse clicks in the terminal tabpage line.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#4247).  Also init
            TabPageIdxs[], in case it's used before a redraw.

ca57ab54d7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 16:42:26 +08:00
718a8862ab vim-patch:8.1.1160: termcodes test would fail in a very big terminal
Problem:    Termcodes test would fail in a very big terminal.
Solution:   Bail out when the row is larger than what will work. (Dominique
            Pelle, closes vim/vim#4246)

c8b3ddab51

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 16:42:26 +08:00
a44c8a3783 vim-patch:partial:8.1.1155: termcodes tests can be improved
Problem:    Termcodes tests can be improved.
Solution:   Add helper functions to simplify tests.  Dragging statusline for
            xterm and sgr. (Dominique Pelle, closes vim/vim#4237)

3fbd2d7c31

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 16:42:23 +08:00
521e039f27 vim-patch:partial:8.2.0425: code for modeless selection not sufficiently tested (#23362)
Problem:    Code for modeless selection not sufficiently tested.
Solution:   Add tests.  Move mouse code functionality to a common script file.
            (Yegappan Lakshmanan, closes vim/vim#5821)

Add some mouse.vim functions that can be made to work in Nvim.

515545e11f
2023-04-28 12:44:11 +08:00
95839a2358 vim-patch:9.0.1494: crash when recovering from corrupted swap file (#23358)
Problem:    Crash when recovering from corrupted swap file.
Solution:   Bail out when the line index looks wrong. (closes vim/vim#12276)

bf1b713202

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 06:27:51 +08:00
50107c3778 Merge pull request #23352 from zeertzjq/pum-at-cursor
fix(pum): make :popup position correctly with float border
2023-04-28 06:23:19 +08:00
aca226d728 vim-patch:9.0.1493: popup menu position wrong in window with toolbar
Problem:    Popup menu position wrong in window with toolbar.
Solution:   Take the window toolbar into account when positioning the popup
            menu. (closes vim/vim#12308)

4e1ca0d9a6

Fixed in the previous commit. Test only.
2023-04-28 05:56:47 +08:00
fbaa278773 fix(pum): make :popup position correctly with float border 2023-04-28 05:49:47 +08:00
f65043154e Merge pull request #23356 from ii14/fix/23355
fix(events): null dereference in autocmd functions
2023-04-27 23:00:28 +02:00
774a32e5fe fix(events): null dereference in autocmd functions 2023-04-27 22:22:54 +02:00
c50cdd6270 ci: replace stale bot with custom implementation
The stale action has a bug where it won't close an issue/PR if it has
comments after the stale label.
2023-04-27 22:07:44 +02:00
1cb6040554 perf(events): store autocommands in flat vectors (#23256)
Instead of nested linked lists, store autocommands in a flat, contiguous
kvec_t, with one kvec_t per event type. Previously patterns were stored
in each node of the outer linked list, so they can be matched only once
on repeating patterns. They are now reference counted and referenced in
each autocommand, and matching is skipped if the pattern repeats. Speeds
up creation and deletion, execution is not affected.

Co-authored-by: ii14 <ii14@users.noreply.github.com>
2023-04-27 19:25:08 +02:00
eb4676c67f fix: disallow removing extmarks in on_lines callbacks (#23219)
fix(extmarks): disallow removing extmarks in on_lines callbacks

decor_redraw_start (which runs before decor_providers_invoke_lines) gets
references for the extmarks on a specific line. If these extmarks are
deleted in on_lines callbacks then this results in a heap-use-after-free
error.

Fixes #22801
2023-04-27 17:30:22 +01:00
9f29176033 vim-patch:9.0.1492: using uninitialized memory when argument is missing (#23351)
Problem:    Using uninitialized memory when argument is missing.
Solution:   Check there are sufficient arguments before the base.
            (closes vim/vim#12302)

b7f2270bab

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 00:01:22 +08:00
a3dfe1bc89 fix(pum): position properly with ext_multigrid (#23336) 2023-04-27 20:19:21 +08:00
4b3fdf321c docs(lsp): remove obsolete lsp-extension example (#23346)
This example is made obsolete by the addition of `vim.lsp.start()` and
`vim.fs` (whose use is already documented in `:h lsp-quickstart`).
2023-04-27 13:05:26 +02:00
0ff58d1bb9 Merge pull request #23216 from bfredl/lpeg
refactor(build): include lpeg as a library
2023-04-27 12:06:44 +02:00
45bcf83869 refactor(build): include lpeg as a library 2023-04-27 11:40:00 +02:00
d321deb4a9 test: fix dependencies between test cases (#23343)
Discovered using --shuffle argument of busted.
2023-04-27 15:51:44 +08:00
d1bb9bffd5 build: remove BUSTED_PRG dead code (#23340)
BUSTED_PRG is no longer used by RunTests.cmake.
2023-04-27 14:36:37 +08:00
39771b2238 build(Makefile): add nvim to oldtest phony target
This is to force a rebuild each time a file is changed.
2023-04-27 08:26:07 +02:00
1fc468aed2 vim-patch:9.0.1491: wrong scrolling with ls=0 and :botright split (#23333)
Problem:    Wrong scrolling with ls=0 and :botright split.
Solution:   Add statusline before calling frame_new_height(). (closes vim/vim#12299)

fbf2071ac9
2023-04-27 09:07:30 +08:00
3b0df1780e refactor: uncrustify
Notable changes: replace all infinite loops to `while(true)` and remove
`int` from `unsigned int`.
2023-04-26 23:23:44 +02:00
7d0479c558 ci: containerize the external dependencies test
Cirrus ci automatically pushes/caches docker images, which makes
containerization much simpler to handle. Moving this job to cirrus ci
shortens the job by a minute, and reduces github actions CI usage by two
minutes per PR.
2023-04-26 23:22:12 +02:00
a1b045f60a refactor(clang-tidy): remove redundant casts 2023-04-26 18:28:49 +02:00
6674d706d9 ci: update reviewers 2023-04-26 18:25:27 +02:00
c98ef2d7c6 build(clint): fix deprecation and linter warnings
`sre_compile` is deprecated in python 11, and gives warning when is used.
2023-04-26 18:25:07 +02:00
efae71819a Merge pull request #23288 from MunifTanjim/issue-22263
fix(normal): fix repeated trigger modechanged for scheduled callback
2023-04-27 00:23:39 +08:00
a35bca2112 test: scheduled callback shouldn't trigger ModeChanged repeatedly 2023-04-26 23:57:09 +08:00
e0d6703a6a vim-patch:9.0.1490: the ModeChanged event may be triggered too often
Problem:    The ModeChanged event may be triggered too often.
Solution:   Only trigger ModeChanged when no operator is pending.
            (closes vim/vim#12298)

73916bac5a
2023-04-26 23:56:21 +08:00
9f0762f1fe Merge pull request #23308 from bfredl/fs_time_boogalo
refactor(fs): IT'S TIME: get rid of fs_loop and fs_loop_mutex
2023-04-26 10:28:27 +02:00
55793bcfa1 build: revert accidental permission changes (#23319)
Revert the permission changes in 794d2744f3.
2023-04-26 13:38:30 +08:00
191e8b4062 vim-patch:9.0.1485: no functions for converting from/to UTF-16 index (#23318)
Problem:    no functions for converting from/to UTF-16 index.
Solution:   Add UTF-16 flag to existing funtions and add strutf16len() and
            utf16idx(). (Yegappan Lakshmanan, closes vim/vim#12216)

67672ef097

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-04-26 09:50:37 +08:00
8af97ecefa vim-patch:8.2.3314: behavior of exists() in a :def function is unpredictable (#23317)
Problem:    Behavior of exists() in a :def function is unpredictable.
Solution:   Add exists_compiled().

267359902c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-26 08:37:22 +08:00
5e569a4703 refactor(fs): now it is time to get rid of fs_loop and fs_loop_mutex
Here's the headline: when run in sync mode (last argument cb=NULL),
these functions don't actually use the uv_loop_t.

An earlier version of this patch instead replaced fs_loop with
using main_loop.uv on the main thread and luv_loop() on luv worker
threads. However this made the code more complicated for no reason.

Also arbitrarily, half of these functions would attempt to handle
UV_ENOMEM by try_to_free_memory(). This would mostly happen
on windows because it needs to allocate a converted WCHAR buffer.
This should be a quite rare situation. Your system is pretty
much hosed already if you cannot allocate like 50 WCHAR:s.
Therefore, take the liberty of simply removing this fallback.

In addition, we tried to "recover" from ENOMEM in read()/readv()
this way which doesn't make any sense. The read buffer(s) are already
allocated at this point.

This would also be an issue when using these functions on a worker
thread, as try_to_free_memory() is not thread-safe. Currently
os_file_is_readable() and os_is_dir() is used by worker threads
(as part of nvim__get_runtime(), to implement require from 'rtp' in
threads).

In the end, these changes makes _all_ os/fs.c functions thread-safe,
and we thus don't need to document and maintain a thread-safe subset.
2023-04-25 21:30:19 +02:00
907018e547 vim-patch:8.2.3139: functions for string manipulation are spread out (#23316)
Problem:    Functions for string manipulation are spread out.
Solution:   Move string related functions to a new source file. (Yegappan
            Lakshmanan, closes vim/vim#8470)

a2438132a6

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-04-26 00:23:11 +08:00
7e0d668012 vim-patch:partial:9.0.0359: error message for wrong argument type is not specific (#23315)
Problem:    Error message for wrong argument type is not specific.
Solution:   Include more information in the error. (Yegappan Lakshmanan,
            closes vim/vim#11037)

8deb2b30c7

Skip reduce() and deepcopy() changes because of missing patches.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-04-25 23:39:15 +08:00
ac9f8669a8 vim-patch:9.0.0875: using freed memory when executing delfunc at more prompt (#23314)
Problem:    Using freed memory when executing delfunc at the more prompt.
Solution:   Check function list not changed in another place. (closes vim/vim#11437)

398a26f7fc

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-25 23:19:00 +08:00
cacc2dc419 Merge pull request #23303 from gpanders/more-vim-iter
Create iter_spec and vim.iter module
2023-04-25 09:17:46 -06:00
7e70ca0b48 feat(lua): vim.keycode (#22960)
Using nvim_replace_termcodes is too verbose, add vim.keycode for
translating keycodes.

Co-authored-by: ii14 <ii14@users.noreply.github.com>
2023-04-25 16:52:44 +02:00
c111460b1a Merge pull request #23313 from zeertzjq/vim-8.2.3768
vim-patch:8.2.{3768,3772}
2023-04-25 22:49:57 +08:00
1e73891d69 refactor(iter): move helper functions under vim.iter
vim.iter is now both a function and a module (similar to vim.version).
2023-04-25 08:23:16 -06:00
1dd9cd2965 vim-patch:8.2.3772: timer info test fails on slow machine
Problem:    Timer info test fails on slow machine.
Solution:   Use WaitForAssert().

ff39a650b2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-25 22:22:40 +08:00
cc6845db94 vim-patch:8.2.3768: timer_info() has the wrong repeat value in a timer callback
Problem:    timer_info() has the wrong repeat value in a timer callback.
Solution:   Do not add one to the repeat value when in the callback.
            (closes vim/vim#9294)

95b2dd0c00

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-25 22:22:40 +08:00
255e547e18 fix(timer): allow timer_info() to get info about current timer 2023-04-25 22:22:40 +08:00
bfa92d3861 vim-patch:8.2.5019: cannot get the first screen column of a character (#23312)
Problem:    Cannot get the first screen column of a character.
Solution:   Let virtcol() optionally return a list. (closes vim/vim#10482,
            closes vim/vim#7964)

0f7a3e1de6

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-04-25 22:22:26 +08:00
43c49746d9 vim-patch:9.0.0335: checks for Dictionary argument often give a vague error (#23309)
Problem:    Checks for Dictionary argument often give a vague error message.
Solution:   Give a useful error message. (Yegappan Lakshmanan, closes vim/vim#11009)

04c4c5746e

Cherry-pick removal of E922 from docs from patch 9.0.1403.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-04-25 21:32:12 +08:00
2e8410b7be refactor: remove unnecessary height change in frame_add_hsep() (#23305)
This height change is wrong, and the height will be overwritten later by
another height change.
2023-04-25 18:52:58 +08:00
965ad7726f Merge pull request #23293 from bfredl/bigsleep
refactor(time): refactor delay with input checking
2023-04-25 12:32:06 +02:00
a4b2400804 fix(statusline): also allow right click when 'mousemodel' is "popup*" (#23258)
Problem:    The 'statusline'-format ui elements do not receive right
            click events when "mousemodel" is "popup*"
Solution:   Do not draw popupmenu and handle click event instead.
2023-04-25 11:05:04 +08:00
147bb87245 test: move vim.iter tests to separate file 2023-04-24 20:31:25 -06:00
0d2fe77865 refactor(time): refactor delay with input checking
Previously, there were three low-level delay entry points

- os_delay(ms, ignoreinput=true): sleep for ms, only break on got_int

- os_delay(ms, ignoreinput=false): sleep for ms, break on any key input
  os_microdelay(us, false): equivalent, but in μs (not directly called)

- os_microdelay(us, true): sleep for μs, never break.

The implementation of the latter two both used uv_cond_timedwait()
This could have been for two reasons:
 1. allow another thread to "interrupt" the wait
 2. uv_cond_timedwait() has higher resolution than uv_sleep()

However we (1) never used the first, even when TUI was a thread, and
(2) nowhere in the codebase are we using μs resolution, it is always a ms
multiplied with 1000.

In addition, os_delay(ms, false) would completely block the thread for
100ms intervals and in between check for input. This is not how event handling
is done alound here.

Therefore:

Replace the implementation of os_delay(ms, false) to use
LOOP_PROCESS_EVENTS_UNTIL which does a proper epoll wait with a timeout,
instead of the 100ms timer panic.

Replace os_microdelay(us, false) with a direct wrapper of uv_sleep.
2023-04-24 17:38:19 +02:00
bab4bcdefb fix(column): don't reset 'statuscolumn' width after it has been drawn
Problem:     'statuscolumn' width may be reset after it has been drawn
              when multiple windows contain the same buffer. This results
              in an offset for the drawn cursor position.
Solution:     Loop over all windows (twice) prior to drawing them to
              reset the 'statuscolumn' width and validate the sign
              column when necessary.
2023-04-24 15:22:11 +01:00
c1331a65dd fix(pum): show right-click menu above cmdline area (#23298) 2023-04-24 09:26:10 +08:00
664f2749e6 build: add "ci" configure preset to reduce verbosity
`cmake --preset ci`

is equivalent to

`cmake -B build -G Ninja -D CI_BUILD=ON`

Also remove build presets as they're not very useful without workflow
presets, which are only available in schema versions 6 and above.
2023-04-23 17:12:46 +02:00
943ac2be55 ci: reuse script to enable Developer Command Prompt 2023-04-23 16:35:49 +02:00
e3f36377c1 vim-patch:71badf9547e8 (#23285)
Update runtime files

71badf9547

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-23 15:22:55 +02:00
f17bb4f411 vim-patch:9.0.1478: filetypes for *.v files not detected properly (#23282)
* vim-patch:9.0.1478: filetypes for *.v files not detected properly

Problem:    Filetypes for *.v files not detected properly.
Solution:   Use the file contents to detect the filetype. (Turiiya,
            closes vim/vim#12281)

80406c2618

Co-authored-by: Turiiya <34311583+tobealive@users.noreply.github.com>
Co-authored-by: Jonas Strittmatter <40792180+smjonas@users.noreply.github.com>
2023-04-23 14:15:52 +02:00
bf0ac4f241 ci(release): clean up wording and undeprecate tar.gz 2023-04-23 12:15:28 +02:00
1355861b92 fix(typval): don't treat v:null as truthy (#23281) 2023-04-23 17:44:08 +08:00
3ac952d4e2 fix(api): avoid assertion when autocmd group id is 0 (#23210) 2023-04-23 09:23:25 +08:00
77ff25b1d9 vim-patch:9.0.1477: crash when recovering from corrupted swap file (#23273)
Problem:    Crash when recovering from corrupted swap file.
Solution:   Check for a valid page count. (closes vim/vim#12275)

b67ba03d3e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-23 08:24:10 +08:00
431b152726 vim-patch:9.0.1479: small source file problems; outdated list of distrib. files (#23272)
Problem:    Small source file problems; outdated list of distributed files.
Solution:   Small updates to source files and list of distributed files.

f39d9e9dca

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-23 08:12:44 +08:00
540d6c595b test(lsp): fix unstable tests for semantic tokens
Add screen:expect() calls after insert() to make sure the screen has
been drawn before we assert the state of the semantic tokens table
2023-04-23 00:08:28 +02:00
eee97300ed ci(labeler): reuse workflow to reduce duplication 2023-04-22 23:28:39 +02:00
8994389845 ci: make all linux releases work with same glibc version 2023-04-22 22:58:14 +02:00
801ac2accb build: drop diff.exe from windows builds
The shipped versions of xdiff already does everything diff does, so this
duplication of tools isn't necessary. Furthermore, this setup is more
consistent overall, as the 'diffopt=external' option should be for
external programs rather than programs we bundle neovim with.

Install diffutils for oldtests in CI to avoid needing to modify tests.
2023-04-22 18:36:33 +02:00
040d9da5c8 vim-patch:9.0.1476: lines put in non-current window are not displayed (#23265)
Problem:    Lines put in non-current window are not displayed. (Marius
            Gedminas)
Solution:   Don't increment the topline when inserting just above it.
            (closes vim/vim#12212)

e7f05a8780

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-23 00:30:52 +08:00
1cb46abff1 vim-patch:9.0.1475: busted configuration files are not recognized (#23266)
Problem:    Busted configuration files are not recognized.
Solution:   Recognize busted configuration files as Lua. (Craig MacEachern,
            closes vim/vim#12209)

Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com>
2023-04-22 23:51:53 +08:00
ccce200cde ci(lintcommit): fix error output
Using print() alone doesn't work properly, toggling the verbose option
is still required.
2023-04-22 17:37:45 +02:00
732cb9e1e0 ci(lintcommit): use nvim -l 2023-04-22 15:10:35 +02:00
d89eb71040 Merge pull request #23263 from bfredl/notapple
fix(cmake): restore previously undocumented workround, now documented
2023-04-22 14:40:12 +02:00
e51e524175 fix(cmake): restore previously undocumented workround, now documented 2023-04-22 14:18:24 +02:00
669030ec08 ci: remove team reviewers
Team reviewers is a nice feature that comes with a severe drawback: it
makes testing the workflows incredibly difficult as they won't work
without a similar token by the tester.
2023-04-22 13:50:27 +02:00
515106ac08 Merge pull request #23255 from lewis6991/vimpatch/9.0.1293
vim-patch:9.0.{1293,1308,1311}: refactor option.c
2023-04-22 12:21:45 +01:00
0b24ab1892 build(deps): bump tree-sitter to HEAD - 321a65262 (#23261) 2023-04-22 12:58:35 +02:00
d9f78b6336 docs(powershell): use tee.exe instead of Tee-Object
Problem: Tee-Object does not create a file if it does not receive input
for example when :grep does not find matches.
and so nvim tries to open a nonexistent errorfile causing an error.

Solution: use tee.exe instead of Tee-Object
2023-04-22 12:04:05 +02:00
4d7a8b47b9 vim-patch:9.0.1311: Coverity warns for using a NULL pointer
Problem:    Coverity warns for using a NULL pointer.
Solution:   Use "empty_option" instead of NULL.

339e114d70

N/A patches for version.c:

vim-patch:9.0.1405: missing check for out-of-memory

Problem:    Missing check for out-of-memory.
Solution:   Check for alloc() returning NULL pointer. (closes vim/vim#12149)

14338024c1
2023-04-22 11:02:16 +01:00
a093c66bcd vim-patch:9.0.1308: the code for setting options is too complicated
Problem:    The code for setting options is too complicated.
Solution:   Refactor the code for setting options. (Yegappan Lakshmanan,
            closes vim/vim#11989)

1a6476428f
2023-04-22 11:02:04 +01:00
df4013cfc7 vim-patch:9.0.1293: the set_num_option() is too long
Problem:    The set_num_option() is too long.
Solution:   Move code to separate functions. (Yegappan Lakshmanan,
            closes vim/vim#11954)

0caaf1e465
2023-04-22 09:11:24 +01:00
e9b85acfbb feat(lsp): enable workspace/didChangeWatchedFiles by default (#23190) 2023-04-22 09:37:38 +02:00
2d2ed4f6fd version.c: update [skip ci] (#22095)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2023-04-22 11:24:28 +08:00
f68af3c3bc refactor(iter): use metatable as packed table tag (#23254)
This is a more robust method for tagging a packed table as it completely
eliminates the possibility of mistaking an actual table key as the
packed table tag.
2023-04-21 16:13:39 -06:00
ef92b5a994 build: include all dependency directories when generating headers
This will add all interface include directories property from all
targets to main_lib. This may not be universally wanted, in which case
we can revisit/rework it.

Closes https://github.com/neovim/neovim/issues/23237.
2023-04-21 21:32:58 +02:00
936b78e811 refactor: revert incorrect change to ui_client.c code
- There is no "resource leak".
- "return 0" is definitely not the correct behavior if we ever occur a
  platform where this would fail.
- There was no problem here to fix. so let's not "fix" it.
- once CI is upgraded to gcc 13, we'll figure out the correct way to make
  it shut the fuck up. warnings on non-ci platforms are not critical.
2023-04-21 17:56:09 +02:00
a0adc51dac Merge pull request #23250 from bfredl/vimvim
refactor(build): move the last generator from scripts/ to src/nvim/generators
2023-04-21 17:28:52 +02:00
702892270d refactor(build): move the last generator from scripts/ to src/nvim/generators
This one generates a runtime/ file instead of a source file.
But otherwise it works the same like all other generators.
It has the same prerequisites (shared and mpack modules, etc), and,
importantly, it uses results from the source generators.

The odd location makes it easy to overlook when refactoring generators
(like I did last time, lol)
2023-04-21 16:46:35 +02:00
558e4191f0 Merge #23234 from justinmk/fixsplit
fix(lua): vim.split may trim inner empty items
2023-04-21 08:05:21 -04:00
5a643da450 vim-patch:9.0.1294: the set_bool_option() function is too long
Problem:    The set_bool_option() function is too long.
Solution:   Move code to separate functions. (Yegappan Lakshmanan,
            closes vim/vim#11964)

80b817b749

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-04-21 13:04:33 +01:00
824766612d refactor(lua): simplify vim.gsplit impl 2023-04-21 13:50:22 +02:00
622b1ae38a fix(lua): vim.split may trim inner empty items
Problem:
`vim.split('a:::', ':', {trimempty=true})` trims inner empty items.
Regression from 9c49c10470

Solution:
Set `empty_start=false` when first non-empty item is found.
close #23212
2023-04-21 13:50:22 +02:00
9e79f7433e fix(usercmd): Fix buffer overflow in uc_list() (#23225)
fix(usercmd): fix buffer overflow in uc_list()

Build with: -Wp,-D_FORTIFY_SOURCE=3 -O1 and gcc 13.

*** buffer overflow detected ***: terminated

(gdb) bt
  #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
  #1  0x00007f3eb8b93c03 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
  #2  0x00007f3eb8b42aee in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
  #3  0x00007f3eb8b2b87f in __GI_abort () at abort.c:79
  #4  0x00007f3eb8b2c60f in __libc_message (fmt=fmt@entry=0x7f3eb8ca72e6 "*** %s ***: terminated\n") at ../sysdeps/posix/libc_fatal.c:150
  #5  0x00007f3eb8c27b29 in __GI___fortify_fail (msg=msg@entry=0x7f3eb8ca728c "buffer overflow detected") at fortify_fail.c:24
  #6  0x00007f3eb8c26364 in __GI___chk_fail () at chk_fail.c:28
  #7  0x00007f3eb8c25f45 in ___snprintf_chk (s=s@entry=0x55b8c7c096a5 <IObuff+5> "t' item", maxlen=maxlen@entry=1025, flag=flag@entry=2, slen=slen@entry=1020, format=format@entry=0x55b8c7b872a6 "%ldc") at snprintf_chk.c:29
  #8  0x000055b8c7aea59f in snprintf (__fmt=0x55b8c7b872a6 "%ldc", __n=1025, __s=0x55b8c7c096a5 <IObuff+5> "t' item") at /usr/include/bits/stdio2.h:54
  #9  uc_list (name=name@entry=0x55b8c8351788 "Explore", name_len=name_len@entry=7) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/usercmd.c:534
  #10 0x000055b8c7aeb8a0 in ex_command (eap=0x7fffdc350e60) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/usercmd.c:1009
  #11 0x000055b8c7972537 in execute_cmd0 (retv=retv@entry=0x7fffdc350e54, eap=eap@entry=0x7fffdc350e60, errormsg=errormsg@entry=0x7fffdc350e58, preview=preview@entry=false) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/ex_docmd.c:1620
  #12 0x000055b8c7975c55 in do_one_cmd (cmdlinep=cmdlinep@entry=0x7fffdc3510b8, flags=flags@entry=0, cstack=cstack@entry=0x7fffdc351140, fgetline=fgetline@entry=0x55b8c79882b8 <getexline>, cookie=cookie@entry=0x0) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/ex_docmd.c:2279
  #13 0x000055b8c79767fe in do_cmdline (cmdline=<optimized out>, fgetline=0x55b8c79882b8 <getexline>, cookie=0x0, flags=0) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/ex_docmd.c:578
  #14 0x000055b8c7a17463 in nv_colon (cap=0x7fffdc351780) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/normal.c:3228
  #15 0x000055b8c7a11b35 in normal_execute (state=0x7fffdc351700, key=<optimized out>) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/normal.c:1196
  #16 0x000055b8c7ab0994 in state_enter (s=0x7fffdc351700) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/state.c:99
  #17 0x000055b8c7a0ef68 in normal_enter (cmdwin=false, noexmode=false) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/normal.c:497
  #18 0x000055b8c78a0640 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/main.c:641
2023-04-21 19:16:32 +08:00
ebfb6399d9 Merge pull request #23239 from cryptomilk/asn-fix-warnings
Fix compiler warnings detected by gcc 13
2023-04-21 19:02:50 +08:00
3e41121e86 Merge pull request #23187 from luukvbaal/statuscolumn
fix(column): rebuild status column when sign column is invalid
2023-04-21 11:46:30 +01:00
4d654472e6 fix(ui_client): check return code of dup()
gsrc/nvim/ui_client.c: In function ‘ui_client_start_server’:
gsrc/nvim/ui_client.c:68:5: warning: ignoring return value of ‘dup’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   68 |     dup(stderr_isatty ? STDERR_FILENO : STDOUT_FILENO);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-04-21 12:14:48 +02:00
54f5602038 fix(statusline): fix uninitialized variable and possible overflow
In file included from /usr/include/string.h:535,
                 from gsrc/nvim/statusline.c:10:
In function ‘strcat’,
    inlined from ‘build_stl_str_hl’ at gsrc/nvim/statusline.c:1688:9:
/usr/include/bits/string_fortified.h:130:10: warning: ‘p’ may be used uninitialized [-Wmaybe-uninitialized]
  130 |   return __builtin___strcat_chk (__dest, __src, __glibc_objsize (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-04-21 12:14:48 +02:00
f5530bf566 fix(linematch): initialize array
gsrc/nvim/linematch.c: In function ‘try_possible_paths’:
gsrc/nvim/linematch.c:204:35: warning: ‘from_vals’ may be used uninitialized [-Wmaybe-uninitialized]
  204 |       size_t unwrapped_idx_from = unwrap_indexes(from_vals, diff_len, ndiffs);
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-04-21 12:14:48 +02:00
a114a21eff fix(ex_getln): initialize pointer with NULL
In function ‘cmdpreview_open_win’,
    inlined from ‘cmdpreview_may_show’ at gsrc/nvim/ex_getln.c:2487:28:
gsrc/nvim/ex_getln.c:2251:16: warning: ‘cmdpreview_buf’ may be used uninitialized [-Wmaybe-uninitialized]
 2251 |   int result = do_buffer(DOBUF_GOTO, DOBUF_FIRST, FORWARD, cmdpreview_buf->handle, 0);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-04-21 12:14:48 +02:00
9802de9334 fix(userfunc): fix possible out of bound access
In file included from /usr/include/string.h:535,
                 from gsrc/nvim/eval/userfunc.c:11:
In function ‘strcpy’,
    inlined from ‘cat_func_name’ at gsrc/nvim/eval/userfunc.c:662:5,
    inlined from ‘get_user_func_name’ at gsrc/nvim/eval/userfunc.c:2854:5:
/usr/include/bits/string_fortified.h:79:10: warning: ‘__builtin___strcpy_chk’ offset 0 from the object at ‘<unknown>’ is out of the bounds of referenced subobject ‘uf_name’ with ty
pe ‘char[]’ at offset 0 [-Warray-bounds=]
   79 |   return __builtin___strcpy_chk (__dest, __src, __glibc_objsize (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from gsrc/nvim/eval/typval.h:10,
                 from gsrc/nvim/buffer_defs.h:20,
                 from gsrc/nvim/autocmd.h:8,
                 from gsrc/nvim/eval/userfunc.c:15:
gsrc/nvim/eval/typval_defs.h: In function ‘get_user_func_name’:
gsrc/nvim/eval/typval_defs.h:342:8: note: subobject ‘uf_name’ declared here
  342 |   char uf_name[];    ///< Name of function (actual size equals name);
      |        ^~~~~~~
2023-04-21 12:14:48 +02:00
2819718873 fix(drawline): initialize variable
src/nvim/drawline.c: In function ‘win_line’:
src/nvim/drawline.c:1418:16: warning: ‘charsize’ may be used uninitialized [-Wmaybe-uninitialized]
 1418 |       wlv.vcol -= charsize;
      |                ^~
2023-04-21 12:14:48 +02:00
e9280a68f7 fix(drawline): initialize variable
src/nvim/drawline.c: In function ‘draw_virt_text’:
src/nvim/drawline.c:298:28: warning: ‘col’ may be used uninitialized [-Wmaybe-uninitialized]
  298 |       state->eol_col = col + 1;
      |                        ~~~~^~~
2023-04-21 12:14:47 +02:00
ef7ae66eef fix(api): avoid integer truncation
gsrc/nvim/api/vim.c: In function ‘nvim_eval_statusline’:
gsrc/nvim/api/vim.c:2268:55: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 2 [-Wformat-tru
ncation=]
 2268 |         snprintf(user_group, sizeof(user_group), "User%d", sp->userhl);
      |                                                       ^~
gsrc/nvim/api/vim.c:2268:50: note: directive argument in the range [1, 2147483647]
 2268 |         snprintf(user_group, sizeof(user_group), "User%d", sp->userhl);
      |                                                  ^~~~~~~~
In file included from /usr/include/stdio.h:906,
                 from gsrc/nvim/api/vim.c:9:
In function ‘snprintf’,
    inlined from ‘nvim_eval_statusline’ at gsrc/nvim/api/vim.c:2268:9:
/usr/include/bits/stdio2.h:54:10: note: ‘__builtin___snprintf_chk’ output between 6 and 15 bytes into a destination of size 6
   54 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   55 |                                    __glibc_objsize (__s), __fmt,
      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   56 |                                    __va_arg_pack ());
      |                                    ~~~~~~~~~~~~~~~~~
2023-04-21 12:14:44 +02:00
05928fe298 docs(gh): suggest distclean in issue template (#23222) 2023-04-21 08:09:11 +01:00
f1b415b3ab vim-patch:9.0.1472: ":drop fname" may change the last used tab page (#23230)
Problem:    ":drop fname" may change the last used tab page.
Solution:   Restore the last used tab page when :drop has changed it.
            (closes vim/vim#12087)

8281a16efc

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-21 09:02:30 +08:00
c4fb418626 Merge pull request #23224 from bfredl/nomutex
refactor(env): remove unused mutex
2023-04-20 22:10:15 +02:00
230e567a05 Merge pull request #23218 from bfredl/nlua0boogalo
fix(build): distinguish vim.mpack from global require'mpack'
2023-04-20 19:23:44 +02:00
ffaf74f147 fix(build): distinguish vim.mpack from global require'mpack'
problem: the api of vim.mpack is not compatible with a system provided mpack
solution: don't require 'mpack' directly from the system path
2023-04-20 19:00:38 +02:00
b773a52515 refactor(env): remove unused mutex
This was needed when TUI was a thread.
lua code uses os_getenv only on the main thread.
2023-04-20 18:54:00 +02:00
ab2811746e fix(treesitter playground): fix the wrong range of a node displayed i… (#23209)
fix(treesitter playground): wrong range of a node displayed in playground

The call parameters order of the function `get_range_str` is flipped for the last two arguments compared to the declaration.
2023-04-20 07:42:49 -06:00
dbcd1985d1 vim-patch:8.2.4598: profile completion test sometimes fails (#23208)
Problem:    Profile completion test sometimes fails.
Solution:   Delete the .res file before running tests.

7e0be3ea21

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-20 09:17:33 +08:00
e81331c2b0 Merge pull request #23106 from bfredl/nlua0
refactor(build): use vendored versions of mpack and luabitop
2023-04-19 21:11:12 +02:00
706f871014 build: update uncrustify to 0.76 2023-04-19 17:04:00 +01:00
3940c435e4 Merge pull request #23155 from bfredl/nobreak
fix(runtime): do not allow breakcheck inside runtime path calculation
2023-04-19 17:07:33 +02:00
ea52961c54 refactor: fix PVS warnings (#23200) 2023-04-19 22:49:14 +08:00
aee6f08ce1 fix(runtime): do not allow breakcheck inside runtime path calculation
problem: breakcheck might run arbitrary lua code, which might require
modules and thus invoke runtime path calculation recursively.
solution: Block the use of breakcheck when expanding glob patterns
inside 'runtimepath'

fixes #23012
2023-04-19 16:34:15 +02:00
0ad5237162 Merge pull request #23198 from gpanders/iter-fix
fix(iter): allow table values in iterator pipelines
2023-04-19 08:23:42 -06:00
0d7bed34a2 vim-patch:9.0.1470: deferred functions invoked in unexpected order (#23199)
Problem:    Deferred functions invoked in unexpected order when using :qa and
            autocommands.
Solution:   Call deferred functions for the current funccal before using the
            stack. (closes vim/vim#12278)

1be4b81bfb
2023-04-19 22:09:48 +08:00
9489406879 fix(iter): remove special case totable for map-like tables
This was originally meant as a convenience but prevents possible
functionality. For example:

  -- Get the keys of the table with even values
  local t = { a = 1, b = 2, c = 3, d = 4 }
  vim.iter(t):map(function(k, v)
    if v % 2 == 0 then return k end
  end):totable()

The example above would not work, because the map() function returns
only a single value, and cannot be converted back into a table (there
are many such examples like this).

Instead, to convert an iterator into a map-like table, users can use
fold():

  vim.iter(t):fold({}, function(t, k, v)
    t[k] = v
    return t
  end)
2023-04-19 07:52:04 -06:00
6b96122453 fix(iter): add tag to packed table
If pack() is called with a single value, it does not create a table; it
simply returns the value it is passed. When unpack is called with a
table argument, it interprets that table as a list of values that were
packed together into a table.

This causes a problem when the single value being packed is _itself_ a
table. pack() will not place it into another table, but unpack() sees
the table argument and tries to unpack it.

To fix this, we add a simple "tag" to packed table values so that
unpack() only attempts to unpack tables that have this tag. Other tables
are left alone. The tag is simply the length of the table.
2023-04-19 07:04:49 -06:00
7bf1a917b7 vim-patch:8.1.2094: the fileio.c file is too big
Problem:    The fileio.c file is too big.
Solution:   Move buf_write() to bufwrite.c. (Yegappan Lakshmanan,
            closes vim/vim#4990)

c079f0fed1

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-04-19 13:15:29 +01:00
ccc939ec10 Merge pull request #23194 from zeertzjq/vim-9.0.1141
vim-patch:9.0.1141: 'cursorcolumn' and 'colorcolumn' wrong after concealing
2023-04-19 18:21:43 +08:00
1e60e8c040 refactor(build): use vendored versions of mpack and luabitop 2023-04-19 10:44:25 +02:00
14caad32b6 test: convert tests in test_conceal.vim to Lua 2023-04-19 16:23:08 +08:00
8bed07357d vim-patch:9.0.1141: 'cursorcolumn' and 'colorcolumn' wrong after concealing
Problem:    'cursorcolumn' and 'colorcolumn' wrong after concealing and
            wrapping line.
Solution:   Reset "wlv.vcol_off" after each screen line. (Alexey Radkov,
            closes vim/vim#11777)

aaa16b0918

Cherry-pick test_conceal.vim changes from patches 8.2.4339, 9.0.0418.

Co-authored-by: Alexey Radkov <alexey.radkov@gmail.com>
2023-04-19 16:23:08 +08:00
cff02e993d vim-patch:9.0.1467: Jenkinsfiles are not recognized as groovy (#23195)
Problem:    Jenkinsfiles are not recognized as groovy.
Solution:   Add a pattern for Jenkinsfiles. (closes vim/vim#12236)

142ffb024d

Co-authored-by: dundargoc <gocdundar@gmail.com>
2023-04-19 10:19:33 +02:00
6d9f5b6bf0 vim-patch:9.0.1464: strace filetype detection is expensive (#23175)
Problem:    Strace filetype detection is expensive.
Solution:   Match with a cheap pattern first. (Federico Mengozzi,
            closes vim/vim#12220)

6e5a9f9482

Co-authored-by: Federico Mengozzi <19249682+fedemengo@users.noreply.github.com>
2023-04-19 09:41:26 +02:00
95c6e1b741 test(terminal/channel_spec): fix screen test immediate success (#23192)
Check for the [No Name] after wiping the buffer.
2023-04-19 12:10:06 +08:00
c218109744 Merge pull request #23191 from zeertzjq/vim-9.0.1007
vim-patch:9.0.{0369,0372,0426,0514,0545,0560,0561,1005,1007,1008,1009,1010,1012,1020,1021,1034}
2023-04-19 12:06:45 +08:00
1c12f844ad refactor(eval): use tv_list_append_allocated_string() 2023-04-19 11:29:35 +08:00
519acb3ec1 vim-patch:9.0.1034: reporting swap file when windows are split
Problem:    Reporting swap file when windows are split.
Solution:   Close extra windows after running a test.

e5eae82bb7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-19 11:29:35 +08:00
b9bf1b1294 vim-patch:9.0.1021: test trips over g:name
Problem:    Test trips over g:name.
Solution:   Delete g:name after using it.

d6e74f5479

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-19 11:29:35 +08:00
5f4e0a005b vim-patch:9.0.1020: tests call GetSwapFileList() before it is defined
Problem:    Tests call GetSwapFileList() before it is defined.
Solution:   Move the call to after defining the function. (Christopher
            Plewright)

6572a90287

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-19 11:29:35 +08:00
ab7bd119d7 vim-patch:9.0.1012: tests may get stuck in buffer with swap file
Problem:    Tests may get stuck in buffer with swap file.
Solution:   Bail out when bwipe! doesn't get another buffer.

fa2533c8bb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-19 11:29:35 +08:00
a2f4bad781 vim-patch:9.0.1010: stray warnings for existing swap files
Problem:    Stray warnings for existing swap files.
Solution:   Wipe out the buffer until it has no name and no swap file.

23526d2539

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-19 11:29:35 +08:00
a0d4649c17 vim-patch:9.0.1009: test for catch after interrupt is flaky on MS-Windows
Problem:    Test for catch after interrupt is flaky on MS-Windows.
Solution:   Mark the test as flaky.

72b5b0d51a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-19 11:29:35 +08:00
94a7ccea43 vim-patch:9.0.1008: test for swapfilelist() fails on MS-Windows
Problem:    Test for swapfilelist() fails on MS-Windows.
Solution:   Only check the tail of the path.  Mark a test as flaky.

6cf3151f0e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-19 11:29:35 +08:00
85c61d6716 vim-patch:9.0.1007: there is no way to get a list of swap file names
Problem:    There is no way to get a list of swap file names.
Solution:   Add the swapfilelist() function.  Use it in the test script to
            clean up.  Remove deleting individual swap files.

c216a7a21a

vim-patch:9.0.1005: a failed test may leave a swap file behind

Problem:    A failed test may leave a swap file behind.
Solution:   Delete the swap file to avoid another test to fail.  Use another
            file name.

d0f8d39d20

Cherry-pick test_window_cmd.vim changes from patch 8.2.1593.
Remove FUNC_ATTR_UNUSED from eval functions as fptr is always unused.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-19 11:29:35 +08:00
d82a6ca72a vim-patch:9.0.0561: when a test gets stuck it just hangs forever
Problem:    When a test gets stuck it just hangs forever.
Solution:   Set a timeout of 30 seconds.

3bcd0ddc2d

Note: This doesn't cause test_timers.vim failures in Nvim because there
is a SetUp() function that calls timer_stopall().

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-19 11:29:35 +08:00
63432c854f vim-patch:9.0.0560: elapsed time since testing started is not visible
Problem:    Elapsed time since testing started is not visible.
Solution:   Show the elapsed time while running tests.

b9093d5009

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-19 11:29:35 +08:00
7592540029 vim-patch:9.0.0545: when a test is slow and CI times out there is no time info
Problem:    When a test is slow and CI times out there is no time info.
Solution:   Add the elapsed time to the "Executing" message.

daaa3d9965

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-19 11:29:35 +08:00
db12c61c56 vim-patch:9.0.0514: terminal test sometimes hangs
Problem:    Terminal test sometimes hangs.
Solution:   Add a bit more information to the test output. (issue vim/vim#11179)

a22c56a59a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-19 11:29:35 +08:00
ad06c1c1c6 vim-patch:9.0.0426: failed flaky tests reports only start time
Problem:    Failed flaky tests reports only start time.
Solution:   Also report the end time.

65258d36dd

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-19 11:29:35 +08:00
c4c5bcd2b2 vim-patch:9.0.0372: MS-Windows: "%T" time format does not appear to work
Problem:    MS-Windows: "%T" time format does not appear to work.
Solution:   Use "%H:%M:%S" instead.

5fbbec180b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-19 11:29:35 +08:00
db6812c444 vim-patch:9.0.0369: a failing flaky test doesn't mention the time
Problem:    A failing flaky test doesn't mention the time.
Solution:   Add the time for debugging.  Improve error message.

06d32a0c17

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-19 11:29:33 +08:00
44d4f03573 fix(column): rebuild status column when sign column is invalid 2023-04-19 03:22:27 +02:00
dd8781128f Merge pull request #23188 from zeertzjq/vim-9.0.1462
vim-patch:9.0.{1462,1468,1469}: :defer fixes
2023-04-19 08:35:27 +08:00
a0c982671e vim-patch:9.0.1469: deferred functions not called from autocommands
Problem:    Deferred functions not called from autocommands.
Solution:   Also go through the funccal_stack. (closes vim/vim#12267)

960cf9119e
2023-04-19 08:09:46 +08:00
a11849abdf vim-patch:9.0.1468: recursively calling :defer function if it does :qa
Problem:    Recursively calling :defer function if it does :qa in a compiled
            function.
Solution:   Clear the defer entry before calling the function. (closes vim/vim#12271)

a1f2b5ddc6
2023-04-19 08:09:46 +08:00
8e0ad6e261 vim-patch:9.0.1462: recursively calling :defer function if it does :qa
Problem:    Recursively calling :defer function if it does :qa.
Solution:   Clear the defer entry before calling the function. (closes vim/vim#12266)

42994bf678

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-19 08:09:46 +08:00
d799456a6b test(column): statuscolumn is rebuild when signs are (un)placed 2023-04-19 01:09:45 +02:00
0a3645a723 build: find system luv on ubuntu
Also use the system luv in CI for the with-external-deps job.
2023-04-19 00:47:15 +02:00
59fed8bb64 fix(api): extmark highlight groups not always included in details (#23179)
Problem:    Erroneous for loop condition.
Solution:   Remove for loop condition.
2023-04-18 21:07:37 +08:00
9033d5eccc Merge pull request #23005 from seandewar/fix-ruf-cmdline-pos
fix(ruler): fix some ruler issues with no statusline
2023-04-18 10:01:42 +01:00
d4eff4052a Merge pull request #23173 from zeertzjq/vim-9.0.0783
vim-patch:9.0.{0783,0785,0815,0817,0820,0864}
2023-04-18 15:04:47 +08:00
2e21d1d5dd vim-patch:6ebe4f970b8b
Update runtime files

6ebe4f970b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-18 14:37:17 +08:00
9180c18c46 vim-patch:9.0.0864: crash when using "!!" without a previous shell command
Problem:    Crash when using "!!" without a previous shell command.
Solution:   Check "prevcmd" is not NULL. (closes vim/vim#11487)

6600447c7b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-18 14:35:04 +08:00
2a94dcf0c5 vim-patch:9.0.0820: memory leak with empty shell command
Problem:    Memory leak with empty shell command.
Solution:   Free the empty string.

03d6e6f42b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-18 14:31:00 +08:00
a1e0f6c07f vim-patch:9.0.0817
fb0cf2357e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-18 14:30:01 +08:00
187ba3efce vim-patch:9.0.0815
9c50eeb401

Co-authored-by: Martin Tournoij <martin@arp242.net>
2023-04-18 14:29:07 +08:00
5b77dde8dd vim-patch:9.0.0785: memory leak with empty shell command
Problem:    Memory leak with empty shell command.
Solution:   Free the allocated memory when bailing out.

9652249a2d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-18 14:22:59 +08:00
c0f10d3fe0 vim-patch:9.0.0783: ":!" doesn't do anything but does update the previous command
Problem:    ":!" doesn't do anything but does update the previous command.
Solution:   Do not have ":!" change the previous command. (Martin Tournoij,
            closes vim/vim#11372)

8107a2a8af

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-18 14:20:44 +08:00
240c41e1af fix(genvimvim): add special abbreviations of :delete (#23172)
Also don't highlight :def as vimCommand.
2023-04-18 09:40:05 +08:00
84a4319545 fix(mouse): cmdline click registered as statuscolumn (#23163) 2023-04-18 08:00:49 +08:00
ab1edecfb7 feat(lua): add vim.iter (#23029)
vim.iter wraps a table or iterator function into an `Iter` object with
methods such as `filter`, `map`, and `fold` which can be chained to
produce iterator pipelines that do not create new tables at each step.
2023-04-17 12:54:19 -06:00
65dd3c1180 fix(ruler): show ruler of curwin with no statusline in cmdline
Problem: After neovim/neovim@846a056, only the ruler for current floating or
last window without a statusline is drawn in the cmdline. This means that if the
current window is not one of these, but has no statusline, its ruler will not be
drawn anymore.

Solution: Make `showmode()` draw the ruler of the current window or the last
window in the cmdline if it has no statusline. This also maintains the
previously restored floating window case (`float->w_status_height` should be 0).

This behaviour should again match Vim, but without the overdraw it seems to do
to achieve the same effect; it calls `showmode()` to draw the ruler for the last
window without a statusline, then may draw over it in `showruler()` (which is
now `show_cursor_info_later()` in Nvim) to show the ruler for the current
window..? It's very confusing.

Also update the logic in `win_redr_ruler()` to mirror the check done in
`showmode()`, so that the ruler doesn't potentially draw over the long
ins-completion mode message in some cases.
2023-04-17 18:40:12 +01:00
7095f8ff9d vim-patch:9.0.1461: ruler not drawn correctly when using 'rulerformat'
Problem:    Ruler not drawn correctly when using 'rulerformat'.
Solution:   Adjust formatting depending on whether the ruler is drawn in the
            statusline or the command line. (Sean Dewar, closes vim/vim#12246)

fc8a601c32

This issue was made apparent after neovim/neovim@0f1e2b6, as `showmode()` calls
`win_redr_ruler()` with `curwin` now if it's floating, rather than the last
window if there's no statusline (which usually already shares its right side
with that of the editor).

Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
2023-04-17 18:38:31 +01:00
6cc76011ca fix(watchfiles): skip Created events when poll starts (#23139) 2023-04-17 18:50:05 +02:00
9e5f9c25d9 vim-patch:9.0.1460: insufficient testing for getcmdcompltype() (#23159)
Problem:    Insufficient testing for getcmdcompltype().
Solution:   Add a few more test cases. (closes vim/vim#12268)

961b2e54bd
2023-04-17 23:27:04 +08:00
07b60efd80 feat(diagnostic): specify diagnostic virtual text prefix as a function
- vim.diagnostic.config() now accepts a function for the virtual_text.prefix
  option, which allows for rendering e.g., diagnostic severities differently.
2023-04-17 12:53:34 +01:00
e83682e652 refactor: suppress clang false positives (#23154) 2023-04-17 19:22:55 +08:00
b98d195c55 ci(labeler): add back GitHub token for type-scope
It is required by `gh pr edit`.
2023-04-17 19:11:29 +08:00
75d9c413d4 fix(excmd): make :def unknown rather than unimplemented (#23150) 2023-04-17 17:44:08 +08:00
a30e61eb4d build(deps): bump tree-sitter to HEAD - af92bfc02 (#23151) 2023-04-17 11:39:57 +02:00
53985a6d31 Merge pull request #23148 from zeertzjq/vim-8.2.4179
vim-patch:8.2.{4179,4180,4181,4182,4183,4184,4185,4186,4193,4197}
2023-04-17 16:10:21 +08:00
79a6933768 vim-patch:partial:6f4754b9f725
Update runtime files

6f4754b9f7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 15:46:24 +08:00
481c6e6cac vim-patch:8.2.4197: cannot use an import in the "expr" part of 'spellsuggest'
Problem:    Cannot use an import in the "expr" part of 'spellsuggest'.
Solution:   Set the script context when evaluating "expr" of 'spellsuggest'.

2a7aa83458

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 15:46:24 +08:00
f560c97059 vim-patch:8.2.4193: cannot use an import in 'charconvert'
Problem:    Cannot use an import in 'charconvert'.
Solution:   Set the script context when evaluating 'charconvert'.  Also expand
            script-local functions in 'charconvert'.

f4e88f2152

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 15:46:24 +08:00
cec42e07bc vim-patch:8.2.4186: cannot use an import in 'patchexpr'
Problem:    Cannot use an import in 'patchexpr'.
Solution:   Set the script context when evaluating 'patchexpr'.  Do not
            require 'patchexpr' to return a bool, it was ignored anyway.

36c2add7f8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 15:46:24 +08:00
5d3ad6fd90 vim-patch:8.2.4185: cannot use an import in 'indentexpr'
Problem:    Cannot use an import in 'indentexpr'.
Solution:   Set the script context when evaluating 'indentexpr'

28e60cc088

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 15:46:24 +08:00
96451e7f60 vim-patch:8.2.4184: cannot use an import in 'includeexpr'
Problem:    Cannot use an import in 'includeexpr'.
Solution:   Set the script context when evaluating 'includeexpr'

47bcc5f4c8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 15:46:24 +08:00
36f1e9824a vim-patch:8.2.4183: cannot use an import in 'formatexpr'
Problem:    Cannot use an import in 'formatexpr'.
Solution:   Set the script context when evaluating 'formatexpr'.

3ba685eeef

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 15:46:24 +08:00
9cf59acfaa vim-patch:8.2.4182: memory leak when evaluating 'diffexpr'
Problem:    Memory leak when evaluating 'diffexpr'.
Solution:   Use free_tv() instead of clear_tv().

39b8944539

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 15:46:24 +08:00
ba57566601 vim-patch:8.2.4181: Vim9: cannot use an import in 'diffexpr'
Problem:    Vim9: cannot use an import in 'diffexpr'.
Solution:   Set the script context when evaluating 'diffexpr'.  Do not require
            'diffexpr' to return a bool, it was ignored anyway.

7b29f6a394

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 15:46:24 +08:00
0c99ae7a88 vim-patch:8.2.4180: 'balloonexpr' is evaluated in the current script context
Problem:    'balloonexpr' is evaluated in the current script context.
Solution:   Use the script context where the option was set.

5600a709f4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 15:46:24 +08:00
d6e0f3dad2 vim-patch:8.2.4179: 'foldtext' is evaluated in the current script context
Problem:    'foldtext' is evaluated in the current script context.
Solution:   Use the script context where the option was set.

9530b580a7

Script version is N/A.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 15:46:24 +08:00
0dbb0419f4 build(deps): bump LuaJIT to HEAD - 1c2791270 (#23140) 2023-04-17 09:08:43 +02:00
9722b3b9f9 vim-patch:9.0.1400: find_file_in_path() is not reentrant (#23146)
Problem:    find_file_in_path() is not reentrant.
Solution:   Instead of global variables pass pointers to the functions.
            (closes vim/vim#12093)

5145c9a829

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 14:38:53 +08:00
85bc9e8970 Merge pull request #23144 from zeertzjq/vim-9.0.0419
vim-patch:9.0.{0406,0419}: the :defer command does not check the function arguments
2023-04-17 10:09:18 +08:00
7a3f86481e vim-patch:9.0.0419: the :defer command does not check the function arguments
Problem:    The :defer command does not check the function argument count and
            types.
Solution:   Check the function arguments when adding a deferred function.

169003289f

Cherry-pick check_internal_func() from Vim, but use EvalFuncDef pointer
as first argument.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 09:38:09 +08:00
6bfba3660c vim-patch:9.0.0406: deferred functions not invoked when partial func exits
Problem:    Deferred functions not invoked when partial func exits.
Solution:   Create a funccall_T when calling a :def function.

9667b2c888

The remove_funccal() function is currently unused, but it will be used
in patch 9.0.0618.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 09:08:08 +08:00
78535664bd vim-patch:8.2.2172: Vim9: number of arguments is not always checked (#23142)
Problem:    Vim9: number of arguments is not always checked. (Yegappan
            Lakshmanan)
Solution:   Check number of arguments when calling function by name.

5082471f91

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 09:07:30 +08:00
55d346fc26 ci: remove unnecessary token usage 2023-04-16 14:16:19 +02:00
88c3d89001 vim-patch:9.0.1143: invalid memory access with bad 'statusline' value (#23133)
Problem:    Invalid memory access with bad 'statusline' value.
Solution:   Avoid going over the NUL at the end.

7b17eb4b06

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 19:21:06 +08:00
227f06b7df vim-patch:9.0.1145: invalid memory access with recursive substitute expression (#23132)
Problem:    Invalid memory access with recursive substitute expression.
Solution:   Check the return value of vim_regsub().

3ac1d97a1d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 18:43:15 +08:00
7f94a032e1 fix(checkhealth): shell_error and cpanm module
shell_error is a function, the code missed parentheses

The actual module for perl module version is App::cpanminus::script, not
App::cpanminus::fatscript.
2023-04-16 12:39:48 +02:00
fd68cd1c0a vim-patch:8.2.2857: Vim9: exception in ISN_INSTR caught at wrong level (#23131)
Problem:    Vim9: exception in ISN_INSTR caught at wrong level.
Solution:   Set the starting trylevel in exec_instructions(). (closes vim/vim#8214)

ff65288aa8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 18:27:33 +08:00
b0978fca6b fix(checkhealth): fix crash due to incorrect argument type 2023-04-16 12:26:13 +02:00
2f779b94e7 fix(lua): inspect_pos respect bufnr when get syntax info (#23098) 2023-04-16 17:50:32 +08:00
6ca4fba97f test(old): sync test_filetype.vim with upstream (#23127) 2023-04-16 17:44:30 +08:00
b28683d252 vim-patch:9.0.0947: invalid memory access in substitute with function (#23126)
Problem:    Invalid memory access in substitute with function that goes to
            another file.
Solution:   Check for text locked in CTRL-W gf.

cc762a48d4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 17:44:14 +08:00
c54592bfda vim-patch:9.0.0621: filetype test leaves file behind (#23125)
Problem:    Filetype test leaves file behind.
Solution:   Add deferred delete flag to writefile(). (Dominique Pellé,
            closes vim/vim#11249)

fc06cda837

Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
2023-04-16 17:06:47 +08:00
d9e9dc3a06 vim-patch:9.0.1455: C++ 20 modules are not recognized (#23124)
Problem:    C++ 20 modules are not recognized.
Solution:   Add patterns to recognize C++ 20 modules as "cpp". (Ben Jackson,
            closes vim/vim#12261)

732d69e191

Co-authored-by: Ben Jackson <puremourning@gmail.com>
2023-04-16 10:59:04 +02:00
42e55ba009 vim-patch:9.0.0398: members of funccall_T are inconsistently named (#23123)
Problem:    Members of funccall_T are inconsistently named.
Solution:   Use the "fc_" prefix for all members.

ca16c60f33

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 16:57:25 +08:00
0b855f7c07 Merge pull request #23116 from zeertzjq/vim-9.0.1064
vim-patch:9.0.{1064,1456}
2023-04-16 16:35:51 +08:00
a81c137251 vim-patch:9.0.1456: shortmess test depends on order of test execution
Problem:    Shortmess test depends on order of test execution.
Solution:   Clear messages. (closes vim/vim#12264)

657b31fa3b
2023-04-16 16:12:52 +08:00
e24a84f18e vim-patch:9.0.1064: code for making 'shortmess' temporarily empty is repeated
Problem:    Code for making 'shortmess' temporarily empty is repeated.
Solution:   Add functions for making 'shortmess' empty and restoring it.
            (Christian Brabandt, closes vim/vim#11709)

9aee8ec400

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-04-16 16:12:52 +08:00
0d9b0fbe57 Merge pull request #23119 from zeertzjq/vim-9.0.0370
vim-patch:9.0.{0370,0379,0390,0397,0411,1446}: :defer and deferred delete
2023-04-16 15:59:32 +08:00
8a59d04a31 test(unit): add test for os_mkdir_recurse "created" 2023-04-16 15:04:41 +08:00
b1a341a48a vim-patch:9.0.1446: unnecessary checks for the "skip" flag when skipping
Problem:    Unnecessary checks for the "skip" flag when skipping.
Solution:   Remove the unnecessary checks. (closes vim/vim#12254)

5299c0933f
2023-04-16 15:04:41 +08:00
f39b33ee49 vim-patch:9.0.0411: only created files can be cleaned up with one call
Problem:    Only created files can be cleaned up with one call.
Solution:   Add flags to mkdir() to delete with a deferred function.
            Expand the writefile() name to a full path to handle changing
            directory.

6f14da15ac

vim-patch:8.2.3742: dec mouse test fails without gnome terminfo entry

Problem:    Dec mouse test fails without gnome terminfo entry.
Solution:   Check if there is a gnome entry. Also fix 'acd' test on
            MS-Windows. (Dominique Pellé, closes vim/vim#9282)

f589fd3e10

Cherry-pick test_autochdir.vim changes from patch 9.0.0313.
Cherry-pick test_autocmd.vim changes from patch 9.0.0323.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 15:04:41 +08:00
7b05ddbb72 vim-patch:9.0.0397: :defer not tested with exceptions and ":qa!"
Problem:    :defer not tested with exceptions and ":qa!".
Solution:   Test :defer works when exceptions are thrown and when ":qa!" is
            used.  Invoke the deferred calls on exit.

58779858fb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 15:04:41 +08:00
335bef0c21 vim-patch:9.0.0390: cannot use a partial with :defer
Problem:    Cannot use a partial with :defer.
Solution:   Add the partial arguments before the other arguments.  Disallow
            using a dictionary.

86d87256c4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 15:04:41 +08:00
0167649ce4 vim-patch:9.0.0379: cleaning up after writefile() is a hassle
Problem:    Cleaning up after writefile() is a hassle.
Solution:   Add the 'D' flag to defer deleting the written file.  Very useful
            in tests.

806a273f3c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 15:04:41 +08:00
b75634e55e vim-patch:9.0.0370: cleaning up afterwards can make a function messy
Problem:    Cleaning up afterwards can make a function messy.
Solution:   Add the :defer command.

1d84f7608f

Omit EX_EXPR_ARG: Vim9 script only.
Make :def throw E319 to avoid confusing behavior.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 15:04:40 +08:00
54dab9ed9e Merge pull request #23118 from zeertzjq/vim-8.2.3783
vim-patch:8.2.{1945,2848,2977,2978,3783,3786}
2023-04-16 10:42:11 +08:00
d7965293ec vim-patch:8.2.3786: test fails because of using Vim9 syntax in legacy function
Problem:    Test fails because of using Vim9 syntax in legacy function.
Solution:   Add "call".

4f16e9de98

Add test_nested_function.vim changes from patches 8.{0.0141,2.1432}.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 10:18:39 +08:00
68ca16c376 vim-patch:8.2.3783: confusing error for using a variable as a function
Problem:    Confusing error for using a variable as a function.
Solution:   If a function is not found but there is a variable, give a more
            useful error. (issue vim/vim#9310)

2ef9156b42

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 10:15:15 +08:00
2e8cec5f2b vim-patch:8.2.2978: warning for uninitialized variable
Problem:    Warning for uninitialized variable.
Solution:   Set return value to FAIL.

744aecf877

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 10:15:15 +08:00
f4d3e279e8 vim-patch:8.2.2977: crash when using a null function reference
Problem:    Crash when using a null function reference. (Naohiro Ono)
Solution:   Check for an invalid function name. (closes vim/vim#8367)

22db0d549f

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 10:15:15 +08:00
08121ef69f vim-patch:8.2.2848: crash whn calling partial
Problem:    Crash whn calling partial.
Solution:   Check for NULL pointer. (Dominique Pellé, closes vim/vim#8202)

fe8ebdbe5c

Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
2023-04-16 10:15:15 +08:00
d13222649a vim-patch:8.2.1945: crash when passing NULL function to reduce()
Problem:    Crash when passing NULL function to reduce().
Solution:   Check for NULL pointer and give an error. (Dominique Pellé,
            closes vim/vim#7243)

0d90e728fe

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 10:15:13 +08:00
6adfd24a06 vim-patch:8.2.4716: memory allocation failure not tested when defining a function (#23117)
Problem:    Memory allocation failure not tested when defining a function.
Solution:   Add a test. (Yegappan Lakshmanan, closes vim/vim#10127)

7c7e19cf50

test_alloc_fail() is N/A.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-04-16 08:26:42 +08:00
c08b030761 refactor: deprecate checkhealth functions
The following functions are deprecated and will be removed in
Nvim v0.11:

- health#report_start()
- health#report_info()
- health#report_ok()
- health#report_warn()
- health#report_error()
- vim.health.report_start()
- vim.health.report_info()
- vim.health.report_ok()
- vim.health.report_warn()
- vim.health.report_error()

Users should instead use these:

- vim.health.start()
- vim.health.info()
- vim.health.ok()
- vim.health.warn()
- vim.health.error()
2023-04-15 23:40:48 +02:00
c8667c8756 build: various cmake fixes
- Remove unused function argument from GetBinaryDeps
- Remove unused variable LUA_LOAD_PACKAGE_MODULE_SOURCE
- Add LUA_FS_MODULE_SOURCE as a dependency of VIM_MODULE_FILE
2023-04-15 22:39:30 +02:00
8c6f97bef8 fix(health): properly use the value of $PYENV_VERSION (#23109) 2023-04-16 00:16:50 +08:00
2e2101cf7b Merge pull request #23107 from zeertzjq/vim-9.0.0269
vim-patch:9.0.{0269,0303,1431}: more getscriptinfo() features
2023-04-15 21:27:30 +08:00
9770dcf96d refactor: remove FC_DEAD
It's for Vim9 script only.
2023-04-15 21:06:17 +08:00
c5ec823a14 vim-patch:9.0.1431: getscriptinfo() loops even when specific SID is given
Problem:    getscriptinfo() loops even when specific SID is given.
Solution:   Only loop when needed.  Give a clearer error message.
            (closes vim/vim#12207)

2d68b722e3
2023-04-15 21:06:17 +08:00
e9b4f51051 vim-patch:9.0.0303: it is not easy to get information about a script
Problem:    It is not easy to get information about a script.
Solution:   Make getscriptinf() return the version.  When selecting a specific
            script return functions and variables. (Yegappan Lakshmanan,
            closes vim/vim#10991)

2f892d8663

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-04-15 21:06:17 +08:00
bcc971de15 vim-patch:9.0.0269: getscriptinfo() does not include the version
Problem:    getscriptinfo() does not include the version.  Cannot select
            entries by script name.
Solution:   Add the "version" item and the "name" argument. (Yegappan
            Lakshmanan, closes vim/vim#10962)

520f6ef60a

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-04-15 21:06:16 +08:00
eb151a9730 build(nix): upgrade nixpkgs to resolve link error (#23101)
bump nixpkgs to get the appropriate treesitter version
2023-04-15 14:54:16 +02:00
62b7b1daf3 Merge pull request #23105 from zeertzjq/vim-8.2.4770
vim-patch:8.2.{4770,4783,4840,4883,4930,4934},9.0.0104: interpolated string
2023-04-15 19:46:17 +08:00
57221e0d11 vim-patch:b59ae59a5870
Update runtime files

b59ae59a58

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 19:13:58 +08:00
9f1d333072 vim-patch:3f32a5f1601a
Update runtime files and translations

3f32a5f160

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 19:05:58 +08:00
f2a9097d76 vim-patch:partial:d899e5112079
Update runtime files

d899e51120

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 19:02:52 +08:00
c6ebcd523d vim-patch:9.0.0104: going beyond allocated memory when evaluating string constant
Problem:    Going beyond allocated memory when evaluating string constant.
Solution:   Properly skip over <Key> form.

1e56bda904

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 19:01:24 +08:00
29efd54e02 vim-patch:8.2.4934: string interpolation fails when not evaluating
Problem:    String interpolation fails when not evaluating.
Solution:   Skip the expression when not evaluating. (closes vim/vim#10398)

70c41241c2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 19:01:19 +08:00
ef9af89da7 vim-patch:8.2.4930: interpolated string expression requires escaping
Problem:    Interpolated string expression requires escaping.
Solution:   Do not require escaping in the expression.

0abc2871c1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 18:19:17 +08:00
bacb5021d4 vim-patch:8.2.4883: string interpolation only works in heredoc
Problem:    String interpolation only works in heredoc.
Solution:   Support interpolated strings.  Use syntax for heredoc consistent
            with strings, similar to C#. (closes vim/vim#10327)

2eaef106e4

Cherry-pick Test_Debugger_breakadd_expr() from Vim.

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-04-15 17:59:32 +08:00
2cf8f01e7d vim-patch:8.2.4840: heredoc expression evaluated even when skipping
Problem:    Heredoc expression evaluated even when skipping.
Solution:   Don't evaluate when "skip" is set. (closes vim/vim#10306)

05c7f5d3d0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 17:40:31 +08:00
3c16e75ae1 vim-patch:8.2.4783: Coverity warns for leaking memory
Problem:    Coverity warns for leaking memory.
Solution:   Use another strategy freeing "theline".

42ccb8d747

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 17:40:31 +08:00
3ad8c08acc vim-patch:8.2.4770: cannot easily mix expression and heredoc
Problem:    Cannot easily mix expression and heredoc.
Solution:   Support  in heredoc. (Yegappan Lakshmanan, closes vim/vim#10138)

efbfa867a1

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-04-15 17:40:31 +08:00
071c455420 Merge pull request #23102 from zeertzjq/vim-8.2.1378
vim-patch:8.2.{1378,3856,4361,4373,4476}
2023-04-15 17:38:46 +08:00
1b556c04bf vim-patch:8.2.4476: operator name spelled wrong
Problem:    Operator name spelled wrong.
Solution:   Change trinary to ternary. (Goc Dundar, closes vim/vim#9850)

e41c1dd889

Co-authored-by: =?UTF-8?q?Dundar=20G=C3=B6c?= <gocdundar@gmail.com>
2023-04-15 17:15:04 +08:00
408e5d16a9 vim-patch:8.2.4373: expression test fails
Problem:    Expression test fails.
Solution:   Make the test work with latest Vim9 syntax.

c87aa34dfd

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 17:14:49 +08:00
b29df57ba7 vim-patch:8.2.4361: Vim9: some tests fail
Problem:    Vim9: some tests fail.
Solution:   Fix the tests, mostly by removing "s:".

62b191c387

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 17:14:30 +08:00
f04125a935 vim-patch:8.2.3856: Vim9: not enough tests
Problem:    Vim9: not enough tests.
Solution:   Run more expression tests also with Vim9. Fix an uncovered
            problem.

fea43e44c0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 17:09:42 +08:00
700152fbf8 vim-patch:8.2.1378: cannot put space between function name and paren
Problem:    Cannot put space between function name and paren.
Solution:   Allow this for backwards compatibility.

bbd3e3c357

This fixes a regression from patch 8.2.1365, which isn't ported yet.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 17:09:41 +08:00
0a61cb60a6 Merge pull request #23099 from zeertzjq/vim-8.2.1014
vim-patch:8.2.{1014,3329}
2023-04-15 14:57:14 +08:00
9636ae6a13 vim-patch:8.2.3329: v_lock not set when getting value of environment variable
Problem:    v_lock not set when getting value of environment variable.
Solution:   Set v_lock to zero.

16e63e6d35

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 14:28:40 +08:00
031cf60d4a vim-patch:8.2.1014: using "name" for a string result is confusing
Problem:    Using "name" for a string result is confusing.
Solution:   Rename to "end".

1e0b7b11db

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 14:21:07 +08:00
1ca77c222b Merge pull request #23097 from zeertzjq/vim-8.2.0101
vim-patch:8.2.{0101,0102,0103,0104,0633,0634}: null typval tests
2023-04-15 14:11:10 +08:00
85741677c8 vim-patch:8.2.0634: crash with null partial and blob
Problem:    Crash with null partial and blob.
Solution:   Check for NULL pointer.  Add more tests. (Yegappan Lakshmanan,
            closes vim/vim#5984)

92b83ccfda

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 13:48:30 +08:00
4b49f312a0 vim-patch:8.2.0633: crash when using null partial in filter()
Problem:    Crash when using null partial in filter().
Solution:   Fix crash.  Add more tests. (Yegappan Lakshmanan, closes vim/vim#5976)

9d8d0b5c64

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 13:31:10 +08:00
3d80392cab vim-patch:8.2.0104: using channel or job with ":execute" has strange effects
Problem:    Using channel or job with ":execute" has strange effects.
Solution:   Give an error message for Job and Channel.

b662591e50

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 13:17:20 +08:00
4c276bbd18 vim-patch:8.2.0103: using null object with execute() has strange effects
Problem:    Using null object with execute() has strange effects.
Solution:   Give an error message ofr Job and Channel.

e2a8f0773e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 13:15:10 +08:00
d372eedcfa vim-patch:8.2.0102: messages test fails in small version
Problem:    Messages test fails in small version.
Solution:   Only use test_null_job() when available.

da292b07af

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 13:10:27 +08:00
0eddf5ad2f vim-patch:8.2.0101: crash when passing null object to ":echomsg"
Problem:    Crash when passing null object to ":echomsg".
Solution:   Check for NULL pointer. (Yasuhiro Matsumoto, closes vim/vim#5460)

9db2afe46d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-15 13:09:05 +08:00
c2e47e7bec build: don't print installed files locally
It takes a significant amount of time to install neovim, and doubly so
on Windows, due to the sheer amount of files neovim ships with. On CI
this information may be important though, so we enable it if the
CI_ENABLE option is set to ON.
2023-04-14 19:19:49 +02:00
ae9654dd73 vim-patch:8.2.4055: Vim9: line break in expression causes v:errmsg to be fillec (#23090)
Problem:    Vim9: line break in expression causes v:errmsg to be filled.
            (Yegappan Lakshmanan)
Solution:   Do not give an error when skipping over an expression.

5e6b9882fe

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 21:56:13 +08:00
002b80cb5d Merge pull request #22968 from luukvbaal/evalstc
fix(api): update "w_scwidth" in nvim_eval_statusline()
2023-04-14 15:12:48 +02:00
e36806666f vim-patch:8.2.2138: Vim9: "exit_cb" causes Vim to exit (#23087)
Problem:    Vim9: "exit_cb" causes Vim to exit.
Solution:   Require white space after a command in Vim9 script. (closes vim/vim#7467)
            Also fix that Vim9 style heredoc was not always recognized.

b5b9480ee9

Omit EX_NONWHITE_OK, E1143, E1144: Vim9 script only.
Cherry-pick test_vimscript.vim changes from patch 8.2.2141.
Cherry-pick E1145 tag from Vim runtime.

N/A patches for version.c:

vim-patch:8.2.2140: build failure with tiny features

Problem:    Build failure with tiny features.
Solution:   Add #ifdef.

2a3cd3af45

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 20:35:46 +08:00
789654accd Merge pull request #22869 from lewis6991/refactor/unitannot
refactor(unit): add type annotations
2023-04-14 13:27:46 +01:00
3d29424fb9 refactor(unit): add type annotations 2023-04-14 12:41:57 +01:00
5465adcbab fix(lint): use tbl_contains 2023-04-14 12:41:57 +01:00
90efe85a99 vim-patch:8.2.1111: inconsistent naming of get_list_tv() and eval_dict() (#23086)
Problem:    Inconsistent naming of get_list_tv() and eval_dict().
Solution:   Rename get_list_tv() to eval_list().  Similarly for eval_number(),
            eval_string(), eval_lit_string() and a few others.

9a78e6df17

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 19:28:39 +08:00
c15939c1f7 Merge pull request #23084 from zeertzjq/vim-8.2.1794
vim-patch:8.2.{1794,1798},9.0.1452
2023-04-14 18:24:44 +08:00
3be966f725 vim-patch:9.0.1452: code using EVAL_CONSTANT is dead, it is never set
Problem:    Code using EVAL_CONSTANT is dead, it is never set.
Solution:   Remove EVAL_CONSTANT. (closes vim/vim#12252)

b7f6f93475
2023-04-14 18:04:12 +08:00
f12afd8e16 vim-patch:8.2.1798: Vim9: trinary operator condition is too permissive
Problem:    Vim9: trinary operator condition is too permissive.
Solution:   Use tv_get_bool_chk().

1310660557

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 18:04:12 +08:00
d6e2804ab4 vim-patch:8.2.1794: no falsy Coalescing operator
Problem:    No falsy Coalescing operator.
Solution:   Add the "??" operator.  Fix mistake with function argument count.

92f26c256e

Cherry-pick tv2bool() into eval/typval.c.
Cherry-pick *??* tag from Vim runtime.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 18:04:09 +08:00
7caf0eafd8 feat(lua)!: add stricter vim.tbl_islist() and rename old one to vim.tbl_isarray() (#16440)
feat(lua)!: add stricter vim.tbl_islist(), rename vim.tbl_isarray()

Problem: `vim.tbl_islist` allows gaps in tables with integer keys
("arrays").

Solution: Rename `vim.tbl_islist` to `vim.tbl_isarray`, add new
`vim.tbl.islist` that checks for consecutive integer keys that start
from 1.
2023-04-14 12:01:08 +02:00
33e90f5138 Merge pull request #23083 from zeertzjq/vim-8.2.1189
vim-patch:8.2.{1189,1512}
2023-04-14 17:40:17 +08:00
aaacfd4a6d vim-patch:8.2.1512: failure after trinary expression fails
Problem:    Failure after trinary expression fails.
Solution:   Restore eval_flags. (Yasuhiro Matsumoto, closes vim/vim#6776)

69e44552c5

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 17:21:22 +08:00
85a7f9dabe vim-patch:8.2.1189: Vim9: line continuation in lambda doesn't always work
Problem:    Vim9: line continuation in lambda doesn't always work.
Solution:   Do not use a local evalarg unless there isn't one. (closes vim/vim#6439)

8af81d656a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 17:21:22 +08:00
4d04feb662 feat(lua): vim.tbl_contains supports general tables and predicates (#23040)
* feat(lua): vim.tbl_contains supports general tables and predicates

Problem: `vim.tbl_contains` only works for list-like tables (integer
keys without gaps) and primitive values (in particular, not for nested
tables).

Solution: Rename `vim.tbl_contains` to `vim.list_contains` and add new
`vim.tbl_contains` that works for general tables and optionally allows
`value` to be a predicate function that is checked for every key.
2023-04-14 10:39:57 +02:00
72a327cad2 Merge pull request #23081 from zeertzjq/vim-8.2.1062
vim-patch:8.2.{1062,1063,1064,1065,1068,1069,1070,1071,1073,1074,1075,1076,1079,1080,1098,1099,1100,1125,1161,1162,1163,1203,3216}
2023-04-14 16:33:37 +08:00
9c66b48316 vim-patch:8.2.3216: Vim9: crash when using variable in a loop at script level
Problem:    Vim9: crash when using variable in a loop at script level.
Solution:   Do not clear the variable if a function was defined.
            Do not create a new entry in sn_var_vals every time.
            (closes vim/vim#8628)

2eb6fc3b52

Omit eval_cstack: Vim9 script only.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:10 +08:00
56cfecdd59 vim-patch:8.2.1203: unused assignments in expression evaluation
Problem:    Unused assignments in expression evaluation.
Solution:   Move declarations and assignments to inner blocks where possible.

3ac9c4701a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:10 +08:00
c804c7df0c vim-patch:8.2.1162: crash when using a lambda
Problem:    Crash when using a lambda.
Solution:   Check for evalarg to be NULL.

efaaaa683b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:10 +08:00
cc7a50a9ae vim-patch:8.2.1161: Vim9: using freed memory
Problem:    Vim9: using freed memory.
Solution:   Put pointer back in evalarg instead of freeing it.

8e2730a315

Omit eval_tofree_lambda: Vim9 script only.

N/A patches for version.c:

vim-patch:8.2.1163: build error

Problem:    Build error.
Solution:   Add missing change to globals.

6e13530ca0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
562840a2a1 vim-patch:8.2.1125: Vim9: double quote can be a string or a comment
Problem:    Vim9: double quote can be a string or a comment.
Solution:   Only support comments starting with # to avoid confusion.

962d721319

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
cf37630d1b vim-patch:8.2.1110: Vim9: line continuation does not work in function arguments
Problem:    Vim9: line continuation does not work in function arguments.
Solution:   Pass "evalarg" to get_func_tv().  Fix seeing double quoted string
            as comment.

e6b5324e3a

Omit skipwhite_and_linebreak_keep_string(): Vim9 script only.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
9c65a18753 vim-patch:8.2.1103: Coverity reports an unnecessary NULL check
Problem:    Coverity reports an unnecessary NULL check.
Solution:   Remove the check for NULL.

e707c882b2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
04b58cec86 vim-patch:8.2.1100: Vim9: cannot use line break in :execute argument
Problem:    Vim9: cannot use line break in :execute, :echomsg and :echoerr
            argument.
Solution:   Check for line break.

47e880d6c1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
78dd6100b1 vim-patch:8.2.1099: Vim9: cannot use line break in :cexpr argument
Problem:    Vim9: cannot use line break in :cexpr argument.
Solution:   Check for line break.

37c8371195

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
ff963d699b vim-patch:8.2.1098: Vim9: cannot use line break in :throw argument
Problem:    Vim9: cannot use line break in :throw argument.
Solution:   Check for line break.

006ad48b8a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
8729c41f44 vim-patch:8.2.1080: Vim9: no line break allowed in a for loop
Problem:    Vim9: no line break allowed in a for loop.
Solution:   Skip line breaks in for command.

b7a78f7a67

Omit *_break_count and skip_for_lines(): Vim9 script only.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
4b84b2e2aa vim-patch:8.2.1079: Vim9: no line break allowed in a while loop
Problem:    Vim9: no line break allowed in a while loop.
Solution:   Update stored loop lines when finding line breaks.

d5053d015a

Omit getline_peek(): Vim9 script only.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
e99f28e57d vim-patch:8.2.1076: Vim9: no line break allowed in :if expression
Problem:    Vim9: no line break allowed in :if expression.
Solution:   Skip linebreak.

faf8626b79

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
64a91f5ea2 vim-patch:8.2.1075: Vim9: no line break allowed in :echo expression
Problem:    Vim9: no line break allowed in :echo expression.
Solution:   Skip linebreak.

7e8967fdcd

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
10b8c6481f vim-patch:8.2.1074: Vim9: no line break allowed after some operators
Problem:    Vim9: no line break allowed after some operators.
Solution:   Skip a line break after the operator.  Add
            eval_may_get_next_line() to simplify checking for a line break.

9215f01218

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
9c29c07705 vim-patch:8.2.1073: Vim9: no line break allowed in () expression
Problem:    Vim9: no line break allowed in () expression.
Solution:   Skip a line break.

7a4981b936

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
d927128fcc vim-patch:8.2.1071: Vim9: no line break allowed inside a lambda
Problem:    Vim9: no line break allowed inside a lambda.
Solution:   Handle line break inside a lambda in Vim9 script.

e40fbc2ca9

Omit skip_expr_concatenate(). Apply the change to skip_expr() instead.
Omit eval_ga: Vim9 script only.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
89ff05b258 vim-patch:8.2.1069: Vim9: fail to check for white space in list
Problem:    Vim9: fail to check for white space in list.
Solution:   Add check for white space.

e6e031739c

N/A patches for version.c:

vim-patch:8.2.1070: Vim9: leaking memory when lacking white space in dict

Problem:    Vim9: leaking memory when lacking white space in dict.
Solution:   Clear the typval.

ab19d495fd

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
4ce20f7229 vim-patch:8.2.1068: Vim9: no line break allowed inside a dict
Problem:    Vim9: no line break allowed inside a dict.
Solution:   Handle line break inside a dict in Vim9 script.

8ea9390b78

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
2af6bbcfa7 vim-patch:8.2.1065: Vim9: no line break allowed inside a list
Problem:    Vim9: no line break allowed inside a list.
Solution:   Handle line break inside a list in Vim9 script.

7147820cb9

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
51f99a347d vim-patch:8.2.1064: Vim9: no line break allowed before comperators
Problem:    Vim9: no line break allowed before comperators.
Solution:   Check for comperator after line break.

e6536aa766

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
9781a21133 vim-patch:8.2.1063: Vim9: no line break allowed before || or &&
Problem:    Vim9: no line break allowed before || or &&.
Solution:   Check for operator after line break.

be7ee48876

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:09 +08:00
9ecfb42ec0 vim-patch:8.2.1062: Vim9: no line break allowed inside "cond ? val1 : val2"
Problem:    Vim9: no line break allowed inside "cond ? val1 : val2".
Solution:   Check for operator after line break.

793648fb56

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 16:10:08 +08:00
37bb40701d Merge pull request #23078 from zeertzjq/vim-8.2.1047
vim-patch:8.2.{1047,1048,1049,1050,1052},9.0.1447
2023-04-14 10:58:29 +08:00
e8c25aac8d vim-patch:9.0.1447: condition is always true
Problem:    Condition is always true.
Solution:   Remove the useless condition. (closes vim/vim#12253)

474891bc89
2023-04-14 10:30:21 +08:00
8e2903d2fe vim-patch:8.2.1049: Vim9: leaking memory when using continuation line
Problem:    Vim9: leaking memory when using continuation line.
Solution:   Keep a pointer to the continuation line in evalarg_T.  Centralize
            checking for a next command.

b171fb1790

Omit eval_next_line(): Vim9 script only.

vim-patch:8.2.1050: missing change in struct

Problem:    Missing change in struct.
Solution:   Add missing change.

65a8ed37f7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 09:42:59 +08:00
bd83b587b1 vim-patch:8.2.1047: Vim9: script cannot use line continuation like :def function
Problem:    Vim9: script cannot use line continuation like in a :def function.
Solution:   Pass the getline function pointer to the eval() functions.  Use it
            for addition and multiplication operators.

5409f5d8c9

Omit source_nextline() and eval_next_non_blank(): Vim9 script only.

N/A patches for version.c:

vim-patch:8.2.1048: build failure without the eval feature

Problem:    Build failure without the eval feature.
Solution:   Add dummy typedef.

9d40c63c7d

vim-patch:8.2.1052: build failure with older compilers

Problem:    Build failure with older compilers.
Solution:   Move declaration to start of block.

7acde51832

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 09:23:40 +08:00
f64f6706e5 vim-patch:9.0.1449: test for prompt buffer is flaky (#23076)
Problem:    Test for prompt buffer is flaky.
Solution:   Use WaitForAssert() instead of TermWait(). (Ozaki Kiichi,
            closes vim/vim#12247)

ff6c230051
2023-04-14 07:12:42 +08:00
8f69c5ed45 vim-patch:8.2.{0695,0725,0734,0753,0818,0819,0822} (#23075)
vim-patch:8.2.0695: Vim9: cannot define a function inside a function

Problem:    Vim9: cannot define a function inside a function.
Solution:   Initial support for :def inside :def.

04b1269783

vim-patch:8.2.0725: Vim9: cannot call a function declared later in Vim9 script

Problem:    Vim9: cannot call a function declared later in Vim9 script.
Solution:   Make two passes through the script file.

09689a0284

vim-patch:8.2.0734: Vim9: leaking memory when using :finish

Problem:    Vim9: leaking memory when using :finish.
Solution:   Do not check for next line in third pass.

04816717df

vim-patch:8.2.0753: Vim9: expressions are evaluated in the discovery phase

Problem:    Vim9: expressions are evaluated in the discovery phase.
Solution:   Bail out if an expression is not a constant.  Require a type for
            declared constants.

32e351179e

vim-patch:8.2.0818: Vim9: using a discovery phase doesn't work well

Problem:    Vim9: using a discovery phase doesn't work well.
Solution:   Remove the discovery phase, instead compile a function only when
            it is used.  Add :defcompile to compile def functions earlier.

822ba24743

vim-patch:8.2.0819: compiler warning for unused variable

Problem:    Compiler warning for unused variable.
Solution:   Remove the variable.

f40e51a880

vim-patch:8.2.0822: Vim9: code left over from discovery phase

Problem:    Vim9: code left over from discovery phase.
Solution:   Remove the dead code.

2eec37926d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-14 07:11:59 +08:00
0adb9f75c5 Merge pull request #23071 from luukvbaal/sloclater
fix: winbar is not redrawn on window change when 'showcmdloc' is "statusline"
2023-04-14 07:00:04 +08:00
80f6d55521 test(winbar_spec): properly update winbar when 'showcmdloc' is "statusline"
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
2023-04-14 00:11:28 +02:00
3a3ec37260 test: remove penlight usage 2023-04-14 00:09:56 +02:00
bfb28b62da refactor: remove modelines from Lua files
Now that we have builtin EditorConfig support and a formatting check in
CI, these are not necessary.
2023-04-13 23:29:13 +02:00
086088ce44 vim-patch:9.0.1451: unnecessary redrawing when 'showcmdloc' is not "last"
Problem:    Unnecessary redrawing when 'showcmdloc' is not "last".
Solution:   Redraw later when "showcmd_is_clear" is set. (Luuk van Baal,
            closes vim/vim#12260)

aa7f25ebf1
2023-04-13 23:10:14 +02:00
66c66d8db8 fix(loader): reset hashes when running the loader 2023-04-13 17:34:47 +01:00
b85ac89326 Merge pull request #23064 from bfredl/nolink
fix(api): make nvim_get_hl not return non-existing groups
2023-04-13 14:39:12 +02:00
d05d63a18f fix(api): make nvim_get_hl not return non-existing groups
fixes #23063
2023-04-13 14:17:12 +02:00
c8c7912a4d build(vim-patch.sh): ignore test_behave.vim (#23062) 2023-04-13 19:07:42 +08:00
231e1988ed Merge pull request #23054 from bfredl/nobehave
feat(ex_cmds)!: remove :behave
2023-04-13 12:39:05 +02:00
e4a136f713 feat(ex_cmds)!: remove :behave
just use the individual options instead.

   set selection=exclusive
   set selectmode=mouse,key
   set mousemodel=popup
   set keymodel=startsel,stopsel
2023-04-13 12:15:30 +02:00
99c1010aa7 vim-patch:partial:9.0.0364: clang static analyzer gives warnings (#23059)
Problem:    Clang static analyzer gives warnings.
Solution:   Avoid the warnings. (Yegappan Lakshmanan, closes vim/vim#11043)

c99e182e1f

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-04-13 13:27:50 +08:00
5ccec143d8 refactor: remove bugreport.vim
We already have :checkhealth that essentially supersedes it with more
useful error checking.
2023-04-12 23:38:56 +02:00
5a7280ba68 build: create helper function for simplifying luarocks installation
The function keeps track of the previously installed rock, meaning we no
longer need to manually keep track of the dependency chain. This will
make adding or removing rocks much easier.
2023-04-12 21:26:06 +02:00
23e9d625cf vim-patch:9.0.1444: crash when passing NULL to setcmdline() (#23048)
Problem:    Crash when passing NULL to setcmdline(). (Andreas Louv)
Solution:   Use tv_get_string() instead of using v_string directly.
            (closes vim/vim#12231, closes vim/vim#12227)

ac6cd31afc
2023-04-12 23:51:43 +08:00
cdc028e97d fix(column): add truncated width during estimation for 'statuscolumn'
Problem:    Estimated 'statuscolumn' width estimated is not properly used,
            executing the `w_redr_statuscol` path unnecessarily.
Solution:   Adjust `w_nrwidth` and 'statuscolumn' width before anything
            is actually drawn in a `win_update()`.
2023-04-12 16:40:58 +01:00
1013aba462 docs: add vim.lsp.buf.formatting_sync() to deprecated.txt (#23045) 2023-04-12 22:52:06 +08:00
37011bc45e fix(diagnostic): rename buffer → bufnr in type annotation (#23042)
See `:h diagnostic-structure`, the property name is `bufnr`, not
`buffer`.
2023-04-12 15:16:15 +02:00
f5231d61a5 fix(runtime): add commentstring for C# ftplugin (#23039)
Problem: No commentstring is set for C# buffers after removing the
default C-style commentstring

Solution: Add `ftplugin/cs.lua` with C-style commentstring
2023-04-12 13:59:11 +02:00
e23c6ebed7 ci(lintcommit): allow colon not followed by space in description (#23035) 2023-04-12 09:50:48 +08:00
57e9b7f2e5 test(startup_spec): use getscriptinfo() instead of :scriptnames (#23034) 2023-04-12 09:17:32 +08:00
2b35de386e refactor: remove :CheckHealth
Using :CheckHealth invokes an error, and many of the features from :checkhealth
doesn't even work such as calling only a specific check. Users should use
:checkhealth instead.
2023-04-12 00:01:34 +02:00
f4136c9d42 build: use -O3 optimization for release builds
Compilers have much more reliable -O3 output these days, so this
workaround is likely not needed.

Closes https://github.com/neovim/neovim/issues/23008.
2023-04-11 21:25:23 +02:00
880f7d12fe feat!: remove vimballs (#22402)
Vimball is an outdated feature that is rarely used these days. It is not
a maintenance burden on its own, but it is nonetheless dead weight and
something we'd need to tell users to ignore when they inevitably ask
what it is.

See: https://github.com/neovim/neovim/pull/21369#issuecomment-1347615173
2023-04-11 19:10:36 +02:00
3c697f62fa test(lsp): fix unstable tests for set_defaults (#23002)
In the `test_rpc_server` procedure, both `on_setup` and `on_init`
callbacks can run concurrently in some scenarios. This caused some CI
failures in tests for the LSP set_defaults feature.

This commit attempts to fix this by merging those two callbacks in the
impacted tests.

See: https://github.com/neovim/neovim/actions/runs/4553550710/attempts/1
2023-04-11 18:37:27 +02:00
9e86f473e0 feat(lua): vim.region accepts getpos() arg (#22635) 2023-04-11 16:28:46 +02:00
aab95ec67e test: avoid name collisions with Xtest directory (#23019) 2023-04-11 17:18:54 +08:00
dcaf207336 fix(highlight): combine ColorColumn with low-priority CursorLine (#23017) 2023-04-11 16:51:31 +08:00
ccc0980f86 fix(treesitter): Use the correct replacement args for #gsub! directive (#23015)
fix(treesitter): use the correct replacement args for #gsub! directive
2023-04-11 10:26:03 +02:00
7ffe450173 fix(health): check for _host_prog variables properly (#23014) 2023-04-11 10:20:25 +08:00
c8d1d8b254 fix(man.lua): don't continue on command error (#23009)
Fix #21169
2023-04-11 09:35:01 +08:00
03a021f378 fix(health): combine python and virtualenv healthchecks (#23004)
fix(health): combine python and virtualenv health checks
2023-04-10 15:46:22 -06:00
cde4892b49 fix(health): fix typo in function name 2023-04-10 22:37:25 +02:00
0451391ec5 fix(mark): properly init mark views (#22996) 2023-04-10 22:49:32 +08:00
bd98ef6ac6 refactor: rewrite perl healthcheck in lua
This is required to remove the vimscript checkhealth functions.
2023-04-10 15:59:50 +02:00
b5c0e7137c refactor: rewrite node healthcheck in lua
This is required to remove the vimscript checkhealth functions.
2023-04-10 15:26:22 +02:00
436e0147f4 Merge pull request #22865 from MunifTanjim/issue-20370
fix(api): do not re-apply win_config.style when missing
2023-04-10 14:29:23 +02:00
7801ffc38a refactor: rewrite ruby healthcheck in lua
This is required to remove the vimscript checkhealth functions.
2023-04-10 14:06:10 +02:00
58433285b9 ci(release/winget): get msi from previous job instead of downloading 2023-04-10 13:50:39 +02:00
da979ae04b fix(api): do not re-apply win_config.style when missing 2023-04-10 16:26:42 +06:00
0e4086b741 fix(eval): prevent double-free in garbage collection (#22990) 2023-04-10 18:06:59 +08:00
5ed7ede1f5 refactor: rewrite virtualenv healthcheck in lua
This is required to remove the vimscript checkhealth functions.
2023-04-10 11:28:42 +02:00
3c724fe1f3 fix(column): 'statuscolumn' not drawn after virt_lines with "n" in 'cpo' (#22967)
Problem:    The 'statuscolumn' is not drawn and the line itself is drawn
            at an offset to the rest of the buffer after virt_lines if
            'cpoptions' includes "n".
Solution:   Make sure 'statuscolumn' is drawn.
2023-04-10 08:39:27 +08:00
d52cc668c7 vim-patch:9.0.1443: ending Insert mode when accessing a hidden prompt buffer (#22984)
Problem:    Ending Insert mode when accessing a hidden prompt buffer.
Solution:   Don't stop Insert mode when it was active before. (closes vim/vim#12237)

05a627c3d4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-10 07:33:26 +08:00
71225228fc refactor: rewrite python provider healthcheck in Lua
This is required to remove the vimscript checkhealth functions.
2023-04-09 22:28:00 +02:00
41b7586cbb refactor: rewrite clipboard provider healthchecks in Lua
This is required to remove the vimscript checkhealth functions.
2023-04-09 20:46:53 +02:00
5d387c3388 build(ci): ensure correct headers are used on macOS
Currently, the release build picks up headers in
`/Library/Frameworks/Mono.framework/Headers`. You can verify this by
downloading the latest nightly build and checking the output of `nvim
--version`.

These headers are likely to be from a different version of `libintl` than the
one we link to. Let's avoid usage of them by setting `CMAKE_FIND_FRAMEWORK` to
`NEVER`.
2023-04-09 20:31:13 +02:00
d3ea9a04bc fix(api): update "w_scwidth" in nvim_eval_statusline()
Problem:    `w_scwidth` may be outdated in `nvim_eval_status()`, causing
            `build_stl_str_hl()` to return an empty `%s` sign segment.
Solution:   Update `w_scwidth` for `'statuscolumn'` evaluation.
2023-04-09 00:47:20 +02:00
339011f59c build: remove uninstall target
The `make uninstall` target can't be expected to find all files it
installs in many cases. It is therefore better to remove it rather than give
the impression to users that it is a robust.
2023-04-08 23:07:09 +02:00
b6d5047d40 Merge pull request #22963 from echasnovski/diagnostic-new-hl
docs: add `hl-DiagnosticDeprecated` and `hl-DiagnosticUnnecessary`
2023-04-08 19:43:57 +02:00
99c86bae15 docs: add hl-DiagnosticDeprecated and hl-DiagnosticUnnecessary 2023-04-08 20:19:39 +03:00
6801befcc5 build(uninstall): don't build if installation manifest not found
Due to the way neovim project is set up, running `make uninstall` would
previously build neovim in order to determine whether neovim was
installed. Instead, check if installation manifest file exists and if
not then skip building entirely.
2023-04-08 15:12:38 +02:00
747264320c refactor(mappings)!: remove #n as a notation for a function key (#17318)
This notation is hardly used and makes the behavior of the from_part
argument of nvim_replace_termcodes confusing.
2023-04-08 20:29:23 +08:00
e6d3f87dfd fix(termdebug): handle partial lines passed to callback (#22950)
Problem:
Job callbacks in termdebug cannot handle partial lines.

Solution:
Add a wrapper function that handles partial lines and only passes full
lines to the real callback.

Fix #22929.
2023-04-08 19:27:58 +08:00
5d01d23389 ci: simplify backport workflow 2023-04-08 13:14:13 +02:00
95fe166d13 revert(packaging): installation context to per-machine on Windows
Revert this change until a proper solution is implemented, such as allowing the
user to select whether to install per-user or per-machine.

Fixes https://github.com/neovim/neovim/issues/22933.
2023-04-08 11:02:13 +02:00
4ce0ada0d4 fix(highlight): add missing g: prefix for colors_name (#22952)
Fix #22951.
This was fixed in Vim in patch 8.2.0613.
2023-04-08 16:57:47 +08:00
72d5a13e55 Merge pull request #22873 from bfredl/keyset2
refactor(api): make typed dicts appear as real types in the source code
2023-04-08 10:38:30 +02:00
bc66b755f6 vim-patch:9.0.1442: mapset() does not restore non-script context (#22942)
Problem:    mapset() does not restore non-script context.
Solution:   Also accept negative sid. (closes vim/vim#12132)

bfc7cbd1d4
2023-04-08 08:21:09 +08:00
8f1541fced ci: use a set instead of array for team reviewers
Adding the same team multiple times will fail the review job.
2023-04-07 23:00:35 +02:00
d4398f4021 ci: don't automatically enable -Werror on CI environments
This catches downstream consumers of neovim off guard when using neovim in an
esoteric environment not tested in our own CI.

Closes https://github.com/neovim/neovim/issues/22932
2023-04-07 22:31:04 +02:00
2d78e656b7 refactor: remove redundant casts 2023-04-07 21:43:00 +02:00
efb0896f21 refactor(api): make typed dicts appear as types in the source code
problem: can we have Serde?
solution: we have Serde at home

This by itself is just a change of notation, that could be quickly
merged to avoid messy merge conflicts, but upcoming changes are planned:

- keysets no longer need to be defined in one single file. `keysets.h` is
  just the initial automatic conversion of the previous `keysets.lua`.
  keysets just used in a single api/{scope}.h can be moved to that file, later on.

- Typed dicts will have more specific types than Object. this will
  enable most of the existing manual typechecking boilerplate to be eliminated.
  We will need some annotation for missing value, i e a boolean will
  need to be represented as a TriState (none/false/true) in some cases.

- Eventually: optional parameters in form of a `Dict opts` final
  parameter will get added in some form to metadata. this will require
  a discussion/desicion about type forward compatibility.
2023-04-07 21:30:21 +02:00
04933b1ea9 refactor: remove redundant casts 2023-04-07 21:08:16 +02:00
9408f2dcf7 refactor: remove redundant const char * casts 2023-04-07 19:40:57 +02:00
1d2a29f75b refactor: make char * parameters const in message.c
Add const to char * parameters in message.c functions and remove some
redundant casts.
2023-04-07 19:39:04 +02:00
d675bd01b1 feat(lua): allow vim.F.if_nil to take multiple arguments (#22903)
The first argument which is non-nil is returned. This is useful when
using nested default values (e.g. in the EditorConfig plugin).

Before:

  local enable = vim.F.if_nil(vim.b.editorconfig, vim.F.if_nil(vim.g.editorconfig, true))

After:

  local enable = vim.F.if_nil(vim.b.editorconfig, vim.g.editorconfig, true)
2023-04-07 08:22:47 -06:00
82cfedab50 docs(news): create new news, rename old news (#22922) 2023-04-07 16:11:02 +02:00
1b57a02969 version bump 2023-04-07 13:35:22 +02:00
2678 changed files with 459966 additions and 273486 deletions

View File

@ -6,15 +6,14 @@ freebsd_task:
name: FreeBSD name: FreeBSD
only_if: $BRANCH != "master" only_if: $BRANCH != "master"
freebsd_instance: freebsd_instance:
image_family: freebsd-13-1 image_family: freebsd-14-2
timeout_in: 30m timeout_in: 30m
install_script: install_script:
- pkg update -f - pkg install -y cmake gmake ninja unzip wget gettext python git
- pkg install -y cmake gmake ninja pkgconf unzip wget gettext python libffi git
build_deps_script: build_deps_script:
- gmake deps - gmake deps
build_script: build_script:
- gmake nvim - gmake CMAKE_EXTRA_FLAGS="-DCI_BUILD=ON" nvim
workaround_script: workaround_script:
# Run tests as user "cirrus" instead of root. This is required for the # Run tests as user "cirrus" instead of root. This is required for the
# permission-related tests to work correctly. # permission-related tests to work correctly.

View File

@ -14,7 +14,7 @@ PenaltyReturnTypeOnItsOwnLine: 200
AllowAllParametersOfDeclarationOnNextLine: false AllowAllParametersOfDeclarationOnNextLine: false
AllowShortIfStatementsOnASingleLine: false AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false AllowShortLoopsOnASingleLine: false
BinPackParameters: false BinPackParameters: true
BreakBeforeBinaryOperators: true BreakBeforeBinaryOperators: true
BreakBeforeTernaryOperators: true BreakBeforeTernaryOperators: true
ContinuationIndentWidth: 2 ContinuationIndentWidth: 2
@ -23,7 +23,7 @@ AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: No AlwaysBreakBeforeMultilineStrings: No
AlwaysBreakTemplateDeclarations: No AlwaysBreakTemplateDeclarations: No
AlignEscapedNewlines: DontAlign AlignEscapedNewlines: DontAlign
BinPackArguments: false BinPackArguments: true
BraceWrapping: BraceWrapping:
AfterClass: false AfterClass: false
AfterControlStatement: false AfterControlStatement: false

View File

@ -1,43 +1,79 @@
WarningsAsErrors: '*' WarningsAsErrors: '*,-clang-diagnostic-unused-function'
Checks: > Checks: >
-*, Enable all warnings by default. This ensures we don't miss new and useful
warnings when a new version of clang-tidy is dropped.
bugprone-*, IMPORTANT
google-*, clang-tidy doesn't support comments but we can simulate comments by just
misc-*, writing text directly here. These are then interpreted as warnings and will
modernize-*, be dropped. As long as you start every sentence with a capital letter and
performance-*, don't use commas in your "comments" you should be fine,
portability-*, *,
readability-*,
Untriaged warnings. Please categorize them accordingly if you find a relevant
section for it,
-bugprone-assignment-in-if-condition, -bugprone-assignment-in-if-condition,
-bugprone-branch-clone,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result, -bugprone-implicit-widening-of-multiplication-result,
-bugprone-macro-parentheses, -bugprone-multi-level-implicit-pointer-conversion,
-bugprone-narrowing-conversions,
-bugprone-not-null-terminated-result, -bugprone-not-null-terminated-result,
-bugprone-reserved-identifier,
-bugprone-sizeof-expression,
-bugprone-suspicious-include,
-bugprone-suspicious-memory-comparison, -bugprone-suspicious-memory-comparison,
-bugprone-unused-return-value, -bugprone-switch-missing-default-case,
-google-readability-braces-around-statements, -cert-env33-c,
-google-readability-function-size, -cert-err33-c,
-misc-misplaced-const, -cert-err34-c,
-misc-no-recursion, -concurrency-mt-unsafe,
-cppcoreguidelines-narrowing-conversions,
Warnings that may be useful, but are too inconsistent to enable by default
May yield useful results with some manual triaging,
-bugprone-branch-clone,
-bugprone-macro-parentheses,
-bugprone-sizeof-expression,
-hicpp-multiway-paths-covered,
-hicpp-signed-bitwise,
-misc-unused-parameters, -misc-unused-parameters,
-modernize-macro-to-enum, -modernize-macro-to-enum,
-performance-no-int-to-ptr, -readability-avoid-nested-conditional-operator,
-readability-avoid-const-params-in-decls,
-readability-braces-around-statements,
-readability-else-after-return, -readability-else-after-return,
-readability-function-cognitive-complexity, -readability-enum-initial-value,
-readability-function-size, -readability-function-size,
-readability-identifier-length,
-readability-isolate-declaration, -readability-isolate-declaration,
Warnings that are rarely useful,
-altera-*, Checks related to OpenCL programming for FPGAs. Not relevant,
-android-*,
-bugprone-easily-swappable-parameters,
-bugprone-inc-dec-in-conditions,
-bugprone-swapped-arguments,
-clang-analyzer-*, Already covered by the cmake target "clang-analyzer",
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-init-variables,
-llvm-header-guard, We use #pragma once,
-llvmlibc-restrict-system-libc-headers, We want to use glibc,
-misc-include-cleaner, Looks useful but redundant with IWYU. We may replace IWYU with this one day,
-misc-misplaced-const,
-misc-no-recursion,
-performance-no-int-to-ptr,
-readability-function-cognitive-complexity,
-readability-identifier-length,
-readability-magic-numbers, -readability-magic-numbers,
-readability-misleading-indentation, -readability-math-missing-parentheses,
-readability-redundant-declaration, -readability-redundant-declaration, Conflicts with our header generation scripts,
-readability-redundant-function-ptr-dereference,
-readability-suspicious-call-argument, -readability-suspicious-call-argument,
Aliases. These are just duplicates of other warnings and should always be ignored,
-bugprone-narrowing-conversions,
-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,
-cppcoreguidelines-macro-to-enum,
-google-readability-braces-around-statements,
-google-readability-function-size,
-hicpp-braces-around-statements,
-hicpp-function-size,
-llvm-else-after-return,

View File

@ -1,2 +1,4 @@
CompileFlags: CompileFlags:
CompilationDatabase: build/ # Search build/ directory for compile_commands.json CompilationDatabase: build/ # Search build/ directory for compile_commands.json
Diagnostics:
UnusedIncludes: None

View File

@ -10,9 +10,12 @@ insert_final_newline = true
[*.{c,h,in,lua}] [*.{c,h,in,lua}]
max_line_length = 100 max_line_length = 100
[src/nvim/{eval,vvars}.lua]
max_line_length = 68
[*.py] [*.py]
indent_size = 4 indent_size = 4
[{Makefile,**/Makefile,runtime/doc/*.txt}] [{Makefile,**/Makefile,*.mk,runtime/doc/*.txt}]
indent_style = tab indent_style = tab
indent_size = 8 indent_size = 8

View File

@ -58,6 +58,11 @@ aa4f9c5341f5280f16cce0630ea54b84eef717b3
6ff245732a5a8ab821598a38fb0c5805e6bd3779 6ff245732a5a8ab821598a38fb0c5805e6bd3779
abf758a2977c4e6cab4dfa217f56da853d85851c abf758a2977c4e6cab4dfa217f56da853d85851c
cb84f5ee530f0f32b92bed5b4ad41344e8b551aa cb84f5ee530f0f32b92bed5b4ad41344e8b551aa
f98b8d2d44d289263b1a3b33b6a7f20644ef671c
544ef994df72c3cbe0dca6b856ce2dcbc5169767
45fe4d11add933df76a2ea4bf52ce8904f4a778b
517f0cc634b985057da5b95cf4ad659ee456a77e
04f2f864e270e772c6326cefdf24947f0130e492
# typos # typos
d238b8f6003d34cae7f65ff7585b48a2cd9449fb d238b8f6003d34cae7f65ff7585b48a2cd9449fb

7
.gitattributes vendored
View File

@ -3,6 +3,13 @@
*CMakeLists.txt linguist-language=CMake *CMakeLists.txt linguist-language=CMake
runtime/doc/* linguist-documentation runtime/doc/* linguist-documentation
runtime/doc/builtin.txt linguist-generated
runtime/lua/vim/_meta/vimfn.lua linguist-generated
runtime/lua/vim/_meta/vvars.lua linguist-generated
runtime/lua/vim/_meta/api.lua linguist-generated
runtime/lua/vim/_meta/api_keysets.lua linguist-generated
runtime/lua/vim/_meta/options.lua linguist-generated
src/xdiff/** linguist-vendored src/xdiff/** linguist-vendored
src/cjson/** linguist-vendored src/cjson/** linguist-vendored

View File

@ -1,13 +1,18 @@
name: Bug Report name: Bug Report
description: Report a problem in Neovim description: Report a problem in Nvim
labels: [bug] type: 'bug'
body: body:
- type: markdown - type: markdown
attributes: attributes:
value: | value: |
_Before reporting:_ search [existing issues](https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aopen+label%3Abug) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ). Usage or "How to" questions belong on the [stackoverflow](https://vi.stackexchange.com/) and will be closed. *Before reporting:*
- Confirm the problem is reproducible on [**master**](https://github.com/neovim/neovim/releases/nightly) or [**latest stable**](https://github.com/neovim/neovim/releases/stable) release
- Run `make distclean` when encountering build issues
- Search [existing issues](https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aopen+label%3Abug,bug-crash) (including [closed](https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aclosed+label%3Abug%2Cbug-crash))
- Read the [FAQ](https://neovim.io/doc/user/faq.html) and ["Reporting Problems" in CONTRIBUTING.md](https://github.com/neovim/neovim/blob/master/CONTRIBUTING.md#reporting-problems).
Usage or "How to" questions belong on [stackoverflow](https://vi.stackexchange.com/) and will be closed.
- type: textarea - type: textarea
attributes: attributes:
label: "Problem" label: "Problem"
@ -19,7 +24,10 @@ body:
label: "Steps to reproduce" label: "Steps to reproduce"
description: | description: |
- For build failures: list the exact steps including CMake flags (if any). - For build failures: list the exact steps including CMake flags (if any).
- If the bug pertains to crashing (or segfault), please include a [stacktrace](https://neovim.io/doc/user/dev_tools.html#dev-tools-backtrace).
- For startup or shell-related problems: try `env -i TERM=ansi-256color "$(which nvim)"`. - For startup or shell-related problems: try `env -i TERM=ansi-256color "$(which nvim)"`.
- Use the provided [minimal reproduction template](https://github.com/neovim/neovim/blob/master/contrib/minimal.lua) to create a minimal configuration. After you fill it out with necessary information, run with `nvim --clean -u minimal.lua`.
- Please do **not** include a package manager in the reproduction steps.
placeholder: | placeholder: |
nvim --clean nvim --clean
:edit foo :edit foo
@ -35,7 +43,7 @@ body:
- type: input - type: input
attributes: attributes:
label: "Neovim version (nvim -v)" label: "Nvim version (nvim -v)"
placeholder: "0.6.0 commit db1b0ee3b30f" placeholder: "0.6.0 commit db1b0ee3b30f"
validations: validations:
required: true required: true

View File

@ -1,5 +1,5 @@
blank_issues_enabled: false blank_issues_enabled: false
contact_links: contact_links:
- name: Question - name: Question
url: https://vi.stackexchange.com/ url: https://github.com/neovim/neovim/discussions
about: Ask questions about configuration and usage of Neovim about: Ask about configuration and usage of Nvim

View File

@ -1,12 +1,12 @@
name: Feature request name: Feature request
description: Request an enhancement for Neovim description: Request an enhancement for Nvim
labels: [enhancement] type: 'enhancement'
body: body:
- type: markdown - type: markdown
attributes: attributes:
value: | value: |
Before requesting: search [existing issues](https://github.com/neovim/neovim/labels/enhancement) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ). Before requesting: search [existing feature requests](https://github.com/neovim/neovim/labels/enhancement) and check the [FAQ](https://neovim.io/doc/user/faq.html).
- type: textarea - type: textarea
attributes: attributes:

View File

@ -1,12 +1,14 @@
name: Language server (LSP) client bug name: Language server (LSP) client bug
description: Report an issue with Neovim LSP description: Report an issue with Nvim LSP
labels: [bug, lsp] title: "LSP: "
type: bug
labels: [lsp]
body: body:
- type: markdown - type: markdown
attributes: attributes:
value: | value: |
_Before reporting:_ search [existing issues](https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aopen+label%3Abug) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ). Usage questions or "Why isn't X language server/feature working?" belong on [stackoverflow](https://vi.stackexchange.com/) and will be closed. _Before reporting:_ search [existing issues](https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aopen+label%3Abug) and check the [FAQ](https://neovim.io/doc/user/faq.html). Usage questions or "Why isn't X language server/feature working?" belong on [stackoverflow](https://vi.stackexchange.com/) and will be closed.
- type: textarea - type: textarea
attributes: attributes:
@ -59,7 +61,7 @@ body:
- type: input - type: input
attributes: attributes:
label: "Neovim version (nvim -v)" label: "Nvim version (nvim -v)"
placeholder: "0.6.0 commit db1b0ee3b30f" placeholder: "0.6.0 commit db1b0ee3b30f"
validations: validations:
required: true required: true

View File

@ -3,6 +3,9 @@ description: "This action caches neovim dependencies"
runs: runs:
using: "composite" using: "composite"
steps: steps:
- run: echo "CACHE_KEY=${{ github.workflow }}" >> $GITHUB_ENV
shell: bash
- run: echo "CACHE_KEY=${{ github.job }}" >> $GITHUB_ENV - run: echo "CACHE_KEY=${{ github.job }}" >> $GITHUB_ENV
shell: bash shell: bash
@ -10,13 +13,21 @@ runs:
run: echo "CACHE_KEY=$CACHE_KEY-${{ join(matrix.*, '-') }}" >> $GITHUB_ENV run: echo "CACHE_KEY=$CACHE_KEY-${{ join(matrix.*, '-') }}" >> $GITHUB_ENV
shell: bash shell: bash
- if: ${{ matrix.build }}
run: echo "CACHE_KEY=$CACHE_KEY-${{ join(matrix.build.*, '-') }}" >> $GITHUB_ENV
shell: bash
- id: image
run: echo "version=$ImageVersion" >> $GITHUB_OUTPUT
shell: bash
# Avoid using '**/CMakeLists.txt' (or any pattern starting with '**/') even # Avoid using '**/CMakeLists.txt' (or any pattern starting with '**/') even
# if it makes the expression below simpler. hashFiles() has a timer that # if it makes the expression below simpler. hashFiles() has a timer that
# will fail the job if it times out, which can happen if there are too many # will fail the job if it times out, which can happen if there are too many
# files to search through. # files to search through.
- uses: actions/cache@v3 - uses: actions/cache@v4
with: with:
path: .deps path: .deps
key: ${{ env.CACHE_KEY }}-${{ hashFiles('cmake**', 'ci/**', key: ${{ env.CACHE_KEY }}-${{ steps.image.outputs.version }}-${{ hashFiles('cmake**',
'.github/workflows/test.yml', 'CMakeLists.txt', '.github/**', 'CMakeLists.txt',
'runtime/CMakeLists.txt', 'src/nvim/**/CMakeLists.txt') }} 'runtime/CMakeLists.txt', 'src/nvim/**/CMakeLists.txt') }}

29
.github/actions/setup/action.yml vendored Normal file
View File

@ -0,0 +1,29 @@
name: 'setup'
description: "Creates necessary setup for CI"
inputs:
install_flags:
description: 'Install script flags'
required: false
default: ''
runs:
using: "composite"
steps:
- name: Set $BIN_DIR
shell: bash
run: echo "$BIN_DIR" >> $GITHUB_PATH
- if: ${{ runner.os != 'Windows' }}
name: Set ulimit
shell: bash
run: ulimit -c unlimited
- if: ${{ runner.os == 'Windows' }}
run: .github/scripts/env.ps1
shell: pwsh
- name: Install dependencies
run: ./.github/scripts/install_deps.sh ${{ inputs.install_flags }}
shell: bash
- name: Cache
uses: ./.github/actions/cache

66
.github/labeler.yml vendored
View File

@ -1,66 +0,0 @@
"lsp":
- runtime/lua/vim/lsp.lua
- runtime/lua/vim/lsp/*
"tui":
- src/nvim/tui/tui.*
"treesitter":
- src/nvim/lua/treesitter.*
- runtime/lua/vim/treesitter.lua
- runtime/lua/vim/treesitter/*
- runtime/queries/**/*
"diagnostic":
- runtime/lua/vim/diagnostic.lua
"dependencies":
- cmake.deps/**/*
"spell":
- src/nvim/spell*
"terminal":
- src/nvim/terminal.*
"column":
- src/nvim/sign*
"folds":
- src/nvim/fold*
"mouse":
- src/nvim/mouse*
"documentation":
- all: ["runtime/doc/*"]
- all: ["**/*.md"]
"clipboard":
- runtime/autoload/provider/clipboard.vim
"diff":
- src/nvim/diff.*
"build":
- CMakeLists.txt
- "**/CMakeLists.txt"
- "**/Makefile"
- "**/*.cmake"
"test":
- all: ["test/**/*"]
"ci":
- .github/labeler.yml
- .github/workflows/**/*
- .builds/*
- ci/**/*
"filetype":
- runtime/lua/vim/filetype.lua
- runtime/lua/vim/filetype/detect.lua
"platform:nix":
- contrib/flake.lock
- contrib/flake.nix

View File

@ -1,36 +0,0 @@
#!/bin/bash -e
echo "Provision universal libintl"
GETTEXT_PREFIX="$(brew --prefix gettext)"
printf 'GETTEXT_PREFIX=%s\n' "$GETTEXT_PREFIX" >> $GITHUB_ENV
bottle_tag="arm64_big_sur"
brew fetch --bottle-tag="$bottle_tag" gettext
cd "$(mktemp -d)"
tar xf "$(brew --cache)"/**/*gettext*${bottle_tag}*.tar.gz
lipo gettext/*/lib/libintl.a "${GETTEXT_PREFIX}/lib/libintl.a" -create -output libintl.a
mv -f libintl.a /usr/local/lib/
echo "Ensure static linkage to libintl"
# We're about to mangle `gettext`, so let's remove any potentially broken
# installs (e.g. curl, git) as those could interfere with our build.
brew uninstall $(brew uses --installed --recursive gettext)
brew unlink gettext
ln -sf "$(brew --prefix)/opt/$(readlink "${GETTEXT_PREFIX}")/bin"/* /usr/local/bin/
ln -sf "$(brew --prefix)/opt/$(readlink "${GETTEXT_PREFIX}")/include"/* /usr/local/include/
rm -f "$GETTEXT_PREFIX"
echo "Build release"
cd "$GITHUB_WORKSPACE"
MACOSX_DEPLOYMENT_TARGET="$(sw_vers -productVersion | cut -f1 -d.)"
export MACOSX_DEPLOYMENT_TARGET
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} -D CMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} -D CMAKE_OSX_ARCHITECTURES=arm64\;x86_64
cmake --build .deps
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} -D CMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} -D CMAKE_OSX_ARCHITECTURES=arm64\;x86_64 -D CI_BUILD=OFF
cmake --build build
cmake --install build --prefix build/release/nvim-macos
cd build
# Make sure we build everything for M1 as well
for macho in bin/* lib/nvim/parser/*.so; do
lipo -info "$macho" | grep -q arm64 || exit 1
done
cpack -C "$NVIM_BUILD_TYPE"

56
.github/scripts/close_unresponsive.js vendored Normal file
View File

@ -0,0 +1,56 @@
function labeledEvent(data) {
return data.event === "labeled" && data.label.name === "needs:response";
}
const numberOfDaysLimit = 30;
const close_message = `This has been closed since a request for information has \
not been answered for ${numberOfDaysLimit} days. It can be reopened when the \
requested information is provided.`;
module.exports = async ({ github, context }) => {
const owner = context.repo.owner;
const repo = context.repo.repo;
const issues = await github.rest.issues.listForRepo({
owner: owner,
repo: repo,
labels: "needs:response",
});
const numbers = issues.data.map((e) => e.number);
for (const number of numbers) {
const events = await github.paginate(
github.rest.issues.listEventsForTimeline,
{
owner: owner,
repo: repo,
issue_number: number,
},
(response) => response.data.filter(labeledEvent),
);
const latest_response_label = events[events.length - 1];
const created_at = new Date(latest_response_label.created_at);
const now = new Date();
const diff = now - created_at;
const diffDays = diff / (1000 * 60 * 60 * 24);
if (diffDays > numberOfDaysLimit) {
github.rest.issues.update({
owner: owner,
repo: repo,
issue_number: number,
state_reason: "not_planned",
state: "closed",
});
github.rest.issues.createComment({
owner: owner,
repo: repo,
issue_number: number,
body: close_message,
});
}
}
};

9
.github/scripts/env.ps1 vendored Normal file
View File

@ -0,0 +1,9 @@
# This script enables Developer Command Prompt
# See https://github.com/microsoft/vswhere/wiki/Start-Developer-Command-Prompt#using-powershell
$installationPath = vswhere.exe -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
if ($installationPath -and (Test-Path "$installationPath\Common7\Tools\vsdevcmd.bat")) {
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -arch=x64 -no_logo && set" | ForEach-Object {
$name, $value = $_ -split '=', 2
"$name=$value" >> $env:GITHUB_ENV
}
}

View File

@ -1,10 +1,58 @@
#!/bin/bash #!/bin/bash
os=$(uname -s) while (($# > 0)); do
if [[ $os == Linux ]]; then case $1 in
--test) # install test dependencies
TEST=1
shift
;;
esac
done
OS=$(uname -s)
ARCH=$(uname -m)
if [[ $OS == Linux ]]; then
sudo apt-get update sudo apt-get update
sudo apt-get install -y build-essential cmake curl gettext locales-all ninja-build pkg-config unzip "$@" sudo apt-get install -y build-essential cmake curl gettext ninja-build
elif [[ $os == Darwin ]]; then
if [[ $CC == clang ]]; then
DEFAULT_CLANG_VERSION=$(echo | clang -dM -E - | grep __clang_major | awk '{print $3}')
CLANG_VERSION=19
if ((DEFAULT_CLANG_VERSION >= CLANG_VERSION)); then
echo "Default clang version is $DEFAULT_CLANG_VERSION, which is equal or larger than wanted version $CLANG_VERSION. Aborting!"
exit 1
fi
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh $CLANG_VERSION
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-$CLANG_VERSION 100
sudo update-alternatives --set clang /usr/bin/clang-$CLANG_VERSION
fi
if [[ -n $TEST ]]; then
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 --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
brew update --quiet brew update --quiet
brew install ninja "$@" 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
fi fi

View File

@ -0,0 +1,91 @@
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/** ]
clipboard:
- changed-files:
- any-glob-to-any-file: [ runtime/autoload/provider/clipboard.vim ]
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 ]
diff:
- changed-files:
- any-glob-to-any-file: [ src/nvim/diff.* ]
documentation:
- changed-files:
- any-glob-to-all-files: [ runtime/doc/*, "**/*.md" ]
editorconfig:
- changed-files:
- any-glob-to-any-file: [ .editorconfig, runtime/lua/editorconfig.lua, runtime/plugin/editorconfig.lua ]
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* ]
lsp:
- changed-files:
- any-glob-to-any-file: [ runtime/lua/vim/lsp.lua, runtime/lua/vim/lsp/* ]
mouse:
- changed-files:
- any-glob-to-any-file: [ src/nvim/mouse* ]
netrw:
- changed-files:
- any-glob-to-any-file: [ runtime/autoload/netrw.vim, runtime/plugin/netrwPlugin.vim ]
snippet:
- changed-files:
- any-glob-to-any-file: [ runtime/lua/vim/snippet.lua ]
spell:
- changed-files:
- any-glob-to-any-file: [ src/nvim/spell* ]
terminal:
- changed-files:
- any-glob-to-any-file: [ src/nvim/terminal.* ]
test:
- changed-files:
- any-glob-to-all-files: [test/**/*]
treesitter:
- changed-files:
- any-glob-to-any-file: [ src/nvim/lua/treesitter.*, runtime/lua/vim/treesitter.lua, runtime/lua/vim/treesitter/*, runtime/queries/**/* ]
tui:
- changed-files:
- any-glob-to-any-file: [ src/nvim/tui/tui.* ]

116
.github/scripts/reviewers_add.js vendored Normal file
View File

@ -0,0 +1,116 @@
module.exports = async ({ github, context }) => {
const pr_data = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
});
const labels = pr_data.data.labels.map((e) => e.name);
const reviewers = new Set();
if (labels.includes("build")) {
reviewers.add("dundargoc");
reviewers.add("jamessan");
reviewers.add("justinmk");
}
if (labels.includes("ci")) {
reviewers.add("dundargoc");
reviewers.add("jamessan");
reviewers.add("justinmk");
}
if (labels.includes("column")) {
reviewers.add("lewis6991");
}
if (labels.includes("comment")) {
reviewers.add("echasnovski");
}
if (labels.includes("defaults")) {
reviewers.add("gpanders");
}
if (labels.includes("diagnostic")) {
reviewers.add("gpanders");
}
if (labels.includes("diff")) {
reviewers.add("lewis6991");
}
if (labels.includes("editorconfig")) {
reviewers.add("gpanders");
}
if (labels.includes("marks")) {
reviewers.add("bfredl");
}
if (labels.includes("filetype")) {
reviewers.add("clason");
}
if (labels.includes("inccommand")) {
reviewers.add("famiu");
}
if (labels.includes("lsp")) {
reviewers.add("MariaSolOs");
}
if (labels.includes("netrw")) {
reviewers.add("justinmk");
}
if (labels.includes("options")) {
reviewers.add("famiu");
}
if (labels.includes("platform:nix")) {
reviewers.add("teto");
}
if (labels.includes("project-management")) {
reviewers.add("bfredl");
reviewers.add("justinmk");
}
if (labels.includes("snippet")) {
reviewers.add("MariaSolOs");
}
if (labels.includes("statusline")) {
reviewers.add("famiu");
}
if (labels.includes("treesitter")) {
reviewers.add("bfredl");
reviewers.add("clason");
reviewers.add("lewis6991");
reviewers.add("wookayin");
}
if (labels.includes("tui")) {
reviewers.add("gpanders");
}
if (labels.includes("typo")) {
reviewers.add("dundargoc");
}
if (labels.includes("vim-patch")) {
reviewers.add("zeertzjq");
}
// Remove person that opened the PR since they can't review themselves
const pr_opener = pr_data.data.user.login;
reviewers.delete(pr_opener);
github.rest.pulls.requestReviewers({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
reviewers: Array.from(reviewers),
});
};

View File

@ -1,18 +1,16 @@
module.exports = async ({github, context}) => { module.exports = async ({ github, context }) => {
const requestedReviewers = await github.rest.pulls.listRequestedReviewers({ const requestedReviewers = await github.rest.pulls.listRequestedReviewers({
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: context.repo.repo,
pull_number: context.issue.number pull_number: context.issue.number,
}); });
const reviewers = requestedReviewers.data.users.map(e => e.login) const reviewers = requestedReviewers.data.users.map((e) => e.login);
const team_reviewers = requestedReviewers.data.teams.map(e => e.name);
github.rest.pulls.removeRequestedReviewers({ github.rest.pulls.removeRequestedReviewers({
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: context.repo.repo,
pull_number: context.issue.number, pull_number: context.issue.number,
reviewers: reviewers, reviewers: reviewers,
team_reviewers: team_reviewers
}); });
} };

View File

@ -1,102 +0,0 @@
module.exports = async ({github, context}) => {
const pr_data = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
})
const labels = pr_data.data.labels.map(e => e.name)
const reviewers = new Set()
const team_reviewers = new Array()
if (labels.includes('api')) {
reviewers.add("bfredl")
}
if (labels.includes('build')) {
team_reviewers.push('ci');
}
if (labels.includes('ci')) {
team_reviewers.push('ci');
}
if (labels.includes('column')) {
reviewers.add("lewis6991")
}
if (labels.includes('dependencies')) {
reviewers.add("jamessan")
}
if (labels.includes('diagnostic')) {
reviewers.add("gpanders")
}
if (labels.includes('diff')) {
reviewers.add("lewis6991")
}
if (labels.includes('distribution')) {
reviewers.add("jamessan")
}
if (labels.includes('documentation')) {
reviewers.add("clason")
}
if (labels.includes('extmarks')) {
reviewers.add("bfredl")
}
if (labels.includes('filetype')) {
reviewers.add("clason")
reviewers.add("gpanders")
reviewers.add("smjonas")
}
if (labels.includes('lsp')) {
team_reviewers.push('lsp');
}
if (labels.includes('platform:nix')) {
reviewers.add("teto")
}
if (labels.includes('project-management')) {
reviewers.add("bfredl")
reviewers.add("justinmk")
}
if (labels.includes('test')) {
reviewers.add("justinmk")
}
if (labels.includes('treesitter')) {
team_reviewers.push('treesitter');
}
if (labels.includes('typo')) {
reviewers.add("dundargoc")
}
if (labels.includes('ui')) {
reviewers.add("bfredl")
}
if (labels.includes('vim-patch')) {
reviewers.add("seandewar")
reviewers.add("zeertzjq")
}
// Remove person that opened the PR since they can't review themselves
const pr_opener = pr_data.data.user.login
reviewers.delete(pr_opener)
github.rest.pulls.requestReviewers({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
reviewers: Array.from(reviewers),
team_reviewers: team_reviewers
});
}

View File

@ -1,18 +0,0 @@
name: Missing API docs
on:
pull_request:
branches-ignore:
- 'marvim/api-doc-update**'
paths:
- 'src/nvim/api/*.[ch]'
- 'runtime/lua/**.lua'
- 'runtime/doc/**'
jobs:
call-regen-api-docs:
permissions:
contents: write
pull-requests: write
uses: ./.github/workflows/api-docs.yml
with:
check_only: true

View File

@ -1,74 +0,0 @@
# Autogenerate the API docs on new commit to important branches
# Also work as a check for PR's to not forget committing their doc changes
# called from api-docs-check.yml
name: Autogenerate API docs
on:
push:
paths:
- 'src/nvim/api/*.[ch]'
- 'runtime/lua/**.lua'
- 'runtime/doc/**'
branches:
- 'master'
- 'release-[0-9]+.[0-9]+'
workflow_dispatch:
workflow_call:
inputs:
check_only:
type: boolean
default: false
required: false
jobs:
regen-api-docs:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: nightly
- uses: actions/checkout@v3
with:
# Fetch depth 0 is required if called through workflow_call. In order
# to create a PR we need to access other branches, which requires a
# full clone.
fetch-depth: 0
- name: Install dependencies
run: |
sudo apt-get update
sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y doxygen python3 python3-msgpack
- name: Set up git config
run: |
git config --global user.name 'marvim'
git config --global user.email 'marvim@users.noreply.github.com'
- run: printf 'DOC_BRANCH=marvim/api-doc-update/%s\n' ${GITHUB_REF#refs/heads/} >> $GITHUB_ENV
- name: Generate docs
id: docs
run: |
git checkout -b ${DOC_BRANCH}
python3 scripts/gen_vimdoc.py
printf 'UPDATED_DOCS=%s\n' $([ -z "$(git diff)" ]; echo $?) >> $GITHUB_OUTPUT
- name: FAIL, PR has not committed doc changes
if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 && inputs.check_only }}
run: |
echo "Job failed, run ./scripts/gen_vimdoc.py and commit your doc changes"
echo "The doc generation produces the following changes:"
git diff --color --exit-code
- name: Automatic PR
if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 && !inputs.check_only }}
run: |
git add -u
git commit -m 'docs: regenerate [skip ci]'
git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} ${DOC_BRANCH}
gh pr create --draft --fill --base ${GITHUB_REF#refs/heads/} --head ${DOC_BRANCH} || true

View File

@ -1,4 +1,4 @@
name: Backport name: backport
on: on:
pull_request_target: pull_request_target:
types: [closed, labeled] types: [closed, labeled]
@ -8,15 +8,39 @@ jobs:
contents: write contents: write
pull-requests: write pull-requests: write
name: Backport Pull Request name: Backport Pull Request
if: > if: github.event.pull_request.merged
github.repository_owner == 'neovim' && (
github.event_name == 'pull_request_target' &&
github.event.pull_request.merged
)
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: actions/create-github-app-token@v1
id: app-token
with: with:
ref: ${{ github.event.pull_request.head.sha }} app-id: ${{ vars.BACKPORT_APP }}
- name: Create backport PRs private-key: ${{ secrets.BACKPORT_KEY }}
uses: korthout/backport-action@v1
- name: Create backport PR
id: backport
uses: korthout/backport-action@v3
with:
pull_title: "${pull_title}"
label_pattern: "^ci:backport ([^ ]+)$"
github_token: ${{ steps.app-token.outputs.token }}
- 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: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
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

@ -10,45 +10,42 @@ on:
- '**/CMakePresets.json' - '**/CMakePresets.json'
- 'cmake.*/**' - 'cmake.*/**'
- '.github/**' - '.github/**'
workflow_dispatch:
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env: env:
BIN_DIR: ${{ github.workspace }}/bin BIN_DIR: ${{ github.workspace }}/bin
INSTALL_PREFIX: ${{ github.workspace }}/nvim-install INSTALL_PREFIX: ${{ github.workspace }}/nvim-install
jobs: jobs:
macos-universal: wasmtime:
runs-on: macos-latest strategy:
timeout-minutes: 20 fail-fast: false
matrix:
test: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.test }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Install dependencies - run: |
run: ./.github/scripts/install_deps.sh cmake -S cmake.deps --preset ci -D ENABLE_WASMTIME=ON
cmake --build .deps
- run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV cmake --preset ci -D ENABLE_WASMTIME=ON
cmake --build build
- name: Build universal binary
run: ./.github/scripts/build_universal_macos.sh
old-cmake: old-cmake:
name: Test oldest supported cmake name: Test oldest supported cmake
runs-on: ubuntu-22.04 runs-on: ubuntu-latest
timeout-minutes: 15 timeout-minutes: 15
env: env:
CMAKE_URL: 'https://cmake.org/files/v3.10/cmake-3.10.0-Linux-x86_64.sh' CMAKE_URL: 'https://cmake.org/files/v3.16/cmake-3.16.0-Linux-x86_64.sh'
CMAKE_VERSION: '3.10.0' CMAKE_VERSION: '3.16.0'
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Set up environment
run: echo "$BIN_DIR" >> $GITHUB_PATH
- name: Install dependencies
run: ./.github/scripts/install_deps.sh
- name: Install minimum required version of cmake - name: Install minimum required version of cmake
run: | run: |
@ -67,7 +64,34 @@ jobs:
run: make deps run: make deps
- name: Build - name: Build
run: make CMAKE_FLAGS="-D CMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX" run: make CMAKE_FLAGS="-D CI_BUILD=ON -D CMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX"
- name: Install - name: Install
run: make install run: make install
use-existing-src:
name: Test USE_EXISTING_SRC_DIR=ON builds with no network access
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Build bundled dependencies
run: make deps
- name: Clean bundled dependencies à la neovim/deps
run: |
rm -rf ./build
find .deps .deps/build -maxdepth 1 '!' \( -name .deps -o -name build -o -name src \) -exec rm -r '{}' +
cd .deps/build/src
rm -rf ./*-build
rm -rf ./*-stamp/*-{configure,build,install,done}
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: |
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

@ -1,9 +1,17 @@
name: "CodeQL" name: "codeql"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
on: on:
schedule: push:
- cron: '42 0 * * 0' branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
workflow_dispatch: workflow_dispatch:
jobs: jobs:
analyze: analyze:
name: Analyze name: Analyze
@ -14,18 +22,15 @@ jobs:
security-events: write security-events: write
steps: steps:
- name: Checkout repository - uses: actions/checkout@v4
uses: actions/checkout@v3 - uses: ./.github/actions/setup
- name: Install dependencies
run: ./.github/scripts/install_deps.sh
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@v2 uses: github/codeql-action/init@v3
with: with:
languages: cpp languages: cpp
- run: make - run: make
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2 uses: github/codeql-action/analyze@v3

View File

@ -1,4 +1,4 @@
name: Coverity name: coverity
on: on:
schedule: schedule:
- cron: '10 0 * * *' # Run every day at 00:10 - cron: '10 0 * * *' # Run every day at 00:10
@ -8,10 +8,8 @@ jobs:
scan: scan:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Install dependencies
run: ./.github/scripts/install_deps.sh
- name: Download Coverity - name: Download Coverity
run: | run: |

26
.github/workflows/docs.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: docs
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
jobs:
docs:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Generate docs
run: |
make doc
if [ -n "$(git status --porcelain)" ]; then
echo "::error::Job failed, run 'make doc' and commit your doc changes."
echo "::error::The doc generation produces the following changes:"
git diff --color --exit-code
fi
- name: Validate docs
run: make lintdoc

31
.github/workflows/labeler_issue.yml vendored Normal file
View File

@ -0,0 +1,31 @@
name: "labeler: issue"
on:
issues:
types: [opened]
jobs:
labeler:
permissions:
issues: write
runs-on: ubuntu-latest
steps:
- name: check issue title
uses: actions/github-script@v7
with:
script: |
const title = context.payload.issue.title;
const titleSplit = title.split(/\b/).map(e => e.toLowerCase());
const keywords = ['api', 'treesitter', 'ui', 'lsp'];
var match = new Set();
for (const keyword of keywords) {
if (titleSplit.includes(keyword)) {
match.add(keyword)
}
}
if (match.size !== 0) {
github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: Array.from(match)
})
}

View File

@ -1,21 +1,21 @@
name: "Pull Request Labeler" name: "labeler: PR"
on: on:
pull_request_target: pull_request_target:
types: [opened] types: [opened]
jobs: jobs:
changed-files:
triage:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: read contents: read
pull-requests: write pull-requests: write
steps: steps:
- uses: actions/labeler@v4 - uses: actions/checkout@v4
- uses: actions/labeler@v5
with: with:
repo-token: "${{ secrets.GITHUB_TOKEN }}" configuration-path: .github/scripts/labeler_configuration.yml
sync-labels: ""
type-scope: type-scope:
needs: changed-files
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: write contents: write
@ -33,18 +33,25 @@ jobs:
- name: "Extract if the PR is a breaking change and add it as label" - 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 run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')" || true
request-reviewer: target-release:
if: github.event.pull_request.state == 'open' && github.event.pull_request.draft == false needs: ["changed-files", "type-scope"]
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: ["triage", "type-scope"]
permissions: permissions:
pull-requests: write pull-requests: write
steps: steps:
- uses: actions/checkout@v3 - if: startsWith(github.base_ref, 'release')
- name: 'Request reviewers' uses: actions/github-script@v7
uses: actions/github-script@v6 with:
with: script: |
github-token: ${{ secrets.TEAM_REVIEW }} github.rest.issues.addLabels({
script: | issue_number: context.issue.number,
const script = require('./.github/scripts/reviews.js') owner: context.repo.owner,
await script({github, context}) 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: "Commit Linter" name: lintcommit
on: on:
pull_request: pull_request:
types: [opened, synchronize, reopened, ready_for_review] types: [opened, synchronize, reopened, ready_for_review]
@ -8,14 +8,20 @@ jobs:
lint-commits: lint-commits:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event.pull_request.draft == false if: github.event.pull_request.draft == false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }} ref: ${{ github.event.pull_request.head.sha }}
- uses: rhysd/action-setup-vim@v1
with: - uses: ./.github/actions/setup
neovim: true
- run: nvim --clean -es +"lua require('scripts.lintcommit').main({trace=false})" - name: Build
run: |
cmake -S cmake.deps --preset ci
cmake --build .deps
cmake --preset ci
cmake --build build
- name: lintcommit
run: cmake --build build --target lintcommit

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

@ -1,15 +1,15 @@
name: "news.txt check" name: "news.txt"
on: on:
pull_request: pull_request:
types: [opened, synchronize, reopened, ready_for_review] types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
branches: branches:
- 'master' - 'master'
jobs: jobs:
check: check:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event.pull_request.draft == false if: github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'ci:skip-news')
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }} ref: ${{ github.event.pull_request.head.sha }}
@ -19,15 +19,15 @@ jobs:
message=$(git log -n1 --pretty=format:%s $commit) message=$(git log -n1 --pretty=format:%s $commit)
type="$(echo "$message" | sed -E 's|([[:alpha:]]+)(\(.*\))?!?:.*|\1|')" type="$(echo "$message" | sed -E 's|([[:alpha:]]+)(\(.*\))?!?:.*|\1|')"
breaking="$(echo "$message" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')" breaking="$(echo "$message" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')"
if [[ "$type" == "feat" ]] || [[ "$breaking" == "breaking-change" ]]; then if [[ "$type" == "feat" ]] || [[ "$type" == "perf" ]] || [[ "$breaking" == "breaking-change" ]]; then
! git diff HEAD~${{ github.event.pull_request.commits }}..HEAD --quiet runtime/doc/news.txt || ! git diff HEAD~${{ github.event.pull_request.commits }}..HEAD --quiet runtime/doc/news.txt runtime/doc/deprecated.txt ||
{ {
echo " echo "
Pull request includes a new feature or a breaking change, but Pull request includes a new feature, performance improvement
news.txt hasn't been updated yet. This is just a reminder or a breaking change, but news.txt hasn't been updated yet.
that news.txt may need to be updated. You can ignore this CI This is just a reminder that news.txt may need to be updated.
failure if you think the change won't be of interest to You can ignore this CI failure if you think the change won't
users." be of interest to users."
exit 1 exit 1
} }
fi fi

View File

@ -9,52 +9,71 @@ ${NVIM_VERSION}
#### Zip #### Zip
1. Download **nvim-win64.zip** 1. Download **nvim-win64.zip**
2. Extract the zip. 2. Extract the zip
3. Run `nvim-qt.exe` 3. Run `nvim.exe` on your CLI of choice
#### MSI #### MSI
1. Download **nvim-win64.msi** 1. Download **nvim-win64.msi**
2. Run the MSI 2. Run the MSI
3. Search and run `nvim-qt.exe` or run `nvim.exe` on your CLI of choice. 3. Run `nvim.exe` on your CLI of choice
### macOS 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).
1. Download **nvim-macos.tar.gz** ### macOS (x86_64)
2. Run `xattr -c ./nvim-macos.tar.gz` (to avoid "unknown developer" warning)
3. Extract: `tar xzvf nvim-macos.tar.gz`
4. Run `./nvim-macos/bin/nvim`
### Linux (x64) 1. Download **nvim-macos-x86_64.tar.gz**
2. Run `xattr -c ./nvim-macos-x86_64.tar.gz` (to avoid "unknown developer" warning)
3. Extract: `tar xzvf nvim-macos-x86_64.tar.gz`
4. Run `./nvim-macos-x86_64/bin/nvim`
### macOS (arm64)
1. Download **nvim-macos-arm64.tar.gz**
2. Run `xattr -c ./nvim-macos-arm64.tar.gz` (to avoid "unknown developer" warning)
3. Extract: `tar xzvf nvim-macos-arm64.tar.gz`
4. Run `./nvim-macos-arm64/bin/nvim`
### Linux (x86_64)
If your system does not have the [required glibc version](https://neovim.io/doc/user/support.html#supported-platforms), try the (unsupported) [builds for older glibc](https://github.com/neovim/neovim-releases).
#### AppImage #### 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): - 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 ./squashfs-root/usr/bin/nvim
``` ```
#### Tarball #### Tarball
*(deprecated)* 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`
1. Download **nvim-linux64.tar.gz** ### Linux (arm64) - Untested
2. Extract: `tar xzvf nvim-linux64.tar.gz`
3. Run `./nvim-linux64/bin/nvim` #### 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 ### Other
- Install by [package manager](https://github.com/neovim/neovim/wiki/Installing-Neovim) - Install by [package manager](https://github.com/neovim/neovim/blob/master/INSTALL.md#install-from-package)
## SHA256 Checksums ## SHA256 Checksums
```
${SHA_LINUX_64_TAR}
${SHA_APP_IMAGE}
${SHA_APP_IMAGE_ZSYNC}
${SHA_MACOS}
${SHA_WIN_64_ZIP}
${SHA_WIN_64_MSI}
```

55
.github/workflows/optional.yml vendored Normal file
View File

@ -0,0 +1,55 @@
name: optional
on:
pull_request:
types: [labeled, opened, synchronize, reopened]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
INSTALL_PREFIX: ${{ github.workspace }}/nvim-install
# Double test timeout since it's running via qemu
TEST_TIMEOUT: 3600
# TEST_FILE: test/functional/shada
# TEST_FILTER: foo
jobs:
s390x:
if: contains(github.event.pull_request.labels.*.name, 'ci:s390x') || github.event_name == 'workflow_dispatch'
strategy:
fail-fast: false
matrix:
test: [functionaltest, oldtest]
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
- uses: docker://multiarch/ubuntu-core:s390x-focal
with:
# Docker runs the command as root, but we want the build/test to run
# as non-root so permissions based tests run correctly
args: >
bash -c
"
apt-get -y update &&
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 &&
cd neovim &&
runuser -u qemuci -- git fetch origin ${{ github.ref }}:pr &&
runuser -u qemuci -- git switch pr &&
runuser -u qemuci -- cmake -S cmake.deps -B .deps -G Ninja -D USE_BUNDLED_LUAJIT=OFF -D USE_BUNDLED_LUA=ON &&
runuser -u qemuci -- cmake --build .deps &&
runuser -u qemuci -- cmake -B build -G Ninja -D CI_BUILD=ON -D PREFER_LUA=ON &&
runuser -u qemuci -- make ${{ matrix.test }}
"
windows-asan:
if: contains(github.event.pull_request.labels.*.name, 'ci:windows-asan') || github.event_name == 'workflow_dispatch'
uses: ./.github/workflows/test_windows.yml
with:
build_flags: "-D ENABLE_ASAN_UBSAN=ON"
functionaltest_timeout: 40

View File

@ -1,4 +1,4 @@
name: Release name: release
on: on:
schedule: schedule:
- cron: '5 5 * * *' - cron: '5 5 * * *'
@ -13,122 +13,141 @@ on:
- v[0-9]+.[0-9]+.[0-9]+ - v[0-9]+.[0-9]+.[0-9]+
# Build on the oldest supported images, so we have broader compatibility # 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: jobs:
linux: setup:
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
outputs: outputs:
version: ${{ steps.build.outputs.version }} build_type: ${{ steps.build.outputs.build_type }}
release: ${{ steps.build.outputs.release }} appimage_tag: ${{ steps.build.outputs.appimage_tag }}
steps: steps:
- uses: actions/checkout@v3 # Nightly uses RelWithDebInfo while stable uses Release (which disables
with: # asserts). This helps get better debug info from people brave enough to
fetch-depth: 0 # use the nightly builds.
- name: Install dependencies
run: ./.github/scripts/install_deps.sh
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly') - if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV run: |
echo 'CMAKE_BUILD_TYPE=Release' >> $GITHUB_ENV
echo 'APPIMAGE_TAG=latest' >> $GITHUB_ENV
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly') - if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
run: printf 'NVIM_BUILD_TYPE=RelWithDebInfo\n' >> $GITHUB_ENV run: |
- name: Build release echo 'CMAKE_BUILD_TYPE=RelWithDebInfo' >> $GITHUB_ENV
echo 'APPIMAGE_TAG=nightly' >> $GITHUB_ENV
- name: Export build information
id: build
run: |
printf "build_type=${CMAKE_BUILD_TYPE}\n" >> $GITHUB_OUTPUT
printf "appimage_tag=${APPIMAGE_TAG}\n" >> $GITHUB_OUTPUT
linux:
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: ${{ matrix.cc }}
LDAI_NO_APPSTREAM: 1 # skip checking (broken) AppStream metadata for issues
outputs:
version: ${{ steps.build.outputs.version }}
steps:
- uses: actions/checkout@v4
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 }}
- name: tar.gz
run: cpack --config build/CPackConfig.cmake -G TGZ
- uses: actions/upload-artifact@v4
with:
name: nvim-appimage-${{ matrix.arch }}
path: |
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-linux-${{ matrix.arch }}
path: |
build/nvim-linux-${{ matrix.arch }}.tar.gz
retention-days: 1
- name: Export version
id: build id: build
run: | run: |
CC=gcc-10 make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} CMAKE_EXTRA_FLAGS="-DCI_BUILD=OFF -DCMAKE_INSTALL_PREFIX:PATH="
printf 'version<<END\n' >> $GITHUB_OUTPUT printf 'version<<END\n' >> $GITHUB_OUTPUT
./build/bin/nvim --version | head -n 3 >> $GITHUB_OUTPUT ./build/bin/nvim --version | head -n 3 >> $GITHUB_OUTPUT
printf 'END\n' >> $GITHUB_OUTPUT printf 'END\n' >> $GITHUB_OUTPUT
printf 'release=%s\n' "$(./build/bin/nvim --version | head -n 1)" >> $GITHUB_OUTPUT macos:
make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-linux64" install needs: setup
cd "$GITHUB_WORKSPACE/build/" strategy:
cpack -C $NVIM_BUILD_TYPE fail-fast: false
- uses: actions/upload-artifact@v3 matrix:
with: runner: [ macos-13, macos-14 ]
name: nvim-linux64 include:
path: | - runner: macos-13
build/nvim-linux64.tar.gz arch: x86_64
retention-days: 1 - runner: macos-14
arch: arm64
appimage: runs-on: ${{ matrix.runner }}
runs-on: ubuntu-20.04 env:
container: MACOSX_DEPLOYMENT_TARGET: 11.0
image: ubuntu:18.04
options: --privileged # Privileged mode is needed to load fuse module.
steps: steps:
- name: Prepare container - uses: actions/checkout@v4
run: |
apt-get update
apt-get install -y software-properties-common
add-apt-repository -y ppa:ubuntu-toolchain-r/test # For gcc-10.
add-apt-repository -y ppa:git-core/ppa # For git>=2.18.
apt-get update
apt-get install -y git gcc-10
apt-get install -y fuse libfuse2 # For linuxdeploy.
# Workaround for https://github.com/actions/checkout/issues/766.
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install dependencies
run: |
apt-get update
apt-get install -y build-essential cmake gettext locales ninja-build pkg-config unzip
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
run: CC=gcc-10 make appimage-latest
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
run: CC=gcc-10 make appimage-nightly
- uses: actions/upload-artifact@v3
with:
name: appimage
path: |
build/bin/nvim.appimage
build/bin/nvim.appimage.zsync
retention-days: 1
macOS:
runs-on: macos-11
steps:
- uses: actions/checkout@v3
with: with:
# Perform a full checkout #13471
fetch-depth: 0 fetch-depth: 0
- name: Install dependencies - name: Install dependencies
run: ./.github/scripts/install_deps.sh run: ./.github/scripts/install_deps.sh
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV - name: Build deps
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly') run: |
run: printf 'NVIM_BUILD_TYPE=RelWithDebInfo\n' >> $GITHUB_ENV cmake -S cmake.deps -B .deps -G Ninja \
- name: Build universal binary -D CMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }} \
run: ./.github/scripts/build_universal_macos.sh -D CMAKE_FIND_FRAMEWORK=NEVER
- uses: actions/upload-artifact@v3 cmake --build .deps
- name: Build neovim
run: |
cmake -B build -G Ninja \
-D CMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }} \
-D ENABLE_LIBINTL=OFF \
-D CMAKE_FIND_FRAMEWORK=NEVER
cmake --build build
- name: Package
run: cpack --config build/CPackConfig.cmake
- uses: actions/upload-artifact@v4
with: with:
name: nvim-macos name: nvim-macos-${{ matrix.arch }}
path: build/nvim-macos.tar.gz path: build/nvim-macos-${{ matrix.arch }}.tar.gz
retention-days: 1 retention-days: 1
windows: windows:
needs: setup
runs-on: windows-2019 runs-on: windows-2019
name: windows (MSVC_64)
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
# Perform a full checkout #13471
fetch-depth: 0 fetch-depth: 0
- name: Set env - run: .github/scripts/env.ps1
run: |
$installationPath = vswhere.exe -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
if ($installationPath -and (Test-Path "$installationPath\Common7\Tools\vsdevcmd.bat")) {
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -arch=x64 -no_logo && set" | ForEach-Object {
$name, $value = $_ -split '=', 2
"$name=$value" >> $env:GITHUB_ENV
}
}
- name: Build deps - name: Build deps
run: | run: |
cmake -S cmake.deps -B .deps -G Ninja -DCMAKE_BUILD_TYPE='RelWithDebInfo' cmake -S cmake.deps -B .deps -G Ninja -DCMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }}
cmake --build .deps cmake --build .deps
- name: build package - name: build package
run: | run: |
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE='RelWithDebInfo' -D CI_BUILD=OFF cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }}
cmake --build build --target package cmake --build build --target package
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v4
with: with:
name: nvim-win64 name: nvim-win64
path: | path: |
@ -137,7 +156,7 @@ jobs:
retention-days: 1 retention-days: 1
publish: publish:
needs: [linux, appimage, macOS, windows] needs: [linux, macos, windows]
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
GH_REPO: ${{ github.repository }} GH_REPO: ${{ github.repository }}
@ -147,9 +166,9 @@ jobs:
steps: steps:
# Must perform checkout first, since it deletes the target directory # Must perform checkout first, since it deletes the target directory
# before running, and would therefore delete the downloaded artifacts # before running, and would therefore delete the downloaded artifacts
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: actions/download-artifact@v3 - uses: actions/download-artifact@v4
- name: Install dependencies - name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y gettext-base run: sudo apt-get update && sudo apt-get install -y gettext-base
@ -176,68 +195,23 @@ jobs:
git push origin :stable || true git push origin :stable || true
# `sha256sum` outputs <sha> <path>, so we cd into each dir to drop the # `sha256sum` outputs <sha> <path>, so we cd into each dir to drop the
# containing folder from the output. # containing folder from the output.
- name: Generate Linux64 SHA256 checksums - run: |
run: | for i in nvim-*; do
cd ./nvim-linux64 (
sha256sum nvim-linux64.tar.gz > nvim-linux64.tar.gz.sha256sum cd $i || exit
echo "SHA_LINUX_64_TAR=$(cat nvim-linux64.tar.gz.sha256sum)" >> $GITHUB_ENV sha256sum * >> $GITHUB_WORKSPACE/shasum.txt
- name: Generate App Image SHA256 checksums )
run: | done
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 SHA256 checksums
run: |
cd ./nvim-macos
sha256sum nvim-macos.tar.gz > nvim-macos.tar.gz.sha256sum
echo "SHA_MACOS=$(cat nvim-macos.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 - name: Publish release
env: env:
NVIM_VERSION: ${{ needs.linux.outputs.version }} NVIM_VERSION: ${{ needs.linux.outputs.version }}
DEBUG: api DEBUG: api
run: | run: |
envsubst < "$GITHUB_WORKSPACE/.github/workflows/notes.md" > "$RUNNER_TEMP/notes.md" envsubst < "$GITHUB_WORKSPACE/.github/workflows/notes.md" > "$RUNNER_TEMP/notes.md"
gh release create $TAG_NAME $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos/* nvim-linux64/* appimage/* nvim-win64/* echo '```' >> "$RUNNER_TEMP/notes.md"
cat shasum.txt >> "$RUNNER_TEMP/notes.md"
echo '```' >> "$RUNNER_TEMP/notes.md"
if [ "$TAG_NAME" != "nightly" ]; then if [ "$TAG_NAME" != "nightly" ]; then
gh release create stable $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos/* 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/* shasum.txt
fi 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-linux-x86_64/* nvim-linux-arm64/* nvim-appimage-x86_64/* nvim-appimage-arm64/* nvim-win64/* shasum.txt
publish-winget:
needs: publish
runs-on: windows-latest
steps:
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
name: Publish stable
uses: vedantmgoyal2009/winget-releaser@v2
with:
identifier: Neovim.Neovim
release-tag: ${{ github.event.inputs.tag_name || github.ref_name }}
token: ${{ secrets.WINGET_TOKEN }}
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
name: Get nightly version
id: get-version
run: |
Invoke-WebRequest https://github.com/neovim/neovim/releases/download/nightly/nvim-win64.msi -OutFile setup.msi
Install-Module -Name 'Carbon.Windows.Installer' -Force
$VERSION = (Get-CMsi (Resolve-Path .\setup.msi).Path).ProductVersion
"version=$VERSION" >> $env:GITHUB_OUTPUT
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
name: Publish nightly
uses: vedantmgoyal2009/winget-releaser@v2
with:
identifier: Neovim.Neovim.Nightly
version: ${{ steps.get-version.outputs.version }}
release-tag: nightly
token: ${{ secrets.WINGET_TOKEN }}

35
.github/workflows/response.yml vendored Normal file
View File

@ -0,0 +1,35 @@
name: no_response
on:
schedule:
- cron: '30 1 * * *' # Run every day at 01:30
workflow_dispatch:
issue_comment:
jobs:
close:
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/github-script@v7
with:
script: |
const script = require('./.github/scripts/close_unresponsive.js')
await script({github, context})
remove_label:
if: github.event_name == 'issue_comment'
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/github-script@v7
with:
script: |
const script = require('./.github/scripts/remove_response_label.js')
await script({github, context})

View File

@ -1,19 +1,19 @@
name: "Request reviews" name: "reviewers: add"
on: on:
pull_request_target: pull_request_target:
types: [labeled, ready_for_review, reopened] types: [labeled, ready_for_review, reopened]
workflow_call:
jobs: jobs:
request-reviewer: 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 runs-on: ubuntu-latest
permissions: permissions:
pull-requests: write pull-requests: write
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: 'Request reviewers' - name: 'Request reviewers'
uses: actions/github-script@v6 uses: actions/github-script@v7
with: with:
github-token: ${{ secrets.TEAM_REVIEW }}
script: | script: |
const script = require('./.github/scripts/reviews.js') const script = require('./.github/scripts/reviewers_add.js')
await script({github, context}) await script({github, context})

View File

@ -1,4 +1,4 @@
name: "Remove reviewers" name: "reviewers: remove"
on: on:
pull_request_target: pull_request_target:
types: [converted_to_draft, closed] types: [converted_to_draft, closed]
@ -8,11 +8,10 @@ jobs:
permissions: permissions:
pull-requests: write pull-requests: write
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: 'Remove reviewers' - name: 'Remove reviewers'
uses: actions/github-script@v6 uses: actions/github-script@v7
with: with:
github-token: ${{ secrets.TEAM_REVIEW }}
script: | script: |
const script = require('./.github/scripts/remove-reviewers.js') const script = require('./.github/scripts/reviewers_remove.js')
await script({github, context}) await script({github, context})

View File

@ -1,42 +0,0 @@
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 1 * * *' # Run every day at 01:30
workflow_dispatch:
issue_comment:
jobs:
close:
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v8
with:
days-before-close: 30
days-before-stale: -1
stale-issue-label: needs:response
stale-pr-label: needs:response
remove-stale-when-updated: false
close-issue-message: "This issue has been closed since a request for
information has not been answered for 30 days. It can be reopened
when the requested information is provided."
close-pr-message: "This PR has been closed since a request for
changes has not been answered for 30 days. It can be reopened when
the requested changes are provided."
remove-label:
if: github.event_name == 'issue_comment'
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v3
- uses: actions/github-script@v6
with:
script: |
const script = require('./.github/scripts/unstale.js')
await script({github, context})

View File

@ -8,75 +8,45 @@ on:
branches: branches:
- 'master' - 'master'
- 'release-[0-9]+.[0-9]+' - 'release-[0-9]+.[0-9]+'
paths-ignore: workflow_dispatch:
- 'contrib/**'
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env: env:
ASAN_OPTIONS: detect_leaks=1:check_initialization_order=1:handle_abort=1:handle_sigill=1:log_path=${{ github.workspace }}/build/log/asan:intercept_tls_get_addr=0 ASAN_OPTIONS: detect_leaks=1:check_initialization_order=1:log_path=${{ github.workspace }}/build/log/asan:intercept_tls_get_addr=0
BIN_DIR: ${{ github.workspace }}/bin BIN_DIR: ${{ github.workspace }}/bin
BUILD_DIR: ${{ github.workspace }}/build BUILD_DIR: ${{ github.workspace }}/build
INSTALL_PREFIX: ${{ github.workspace }}/nvim-install INSTALL_PREFIX: ${{ github.workspace }}/nvim-install
LOG_DIR: ${{ github.workspace }}/build/log LOG_DIR: ${{ github.workspace }}/build/log
NVIM_LOG_FILE: ${{ github.workspace }}/build/.nvimlog NVIM_LOG_FILE: ${{ github.workspace }}/build/.nvimlog
TSAN_OPTIONS: log_path=${{ github.workspace }}/build/log/tsan TSAN_OPTIONS: log_path=${{ github.workspace }}/build/log/tsan
UBSAN_OPTIONS: "print_stacktrace=1 log_path=${{ github.workspace }}/build/log/ubsan"
VALGRIND_LOG: ${{ github.workspace }}/build/log/valgrind-%p.log VALGRIND_LOG: ${{ github.workspace }}/build/log/valgrind-%p.log
# TEST_FILE: test/functional/core/startup_spec.lua # TEST_FILE: test/functional/core/startup_spec.lua
# TEST_FILTER: foo # TEST_FILTER: foo
jobs: jobs:
lint: lint:
if: (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'push' && github.ref == 'refs/heads/master') runs-on: ubuntu-24.04
runs-on: ubuntu-22.04
timeout-minutes: 10 timeout-minutes: 10
env: env:
CACHE_UNCRUSTIFY: ${{ github.workspace }}/.cache/uncrustify CC: clang
UNCRUSTIFY_VERSION: uncrustify-0.75.0
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Install dependencies - name: Install stylua
run: ./.github/scripts/install_deps.sh lua-check
- name: Cache uncrustify
id: cache-uncrustify
uses: actions/cache@v3
with:
path: ${{ env.CACHE_UNCRUSTIFY }}
key: ${{ env.UNCRUSTIFY_VERSION }}
- name: Clone uncrustify
if: steps.cache-uncrustify.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: uncrustify/uncrustify
ref: ${{ env.UNCRUSTIFY_VERSION }}
path: uncrustify
- name: Install uncrustify
if: steps.cache-uncrustify.outputs.cache-hit != 'true'
run: | run: |
source_dir=uncrustify wget --directory-prefix="$BIN_DIR" https://github.com/JohnnyMorganz/StyLua/releases/latest/download/stylua-linux-x86_64.zip
build_dir=uncrustify/build (cd "$BIN_DIR"; unzip stylua*.zip)
cmake -S $source_dir -B $build_dir -G Ninja -D CMAKE_BUILD_TYPE=Release
cmake --build $build_dir
mkdir -p .cache
cp $build_dir/uncrustify ${{ env.CACHE_UNCRUSTIFY }}
- uses: ./.github/actions/cache
- name: Build third-party deps - name: Build third-party deps
run: | run: |
cmake -S cmake.deps -B .deps -G Ninja cmake -S cmake.deps -B .deps -G Ninja
cmake --build .deps cmake --build .deps
- if: success() || failure() && steps.abort_job.outputs.status == 'success' - run: cmake -B build -G Ninja -D CI_LINT=ON
name: configure
run: cmake -B build -G Ninja -D CI_BUILD=OFF
- if: "!cancelled()" - if: "!cancelled()"
name: Determine if run should be aborted name: Determine if run should be aborted
@ -84,12 +54,12 @@ jobs:
run: echo "status=${{ job.status }}" >> $GITHUB_OUTPUT run: echo "status=${{ job.status }}" >> $GITHUB_OUTPUT
- if: success() || failure() && steps.abort_job.outputs.status == 'success' - if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: lintstylua name: stylua
uses: JohnnyMorganz/stylua-action@v2 run: cmake --build build --target lintlua-stylua
with:
token: ${{ secrets.GITHUB_TOKEN }} - if: success() || failure() && steps.abort_job.outputs.status == 'success'
version: latest name: luals
args: --check runtime/ run: cmake --build build --target luals
- if: success() || failure() && steps.abort_job.outputs.status == 'success' - if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: luacheck name: luacheck
@ -104,133 +74,105 @@ jobs:
run: cmake --build build --target lintc-clint run: cmake --build build --target lintc-clint
- if: success() || failure() && steps.abort_job.outputs.status == 'success' - if: success() || failure() && steps.abort_job.outputs.status == 'success'
run: cmake --build build --target clang-tidy name: clang-tidy
run: cmake --build build --target lintc-clang-tidy
- if: success() || failure() && steps.abort_job.outputs.status == 'success' - if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: uncrustify name: uncrustify
run: cmake --build build --target lintc-uncrustify
clang-analyzer:
runs-on: ubuntu-24.04
timeout-minutes: 20
env:
CC: clang
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Build third-party deps
run: | run: |
${{ env.CACHE_UNCRUSTIFY }} -c ./src/uncrustify.cfg -q --replace --no-backup $(find ./src/nvim -name "*.[ch]") cmake -S cmake.deps --preset ci
cmake --build .deps
- if: success() || failure() && steps.abort_job.outputs.status == 'success' cmake --preset ci
name: suggester / uncrustify - run: cmake --build build --target clang-analyzer
uses: reviewdog/action-suggester@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tool_name: uncrustify
cleanup: false
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: check uncrustify
run: git diff --color --exit-code
posix: posix:
name: ${{ matrix.runner }} ${{ matrix.flavor }} (cc=${{ matrix.cc }}) name: ${{ matrix.build.os }} ${{ matrix.build.flavor }} ${{ matrix.build.cc }} ${{ matrix.test }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
include: # The `os` field is not needed to differentiate between the different
- flavor: asan # matrix builds. It is needed to not change the required checks (which
cc: clang # uses jobs names) each time we bump the runner version. It may be
runner: ubuntu-22.04 # possible to remove if we e.g. start using `-latest` runner versions
flags: -D ENABLE_ASAN_UBSAN=ON # or if github introduces a wildcard for required checks in the future.
- flavor: tsan build:
cc: clang [
runner: ubuntu-22.04 { runner: ubuntu-24.04, os: ubuntu, flavor: asan, cc: clang, flags: -D ENABLE_ASAN_UBSAN=ON },
flags: -D ENABLE_TSAN=ON { runner: ubuntu-24.04, os: ubuntu, flavor: tsan, cc: clang, flags: -D ENABLE_TSAN=ON },
- flavor: uchar { runner: ubuntu-24.04, os: ubuntu, flavor: release, cc: gcc, flags: -D CMAKE_BUILD_TYPE=Release -D ENABLE_TRANSLATIONS=ON },
cc: gcc # { runner: ubuntu-24.04-arm, os: ubuntu, flavor: arm, cc: gcc, flags: -D CMAKE_BUILD_TYPE=RelWithDebInfo },
runner: ubuntu-22.04 { runner: macos-13, os: macos, flavor: intel, cc: clang, flags: -D CMAKE_FIND_FRAMEWORK=NEVER, deps_flags: -D CMAKE_FIND_FRAMEWORK=NEVER },
flags: -D UNSIGNED_CHAR=ON { runner: macos-15, os: macos, flavor: arm, cc: clang, flags: -D CMAKE_FIND_FRAMEWORK=NEVER, deps_flags: -D CMAKE_FIND_FRAMEWORK=NEVER },
- cc: clang { 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 },
runner: macos-12 ]
test: [unittest, functionaltest, oldtest]
# functionaltest-lua is our dumping ground for non-mainline configurations. exclude:
# 1. Check that the tests pass with PUC Lua instead of LuaJIT. - test: unittest
# 2. No treesitter parsers installed. build: { flavor: tsan }
- flavor: functionaltest-lua - test: unittest
cc: gcc build: { flavor: puc-lua }
runner: ubuntu-22.04 - test: oldtest
deps_flags: -D USE_BUNDLED_LUAJIT=OFF -D USE_BUNDLED_LUA=ON build: { flavor: tsan }
flags: -D PREFER_LUA=ON runs-on: ${{ matrix.build.runner }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 45 timeout-minutes: 45
env: env:
CC: ${{ matrix.cc }} CC: ${{ matrix.build.cc }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Set up environment with:
run: | install_flags: "--test"
ulimit -c unlimited
echo "$BIN_DIR" >> $GITHUB_PATH
- name: Create log dir - name: Create log dir
run: mkdir -p "$LOG_DIR" run: mkdir -p "$LOG_DIR"
- name: Install dependencies - if: ${{ matrix.test != 'unittest' }}
run: ./.github/scripts/install_deps.sh cpanminus name: Set up interpreter packages
- name: Setup interpreter packages
run: | run: |
# Use default CC to avoid compilation problems when installing Python modules.
echo "Install neovim module for Python."
CC=cc python3 -m pip -q install --user --upgrade pynvim
echo "Install neovim RubyGem." echo "Install neovim RubyGem."
gem install --no-document --bindir "$BIN_DIR" --user-install --pre neovim gem install --no-document --bindir "$BIN_DIR" --user-install --pre neovim
echo "Install neovim npm package" sudo cpanm -n Neovim::Ext || cat "$HOME/.cpanm/build.log"
npm install -g neovim perl -W -e 'use Neovim::Ext; print $Neovim::Ext::VERSION'
npm link neovim
if [[ $RUNNER_OS != macOS ]]; then - name: Remove .git directory
sudo cpanm -n Neovim::Ext || cat "$HOME/.cpanm/build.log" if: ${{ matrix.build.os == 'ubuntu' }}
perl -W -e 'use Neovim::Ext; print $Neovim::Ext::VERSION' run: cmake -E rm -rf -- .git
fi
- uses: ./.github/actions/cache
- name: Build third-party deps - name: Build third-party deps
run: | run: |
cmake -S cmake.deps -B .deps -G Ninja ${{ matrix.deps_flags }} cmake -S cmake.deps --preset ci -D CMAKE_BUILD_TYPE=Debug ${{ matrix.build.deps_flags }}
cmake --build .deps cmake --build .deps
- name: Build - name: Build
run: | run: |
cmake -B build -G Ninja -D CMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX ${{ matrix.flags }} cmake --preset ci -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX ${{ matrix.build.flags }}
cmake --build build cmake --build build
- if: "!cancelled()" - if: ${{ matrix.test == 'oldtest' }}
name: Determine if run should be aborted name: ${{ matrix.test }}
id: abort_job
run: echo "status=${{ job.status }}" >> $GITHUB_OUTPUT
- if: matrix.flavor != 'tsan' && matrix.flavor != 'functionaltest-lua' && (success() || failure() && steps.abort_job.outputs.status == 'success')
name: Unittest
timeout-minutes: 5
run: cmake --build build --target unittest
- if: matrix.flavor != 'functionaltest-lua' && (success() || failure() && steps.abort_job.outputs.status == 'success')
name: Functionaltest
timeout-minutes: 20 timeout-minutes: 20
run: cmake --build build --target functionaltest run: make -C test/old/testdir NVIM_PRG=$(realpath build)/bin/nvim
- if: matrix.flavor == 'functionaltest-lua' && (success() || failure() && steps.abort_job.outputs.status == 'success') - if: ${{ matrix.test != 'oldtest' }}
name: Functionaltest with PUC Lua name: ${{ matrix.test }}
timeout-minutes: 20 timeout-minutes: 20
run: cmake --build build --target functionaltest-lua run: cmake --build build --target ${{ matrix.test }}
- if: matrix.flavor != 'tsan' && (success() || failure() && steps.abort_job.outputs.status == 'success') - name: Install
name: Oldtest
run: make oldtest
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: Install
run: cmake --install build
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: Installtests
run: | run: |
cmake --install build
"$INSTALL_PREFIX/bin/nvim" --version "$INSTALL_PREFIX/bin/nvim" --version
if ! "$INSTALL_PREFIX/bin/nvim" -u NONE -e -c ':help' -c ':qall'; then if ! "$INSTALL_PREFIX/bin/nvim" -u NONE -e -c ':help' -c ':qall'; then
echo "Running ':help' in the installed nvim failed." echo "Running ':help' in the installed nvim failed."
@ -255,155 +197,44 @@ jobs:
exit 1 exit 1
fi fi
- if: success() || failure() && steps.abort_job.outputs.status == 'success' - if: '!cancelled()'
name: Show logs name: Show logs
run: cat $(find "$LOG_DIR" -type f) run: cat $(find "$LOG_DIR" -type f)
build-types:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: ./.github/scripts/install_deps.sh
- uses: ./.github/actions/cache
- name: Build third-party deps
run: |
cmake -S cmake.deps -B .deps -G "Ninja Multi-Config"
cmake --build .deps
- name: Configure
run: cmake -B build -G "Ninja Multi-Config" -D CMAKE_C_COMPILER=gcc
- name: Release
run: cmake --build build --config Release
- name: RelWithDebInfo
run: cmake --build build --config RelWithDebInfo
- name: MinSizeRel
run: cmake --build build --config MinSizeRel
windows: windows:
runs-on: windows-2022 uses: ./.github/workflows/test_windows.yml
timeout-minutes: 45
name: windows
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/cache
- name: Set env
run: |
$installationPath = vswhere.exe -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
if ($installationPath -and (Test-Path "$installationPath\Common7\Tools\vsdevcmd.bat")) {
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -arch=x64 -no_logo && set" | ForEach-Object {
$name, $value = $_ -split '=', 2
"$name=$value" >> $env:GITHUB_ENV
}
}
- name: Build deps
run: |
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE='RelWithDebInfo'
cmake --build .deps
- name: Build
run: |
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE='RelWithDebInfo'
cmake --build build
- name: Install test deps
run: |
$PSNativeCommandArgumentPassing = 'Legacy'
& build\bin\nvim.exe "--version"
# Ensure that the "win32" feature is set.
& build\bin\nvim -u NONE --headless -c 'exe !has(\"win32\").\"cq\"'
python -m pip install pynvim
# Sanity check
python -c "import pynvim; print(str(pynvim))"
node --version
npm.cmd --version
npm.cmd install -g neovim
Get-Command -CommandType Application neovim-node-host.cmd
npm.cmd link neovim
- if: "!cancelled()"
name: Determine if run should be aborted
id: abort_job
run: |
"status=${{ job.status }}" >> $env:GITHUB_OUTPUT
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: Run functionaltest
timeout-minutes: 20
run: cmake --build build --target functionaltest
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
uses: msys2/setup-msys2@v2
with:
update: true
pacboy: >-
make:p gcc:p
release: false
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: Run oldtest
shell: msys2 {0}
run: |
cd test/old/testdir
mingw32-make VERBOSE=1
with-external-deps: with-external-deps:
runs-on: ubuntu-22.04 runs-on: ubuntu-24.04
timeout-minutes: 10 timeout-minutes: 10
env:
CC: gcc
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo add-apt-repository ppa:neovim-ppa/stable sudo add-apt-repository ppa:neovim-ppa/stable
./.github/scripts/install_deps.sh
sudo apt-get install -y \ sudo apt-get install -y \
libluajit-5.1-dev \ libluajit-5.1-dev \
libmsgpack-dev \
libtermkey-dev \
libunibilium-dev \ libunibilium-dev \
libuv1-dev \ libuv1-dev \
lua-filesystem \ lua-filesystem \
lua-lpeg \ lua-lpeg \
lua-mpack \ luajit \
luajit lua-luv-dev
# libtree-sitter-dev \ # libtree-sitter-dev \
# libvterm-dev \
# lua-luv-dev
# Remove comments from packages once we start using these external # Remove comments from packages once we start using these external
# dependencies. # dependencies.
- uses: ./.github/actions/cache
- name: Build third-party deps - name: Build third-party deps
run: | run: |
# Ideally all dependencies should external for this job, but some cmake -S cmake.deps --preset external_deps
# dependencies don't have the required version available. We use the
# bundled versions for these with the hopes of being able to remove them
# later on.
cmake -S cmake.deps -B .deps -G Ninja -D USE_BUNDLED=OFF \
-D USE_BUNDLED_LUV=ON \
-D USE_BUNDLED_LIBVTERM=ON \
-D USE_BUNDLED_TS=ON
cmake --build .deps cmake --build .deps
- name: Build - name: Build
run: | run: |
cmake -B build -G Ninja cmake --preset ci
cmake --build build cmake --build build

73
.github/workflows/test_windows.yml vendored Normal file
View File

@ -0,0 +1,73 @@
name: windows
on:
workflow_call:
inputs:
build_flags:
type: string
functionaltest_timeout:
default: 20
type: number
workflow_dispatch:
jobs:
windows:
runs-on: windows-2022
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
test: [functional, old]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Build deps
run: |
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE='RelWithDebInfo'
cmake --build .deps
- name: Build
run: |
cmake --preset ci -D CMAKE_BUILD_TYPE='RelWithDebInfo' ${{ inputs.build_flags }}
cmake --build build
- name: Install test deps
run: |
$PSNativeCommandArgumentPassing = 'Legacy'
& build\bin\nvim.exe "--version"
# Ensure that the "win32" feature is set.
& build\bin\nvim -u NONE --headless -c 'exe !has(\"win32\").\"cq\"'
python -m pip install pynvim
# Sanity check
python -c "import pynvim; print(str(pynvim))"
node --version
npm.cmd --version
npm.cmd install -g neovim
Get-Command -CommandType Application neovim-node-host.cmd
npm.cmd link neovim
- if: ${{ matrix.test == 'functional' }}
name: functionaltest
timeout-minutes: ${{ inputs.functionaltest_timeout }}
run: cmake --build build --target functionaltest
- if: ${{ matrix.test == 'old' }}
uses: msys2/setup-msys2@v2
with:
update: true
install: unzip
pacboy: >-
make:p gcc:p diffutils:p
release: false
- if: ${{ matrix.test == 'old' }}
name: oldtest
shell: msys2 {0}
run: |
cd test/old/testdir
mingw32-make VERBOSE=1

View File

@ -15,11 +15,11 @@ jobs:
VERSION_BRANCH: marvim/ci-version-update VERSION_BRANCH: marvim/ci-version-update
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
repository: vim/vim repository: vim/vim
path: ${{ env.VIM_SOURCE_DIR }} path: ${{ env.VIM_SOURCE_DIR }}
@ -28,10 +28,10 @@ jobs:
- run: sudo apt-get install libfuse2 - run: sudo apt-get install libfuse2
- run: | - run: |
gh release download -R neovim/neovim -p nvim.appimage gh release download -R neovim/neovim -p nvim-linux-x86_64.appimage
chmod a+x nvim.appimage chmod a+x nvim-linux-x86_64.appimage
mkdir -p $HOME/.local/bin 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 printf '%s\n' "$HOME/.local/bin" >> $GITHUB_PATH
- name: Set up git config - name: Set up git config
@ -43,13 +43,13 @@ jobs:
id: update-version id: update-version
run: | run: |
git checkout -b ${VERSION_BRANCH} 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 printf 'NEW_PATCHES=%s\n' $([ -z "$(git diff)" ]; echo $?) >> $GITHUB_OUTPUT
- name: Automatic PR - name: Automatic PR
if: ${{ steps.update-version.outputs.NEW_PATCHES != 0 }} if: ${{ steps.update-version.outputs.NEW_PATCHES != 0 }}
run: | run: |
git add -u git add -u
git commit -m 'version.c: update [skip ci]' git commit -m 'docs: update version.c'
git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} ${VERSION_BRANCH} 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 gh pr create --draft --fill --label vim-patch --base ${GITHUB_REF#refs/heads/} --head ${VERSION_BRANCH} || true

5
.gitignore vendored
View File

@ -1,7 +1,8 @@
# Tools # Tools
/.direnv/
/venv/ /venv/
compile_commands.json compile_commands.json
/.luarc.json /.envrc
# IDEs # IDEs
/.vs/ /.vs/
@ -41,7 +42,9 @@ compile_commands.json
/test/old/testdir/test*.res /test/old/testdir/test*.res
/test/old/testdir/test*.log /test/old/testdir/test*.log
/test/old/testdir/messages /test/old/testdir/messages
/test/old/testdir/starttime
/test/old/testdir/viminfo /test/old/testdir/viminfo
/test/old/testdir/opt_test.vim
/test/old/testdir/test.ok /test/old/testdir/test.ok
/test/old/testdir/*.failed /test/old/testdir/*.failed
/test/old/testdir/X* /test/old/testdir/X*

View File

@ -38,10 +38,17 @@ globals = {
"vim.bo", "vim.bo",
"vim.wo", "vim.wo",
"vim.go", "vim.go",
"vim.env" "vim.env",
"_",
} }
exclude_files = { exclude_files = {
'test/_meta.lua',
'test/functional/fixtures/lua/syntax_error.lua', 'test/functional/fixtures/lua/syntax_error.lua',
'runtime/lua/vim/treesitter/_meta.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/coxpcall.lua',
'src/nvim/eval.lua',
} }

32
.luarc.json Normal file
View File

@ -0,0 +1,32 @@
{
"$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
"runtime": {
"version": "LuaJIT"
},
"workspace": {
"library": [
"runtime/lua",
"${3rd}/busted/library",
"${3rd}/luv/library"
],
"ignoreDir": [
"test",
"_vim9script.lua"
],
"checkThirdParty": "Disable"
},
"diagnostics": {
"groupFileStatus": {
"strict": "Opened",
"strong": "Opened"
},
"groupSeverity": {
"strong": "Warning",
"strict": "Warning"
},
"unusedLocalExclude": [ "_*" ],
"disable": [
"luadoc-miss-see-name"
]
}
}

View File

@ -8,19 +8,17 @@ Anmol Sethi <hi@nhooyr.io> <nhooyr@users.noreply.github.com>
BK1603 <chouhan.shreyansh2702@gmail.com> Shreyansh Chouhan BK1603 <chouhan.shreyansh2702@gmail.com> Shreyansh Chouhan
Billy Su <g4691821@gmail.com> Billy SU Billy Su <g4691821@gmail.com> Billy SU
Billy Vong <billyvg@gmail.com> <billyvg@users.noreply.github.com> Billy Vong <billyvg@gmail.com> <billyvg@users.noreply.github.com>
bfredl <bjorn.linse@gmail.com>
Carlos Hernandez <carlos@techbyte.ca> <hurricanehrndz@users.noreply.github.com> Carlos Hernandez <carlos@techbyte.ca> <hurricanehrndz@users.noreply.github.com>
Chris Kipp <ckipp@pm.me> ckipp01 Chris Kipp <ckipp@pm.me> ckipp01
Christian Clason <c.clason@uni-graz.at> <christian.clason@uni-due.de> Christian Clason <c.clason@uni-graz.at> <christian.clason@uni-due.de>
Cédric Barreteau <> <cbarrete@users.noreply.github.com> Cédric Barreteau <> <cbarrete@users.noreply.github.com>
Dan Aloni <alonid@gmail.com> <dan@kernelim.com> Dan Aloni <alonid@gmail.com> <dan@kernelim.com>
Daniel Hahler <git@thequod.de> <github@thequod.de> Daniel Hahler <git@thequod.de> <github@thequod.de>
dundargoc <gocdundar@gmail.com> <33953936+dundargoc@users.noreply.github.com>
dundargoc <gocdundar@gmail.com> Dundar Goc
Eisuke Kawashima <e-kwsm@users.noreply.github.com> E Kawashima Eisuke Kawashima <e-kwsm@users.noreply.github.com> E Kawashima
ElPiloto <luis.r.piloto@gmail.com> Luis Piloto ElPiloto <luis.r.piloto@gmail.com> Luis Piloto
Eliseo Martínez <eliseomarmol@gmail.com> Eliseo Martínez Eliseo Martínez <eliseomarmol@gmail.com> Eliseo Martínez
Fabian Viöl <f.vioel@googlemail.com> Fabian 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> Florian Walch <florian@fwalch.com> <fwalch@users.noreply.github.com>
Gabriel Cruz <gabs.oficial98@gmail.com> <LTKills@users.noreply.github.com> Gabriel Cruz <gabs.oficial98@gmail.com> <LTKills@users.noreply.github.com>
Gaelan Steele <gbs@canishe.com> Gaelan Gaelan Steele <gbs@canishe.com> Gaelan
@ -38,6 +36,7 @@ J Phani Mahesh <phanimahesh@gmail.com> <github@phanimahesh.me>
Jack Bracewell <FriedSock@users.noreply.github.com> <jack.bracewell@unboxedconsulting.com> Jack Bracewell <FriedSock@users.noreply.github.com> <jack.bracewell@unboxedconsulting.com>
Jack Bracewell <FriedSock@users.noreply.github.com> <jbtwentythree@gmail.com> Jack Bracewell <FriedSock@users.noreply.github.com> <jbtwentythree@gmail.com>
Jacques Germishuys <jacquesg@striata.com> <jacquesg@users.noreply.github.com> Jacques Germishuys <jacquesg@striata.com> <jacquesg@users.noreply.github.com>
Jaehwang Jung <tomtomjhj@gmail.com> Jaehwang Jerry Jung
Jakub Łuczyński <doubleloop@o2.pl> <doubleloop@users.noreply.github.com> Jakub Łuczyński <doubleloop@o2.pl> <doubleloop@users.noreply.github.com>
James McCoy <jamessan@jamessan.com> <vega.james@gmail.com> James McCoy <jamessan@jamessan.com> <vega.james@gmail.com>
Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> <janedmundlazo@hotmail.com> Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> <janedmundlazo@hotmail.com>
@ -57,6 +56,8 @@ Kwon-Young Choi <kwon-young.choi@hotmail.fr> Kwon-Young
Lewis Russell <lewis6991@gmail.com> <me@lewisr.dev> Lewis Russell <lewis6991@gmail.com> <me@lewisr.dev>
Lucas Hoffmann <l-m-h@web.de> <lucc@posteo.de> Lucas Hoffmann <l-m-h@web.de> <lucc@posteo.de>
Lucas Hoffmann <l-m-h@web.de> <lucc@users.noreply.github.com> Lucas Hoffmann <l-m-h@web.de> <lucc@users.noreply.github.com>
Luuk van Baal <luukvbaal@gmail.com> <31730729+luukvbaal@users.noreply.github.com>
Luuk van Baal <luukvbaal@gmail.com> luukvbaal
Marco Hinz <mh.codebro@gmail.com> <mh.codebro+github@gmail.com> Marco Hinz <mh.codebro@gmail.com> <mh.codebro+github@gmail.com>
Marvim the Paranoid Android <marvim@users.noreply.github.com> marvim Marvim the Paranoid Android <marvim@users.noreply.github.com> marvim
Mateusz Czapliński <czapkofan@gmail.com> Mateusz Czaplinski Mateusz Czapliński <czapkofan@gmail.com> Mateusz Czaplinski
@ -111,14 +112,20 @@ Yorick Peterse <git@yorickpeterse.com> <yorick@yorickpeterse.com>
ZyX <kp-pav@yandex.ru> <kp-pav@ya.ru> ZyX <kp-pav@yandex.ru> <kp-pav@ya.ru>
ZyX <kp-pav@yandex.ru> Nikolai Aleksandrovich Pavlov ZyX <kp-pav@yandex.ru> Nikolai Aleksandrovich Pavlov
aph <a.hewson@gmail.com> Ashley Hewson aph <a.hewson@gmail.com> Ashley Hewson
bfredl <bjorn.linse@gmail.com>
butwerenotthereyet <58348703+butwerenotthereyet@users.noreply.github.com> We're Yet butwerenotthereyet <58348703+butwerenotthereyet@users.noreply.github.com> We're Yet
chemzqm <chemzqm@gmail.com> Qiming zhao chemzqm <chemzqm@gmail.com> Qiming zhao
chentau <tchen1998@gmail.com> Tony Chen chentau <tchen1998@gmail.com> Tony Chen
dedmass <carlo.abelli@gmail.com> Carlo Abelli dedmass <carlo.abelli@gmail.com> Carlo Abelli
dundargoc <gocdundar@gmail.com> <33953936+dundargoc@users.noreply.github.com>
dundargoc <gocdundar@gmail.com> Dundar Goc
equal-l2 <eng.equall2@gmail.com> <equal-l2@users.noreply.github.com> equal-l2 <eng.equall2@gmail.com> <equal-l2@users.noreply.github.com>
francisco souza <fsouza@users.noreply.github.com> <108725+fsouza@users.noreply.github.com> francisco souza <fsouza@users.noreply.github.com> <108725+fsouza@users.noreply.github.com>
glacambre <code@lacamb.re> <me@r4> glacambre <code@lacamb.re> <me@r4>
glacambre <code@lacamb.re> Ghjuvan Lacambre glacambre <code@lacamb.re> Ghjuvan Lacambre
glepnir <glephunter@gmail.com> Raphael
glepnir <glepnir@gopherhub.org> Raphael
glepnir <glepnir@neovim.pro> Raphael
ii14 <ii14@users.noreply.github.com> <59243201+ii14@users.noreply.github.com> ii14 <ii14@users.noreply.github.com> <59243201+ii14@users.noreply.github.com>
jdrouhard <john@jmdtech.org> <github@jmdtech.org> jdrouhard <john@jmdtech.org> <github@jmdtech.org>
kuuote <znmxodq1@gmail.com> <36663503+kuuote@users.noreply.github.com> kuuote <znmxodq1@gmail.com> <36663503+kuuote@users.noreply.github.com>

View File

@ -3,4 +3,4 @@ line_endings = "Unix"
indent_type = "Spaces" indent_type = "Spaces"
indent_width = 2 indent_width = 2
quote_style = "AutoPreferSingle" quote_style = "AutoPreferSingle"
call_parentheses = "Always" call_parentheses = "Input"

View File

@ -1,3 +1,14 @@
/scripts /build/
/src /.deps/
/test /runtime/lua/coxpcall.lua
/runtime/lua/vim/_meta
/runtime/lua/vim/re.lua
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

457
BUILD.md Normal file
View File

@ -0,0 +1,457 @@
- **IMPORTANT**: Before upgrading to a new version, **always check for [breaking changes](https://neovim.io/doc/user/news.html#news-breaking).**
## Quick start
1. Install [build prerequisites](#build-prerequisites) on your system
2. `git clone https://github.com/neovim/neovim`
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._
5. `sudo make install`
- Default install location is `/usr/local`
- 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`.
- Third-party dependencies (libuv, LuaJIT, etc.) are downloaded automatically to `.deps/`. See the [FAQ](https://neovim.io/doc/user/faq.html#faq-build) if you have issues.
- After building, you can run the `nvim` executable without installing it by running `VIMRUNTIME=runtime ./build/bin/nvim`.
- If you plan to develop Neovim, install [Ninja](https://ninja-build.org/) for faster builds. It will automatically be used.
- Install [ccache](https://ccache.dev/) for faster rebuilds of Neovim. It's used by default. To disable it, use `CCACHE_DISABLE=true make`.
## Running tests
See [test/README.md](https://github.com/neovim/neovim/blob/master/test/README.md).
## Building
First make sure you installed the [build prerequisites](#build-prerequisites). Now that you have the dependencies, you can try other build targets explained below.
The _build type_ determines the level of used compiler optimizations and debug information:
- `Release`: Full compiler optimizations and no debug information. Expect the best performance from this build type. Often used by package maintainers.
- `Debug`: Full debug information; few optimizations. Use this for development to get meaningful output from debuggers like GDB or LLDB. This is the default if `CMAKE_BUILD_TYPE` is not specified.
- `RelWithDebInfo` ("Release With Debug Info"): Enables many optimizations and adds enough debug info so that when Neovim ever crashes, you can still get a backtrace.
So, for a release build, just use:
```
make CMAKE_BUILD_TYPE=Release
```
(Do not add a `-j` flag if `ninja` is installed! The build will be in parallel automatically.)
Afterwards, the `nvim` executable can be found in `build/bin`. To verify the build type after compilation, run:
```sh
./build/bin/nvim --version | grep ^Build
```
To install the executable to a certain location, use:
```
make CMAKE_INSTALL_PREFIX=$HOME/local/nvim install
```
CMake, our main build system, caches a lot of things in `build/CMakeCache.txt`. If you ever want to change `CMAKE_BUILD_TYPE` or `CMAKE_INSTALL_PREFIX`, run `rm -rf build` first. This is also required when rebuilding after a Git commit adds or removes files (including from `runtime`) — when in doubt, run `make distclean` (which is basically a shortcut for `rm -rf build .deps`).
By default (`USE_BUNDLED=1`), Neovim downloads and statically links its needed dependencies. In order to be able to use a debugger on these libraries, you might want to compile them with debug information as well:
<!-- THIS CAUSES SCREEN INTERFERENCE
```
make distclean
VERBOSE=1 DEBUG=1 make deps
```
-->
```
make distclean
make deps
```
## Building on Windows
### Windows / MSVC
**MSVC (Visual Studio) is the recommended way to build on Windows.** These steps were confirmed as of 2023.
1. Install [Visual Studio](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community) (2017 or later) with the _Desktop development with C++_ workload.
- On 32-bit Windows, you will need [this workaround](https://developercommunity.visualstudio.com/content/problem/212989/ninja-binary-format.html).
2. Open the Neovim project folder.
- Visual Studio should detect the cmake files and automatically start building...
3. Choose the `nvim.exe (bin\nvim.exe)` target and hit F5.
- If the build fails, it may be because Visual Studio started the build with `x64-{Debug,Release}` before you switched the configuration to `x86-Release`.
- 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 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
To build from the command line (i.e. invoke the `cmake` commands yourself),
1. Ensure you have the Visual Studio environment variables, using any of the following:
- Using the [Visual Studio Developer Command Prompt or Visual Studio Developer PowerShell](https://learn.microsoft.com/en-us/visualstudio/ide/reference/command-prompt-powershell?view=vs-2022)
- Invoking `Import-VisualStudioVars` in PowerShell from [this PowerShell module](https://github.com/Pscx/Pscx)
- Invoking `VsDevCmd.bat` in Command Prompt
```
VsDevCmd.bat -arch=x64
```
This is to make sure that `luarocks` finds the Visual Studio installation, and doesn't fall back to MinGW with errors like:
```
'mingw32-gcc' is not recognized as an internal or external command
```
2. From the "Developer PowerShell" or "Developer Command Prompt":
```
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE=Release
cmake --build .deps --config Release
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=Release
cmake --build build --config Release
```
- Omit `--config Release` if you want a debug build.
- Omit `-G Ninja` to use the "Visual Studio" generator.
### Windows / CLion
1. Install [CLion](https://www.jetbrains.com/clion/).
2. Open the Neovim project in CLion.
3. Select _Build → Build All in 'Release'_.
### Windows / Cygwin
Install all dependencies the normal way, then build Neovim the normal way for a random CMake application (i.e. do not use the `Makefile` that automatically downloads and builds "bundled" dependencies).
The `cygport` repo contains Cygport files (e.g. `APKBUILD`, `PKGBUILD`) for all the dependencies not available in the Cygwin distribution, and describes any special commands or arguments needed to build. The Cygport definitions also try to describe the required dependencies for each one. Unless custom commands are provided, Cygport just calls `autogen`/`cmake`, `make`, `make install`, etc. in a clean and consistent way.
https://github.com/cascent/neovim-cygwin was built on Cygwin 2.9.0. Newer `libuv` should require slightly less patching. Some SSP stuff changed in Cygwin 2.10.0, so that might change things too when building Neovim.
### Windows / MSYS2 / MinGW
1. From the MSYS2 shell, install these packages:
```
pacman -S \
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\ucrt64\bin;c:\msys64\usr\bin;%PATH%
```
3. You have two options:
- Build using `cmake` and `Ninja` generator:
```cmd
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build .deps
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build
```
If you cannot install neovim with `ninja install` due to permission restriction, you can install neovim in a directory you have write access to.
```cmd
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build .deps
cmake -B build -G Ninja -D CMAKE_INSTALL_PREFIX=C:\nvim -D CMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build
```
- Or, alternatively, you can use `mingw32-make`:
```cmd
mingw32-make deps
mingw32-make CMAKE_BUILD_TYPE=RelWithDebInfo
:: Or you can do the previous command specifying a custom prefix
:: (Default is C:\Program Files (x86)\nvim)
:: mingw32-make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_INSTALL_PREFIX=C:\nvim
mingw32-make install
```
## Localization
### Localization build
A normal build will create `.mo` files in `build/src/nvim/po`.
* 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`.
### Localization check
To check the translations for `$LANG`, run `make -C build check-po-$LANG`. Examples:
```
cmake --build build --target check-po-de
cmake --build build --target check-po-pt_BR
```
- `check-po-$LANG` generates a detailed report in `./build/src/nvim/po/check-${LANG}.log`. (The report is generated by `nvim`, not by `msgfmt`.)
### Localization update
To update the `src/nvim/po/$LANG.po` file with the latest strings, run the following:
```
cmake --build build --target update-po-$LANG
```
- **Note**: Run `src/nvim/po/cleanup.vim` after updating.
## Compiler options
To see the chain of includes, use the `-H` option ([#918](https://github.com/neovim/neovim/issues/918)):
```sh
echo '#include "./src/nvim/buffer.h"' | \
> clang -I.deps/usr/include -Isrc -std=c99 -P -E -H - 2>&1 >/dev/null | \
> grep -v /usr/
```
- `grep -v /usr/` is used to filter out system header files.
- `-save-temps` can be added as well to see expanded macros or commented assembly.
## Custom Makefile
You can customize the build process locally by creating a `local.mk`, which is referenced at the top of the main `Makefile`. It's listed in `.gitignore`, so it can be used across branches. **A new target in `local.mk` overrides the default make-target.**
Here's a sample `local.mk` which adds a target to force a rebuild but *does not* override the default-target:
```make
all:
rebuild:
rm -rf build
make
```
## 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.
To build the bundled dependencies using CMake:
```sh
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build .deps
```
By default the libraries and headers are placed in `.deps/usr`. Now you can build Neovim:
```sh
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build
```
### How to build without "bundled" dependencies
1. Manually install the dependencies:
- 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
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_TS=ON
cmake --build .deps
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build
```
3. Run `make`, `ninja`, or whatever build tool you told CMake to generate.
- 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/`).
#### Debian 10 (Buster) example:
```sh
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
```
#### Example of using a Makefile
- Example of using a package with all dependencies:
```
make USE_BUNDLED=OFF
```
- 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_LIBUV=ON"
```
## Build prerequisites
General requirements (see [#1469](https://github.com/neovim/neovim/issues/1469#issuecomment-63058312)):
- Clang or GCC version 4.9+
- 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 curl build-essential
```
### RHEL / Fedora
```
sudo dnf -y install ninja-build cmake gcc make gettext curl glibc-gconv-extra
```
### openSUSE
```
sudo zypper install ninja cmake gcc-c++ gettext-tools curl
```
### Arch Linux
```
sudo pacman -S base-devel cmake ninja curl
```
### Alpine Linux
```
apk add build-base cmake coreutils curl gettext-tiny-dev
```
### Void Linux
```
xbps-install base-devel cmake curl git
```
### NixOS / Nix
Starting from NixOS 18.03, the Neovim binary resides in the `neovim-unwrapped` Nix package (the `neovim` package being just a wrapper to setup runtime options like Ruby/Python support):
```sh
cd path/to/neovim/src
```
Drop into `nix-shell` to pull in the Neovim dependencies:
```
nix-shell '<nixpkgs>' -A neovim-unwrapped
```
Configure and build:
```sh
rm -rf build && cmakeConfigurePhase
buildPhase
```
Tests are not available by default, because of some unfixed failures. You can enable them via adding this package in your overlay:
```
neovim-dev = (super.pkgs.neovim-unwrapped.override {
doCheck=true;
}).overrideAttrs(oa:{
cmakeBuildType="debug";
nativeBuildInputs = oa.nativeBuildInputs ++ [ self.pkgs.valgrind ];
shellHook = ''
export NVIM_PYTHON_LOG_LEVEL=DEBUG
export NVIM_LOG_FILE=/tmp/log
export VALGRIND_LOG="$PWD/valgrind.log"
'';
});
```
and replacing `neovim-unwrapped` with `neovim-dev`:
```
nix-shell '<nixpkgs>' -A neovim-dev
```
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: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 wget gettext curl
```
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).
### OpenBSD
```sh
doas pkg_add gmake cmake curl gettext-tools
```
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:
```sh
mkdir .deps
cd .deps
cmake ../cmake.deps/
gmake
cd ..
mkdir build
cd build
cmake ..
gmake
```
### macOS
#### macOS / Homebrew
1. Install Xcode Command Line Tools: `xcode-select --install`
2. Install [Homebrew](http://brew.sh)
3. Install Neovim build dependencies:
```
brew install ninja cmake gettext curl
```
- **Note**: If you see Wget certificate errors (for older macOS versions less than 10.10):
```sh
brew install curl-ca-bundle
echo CA_CERTIFICATE=$(brew --prefix curl-ca-bundle)/share/ca-bundle.crt >> ~/.wgetrc
```
- **Note**: If you see `'stdio.h' file not found`, try the following:
```
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
```
#### macOS / MacPorts
1. Install Xcode Command Line Tools: `xcode-select --install`
2. Install [MacPorts](http://www.macports.org)
3. Install Neovim build dependencies:
```
sudo port install ninja cmake gettext
```
- **Note**: If you see Wget certificate errors (for older macOS versions less than 10.10):
```sh
sudo port install curl-ca-bundle
echo CA_CERTIFICATE=/opt/local/share/curl/curl-ca-bundle.crt >> ~/.wgetrc
```
- **Note**: If you see `'stdio.h' file not found`, try the following:
```
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
```
#### Building for older macOS versions
From a newer macOS version, to build for older macOS versions, you will have to set the macOS deployment target:
```
make CMAKE_BUILD_TYPE=Release MACOSX_DEPLOYMENT_TARGET=10.13 DEPS_CMAKE_FLAGS="-DCMAKE_CXX_COMPILER=$(xcrun -find c++)"
```
Note that the C++ compiler is explicitly set so that it can be found when the deployment target is set.

View File

@ -1,20 +1,22 @@
# CMAKE REFERENCE # CMAKE REFERENCE
# intro: https://codingnest.com/basic-cmake/ # - intro: https://codingnest.com/basic-cmake/
# best practices (3.0+): https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1 # - best practices (3.0+): https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1
# pitfalls: https://izzys.casa/2019/02/everything-you-never-wanted-to-know-about-cmake/ # - 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. # Version should match the tested CMAKE_URL in .github/workflows/build.yml.
cmake_minimum_required(VERSION 3.10) cmake_minimum_required(VERSION 3.16)
# Can be removed once minimum version is at least 3.15
if(POLICY CMP0092)
cmake_policy(SET CMP0092 NEW)
endif()
project(nvim C) project(nvim C)
if(POLICY CMP0075) if(POLICY CMP0135)
cmake_policy(SET CMP0075 NEW) cmake_policy(SET CMP0135 NEW)
endif()
if(XCODE)
message(FATAL_ERROR [[Xcode generator is not supported. Use "Ninja" or "Unix Makefiles" instead]])
endif() endif()
# Point CMake at any custom modules we may ship # Point CMake at any custom modules we may ship
@ -22,17 +24,44 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
include(CheckCCompilerFlag) include(CheckCCompilerFlag)
include(CheckCSourceCompiles) include(CheckCSourceCompiles)
include(CheckLibraryExists)
include(ExternalProject)
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
include(GNUInstallDirs)
include(Deps)
include(Find)
include(InstallHelpers) include(InstallHelpers)
include(LuaHelpers)
include(PreventInTreeBuilds) include(PreventInTreeBuilds)
include(Util) include(Util)
set(TOUCHES_DIR ${PROJECT_BINARY_DIR}/touches) #-------------------------------------------------------------------------------
# User settings
#-------------------------------------------------------------------------------
find_program(CCACHE_PRG ccache) set(DEPS_IGNORE_SHA FALSE)
if(CCACHE_PRG)
set(CMAKE_C_COMPILER_LAUNCHER ${CMAKE_COMMAND} -E env CCACHE_SLOPPINESS=pch_defines,time_macros ${CCACHE_PRG}) #-------------------------------------------------------------------------------
# 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)
if(NOT CI_BUILD)
set(CMAKE_INSTALL_MESSAGE NEVER)
endif()
if(${CMAKE_VERSION} VERSION_LESS 3.20)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
endif()
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.26)
set(COPY_DIRECTORY copy_directory_if_different)
else()
set(COPY_DIRECTORY copy_directory)
endif() endif()
# Prefer our bundled versions of dependencies. # Prefer our bundled versions of dependencies.
@ -83,10 +112,8 @@ if(APPLE)
endif() endif()
if(WIN32 OR APPLE) 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) set(CASE_INSENSITIVE_FILENAME TRUE)
# Enable fixing case-insensitive filenames for Windows and Mac.
set(USE_FNAME_CASE TRUE)
endif() endif()
if (MINGW) if (MINGW)
@ -97,35 +124,31 @@ if (MINGW)
else() else()
option(ENABLE_LTO "enable link time optimization" ON) option(ENABLE_LTO "enable link time optimization" ON)
endif() endif()
option(ENABLE_LIBINTL "enable libintl" ON)
option(ENABLE_WASMTIME "enable wasmtime" OFF)
message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
set_default_buildtype() set_default_buildtype(Debug)
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(NOT isMultiConfig)
# 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 # 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`. # version string, else they are combined with the result of `git describe`.
set(NVIM_VERSION_MAJOR 0) set(NVIM_VERSION_MAJOR 0)
set(NVIM_VERSION_MINOR 9) set(NVIM_VERSION_MINOR 11)
set(NVIM_VERSION_PATCH 0) set(NVIM_VERSION_PATCH 1)
set(NVIM_VERSION_PRERELEASE "") # for package maintainers set(NVIM_VERSION_PRERELEASE "") # for package maintainers
# API level # API level
set(NVIM_API_LEVEL 11) # Bump this after any API change. set(NVIM_API_LEVEL 13) # Bump this after any API/stdlib change.
set(NVIM_API_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change. set(NVIM_API_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change.
set(NVIM_API_PRERELEASE false) set(NVIM_API_PRERELEASE false)
# Default to -O2 on release builds.
if(CMAKE_C_FLAGS_RELEASE MATCHES "-O3")
message(STATUS "Replacing -O3 in CMAKE_C_FLAGS_RELEASE with -O2")
string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
endif()
# 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. # We _want_ assertions in RelWithDebInfo build-type.
if(CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DNDEBUG) 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}")
@ -133,11 +156,9 @@ if(CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DNDEBUG)
string(REPLACE " " " " CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") # Remove duplicate whitespace string(REPLACE " " " " CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") # Remove duplicate whitespace
endif() endif()
option(LOG_LIST_ACTIONS "Add list actions logging" OFF)
option(ENABLE_ASAN_UBSAN "Enable Clang address & undefined behavior sanitizer for nvim binary." OFF) option(ENABLE_ASAN_UBSAN "Enable Clang address & undefined behavior sanitizer for nvim binary." OFF)
option(LOG_DEBUG "Enable debug log messages even in a release build" OFF)
option(ENABLE_MSAN "Enable Clang memory sanitizer for nvim binary." OFF) option(ENABLE_MSAN "Enable Clang memory sanitizer for nvim binary." OFF)
# TSAN exists to test Luv threads.
option(ENABLE_TSAN "Enable Clang thread sanitizer for nvim binary." OFF) option(ENABLE_TSAN "Enable Clang thread sanitizer for nvim binary." OFF)
if((ENABLE_ASAN_UBSAN AND ENABLE_MSAN) if((ENABLE_ASAN_UBSAN AND ENABLE_MSAN)
@ -146,12 +167,6 @@ if((ENABLE_ASAN_UBSAN AND ENABLE_MSAN)
message(FATAL_ERROR "Sanitizers cannot be enabled simultaneously") message(FATAL_ERROR "Sanitizers cannot be enabled simultaneously")
endif() endif()
if(ENABLE_ASAN_UBSAN OR ENABLE_MSAN OR ENABLE_TSAN)
if(NOT CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_C_COMPILER_ID MATCHES "GNU")
message(FATAL_ERROR "Sanitizers are only supported for Clang and GCC")
endif()
endif()
# Place targets in bin/ or lib/ for all build configurations # Place targets in bin/ or lib/ for all build configurations
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
@ -163,30 +178,14 @@ foreach(CFGNAME ${CMAKE_CONFIGURATION_TYPES})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFGNAME} ${CMAKE_BINARY_DIR}/lib) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFGNAME} ${CMAKE_BINARY_DIR}/lib)
endforeach() endforeach()
set(LUA_DEPENDENCIES lpeg mpack bit) if(NOT PREFER_LUA)
if(NOT LUA_PRG) find_program(LUA_PRG NAMES luajit)
foreach(CURRENT_LUA_PRG luajit lua5.1 lua5.2 lua)
unset(_CHECK_LUA_PRG CACHE)
unset(LUA_PRG_WORKS)
find_program(_CHECK_LUA_PRG ${CURRENT_LUA_PRG})
if(_CHECK_LUA_PRG)
check_lua_deps(${_CHECK_LUA_PRG} "${LUA_DEPENDENCIES}" LUA_PRG_WORKS)
if(LUA_PRG_WORKS)
set(LUA_PRG "${_CHECK_LUA_PRG}" CACHE FILEPATH "Path to a program.")
break()
endif()
endif()
endforeach()
unset(_CHECK_LUA_PRG CACHE)
else()
check_lua_deps(${LUA_PRG} "${LUA_DEPENDENCIES}" LUA_PRG_WORKS)
endif() endif()
find_program(LUA_PRG NAMES lua5.1 lua5.2 lua)
if(NOT LUA_PRG_WORKS) mark_as_advanced(LUA_PRG)
if(NOT LUA_PRG)
message(FATAL_ERROR "Failed to find a Lua 5.1-compatible interpreter") message(FATAL_ERROR "Failed to find a Lua 5.1-compatible interpreter")
endif() endif()
message(STATUS "Using Lua interpreter: ${LUA_PRG}") message(STATUS "Using Lua interpreter: ${LUA_PRG}")
# Some of the code generation still relies on stable table ordering in order to # Some of the code generation still relies on stable table ordering in order to
@ -197,11 +196,10 @@ message(STATUS "Using Lua interpreter: ${LUA_PRG}")
if(NOT LUA_GEN_PRG) if(NOT LUA_GEN_PRG)
set(LUA_GEN_PRG "${LUA_PRG}" CACHE FILEPATH "Path to the lua used for code generation.") set(LUA_GEN_PRG "${LUA_PRG}" CACHE FILEPATH "Path to the lua used for code generation.")
endif() endif()
mark_as_advanced(LUA_GEN_PRG)
message(STATUS "Using Lua interpreter for code generation: ${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) option(COMPILE_LUA "Pre-compile Lua sources into bytecode (for sources that are included in the binary)" ON)
if(COMPILE_LUA AND NOT WIN32) if(COMPILE_LUA AND NOT WIN32)
if(PREFER_LUA) if(PREFER_LUA)
foreach(CURRENT_LUAC_PRG luac5.1 luac) foreach(CURRENT_LUAC_PRG luac5.1 luac)
@ -218,35 +216,39 @@ if(COMPILE_LUA AND NOT WIN32)
endif() endif()
endif() endif()
endif() endif()
mark_as_advanced(LUAC_PRG)
if(LUAC_PRG) if(LUAC_PRG)
message(STATUS "Using Lua compiler: ${LUAC_PRG}") message(STATUS "Using Lua compiler: ${LUAC_PRG}")
endif() endif()
#
# Lint # Lint
# option(CI_LINT "Abort if lint programs not found" OFF)
find_program(LUACHECK_PRG luacheck) if(CI_LINT)
find_program(SHELLCHECK_PRG shellcheck) set(LINT_REQUIRED "REQUIRED")
find_program(STYLUA_PRG stylua) endif()
find_program(UNCRUSTIFY_PRG uncrustify) 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( add_glob_target(
REQUIRED
TARGET lintlua-luacheck TARGET lintlua-luacheck
COMMAND ${LUACHECK_PRG} COMMAND $<TARGET_FILE:nvim_bin>
FLAGS -q FLAGS -ll ${PROJECT_SOURCE_DIR}/test/lua_runner.lua ${CMAKE_BINARY_DIR}/usr luacheck -q
GLOB_DIRS runtime/ scripts/ src/ test/ GLOB_DIRS runtime scripts src test
GLOB_PAT *.lua GLOB_PAT *.lua
TOUCH_STRATEGY SINGLE) TOUCH_STRATEGY PER_DIR)
add_dependencies(lintlua-luacheck lua_dev_deps)
add_glob_target( add_glob_target(
TARGET lintlua-stylua TARGET lintlua-stylua
COMMAND ${STYLUA_PRG} COMMAND ${STYLUA_PRG}
FLAGS --color=always --check FLAGS --color=always --check --respect-ignores
GLOB_DIRS runtime/ GLOB_DIRS ${STYLUA_DIRS}
GLOB_PAT *.lua GLOB_PAT *.lua
TOUCH_STRATEGY SINGLE) TOUCH_STRATEGY PER_DIR)
add_custom_target(lintlua) add_custom_target(lintlua)
add_dependencies(lintlua lintlua-luacheck lintlua-stylua) add_dependencies(lintlua lintlua-luacheck lintlua-stylua)
@ -257,28 +259,23 @@ add_glob_target(
FLAGS -x -a FLAGS -x -a
GLOB_DIRS scripts GLOB_DIRS scripts
GLOB_PAT *.sh GLOB_PAT *.sh
EXCLUDE TOUCH_STRATEGY PER_DIR)
scripts/pvscheck.sh
TOUCH_STRATEGY SINGLE)
add_custom_target(lintcommit add_custom_target(lintcommit
COMMAND ${PROJECT_BINARY_DIR}/bin/nvim -u NONE -es -c [[lua require('scripts.lintcommit').main({trace=false})]] COMMAND $<TARGET_FILE:nvim_bin> -u NONE -l ${PROJECT_SOURCE_DIR}/scripts/lintcommit.lua main)
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} add_dependencies(lintcommit nvim_bin)
VERBATIM)
add_dependencies(lintcommit nvim)
add_custom_target(lint) add_custom_target(lint)
add_dependencies(lint clang-tidy lintc lintlua lintsh lintcommit) add_dependencies(lint lintc lintlua lintsh)
#
# Format # Format
# add_glob_target(
add_custom_target(formatlua TARGET formatlua
COMMAND ${CMAKE_COMMAND} COMMAND ${STYLUA_PRG}
-D FORMAT_PRG=${STYLUA_PRG} FLAGS --respect-ignores
-D LANG=lua GLOB_DIRS ${STYLUA_DIRS}
-P ${PROJECT_SOURCE_DIR}/cmake/Format.cmake GLOB_PAT *.lua
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) TOUCH_STRATEGY PER_DIR)
add_custom_target(format) add_custom_target(format)
add_dependencies(format formatc formatlua) add_dependencies(format formatc formatlua)
@ -287,21 +284,13 @@ install_helper(
FILES ${CMAKE_SOURCE_DIR}/src/man/nvim.1 FILES ${CMAKE_SOURCE_DIR}/src/man/nvim.1
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
if(EXISTS "${DEPS_PREFIX}/share/nvim-qt") add_custom_target(nvim ALL)
option(USE_BUNDLED_NVIMQT "Bundle neovim-qt" ON) add_dependencies(nvim nvim_bin nvim_runtime_deps nvim_runtime)
else()
option(USE_BUNDLED_NVIMQT "Bundle neovim-qt" OFF)
endif()
add_subdirectory(src/nvim) add_subdirectory(src/nvim)
add_subdirectory(cmake.config) add_subdirectory(cmake.config)
add_subdirectory(runtime) add_subdirectory(runtime)
add_subdirectory(test) add_subdirectory(test)
if(WIN32 AND USE_BUNDLED_NVIMQT)
install_helper(
FILES ${DEPS_PREFIX}/share/nvim-qt/runtime/plugin/nvim_gui_shim.vim
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim-qt/runtime/plugin)
endif()
add_custom_target(uninstall add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/cmake/UninstallHelper.cmake) COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/cmake/UninstallHelper.cmake)
@ -309,3 +298,60 @@ add_custom_target(uninstall
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(cmake.packaging) add_subdirectory(cmake.packaging)
endif() endif()
get_externalproject_options(uncrustify ${DEPS_IGNORE_SHA})
ExternalProject_Add(uncrustify
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
${EXTERNALPROJECT_OPTIONS})
option(USE_BUNDLED_BUSTED "Use bundled busted" ON)
if(USE_BUNDLED_BUSTED)
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
${EXTERNALPROJECT_OPTIONS})
else()
add_custom_target(lua_dev_deps)
endif()
if (CMAKE_SYSTEM_PROCESSOR MATCHES arm64)
set(LUALS_ARCH arm64)
else()
set(LUALS_ARCH x64)
endif()
set(LUALS_VERSION 3.13.9)
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", "name": "default",
"displayName": "RelWithDebInfo", "displayName": "RelWithDebInfo",
"description": "Enables optimizations (-Og or -O2) with debug information", "description": "Enables optimizations with debug information",
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo" "CMAKE_BUILD_TYPE": "RelWithDebInfo"
}, },
@ -19,7 +19,7 @@
{ {
"name": "debug", "name": "debug",
"displayName": "Debug", "displayName": "Debug",
"description": "Disables optimizations (-O0), enables debug information", "description": "No optimizations, enables debug information",
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug" "CMAKE_BUILD_TYPE": "Debug"
}, },
@ -28,71 +28,27 @@
{ {
"name": "release", "name": "release",
"displayName": "Release", "displayName": "Release",
"description": "Same as RelWithDebInfo, but disables debug information", "description": "Optimized for performance, disables debug information",
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Release" "CMAKE_BUILD_TYPE": "Release"
}, },
"inherits": ["base"] "inherits": ["base"]
}, },
{
"name": "windows-default",
"displayName": "Windows x64 RelWithDebInfo",
"description": "Sets Ninja generator, enables optimizations with debug information for x64",
"generator": "Ninja",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
},
"architecture": {
"value": "x64",
"strategy": "external"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": ["Windows"]
}
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
},
"inherits": ["base"]
},
{ {
"name": "iwyu", "name": "iwyu",
"displayName": "IWYU", "displayName": "IWYU",
"description": "Run include-what-you-use with the compiler", "description": "Run include-what-you-use",
"cacheVariables": { "cacheVariables": {
"ENABLE_IWYU": "ON" "ENABLE_IWYU": "ON"
}, },
"inherits": ["base"] "inherits": ["base"]
}
],
"buildPresets": [
{
"name": "default",
"configurePreset": "default"
}, },
{ {
"name": "debug", "name": "ci",
"configurePreset": "debug" "cacheVariables": {
}, "CI_BUILD": "ON"
{ },
"name": "release", "inherits": ["base"]
"configurePreset": "release"
},
{
"name": "windows-default",
"configurePreset": "windows-default",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "iwyu",
"configurePreset": "iwyu"
} }
] ]
} }

View File

@ -8,12 +8,11 @@ If you want to help but don't know where to start, here are some
low-risk/isolated tasks: low-risk/isolated tasks:
- Try a [complexity:low] issue. - Try a [complexity:low] issue.
- Fix bugs found by [Clang](#clang-scan-build), [PVS](#pvs-studio) or - Fix bugs found by [Coverity](#coverity).
[Coverity](#coverity).
- [Improve documentation](#documenting)
- [Merge a Vim patch] (requires strong familiarity with Vim) - [Merge a Vim patch] (requires strong familiarity with Vim)
- NOTE: read the above link before sending improvements to "runtime files" (anything in `runtime/`). - NOTE: read the above link before sending improvements to "runtime files" (anything in `runtime/`).
- Vimscript and documentation files are (mostly) maintained by [Vim](https://github.com/vim/vim), not Nvim. - Vimscript and documentation files are (mostly) maintained by [Vim], not Nvim.
- Nvim's [filetype detection](https://github.com/neovim/neovim/blob/master/runtime/lua/vim/filetype.lua) behavior matches Vim, so changes to filetype detection should be submitted to [Vim] first.
- Lua files are maintained by Nvim. - Lua files are maintained by Nvim.
Reporting problems Reporting problems
@ -23,29 +22,30 @@ Reporting problems
- [Search existing issues][github-issues] (including closed!) - [Search existing issues][github-issues] (including closed!)
- Update Neovim to the latest version to see if your problem persists. - Update Neovim to the latest version to see if your problem persists.
- Try to reproduce with `nvim --clean` ("factory defaults"). - Try to reproduce with `nvim --clean` ("factory defaults").
- If a specific configuration or plugin is necessary to recreate the problem, use the minimal template in `contrib/minimal.lua` with `nvim --clean -u contrib/minimal.lua` after making the necessary changes.
- [Bisect](https://neovim.io/doc/user/starting.html#bisect) your config: disable plugins incrementally, to narrow down the cause of the issue. - [Bisect](https://neovim.io/doc/user/starting.html#bisect) your config: disable plugins incrementally, to narrow down the cause of the issue.
- [Bisect][git-bisect] Neovim's source code to find the cause of a regression, if you can. This is _extremely_ helpful. - [Bisect][git-bisect] Neovim's source code to find the cause of a regression, if you can. This is _extremely_ helpful.
- When reporting a crash, [include a stacktrace](https://github.com/neovim/neovim/wiki/FAQ#backtrace-linux). - When reporting a crash, [include a stacktrace](https://neovim.io/doc/user/dev_tools.html#dev-tools-backtrace).
- Use [ASAN/UBSAN](#clang-sanitizers-asan-and-ubsan) to get detailed errors for segfaults and undefined behavior. - Use [ASAN/UBSAN](#sanitizers-asan-and-ubsan) to get detailed errors for segfaults and undefined behavior.
- Check the logs. `:edit $NVIM_LOG_FILE` - Check the logs. `:edit $NVIM_LOG_FILE`
- Include `cmake --system-information` for build-related issues. - Include `cmake --system-information` for build-related issues.
Developer guidelines Developer guidelines
-------------------- --------------------
- Read [:help dev](https://neovim.io/doc/user/develop.html#dev) if you are working on Nvim core. - Read [:help dev](https://neovim.io/doc/user/develop.html#dev) and [:help dev-doc][dev-doc-guide] if you are working on Nvim core.
- Read [:help dev-ui](https://neovim.io/doc/user/develop.html#dev-ui) if you are developing a UI. - Read [:help dev-ui](https://neovim.io/doc/user/develop.html#dev-ui) if you are developing a UI.
- Read [:help dev-api-client](https://neovim.io/doc/user/develop.html#dev-api-client) if you are developing an API client. - Read [:help dev-api-client](https://neovim.io/doc/user/develop.html#dev-api-client) if you are developing an API client.
- Install `ninja` for faster builds of Nvim. - Install `ninja` for faster builds of Nvim.
``` ```bash
sudo apt-get install ninja-build sudo apt-get install ninja-build
make distclean make distclean
make # Nvim build system uses ninja automatically, if available. make # Nvim build system uses ninja automatically, if available.
``` ```
- Install `ccache` for faster rebuilds of Nvim. Nvim will use it automatically - Install `ccache` or `sccache` for faster rebuilds of Nvim. Nvim will use one
if it's found. To disable caching use: 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) Pull requests (PRs)
@ -55,12 +55,8 @@ Pull requests (PRs)
- Your PR must include [test coverage][run-tests]. - Your PR must include [test coverage][run-tests].
- Avoid cosmetic changes to unrelated files in the same commit. - Avoid cosmetic changes to unrelated files in the same commit.
- Use a [feature branch][git-feature-branch] instead of the master branch. - Use a [feature branch][git-feature-branch] instead of the master branch.
- Use a _rebase workflow_ for small PRs. - Use a _rebase workflow_ for all PRs.
- After addressing review comments, it's fine to force-push. - After addressing review comments, it's fine to force-push.
- Use a _merge workflow_ (as opposed to "rebase") for big, high-risk PRs.
- Merge `master` into your PR when there are conflicts or when master
introduces breaking changes.
- Do not edit commits that come before the merge commit.
### Merging to master ### Merging to master
@ -87,33 +83,36 @@ a comment.
### Commit messages ### Commit messages
Follow the [conventional commits guidelines][conventional_commits] to *make reviews easier* and to make Follow the [conventional commits guidelines][conventional_commits] to *make reviews easier* and to make
the VCS/git logs more valuable. The general 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
<type>([optional scope]): <description>
[optional body] Problem:
...
[optional footer(s)] Solution:
``` ...
- Prefix the commit subject with one of these [_types_](https://github.com/commitizen/conventional-commit-types/blob/master/index.json): - Commit message **subject** (you can **ignore this for "fixup" commits** or any commits you expect to be squashed):
- `build`, `ci`, `docs`, `feat`, `fix`, `perf`, `refactor`, `revert`, `test`, `vim-patch` - Prefix with a [_type_](https://github.com/commitizen/conventional-commit-types/blob/master/index.json):
- You can **ignore this for "fixup" commits** or any commits you expect to be squashed. - `build ci docs feat fix perf refactor revert test vim-patch`
- Append optional scope to _type_ such as `(lsp)`, `(treesitter)`, `(float)`, … - Append an optional `(scope)` such as `(lsp)`, `(treesitter)`, `(float)`, …
- _Description_ shouldn't start with a capital letter or end in a period. - Use the _imperative voice_: "Fix bug" rather than "Fixed bug" or "Fixes bug."
- Use the _imperative voice_: "Fix bug" rather than "Fixed bug" or "Fixes bug." - Keep it short (under 72 characters).
- Try to keep the first line under 72 characters. - Commit message **body** (detail):
- A blank line must follow the subject. - Concisely describe the Problem/Solution in the commit **body**. [Describing the problem](https://lamport.azurewebsites.net/pubs/state-the-problem.pdf)
- Breaking API changes must be indicated by _independently of the solution_ often leads to a better understanding for you, reviewers, and future readers.
1. "!" after the type/scope, and ```
2. a "BREAKING CHANGE" footer describing the change. Problem:
Example:
```
refactor(provider)!: drop support for Python 2
BREAKING CHANGE: refactor to use Python 3 features since Python 2 is no longer supported. Solution:
``` ```
- Indicate breaking API changes with "!" after the type, and a "BREAKING CHANGE" footer. Example:
```
refactor(provider)!: drop support for Python 2
BREAKING CHANGE: refactor to use Python 3 features since Python 2 is no longer supported.
```
### Automated builds (CI) ### Automated builds (CI)
@ -124,48 +123,20 @@ Each pull request must pass the automated builds on [Cirrus CI] and [GitHub Acti
- If any tests fail, the build will fail. See [test/README.md#running-tests][run-tests] to run tests locally. - If any tests fail, the build will fail. See [test/README.md#running-tests][run-tests] to run tests locally.
- CI runs [ASan] and other analyzers. - CI runs [ASan] and other analyzers.
- To run valgrind locally: `VALGRIND=1 make test` - To run valgrind locally: `VALGRIND=1 make test`
- To run Clang ASan/UBSan locally: `CC=clang make CMAKE_FLAGS="-DENABLE_ASAN_UBSAN=ON"` - To run ASan/UBSan locally: `CC=clang make CMAKE_FLAGS="-DENABLE_ASAN_UBSAN=ON"`.
- The [lint](#lint) build checks modified lines _and their immediate Note that MSVC requires Release or RelWithDebInfo build type to work properly.
neighbors_, to encourage incrementally updating the legacy style to meet our - The [lint](#lint) build checks that the code is formatted correctly and
[style](#style). (See [#3174][3174] for background.) passes various linter checks.
- CI for FreeBSD runs on [Cirrus CI]. - CI for FreeBSD runs on [Cirrus CI].
- To see CI results faster in your PR, you can temporarily set `TEST_FILE` in - 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).
### Clang scan-build
View the [Clang report] to see potential bugs found by the Clang
[scan-build](https://clang-analyzer.llvm.org/scan-build.html) analyzer.
- Search the Neovim commit history to find examples:
```
git log --oneline --no-merges --grep clang
```
- To verify a fix locally, run `scan-build` like this:
```
rm -rf build/
scan-build --use-analyzer=/usr/bin/clang make
```
### PVS-Studio
View the [PVS report](https://neovim.io/doc/reports/pvs/PVS-studio.html.d/) to
see potential bugs found by [PVS Studio](https://www.viva64.com/en/pvs-studio/).
- Use this format for commit messages (where `{id}` is the PVS warning-id)):
```
fix(PVS/V{id}): {description}
```
- Search the Neovim commit history to find examples:
```
git log --oneline --no-merges --grep PVS
```
- Try `./scripts/pvscheck.sh` to run PVS locally.
### Coverity ### Coverity
[Coverity](https://scan.coverity.com/projects/neovim-neovim) runs against the Coverity runs against the master build. To view the defects you must
master build. To view the defects, just request access; you will be approved. [request access](https://scan.coverity.com/projects/neovim-neovim) (Coverity
does not have a "public" view), then you will be approved as soon as
a maintainer sees the email.
- Use this format for commit messages (where `{id}` is the CID (Coverity ID); - Use this format for commit messages (where `{id}` is the CID (Coverity ID);
([example](https://github.com/neovim/neovim/pull/804))): ([example](https://github.com/neovim/neovim/pull/804))):
@ -173,11 +144,11 @@ master build. To view the defects, just request access; you will be approved.
fix(coverity/{id}): {description} fix(coverity/{id}): {description}
``` ```
- Search the Neovim commit history to find examples: - Search the Neovim commit history to find examples:
``` ```bash
git log --oneline --no-merges --grep coverity git log --oneline --no-merges --grep coverity
``` ```
### Clang sanitizers (ASAN and UBSAN) ### Sanitizers (ASAN and UBSAN)
ASAN/UBSAN can be used to detect memory errors and other common forms of undefined behavior at runtime in debug builds. ASAN/UBSAN can be used to detect memory errors and other common forms of undefined behavior at runtime in debug builds.
@ -187,7 +158,7 @@ master build. To view the defects, just request access; you will be approved.
``` ```
- When running Neovim, use - When running Neovim, use
``` ```
UBSAN_OPTIONS=print_stacktrace=1 ASAN_OPTIONS=log_path=/tmp/nvim_asan,handle_abort=1,handle_sigill=1 nvim args... ASAN_OPTIONS=log_path=/tmp/nvim_asan nvim args...
``` ```
- If Neovim exits unexpectedly, check `/tmp/nvim_asan.{PID}` (or your preferred `log_path`) for log files with error messages. - If Neovim exits unexpectedly, check `/tmp/nvim_asan.{PID}` (or your preferred `log_path`) for log files with error messages.
@ -199,33 +170,27 @@ Coding
You can run the linter locally by: You can run the linter locally by:
make lint ```bash
make lint
The lint step downloads the [master error list] and excludes them, so only lint ```
errors related to the local changes are reported.
You can lint a single file (but this will _not_ exclude legacy errors):
./src/clint.py src/nvim/ops.c
### Style ### Style
- You can format files by using: - You can format files by using:
``` ```bash
make format make format # or formatc, formatlua
``` ```
This will format changed Lua and C files with all appropriate flags set. This will format changed Lua and C files with all appropriate flags set.
- Style rules are (mostly) defined by `src/uncrustify.cfg` which tries to match - Style rules are (mostly) defined by `src/uncrustify.cfg` which tries to match
the [style-guide]. To use the Nvim `gq` command with `uncrustify`: the [style-guide]. To use the Nvim `gq` command with `uncrustify`:
``` ```vim
if !empty(findfile('src/uncrustify.cfg', ';')) if !empty(findfile('src/uncrustify.cfg', ';'))
setlocal formatprg=uncrustify\ -q\ -l\ C\ -c\ src/uncrustify.cfg\ --no-backup setlocal formatprg=uncrustify\ -q\ -l\ C\ -c\ src/uncrustify.cfg\ --no-backup
endif endif
``` ```
The required version of `uncrustify` is specified in `uncrustify.cfg`.
- There is also `.clang-format` which has drifted from the [style-guide], but - There is also `.clang-format` which has drifted from the [style-guide], but
is available for reference. To use the Nvim `gq` command with `clang-format`: is available for reference. To use the Nvim `gq` command with `clang-format`:
``` ```vim
if !empty(findfile('.clang-format', ';')) if !empty(findfile('.clang-format', ';'))
setlocal formatprg=clang-format\ -style=file setlocal formatprg=clang-format\ -style=file
endif endif
@ -233,18 +198,14 @@ You can lint a single file (but this will _not_ exclude legacy errors):
### Navigate ### Navigate
- Set `blame.ignoreRevsFile` to ignore [noise commits](https://github.com/neovim/neovim/commit/2d240024acbd68c2d3f82bc72cb12b1a4928c6bf) in git blame: - Set `blame.ignoreRevsFile` to ignore [noisy commits](https://github.com/neovim/neovim/commit/2d240024acbd68c2d3f82bc72cb12b1a4928c6bf) in git blame:
``` ```bash
git config blame.ignoreRevsFile .git-blame-ignore-revs git config blame.ignoreRevsFile .git-blame-ignore-revs
``` ```
- Recommendation is to use **[clangd]**. - Recommendation is to use **[clangd]**.
Can use the maintained config in [nvim-lspconfig/clangd]. Can use the maintained config in [nvim-lspconfig/clangd].
- Explore the source code [on the web](https://sourcegraph.com/github.com/neovim/neovim). - Explore the source code [on the web](https://sourcegraph.com/github.com/neovim/neovim).
- If using [lua-language-server], symlink `contrib/luarc.json` into the
project root:
$ ln -s contrib/luarc.json .luarc.json
### Includes ### Includes
@ -252,63 +213,128 @@ For managing includes in C files, use [include-what-you-use].
- [Install include-what-you-use][include-what-you-use-install] - [Install include-what-you-use][include-what-you-use-install]
- To see which includes needs fixing use the cmake preset `iwyu`: - To see which includes needs fixing use the cmake preset `iwyu`:
``` ```bash
cmake --preset iwyu cmake --preset iwyu
cmake --build --preset iwyu cmake --build build
``` ```
- There's also a make target that automatically fixes the suggestions from - There's also a make target that automatically fixes the suggestions from
IWYU: IWYU:
``` ```bash
make iwyu make iwyu
``` ```
See [#549][549] for more details. See [#549][549] for more details.
Documenting ### Lua runtime files
-----------
Many parts of the `:help` documentation are autogenerated from C or Lua docstrings using the `./scripts/gen_vimdoc.py` script. Most of the Lua core [`runtime/`](./runtime) modules are precompiled to
You can filter the regeneration based on the target (api, lua, or lsp), or the file you changed, that need a doc refresh using `./scripts/gen_vimdoc.py -t <target>`. bytecode, so changes to those files won't get used unless you rebuild Nvim or
by passing `--luamod-dev` and `$VIMRUNTIME`. For example, try adding a function
to `runtime/lua/vim/_editor.lua` then:
## Lua docstrings ```bash
VIMRUNTIME=./runtime ./build/bin/nvim --luamod-dev
Lua documentation uses a subset of [EmmyLua] annotations. A rough outline of a function documentation is
```lua
--- {Brief}
---
--- {Long explanation}
---
---@param arg1 type {description}
---@param arg2 type {description}
{...}
---
---@return type {description}
``` ```
If possible, always add type information (`table`, `string`, `number`, ...). Multiple valid types are separated by a bar (`string|table`). Indicate optional parameters via `type|nil`. Documentation
-------------
If a function in your Lua module should not be documented (e.g. internal function or local function), you should set the doc comment to: Read [:help dev-doc][dev-doc-guide] to understand the expected documentation style and conventions.
``` ### Generating :help
---@private
Many `:help` docs are autogenerated from (C or Lua) docstrings. To generate the documentation run:
```bash
make doc
``` ```
Mark functions that are deprecated as To validate the documentation files, run:
```bash
make lintdoc
``` ```
---@deprecated
If you need to modify or debug the documentation flow, these are the main files:
- `./src/gen/gen_vimdoc.lua`:
Main doc generator. Parses C and Lua files to render vimdoc files.
- `./src/gen/luacats_parser.lua`:
Documentation parser for Lua files.
- `./src/gen/cdoc_parser.lua`:
Documentation parser for C files.
- `./src/gen/luacats_grammar.lua`:
Lpeg grammar for LuaCATS
- `./src/gen/cdoc_grammar.lua`:
Lpeg grammar for C doc comments
- `./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/options.lua => runtime/doc/options.txt
```
- `./scripts/lintdoc.lua`: Validation and linting of documentation files.
### Lua docstrings
Use [LuaLS] annotations in Lua docstrings to annotate parameter types, return
types, etc. See [:help dev-lua-doc][dev-lua-doc].
- The template for function documentation is:
```lua
--- {Brief}
---
--- {Long explanation}
---
--- @param arg1 type {description}
--- @param arg2 type {description}
--- ...
---
--- @return type {description}
```
- 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").
- Mark deprecated functions with `@deprecated`.
Third-party dependencies
------------------------
To build Nvim using a different commit of a dependency change the appropriate
URL in `cmake.deps/deps.txt`. For example, to use a different version of luajit
replace the value in `LUAJIT_URL` with the wanted commit hash:
```bash
LUAJIT_URL https://github.com/LuaJIT/LuaJIT/archive/<sha>.tar.gz
```
Set `DEPS_IGNORE_SHA` to `TRUE` in `cmake.deps/CMakeLists.txt` to skip hash
check from cmake.
Alternatively, you may point the URL as a local path where the repository is.
This is convenient when bisecting a problem in a dependency with `git bisect`.
This may require running `make distclean` between each build. Hash checking is
always skipped in this case regardless of `DEPS_IGNORE_SHA`.
```bash
LUAJIT_URL /home/user/luajit
``` ```
Reviewing Reviewing
--------- ---------
To help review pull requests, start with [this checklist][review-checklist].
Reviewing can be done on GitHub, but you may find it easier to do locally. Reviewing can be done on GitHub, but you may find it easier to do locally.
Using [GitHub CLI][gh], you can create a new branch with the contents of a pull Using [GitHub CLI][gh], you can create a new branch with the contents of a pull
request, e.g. [#1820][1820]: request, e.g. [#1820][1820]:
gh pr checkout https://github.com/neovim/neovim/pull/1820 ```bash
gh pr checkout https://github.com/neovim/neovim/pull/1820
```
Use [`git log -p master..FETCH_HEAD`][git-history-filtering] to list all Use [`git log -p master..FETCH_HEAD`][git-history-filtering] to list all
commits in the feature branch which aren't in the `master` branch; `-p` commits in the feature branch which aren't in the `master` branch; `-p`
@ -322,29 +348,26 @@ as context, use the `-W` argument as well.
[Cirrus CI]: https://cirrus-ci.com/github/neovim/neovim [Cirrus CI]: https://cirrus-ci.com/github/neovim/neovim
[Clang report]: https://neovim.io/doc/reports/clang/ [Clang report]: https://neovim.io/doc/reports/clang/
[GitHub Actions]: https://github.com/neovim/neovim/actions [GitHub Actions]: https://github.com/neovim/neovim/actions
[Vim]: https://github.com/vim/vim
[clangd]: https://clangd.llvm.org [clangd]: https://clangd.llvm.org
[Merge a Vim patch]: https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-Vim [Merge a Vim patch]: https://neovim.io/doc/user/dev_vimpatch.html
[complexity:low]: https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aissue+label%3Acomplexity%3Alow [complexity:low]: https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aissue+label%3Acomplexity%3Alow
[conventional_commits]: https://www.conventionalcommits.org [conventional_commits]: https://www.conventionalcommits.org
[EmmyLua]: https://github.com/sumneko/lua-language-server/wiki/Annotations [dev-doc-guide]: https://neovim.io/doc/user/develop.html#dev-doc
[dev-lua-doc]: https://neovim.io/doc/user/develop.html#dev-lua-doc
[LuaLS]: https://luals.github.io/wiki/annotations/
[gcc-warnings]: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html [gcc-warnings]: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
[gh]: https://cli.github.com/ [gh]: https://cli.github.com/
[git-bisect]: http://git-scm.com/book/en/v2/Git-Tools-Debugging-with-Git [git-bisect]: http://git-scm.com/book/en/v2/Git-Tools-Debugging-with-Git
[git-feature-branch]: https://www.atlassian.com/git/tutorials/comparing-workflows [git-feature-branch]: https://www.atlassian.com/git/tutorials/comparing-workflows
[git-history-filtering]: https://www.atlassian.com/git/tutorials/git-log/filtering-the-commit-history [git-history-filtering]: https://www.atlassian.com/git/tutorials/git-log/filtering-the-commit-history
[git-history-rewriting]: http://git-scm.com/book/en/v2/Git-Tools-Rewriting-History
[git-rebasing]: http://git-scm.com/book/en/v2/Git-Branching-Rebasing
[github-issues]: https://github.com/neovim/neovim/issues [github-issues]: https://github.com/neovim/neovim/issues
[include-what-you-use-install]: https://github.com/include-what-you-use/include-what-you-use#how-to-install [include-what-you-use-install]: https://github.com/include-what-you-use/include-what-you-use#how-to-install
[include-what-you-use]: https://github.com/include-what-you-use/include-what-you-use#using-with-cmake [include-what-you-use]: https://github.com/include-what-you-use/include-what-you-use#using-with-cmake
[lua-language-server]: https://github.com/sumneko/lua-language-server/ [lua-language-server]: https://github.com/sumneko/lua-language-server/
[master error list]: https://raw.githubusercontent.com/neovim/doc/gh-pages/reports/clint/errors.json
[nvim-lspconfig/clangd]: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#clangd [nvim-lspconfig/clangd]: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#clangd
[pr-draft]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request [pr-draft]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request
[pr-ready]: https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request [pr-ready]: https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request
[review-checklist]: https://github.com/neovim/neovim/wiki/Code-review-checklist
[run-tests]: https://github.com/neovim/neovim/blob/master/test/README.md#running-tests [run-tests]: https://github.com/neovim/neovim/blob/master/test/README.md#running-tests
[style-guide]: https://neovim.io/doc/user/dev_style.html#dev-style [style-guide]: https://neovim.io/doc/user/dev_style.html#dev-style
[uncrustify]: http://uncrustify.sourceforge.net/ [wiki-faq]: https://neovim.io/doc/user/faq.html
[wiki-contribute-help]: https://github.com/neovim/neovim/wiki/contribute-%3Ahelp
[wiki-faq]: https://github.com/neovim/neovim/wiki/FAQ

426
INSTALL.md Normal file
View File

@ -0,0 +1,426 @@
You can install Neovim from [download](#install-from-download), [package](#install-from-package), or [source](#install-from-source) in just a few seconds.
---
- To start Neovim, run `nvim` (not `neovim`).
- [Discover plugins](https://github.com/neovim/neovim/wiki/Related-projects#plugins).
- Before upgrading to a new version, **check [Breaking Changes](https://neovim.io/doc/user/news.html#news-breaking).**
- For config (vimrc) see [the FAQ](https://neovim.io/doc/user/faq.html#faq-general).
---
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_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)
Install from package
====================
Packages are listed below. (You can also [build Neovim from source](#install-from-source).)
## Windows
Windows 8+ is required. Windows 7 or older is not supported.
### [Winget](https://docs.microsoft.com/en-us/windows/package-manager/winget/)
- **Release:** `winget install Neovim.Neovim`
### [Chocolatey](https://chocolatey.org)
- **Latest Release:** `choco install neovim` (use -y for automatically skipping confirmation messages)
- **Development (pre-release):** `choco install neovim --pre`
### [Scoop](https://scoop.sh/)
```
scoop bucket add main
scoop install neovim
```
- **Release:** `scoop install neovim`
Several Neovim GUIs are available from scoop (extras): [scoop.sh/#/apps?q=neovim](https://scoop.sh/#/apps?q=neovim)
### Pre-built archives
0. If you are missing `VCRUNTIME140.dll`, install the [Visual Studio 2015 C++ redistributable](https://support.microsoft.com/en-us/kb/2977003) (choose x86_64 or x86 depending on your system).
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. 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` from anywhere.
- If `:set spell` does not work, create the `C:/Users/foo/AppData/Local/nvim/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'
```
- Run `:checkhealth` and read `:help provider-python`.
- **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.
## macOS / OS X
### Pre-built archives
The [Releases](https://github.com/neovim/neovim/releases) page provides pre-built binaries for macOS 10.15+.
For x86_64:
curl -LO https://github.com/neovim/neovim/releases/download/nightly/nvim-macos-x86_64.tar.gz
tar xzf nvim-macos-x86_64.tar.gz
./nvim-macos-x86_64/bin/nvim
For arm64:
curl -LO https://github.com/neovim/neovim/releases/download/nightly/nvim-macos-arm64.tar.gz
tar xzf nvim-macos-arm64.tar.gz
./nvim-macos-arm64/bin/nvim
### [Homebrew](https://brew.sh) on macOS or Linux
brew install neovim
### [MacPorts](https://www.macports.org/)
sudo port selfupdate
sudo port install neovim
## Linux
### Pre-built archives
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-linux-x86_64.tar.gz
sudo rm -rf /opt/nvim
sudo tar -C /opt -xzf nvim-linux-x86_64.tar.gz
```
Then add this to your shell config (`~/.bashrc`, `~/.zshrc`, ...):
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-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-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-linux-x86_64.appimage /opt/nvim/nvim
And the following line to your shell config (`~/.bashrc`, `~/.zshrc`, ...):
export PATH="$PATH:/opt/nvim/"
If the `./nvim-linux-x86_64.appimage` command fails, try:
```sh
./nvim-linux-x86_64.appimage --appimage-extract
./squashfs-root/AppRun --version
# Optional: exposing nvim globally.
sudo mv squashfs-root /
sudo ln -s /squashfs-root/AppRun /usr/bin/nvim
nvim
```
### Arch Linux
Neovim can be installed from the community repository:
sudo pacman -S neovim
Alternatively, Neovim can be also installed using the PKGBUILD [`neovim-git`](https://aur.archlinux.org/packages/neovim-git), available on the [AUR](https://wiki.archlinux.org/index.php/Arch_User_Repository).
Alternatively, Neovim Nightly builds can be also installed using the PKGBUILD [`neovim-nightly-bin`](https://aur.archlinux.org/packages/neovim-nightly-bin), available on the [AUR](https://wiki.archlinux.org/index.php/Arch_User_Repository).
The Python module is available from the community repository:
sudo pacman -S python-pynvim
Ruby modules (currently only supported in `neovim-git`) are available from the AUR as [`ruby-neovim`](https://aur.archlinux.org/packages/ruby-neovim).
### CentOS 8 / RHEL 8
Neovim is available through [EPEL (Extra Packages for Enterprise Linux)](https://fedoraproject.org/wiki/EPEL)
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
yum install -y neovim python3-neovim
### Clear Linux OS
Neovim is available through the [neovim bundle](https://github.com/clearlinux/clr-bundles/blob/master/bundles/neovim)
sudo swupd bundle-add neovim
Python (`:python`) support is available if the [python-basic bundle](https://github.com/clearlinux/clr-bundles/blob/master/bundles/python-basic) is installed.
sudo swupd bundle-add python-basic
### Debian
Neovim is in [Debian](https://packages.debian.org/search?keywords=neovim).
sudo apt-get install neovim
Python (`:python`) support is installable via the package manager on Debian unstable.
sudo apt-get install python3-neovim
### Exherbo Linux
Exhereses for scm and released versions are currently available in repository `::medvid`. Python client (with GTK+ GUI included) and Qt5 GUI are also available as suggestions:
cave resolve app-editors/neovim --take dev-python/neovim-python --take app-editors/neovim-qt
### Fedora
Neovim is in [Fedora](https://src.fedoraproject.org/rpms/neovim) starting with Fedora 25:
sudo dnf install -y neovim python3-neovim
You can also get nightly builds of git master from the [Copr automated build system](https://copr.fedoraproject.org/coprs/agriffis/neovim-nightly/):
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.
### Flatpak
You can find Neovim on [Flathub](https://flathub.org/apps/details/io.neovim.nvim). Providing you have Flatpak [set up](https://flatpak.org/setup/):
flatpak install flathub io.neovim.nvim
flatpak run io.neovim.nvim
You can add `/var/lib/flatpak/exports/bin` (or `~/.local/share/flatpak/exports/bin` if you used `--user`) to the `$PATH` and run it with `io.neovim.nvim`.
Note that Flatpak'ed Neovim will look for `init.vim` in `~/.var/app/io.neovim.nvim/config/nvim` instead of `~/.config/nvim`.
### Gentoo Linux
An ebuild is available in Gentoo's official portage repository:
emerge -a app-editors/neovim
### GNU Guix
Neovim can be installed with:
guix install neovim
### GoboLinux
Neovim can be installed with:
sudo -H Compile NeoVim
### Nix / NixOS
Neovim can be installed with:
nix-env -iA nixpkgs.neovim
Or alternatively, if you use flakes:
nix profile install nixpkgs#neovim
### Mageia 7
urpmi neovim
To install the Python modules:
urpmi python3-pynvim
### makedeb Package Repository (MPR)
Neovim is available inside the [MPR](https://mpr.makedeb.org/packages/neovim). You can install it with:
git clone https://mpr.makedeb.org/neovim
cd neovim/
makedeb -si
### OpenSUSE
Neovim can be installed with:
sudo zypper in neovim
To install the Python modules:
sudo zypper in python-neovim python3-neovim
### PLD Linux
Neovim is in [PLD Linux](https://github.com/pld-linux/neovim):
poldek -u neovim
poldek -u python-neovim python3-neovim
poldek -u python-neovim-gui python3-neovim-gui
### Slackware
See [neovim on SlackBuilds](https://slackbuilds.org/apps/neovim/).
### Source Mage
Neovim can be installed using the Sorcery package manager:
cast neovim
### Solus
Neovim can be installed using the default package manager in Solus (eopkg):
sudo eopkg install neovim
### Snap
Neovim nightly and stable are available on the [snap store](https://snapcraft.io/nvim).
**Stable Builds**
```sh
sudo snap install nvim --classic
```
**Nightly Builds**
```sh
sudo snap install --edge nvim --classic
```
### Ubuntu
As in Debian, Neovim is in [Ubuntu](https://packages.ubuntu.com/search?keywords=neovim).
sudo apt install neovim
Python (`:python`) support seems to be automatically installed
sudo apt install python3-neovim
Neovim has been added to a "Personal Package Archive" (PPA). This allows you to install it with `apt-get`. Follow the links to the PPAs to see which versions of Ubuntu are currently available via the PPA. Choose **stable** or **unstable**:
- [https://launchpad.net/~neovim-ppa/+archive/ubuntu/**stable**](https://launchpad.net/~neovim-ppa/+archive/ubuntu/stable)
- [https://launchpad.net/~neovim-ppa/+archive/ubuntu/**unstable**](https://launchpad.net/~neovim-ppa/+archive/ubuntu/unstable)
**Important:** The Neovim team does not maintain the PPA packages. For problems or questions about the PPA specifically contact https://launchpad.net/~neovim-ppa.
To be able to use **add-apt-repository** you may need to install software-properties-common:
sudo apt-get install software-properties-common
If you're using an older version Ubuntu you must use:
sudo apt-get install python-software-properties
Run the following commands:
sudo add-apt-repository ppa:neovim-ppa/stable
sudo apt-get update
sudo apt-get install neovim
Prerequisites for the Python modules:
sudo apt-get install python-dev python-pip python3-dev python3-pip
If you're using an older version Ubuntu you must use:
sudo apt-get install python-dev python-pip python3-dev
sudo apt-get install python3-setuptools
sudo easy_install3 pip
### Void-Linux
Neovim can be installed using the xbps package manager
sudo xbps-install -S neovim
### Alpine Linux
Neovim can be installed using the apk package manager
sudo apk add neovim
## BSD
### FreeBSD
Neovim can be installed using [`pkg(8)`](https://www.freebsd.org/cgi/man.cgi?query=pkg&sektion=8&n=1):
pkg install neovim
or [from the ports tree](https://www.freshports.org/editors/neovim/):
cd /usr/ports/editors/neovim/ && make install clean
To install the pynvim Python modules using [`pkg(8)`](https://www.freebsd.org/cgi/man.cgi?query=pkg&sektion=8&n=1) run:
pkg install py36-pynvim
### OpenBSD
Neovim can be installed using [`pkg_add(1)`](https://man.openbsd.org/pkg_add):
pkg_add neovim
or [from the ports tree](https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/editors/neovim/):
cd /usr/ports/editors/neovim/ && make install
## Android
[Termux](https://github.com/termux/termux-app) offers a Neovim package.
Install from source
===================
If a package is not provided for your platform, you can build Neovim from source. See [BUILD.md](./BUILD.md) for details. If you have the [prerequisites](./BUILD.md#build-prerequisites) then building is easy:
make CMAKE_BUILD_TYPE=Release
sudo make install
For Unix-like systems this installs Neovim to `/usr/local`, while for Windows to `C:\Program Files`. Note, however, that this can complicate uninstallation. The following example avoids this by isolating an installation under `$HOME/neovim`:
rm -r build/ # clear the CMake cache
make CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=$HOME/neovim"
make install
export PATH="$HOME/neovim/bin:$PATH"
## Uninstall
There is a CMake target to _uninstall_ after `make install`:
```sh
sudo cmake --build build/ --target uninstall
```
Alternatively, just delete the `CMAKE_INSTALL_PREFIX` artifacts:
```sh
sudo rm /usr/local/bin/nvim
sudo rm -r /usr/local/share/nvim/
```

View File

@ -233,8 +233,8 @@ II) It is allowed to distribute a modified (or extended) version of Vim,
maintainer will do with your changes and under what license they maintainer will do with your changes and under what license they
will be distributed is negotiable. If there has been no negotiation will be distributed is negotiable. If there has been no negotiation
then this license, or a later version, also applies to your changes. then this license, or a later version, also applies to your changes.
The current maintainer is Bram Moolenaar <Bram@vim.org>. If this The current maintainers are listed here: https://github.com/orgs/vim/people.
changes it will be announced in appropriate places (most likely If this changes it will be announced in appropriate places (most likely
vim.sf.net, www.vim.org and/or comp.editors). When it is completely vim.sf.net, www.vim.org and/or comp.editors). When it is completely
impossible to contact the maintainer, the obligation to send him impossible to contact the maintainer, the obligation to send him
your changes ceases. Once the maintainer has confirmed that he has your changes ceases. Once the maintainer has confirmed that he has

View File

@ -22,10 +22,10 @@ In practice we haven't found a way to forecast more precisely than "next" and
* Next feature-release (1.x.0) * Next feature-release (1.x.0)
The forecasting problem might be solved with an explicit priority system (like The forecasting problem might be solved with an explicit priority system (like
Bram's todo.txt). Meanwhile the Neovim priority system is defined by: Vim's todo.txt). Meanwhile the Neovim priority system is defined by:
* PRs nearing completion. * PRs nearing completion.
* Issue labels. E.g. the `+plan` label increases the ticket's priority merely * Issue labels. E.g. the `has:plan` label increases the ticket's priority merely
for having a plan written down: it is _closer to completion_ than tickets for having a plan written down: it is _closer to completion_ than tickets
without a plan. without a plan.
* Comment activity or new information. * Comment activity or new information.
@ -50,20 +50,78 @@ has a major bug:
1. Fix the bug on `master`. 1. Fix the bug on `master`.
2. Cherry-pick the fix to `release-x.y`. 2. Cherry-pick the fix to `release-x.y`.
3. Cut a release from `release-x.y`. 3. Cut a release from `release-x.y`.
* Run `./scripts/release.sh` * Run `./scripts/release.sh` (requires [git cliff](https://github.com/orhun/git-cliff))
* Update (force-push) the remote `stable` tag.
* The [CI job](https://github.com/neovim/neovim/blob/3d45706478cd030c3ee05b4f336164bb96138095/.github/workflows/release.yml#L11-L13) * The [CI job](https://github.com/neovim/neovim/blob/3d45706478cd030c3ee05b4f336164bb96138095/.github/workflows/release.yml#L11-L13)
will update the release assets and force-push to the `stable` tag. will update the release assets and [force-push to the "stable" tag](https://github.com/neovim/neovim/blob/cdd87222c86c5b2274a13d36f23de0637462e317/.github/workflows/release.yml#L229).
### Release automation ### Release automation
Neovim automation includes a [backport bot](https://github.com/zeebe-io/backport-action). Neovim automation includes a [backport bot](https://github.com/korthout/backport-action).
Trigger the action by labeling a PR with `backport release-X.Y`. See `.github/workflows/backport.yml`. Trigger the action by labeling a PR with `ci:backport release-x.y`. See `.github/workflows/backport.yml`.
Deprecating and removing features
---------------------------------
Neovim inherits many features and design decisions from Vim, not all of which
align with the goals of this project. It is sometimes desired or necessary to
remove existing features, or refactor parts of the code that would change
user's workflow. In these cases, a deprecation policy is needed to properly
inform users of the change.
When a (non-experimental) feature is slated to be removed it should:
1. Be _soft_ deprecated in the _next_ release
- Use of the deprecated feature will still work.
- This means deprecating via documentation and annotation (`@deprecated`).
- Include a note in `deprecated.txt`.
- For Lua features, use `vim.deprecate()`. The specified version is the
current minor version + 2. For example, if the current version is
`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.
- `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 following a 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.
3. Be removed in a release following the release in which it was hard deprecated
- Usually this will be the next release, but it may be a later release if
a longer deprecation cycle is desired
- If possible, keep the feature as a stub (e.g. function API) and issue an
error when it is accessed.
Example:
Deprecation Removal
┆ ┆ ┆
┆ Soft ┆ Hard ┆
┆ Deprecation ┆ Deprecation ┆
┆ Period ┆ Period ┆
────────────────────────────────────────────────────────────
Version: 0.10 0.11 0.12
────────────────────────────────────────────────────────────
Old code Old code Old code
+ +
New code New code New code
Feature removals which may benefit from community input or further discussion
should also have a tracking issue (which should be linked to in the release
notes).
Exceptions to this policy may be made (for experimental subsystems or when
there is broad consensus among maintainers). The rationale for the exception
should be stated explicitly and publicly.
Third-party dependencies Third-party dependencies
------------------------ ------------------------
These "bundled" dependencies can be updated by bumping their versions in `cmake.deps/CMakeLists.txt`. For some dependencies we maintain temporary "forks", which are simply private
branches with a few extra patches, while we wait for the upstream project to
merge the patches. This is done instead of maintaining the patches as (fragile)
CMake `PATCH_COMMAND` steps.
These "bundled" dependencies can be updated by bumping their versions in `cmake.deps/deps.txt`.
Some can be auto-bumped by `scripts/bump_deps.lua`. Some can be auto-bumped by `scripts/bump_deps.lua`.
* [LuaJIT](https://github.com/LuaJIT/LuaJIT) * [LuaJIT](https://github.com/LuaJIT/LuaJIT)
@ -72,14 +130,12 @@ Some can be auto-bumped by `scripts/bump_deps.lua`.
* 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 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).
* [gettext](https://ftp.gnu.org/pub/gnu/gettext/) * [gettext](https://ftp.gnu.org/pub/gnu/gettext/)
* [libiconv](https://ftp.gnu.org/pub/gnu/libiconv) * [libiconv](https://ftp.gnu.org/pub/gnu/libiconv)
* [libtermkey](https://github.com/neovim/libtermkey)
* [libuv](https://github.com/libuv/libuv) * [libuv](https://github.com/libuv/libuv)
* [libvterm](http://www.leonerd.org.uk/code/libvterm/)
* [lua-compat](https://github.com/keplerproject/lua-compat-5.3) * [lua-compat](https://github.com/keplerproject/lua-compat-5.3)
* [msys2](https://github.com/msys2/MINGW-packages) (for mingw Windows build)
* Changes to mingw can [break our mingw build](https://github.com/msys2/MINGW-packages/issues/9946).
* [tree-sitter](https://github.com/tree-sitter/tree-sitter) * [tree-sitter](https://github.com/tree-sitter/tree-sitter)
* [unibilium](https://github.com/neovim/unibilium) * [unibilium](https://github.com/neovim/unibilium)
* The original project [was abandoned](https://github.com/neovim/neovim/issues/10302), so the [neovim/unibilium](https://github.com/neovim/unibilium) fork is considered "upstream" and is maintained on the `master` branch.
* [treesitter parsers](https://github.com/neovim/neovim/blob/7e97c773e3ba78fcddbb2a0b9b0d572c8210c83e/cmake.deps/deps.txt#L47-L62)
### Vendored dependencies ### Vendored dependencies
@ -87,52 +143,102 @@ These dependencies are "vendored" (inlined), we must update the sources manually
* `src/mpack/`: [libmpack](https://github.com/libmpack/libmpack) * `src/mpack/`: [libmpack](https://github.com/libmpack/libmpack)
* send improvements upstream! * 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/xdiff/`: [xdiff](https://github.com/git/git/tree/master/xdiff)
* `src/cjson/`: [lua-cjson](https://github.com/openresty/lua-cjson) * `src/cjson/`: [lua-cjson](https://github.com/openresty/lua-cjson)
* `src/nvim/lib/`: [Klib](https://github.com/attractivechaos/klib) * `src/klib/`: [Klib](https://github.com/attractivechaos/klib)
* `runtime/lua/vim/inspect.lua`: [inspect.lua](https://github.com/kikito/inspect.lua) * `runtime/lua/vim/inspect.lua`: [inspect.lua](https://github.com/kikito/inspect.lua)
* `src/nvim/tui/terminfo_defs.h`: terminfo definitions * `src/nvim/tui/terminfo_defs.h`: terminfo definitions
* Run `scripts/update_terminfo.sh` to update these 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.
* `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.
* `runtime/lua/vim/re.lua`: LPeg regex module.
* Vendored from LPeg. Needs to be updated when LPeg is updated.
* `runtime/lua/vim/_meta/re.lua`: docs for LPeg regex module.
* 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/ * `src/bit.c`: only for PUC lua: port of `require'bit'` from luajit https://bitop.luajit.org/
* [treesitter parsers](https://github.com/neovim/neovim/blob/fcc24e43e0b5f9d801a01ff2b8f78ce8c16dd551/cmake.deps/CMakeLists.txt#L197-L210) * `runtime/lua/coxpcall.lua`: coxpcall (only needed for PUC lua, builtin to luajit)
### Forks Other dependencies
--------------------------
We may maintain forks, if we are waiting on upstream changes: https://github.com/neovim/neovim/wiki/Deps * GitHub users:
* https://github.com/marvim
* 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
* packspec.org
* pkgjson.org
* DNS for the above domains is managed in https://cloudflare.com (not the domain registrar)
CI
--------------
### General Refactoring
-----------
As our CI is primarily dependent on GitHub Actions at the moment, then so will ### Frozen legacy modules
our CI strategy be. The following guidelines have worked well for us so far:
* Never use a macOS runner if an Ubuntu or a Windows runner can be used Refactoring Vim structurally and aesthetically is an important goal of Neovim.
instead. This is because macOS runners have a [tighter restrictions on the But there are some modules that should not be changed significantly, because
number of concurrent jobs](https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#usage-limits). 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:
### Runner versions - `regexp.c`
- `indent_c.c`
* For special-purpose jobs where the runner version doesn't really matter, Automation (CI)
prefer `-latest` tags so we don't need to manually bump the versions. An ---------------
example of a special-purpose workflow is `labeler.yml`.
* For our testing jobs, which are in `test.yml` and `build.yml`, prefer to use ### Backup
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 automatic
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 Discussions from issues and PRs are backed up here:
(i.e. non-deprecated) versions available. The reason is that we're trying to https://github.com/neovim/neovim-backup
produce images that work in the broadest number of environments, and
therefore want to use older releases. ### Development guidelines
* CI and automation jobs are primarily driven by GitHub Actions.
* Avoid macOS if an Ubuntu or a Windows runner can be used instead. This is
because macOS runners have [tighter restrictions on the number of concurrent
jobs](https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#usage-limits).
* Runner versions:
* 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 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,
and therefore want to use older releases.
### Special labels
Some github labels are used to trigger certain jobs:
* `ci:backport release-x.y` - backport to branch `release-x.y`
* `ci:s390x` - enable s390x CI
* `ci:skip-news` - skip news.yml workflows
* `ci:windows-asan` - test windows with ASAN enabled
* `needs:response` - close PR after a certain amount of time if author doesn't
respond
See also See also
-------- --------
* https://github.com/neovim/neovim/issues/862 * 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

140
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_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
MAKEFILE_DIR := $(dir $(MAKEFILE_PATH)) MAKEFILE_DIR := $(dir $(MAKEFILE_PATH))
@ -9,8 +41,6 @@ filter-true = $(strip $(filter-out 1 on ON true TRUE,$1))
all: nvim all: nvim
CMAKE_PRG ?= $(shell (command -v cmake3 || echo cmake))
CMAKE_BUILD_TYPE ?= Debug
CMAKE_FLAGS := -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) CMAKE_FLAGS := -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE)
# Extra CMake flags which extend the default set # Extra CMake flags which extend the default set
CMAKE_EXTRA_FLAGS ?= CMAKE_EXTRA_FLAGS ?=
@ -28,7 +58,7 @@ override CMAKE_EXTRA_FLAGS += -DCMAKE_INSTALL_PREFIX=$(CMAKE_INSTALL_PREFIX)
checkprefix: checkprefix:
@if [ -f build/.ran-cmake ]; then \ @if [ -f build/.ran-cmake ]; then \
cached_prefix=$(shell $(CMAKE_PRG) -L -N build | 2>/dev/null grep 'CMAKE_INSTALL_PREFIX' | cut -d '=' -f2); \ cached_prefix=$(shell $(CMAKE) -L -N build | 2>/dev/null grep 'CMAKE_INSTALL_PREFIX' | cut -d '=' -f2); \
if ! [ "$(CMAKE_INSTALL_PREFIX)" = "$$cached_prefix" ]; then \ if ! [ "$(CMAKE_INSTALL_PREFIX)" = "$$cached_prefix" ]; then \
printf "Re-running CMake: CMAKE_INSTALL_PREFIX '$(CMAKE_INSTALL_PREFIX)' does not match cached value '%s'.\n" "$$cached_prefix"; \ printf "Re-running CMake: CMAKE_INSTALL_PREFIX '$(CMAKE_INSTALL_PREFIX)' does not match cached value '%s'.\n" "$$cached_prefix"; \
$(RM) build/.ran-cmake; \ $(RM) build/.ran-cmake; \
@ -38,32 +68,11 @@ else
checkprefix: ; checkprefix: ;
endif endif
CMAKE_GENERATOR ?= $(shell (command -v ninja > /dev/null 2>&1 && echo "Ninja") || \ DEPS_BUILD_DIR ?= ".deps"
echo "Unix Makefiles")
DEPS_BUILD_DIR ?= .deps
ifneq (1,$(words [$(DEPS_BUILD_DIR)])) ifneq (1,$(words [$(DEPS_BUILD_DIR)]))
$(error DEPS_BUILD_DIR must not contain whitespace) $(error DEPS_BUILD_DIR must not contain whitespace)
endif endif
ifeq (,$(BUILD_TOOL))
ifeq (Ninja,$(CMAKE_GENERATOR))
BUILD_TOOL = ninja
else
BUILD_TOOL = $(MAKE)
endif
endif
# Only need to handle Ninja here. Make will inherit the VERBOSE variable, and the -j, -l, and -n flags.
ifeq ($(CMAKE_GENERATOR),Ninja)
ifneq ($(VERBOSE),)
BUILD_TOOL += -v
endif
BUILD_TOOL += $(shell printf '%s' '$(MAKEFLAGS)' | grep -o -- ' *-[jl][0-9]\+ *')
ifeq (n,$(findstring n,$(firstword -$(MAKEFLAGS))))
BUILD_TOOL += -n
endif
endif
DEPS_CMAKE_FLAGS ?= DEPS_CMAKE_FLAGS ?=
USE_BUNDLED ?= USE_BUNDLED ?=
@ -73,7 +82,7 @@ endif
ifneq (,$(findstring functionaltest-lua,$(MAKECMDGOALS))) ifneq (,$(findstring functionaltest-lua,$(MAKECMDGOALS)))
BUNDLED_LUA_CMAKE_FLAG := -DUSE_BUNDLED_LUA=ON 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 endif
# For use where we want to make sure only a single job is run. This does issue # For use where we want to make sure only a single job is run. This does issue
@ -81,78 +90,87 @@ endif
SINGLE_MAKE = export MAKEFLAGS= ; $(MAKE) SINGLE_MAKE = export MAKEFLAGS= ; $(MAKE)
nvim: build/.ran-cmake deps nvim: build/.ran-cmake deps
+$(BUILD_TOOL) -C build $(CMAKE) --build build
libnvim: build/.ran-cmake deps libnvim: build/.ran-cmake deps
+$(BUILD_TOOL) -C build libnvim $(CMAKE) --build build --target libnvim
cmake: cmake:
touch CMakeLists.txt $(TOUCH) CMakeLists.txt
$(MAKE) build/.ran-cmake $(MAKE) build/.ran-cmake
build/.ran-cmake: | deps build/.ran-cmake: | deps
cd build && $(CMAKE_PRG) -G '$(CMAKE_GENERATOR)' $(CMAKE_FLAGS) $(CMAKE_EXTRA_FLAGS) $(MAKEFILE_DIR) $(CMAKE) -B build -G $(CMAKE_GENERATOR) $(CMAKE_FLAGS) $(CMAKE_EXTRA_FLAGS) $(MAKEFILE_DIR)
touch $@ $(TOUCH) $@
deps: | build/.ran-deps-cmake deps: | build/.ran-deps-cmake
ifeq ($(call filter-true,$(USE_BUNDLED)),) ifeq ($(call filter-true,$(USE_BUNDLED)),)
+$(BUILD_TOOL) -C $(DEPS_BUILD_DIR) $(CMAKE) --build $(DEPS_BUILD_DIR)
endif endif
ifeq ($(call filter-true,$(USE_BUNDLED)),) ifeq ($(call filter-true,$(USE_BUNDLED)),)
$(DEPS_BUILD_DIR): $(DEPS_BUILD_DIR):
mkdir -p "$@" $(MKDIR) $@
build/.ran-deps-cmake:: $(DEPS_BUILD_DIR) build/.ran-deps-cmake:: $(DEPS_BUILD_DIR)
cd $(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_PRG) -G '$(CMAKE_GENERATOR)' $(BUNDLED_CMAKE_FLAG) $(BUNDLED_LUA_CMAKE_FLAG) \
$(DEPS_CMAKE_FLAGS) $(MAKEFILE_DIR)/cmake.deps
endif endif
build/.ran-deps-cmake:: build/.ran-deps-cmake::
mkdir -p build $(MKDIR) build
touch $@ $(TOUCH) "$@"
# TODO: cmake 3.2+ add_custom_target() has a USES_TERMINAL flag. # TODO: cmake 3.2+ add_custom_target() has a USES_TERMINAL flag.
oldtest: | nvim build/runtime/doc/tags oldtest: | nvim
+$(SINGLE_MAKE) -C test/old/testdir clean $(SINGLE_MAKE) -C test/old/testdir clean
ifeq ($(strip $(TEST_FILE)),) ifeq ($(strip $(TEST_FILE)),)
+$(SINGLE_MAKE) -C test/old/testdir NVIM_PRG=$(NVIM_PRG) $(MAKEOVERRIDES) $(SINGLE_MAKE) -C test/old/testdir NVIM_PRG=$(NVIM_PRG) $(MAKEOVERRIDES)
else else
@# Handle TEST_FILE=test_foo{,.res,.vim}. @# Handle TEST_FILE=test_foo{,.res,.vim}.
+$(SINGLE_MAKE) -C test/old/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst %.vim,%,$(patsubst %.res,%,$(TEST_FILE))) $(SINGLE_MAKE) -C test/old/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst %.vim,%,$(patsubst %.res,%,$(TEST_FILE)))
endif endif
# Build oldtest by specifying the relative .vim filename. # Build oldtest by specifying the relative .vim filename.
.PHONY: phony_force .PHONY: phony_force
test/old/testdir/%.vim: phony_force test/old/testdir/%.vim: phony_force nvim
+$(SINGLE_MAKE) -C test/old/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst test/old/testdir/%.vim,%,$@) $(SINGLE_MAKE) -C test/old/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst test/old/testdir/%.vim,%,$@)
functionaltest-lua: | nvim functionaltest-lua: | nvim
$(BUILD_TOOL) -C build $@ $(CMAKE) --build build --target functionaltest
FORMAT=formatc formatlua format FORMAT=formatc formatlua format
LINT=lintlua lintsh lintc clang-tidy lintcommit lint LINT=lintlua lintsh lintc clang-analyzer lintcommit lintdoc lint luals
TEST=functionaltest unittest TEST=functionaltest unittest
generated-sources benchmark uninstall $(FORMAT) $(LINT) $(TEST): | build/.ran-cmake generated-sources benchmark $(FORMAT) $(LINT) $(TEST) doc: | build/.ran-cmake
$(CMAKE_PRG) --build build --target $@ $(CMAKE) --build build --target $@
test: $(TEST) 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 iwyu: build/.ran-cmake
cmake --preset iwyu $(CMAKE) --preset iwyu
cmake --build --preset iwyu > build/iwyu.log $(CMAKE) --build build > build/iwyu.log
iwyu-fix-includes --only_re="src/nvim" --ignore_re="src/nvim/(auto|map.h|eval/encode.c)" --safe_headers < build/iwyu.log iwyu-fix-includes --only_re="src/nvim" --ignore_re="(src/nvim/eval/encode.c\
cmake -B build -U ENABLE_IWYU |src/nvim/auto/\
|src/nvim/os/lang.c\
|src/nvim/map.c\
)" --nosafe_headers < build/iwyu.log
$(CMAKE) -B build -U ENABLE_IWYU
$(CMAKE) --build build
clean: 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 test/old/testdir clean
$(MAKE) -C runtime/indent clean $(MAKE) -C runtime/indent clean
distclean: distclean:
rm -rf $(DEPS_BUILD_DIR) build $(call rmdir, $(DEPS_BUILD_DIR))
$(call rmdir, build)
$(MAKE) clean $(MAKE) clean
install: checkprefix nvim install: checkprefix nvim
+$(BUILD_TOOL) -C build install $(CMAKE) --install build
appimage: appimage:
bash scripts/genappimage.sh bash scripts/genappimage.sh
@ -163,14 +181,4 @@ appimage:
appimage-%: appimage-%:
bash scripts/genappimage.sh $* bash scripts/genappimage.sh $*
# Generic pattern rules, allowing for `make build/bin/nvim` etc. .PHONY: test clean distclean nvim libnvim cmake deps install appimage checkprefix benchmark $(FORMAT) $(LINT) $(TEST)
# 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 uninstall $(FORMAT) $(LINT) $(TEST)

View File

@ -6,8 +6,6 @@
</h1> </h1>
[![Coverity Scan analysis](https://scan.coverity.com/projects/2227/badge.svg)](https://scan.coverity.com/projects/2227) [![Coverity Scan analysis](https://scan.coverity.com/projects/2227/badge.svg)](https://scan.coverity.com/projects/2227)
[![Clang analysis](https://neovim.io/doc/reports/clang/badge.svg)](https://neovim.io/doc/reports/clang)
[![PVS-Studio analysis](https://neovim.io/doc/reports/pvs/badge.svg)](https://neovim.io/doc/reports/pvs/PVS-studio.html.d)
[![Packages](https://repology.org/badge/tiny-repos/neovim.svg)](https://repology.org/metapackage/neovim) [![Packages](https://repology.org/badge/tiny-repos/neovim.svg)](https://repology.org/metapackage/neovim)
[![Debian CI](https://badges.debian.net/badges/debian/testing/neovim/version.svg)](https://buildd.debian.org/neovim) [![Debian CI](https://badges.debian.net/badges/debian/testing/neovim/version.svg)](https://buildd.debian.org/neovim)
[![Downloads](https://img.shields.io/github/downloads/neovim/neovim/total.svg?maxAge=2592001)](https://github.com/neovim/neovim/releases/) [![Downloads](https://img.shields.io/github/downloads/neovim/neovim/total.svg?maxAge=2592001)](https://github.com/neovim/neovim/releases/)
@ -17,7 +15,7 @@ Neovim is a project that seeks to aggressively refactor [Vim](https://www.vim.or
- Simplify maintenance and encourage [contributions](CONTRIBUTING.md) - Simplify maintenance and encourage [contributions](CONTRIBUTING.md)
- Split the work between multiple developers - Split the work between multiple developers
- Enable [advanced UIs] without modifications to the core - Enable [advanced UIs] without modifications to the core
- Maximize [extensibility](https://github.com/neovim/neovim/wiki/Plugin-UI-architecture) - Maximize [extensibility](https://neovim.io/doc/user/ui.html)
See the [Introduction](https://github.com/neovim/neovim/wiki/Introduction) wiki page and [Roadmap] See the [Introduction](https://github.com/neovim/neovim/wiki/Introduction) wiki page and [Roadmap]
for more information. for more information.
@ -29,7 +27,7 @@ Features
- [API access](https://github.com/neovim/neovim/wiki/Related-projects#api-clients) - [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, 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 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) - Asynchronous [job control](https://github.com/neovim/neovim/pull/2247)
- [Shared data (shada)](https://github.com/neovim/neovim/pull/2506) among multiple editor instances - [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 - [XDG base directories](https://github.com/neovim/neovim/pull/3470) support
@ -48,7 +46,7 @@ Pre-built packages for Windows, macOS, and Linux are found on the
Install from source Install from source
------------------- -------------------
See the [Building Neovim](https://github.com/neovim/neovim/wiki/Building-Neovim) wiki page and [supported platforms](https://neovim.io/doc/user/support.html#supported-platforms) for details. See [BUILD.md](./BUILD.md) and [supported platforms](https://neovim.io/doc/user/support.html#supported-platforms) for details.
The build is CMake-based, but a Makefile is provided as a convenience. The build is CMake-based, but a Makefile is provided as a convenience.
After installing the dependencies, run the following command. After installing the dependencies, run the following command.
@ -81,7 +79,7 @@ Project layout
├─ runtime/ plugins and docs ├─ runtime/ plugins and docs
├─ src/nvim/ application source code (see src/nvim/README.md) ├─ src/nvim/ application source code (see src/nvim/README.md)
│ ├─ api/ API subsystem │ ├─ api/ API subsystem
│ ├─ eval/ VimL subsystem │ ├─ eval/ Vimscript subsystem
│ ├─ event/ event-loop subsystem │ ├─ event/ event-loop subsystem
│ ├─ generators/ code generation (pre-compilation) │ ├─ generators/ code generation (pre-compilation)
│ ├─ lib/ generic data structures │ ├─ lib/ generic data structures
@ -114,7 +112,7 @@ Apache 2.0 license, except for contributions copied from Vim (identified by the
[nvim-news]: https://neovim.io/doc/user/news.html [nvim-news]: https://neovim.io/doc/user/news.html
[Roadmap]: https://neovim.io/roadmap/ [Roadmap]: https://neovim.io/roadmap/
[advanced UIs]: https://github.com/neovim/neovim/wiki/Related-projects#gui [advanced UIs]: https://github.com/neovim/neovim/wiki/Related-projects#gui
[Managed packages]: https://github.com/neovim/neovim/wiki/Installing-Neovim#install-from-package [Managed packages]: ./INSTALL.md#install-from-package
[Debian]: https://packages.debian.org/testing/neovim [Debian]: https://packages.debian.org/testing/neovim
[Ubuntu]: https://packages.ubuntu.com/search?keywords=neovim [Ubuntu]: https://packages.ubuntu.com/search?keywords=neovim
[Fedora]: https://packages.fedoraproject.org/pkgs/neovim/neovim/ [Fedora]: https://packages.fedoraproject.org/pkgs/neovim/neovim/

View File

@ -4,6 +4,7 @@ include(CheckFunctionExists)
include(CheckIncludeFiles) include(CheckIncludeFiles)
include(CheckCSourceRuns) include(CheckCSourceRuns)
include(CheckCSourceCompiles) include(CheckCSourceCompiles)
include(TestBigEndian)
check_c_source_compiles(" check_c_source_compiles("
#include <execinfo.h> #include <execinfo.h>
@ -40,6 +41,9 @@ check_include_files(sys/utsname.h HAVE_SYS_UTSNAME_H)
check_include_files(termios.h HAVE_TERMIOS_H) check_include_files(termios.h HAVE_TERMIOS_H)
check_include_files(sys/uio.h HAVE_SYS_UIO_H) check_include_files(sys/uio.h HAVE_SYS_UIO_H)
check_include_files(sys/sdt.h HAVE_SYS_SDT_H) check_include_files(sys/sdt.h HAVE_SYS_SDT_H)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
check_include_files(sys/xattr.h HAVE_XATTR)
endif()
# Functions # Functions
check_function_exists(fseeko HAVE_FSEEKO) check_function_exists(fseeko HAVE_FSEEKO)
@ -75,6 +79,17 @@ int main(void)
} }
" HAVE_PWD_FUNCS) " HAVE_PWD_FUNCS)
check_c_source_compiles("
#include <intrin.h>
int main(void)
{
unsigned long index;
unsigned char mask = 0x8000;
_BitScanForward64(&index, mask);
return 0;
}
" HAVE_BITSCANFORWARD64)
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS") if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
check_c_source_compiles(" check_c_source_compiles("
@ -127,43 +142,56 @@ endif()
if("${HAVE_BE64TOH_MACROS}" OR "${HAVE_BE64TOH_FUNC}") if("${HAVE_BE64TOH_MACROS}" OR "${HAVE_BE64TOH_FUNC}")
set(HAVE_BE64TOH 1) set(HAVE_BE64TOH 1)
endif() endif()
if (NOT "${HAVE_BE64TOH}")
if (NOT "${CMAKE_CROSSCOMPILING}") test_big_endian(ORDER_BIG_ENDIAN)
# It is safe to make ORDER_BIG_ENDIAN not defined if
# - HAVE_BE64TOH is true. In this case be64toh will be used unconditionally in
# any case and ORDER_BIG_ENDIAN will not be examined.
# - CMAKE_CROSSCOMPILING *and* HAVE_BE64TOH are both false. In this case
# be64toh function which uses cycle and arithmetic operations is used which
# will work regardless of endianness. Function is sub-optimal though.
check_c_source_runs("
${SI}
${MS}
char *s = (char *) &i;
return (
s[0] == 0x01
&& s[1] == 0x02
&& s[2] == 0x03
&& s[3] == 0x04
&& s[4] == 0x05
&& s[5] == 0x06
&& s[6] == 0x07
&& s[7] == 0x08) ? 0 : 1;
${ME}"
ORDER_BIG_ENDIAN)
endif()
endif()
configure_file ( configure_file (
"${PROJECT_SOURCE_DIR}/cmake.config/config.h.in" "${PROJECT_SOURCE_DIR}/cmake.config/config.h.in"
"${PROJECT_BINARY_DIR}/cmake.config/auto/config.h" "${PROJECT_BINARY_DIR}/cmake.config/auto/config.h"
) )
set(VERSION_STRING "${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS} ")
foreach(BUILD_TYPE Debug Release RelWithDebInfo MinSizeRel)
string(TOUPPER ${BUILD_TYPE} BUILD_TYPE_UPPER)
set(GEN_CONFIG "$<CONFIG:${BUILD_TYPE}>")
set(GEN_RHS "${CMAKE_C_FLAGS_${BUILD_TYPE_UPPER}} ")
string(APPEND VERSION_STRING "$<${GEN_CONFIG}:${GEN_RHS}>")
set(GEN_RHS "$<$<BOOL:$<TARGET_PROPERTY:nvim_bin,INTERPROCEDURAL_OPTIMIZATION_${BUILD_TYPE_UPPER}>>:${CMAKE_C_COMPILE_OPTIONS_IPO}>")
string(APPEND VERSION_STRING "$<${GEN_CONFIG}:${GEN_RHS}>")
endforeach()
string(APPEND VERSION_STRING " ")
function(append_target_expression)
cmake_parse_arguments(ARG
""
"PREFIX;PROPERTY"
""
${ARGN})
set(TARGET_EXPRESSION "$<TARGET_PROPERTY:nvim_bin,${ARG_PROPERTY}>")
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)
endfunction()
append_target_expression(PROPERTY COMPILE_OPTIONS)
append_target_expression(PROPERTY LINK_OPTIONS)
append_target_expression(PREFIX "-D" PROPERTY COMPILE_DEFINITIONS)
append_target_expression(PREFIX "-I" PROPERTY INCLUDE_DIRECTORIES)
string(REPLACE ";" " " VERSION_STRING "${VERSION_STRING}")
string(REPLACE " " " " VERSION_STRING "${VERSION_STRING}")
configure_file(versiondef.h.in auto/versiondef.h.gen) configure_file(versiondef.h.in auto/versiondef.h.gen)
file(GENERATE file(GENERATE
OUTPUT "${PROJECT_BINARY_DIR}/cmake.config/auto/versiondef-$<CONFIG>.h" OUTPUT "${PROJECT_BINARY_DIR}/cmake.config/auto/versiondef-$<CONFIG>.h"
INPUT "${PROJECT_BINARY_DIR}/cmake.config/auto/versiondef.h.gen") INPUT "${PROJECT_BINARY_DIR}/cmake.config/auto/versiondef.h.gen")
configure_file ( configure_file (
"${PROJECT_SOURCE_DIR}/cmake.config/pathdef.c.in" "${PROJECT_SOURCE_DIR}/cmake.config/pathdef.h.in"
"${PROJECT_BINARY_DIR}/cmake.config/auto/pathdef.c" "${PROJECT_BINARY_DIR}/cmake.config/auto/pathdef.h"
ESCAPE_QUOTES) ESCAPE_QUOTES)

View File

@ -1,5 +1,4 @@
#ifndef AUTO_CONFIG_H #pragma once
#define AUTO_CONFIG_H
#cmakedefine SIZEOF_INT @SIZEOF_INT@ #cmakedefine SIZEOF_INT @SIZEOF_INT@
#cmakedefine SIZEOF_INTMAX_T @SIZEOF_INTMAX_T@ #cmakedefine SIZEOF_INTMAX_T @SIZEOF_INTMAX_T@
@ -27,6 +26,7 @@
#cmakedefine HAVE_STRINGS_H #cmakedefine HAVE_STRINGS_H
#cmakedefine HAVE_STRNCASECMP #cmakedefine HAVE_STRNCASECMP
#cmakedefine HAVE_STRPTIME #cmakedefine HAVE_STRPTIME
#cmakedefine HAVE_XATTR
#cmakedefine HAVE_SYS_SDT_H #cmakedefine HAVE_SYS_SDT_H
#cmakedefine HAVE_SYS_UTSNAME_H #cmakedefine HAVE_SYS_UTSNAME_H
#cmakedefine HAVE_SYS_WAIT_H #cmakedefine HAVE_SYS_WAIT_H
@ -34,7 +34,6 @@
#cmakedefine HAVE_WORKING_LIBINTL #cmakedefine HAVE_WORKING_LIBINTL
#cmakedefine UNIX #cmakedefine UNIX
#cmakedefine CASE_INSENSITIVE_FILENAME #cmakedefine CASE_INSENSITIVE_FILENAME
#cmakedefine USE_FNAME_CASE
#cmakedefine HAVE_SYS_UIO_H #cmakedefine HAVE_SYS_UIO_H
#ifdef HAVE_SYS_UIO_H #ifdef HAVE_SYS_UIO_H
#cmakedefine HAVE_READV #cmakedefine HAVE_READV
@ -45,10 +44,6 @@
#cmakedefine HAVE_DIRFD_AND_FLOCK #cmakedefine HAVE_DIRFD_AND_FLOCK
#cmakedefine HAVE_FORKPTY #cmakedefine HAVE_FORKPTY
#ifndef UNIT_TESTING
#cmakedefine LOG_LIST_ACTIONS
#endif
#cmakedefine HAVE_BE64TOH #cmakedefine HAVE_BE64TOH
#cmakedefine ORDER_BIG_ENDIAN #cmakedefine ORDER_BIG_ENDIAN
#define ENDIAN_INCLUDE_FILE <@ENDIAN_INCLUDE_FILE@> #define ENDIAN_INCLUDE_FILE <@ENDIAN_INCLUDE_FILE@>
@ -56,5 +51,6 @@
#cmakedefine HAVE_EXECINFO_BACKTRACE #cmakedefine HAVE_EXECINFO_BACKTRACE
#cmakedefine HAVE_BUILTIN_ADD_OVERFLOW #cmakedefine HAVE_BUILTIN_ADD_OVERFLOW
#cmakedefine HAVE_WIMPLICIT_FALLTHROUGH_FLAG #cmakedefine HAVE_WIMPLICIT_FALLTHROUGH_FLAG
#cmakedefine HAVE_BITSCANFORWARD64
#endif // AUTO_CONFIG_H #define VTERM_TEST_FILE "@VTERM_TEST_FILE@"

1031
cmake.config/iwyu/c99.imp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,226 +0,0 @@
# This was initially taken from the IWYU repository:
# github.com/include-what-you-use/include-what-you-use/blob/164b8fe7597805ae55f029ecf6580dc46a74c7ed/gcc.libc.imp
# It has useful mappings that are normally enabled by default, but there are
# other default mappings that conflict with our builds. The best solution seems
# to be to disable all defaults, import the defaults from the IWYU
# repo and modify the rules that conflict with our build.
#
# TODO(dundargoc): Check if there is a way to disable specific builtin maps as
# to avoid this file entirely.
# Mappings for GNU libc
# ( cd /usr/include && grep '^ *# *include' {sys/,net/,}* | perl -nle 'm/^([^:]+).*<([^>]+)>/ && print qq@ { include: [ "<$2>", private, "<$1>", public ] },@' | grep bits/ | sort )
# When I saw more than one mapping for these, I typically picked
# what I thought was the "best" one.
[
{ include: [ "<bits/a.out.h>", private, "<a.out.h>", public ] },
{ include: [ "<bits/auxv.h>", private, "<sys/auxv.h>", public ] },
{ include: [ "<bits/byteswap.h>", private, "<byteswap.h>", public ] },
{ include: [ "<bits/cmathcalls.h>", private, "<complex.h>", public ] },
{ include: [ "<bits/confname.h>", private, "<unistd.h>", private ] },
{ include: [ "<bits/dirent.h>", private, "<dirent.h>", public ] },
{ include: [ "<bits/dlfcn.h>", private, "<dlfcn.h>", public ] },
{ include: [ "<bits/elfclass.h>", private, "<link.h>", public ] },
{ include: [ "<bits/endian.h>", private, "<endian.h>", public ] },
{ include: [ "<bits/environments.h>", private, "<unistd.h>", private ] },
{ include: [ "<bits/epoll.h>", private, "<sys/epoll.h>", public ] },
{ include: [ "<bits/errno.h>", private, "<errno.h>", public ] },
{ include: [ "<bits/error.h>", private, "<error.h>", public ] },
{ include: [ "<bits/eventfd.h>", private, "<sys/eventfd.h>", public ] },
{ include: [ "<bits/fcntl.h>", private, "<fcntl.h>", public ] },
{ include: [ "<bits/fcntl2.h>", private, "<fcntl.h>", public ] },
{ include: [ "<bits/fenv.h>", private, "<fenv.h>", public ] },
{ include: [ "<bits/fenvinline.h>", private, "<fenv.h>", public ] },
{ include: [ "<bits/huge_val.h>", private, "<math.h>", public ] },
{ include: [ "<bits/huge_valf.h>", private, "<math.h>", public ] },
{ include: [ "<bits/huge_vall.h>", private, "<math.h>", public ] },
{ include: [ "<bits/hwcap.h>", private, "<sys/auxv.h>", public ] },
{ include: [ "<bits/inf.h>", private, "<math.h>", public ] },
{ include: [ "<bits/inotify.h>", private, "<sys/inotify.h>", public ] },
{ include: [ "<bits/ioctl-types.h>", private, "<sys/ioctl.h>", public ] },
{ include: [ "<bits/ioctls.h>", private, "<sys/ioctl.h>", public ] },
{ include: [ "<bits/ipc.h>", private, "<sys/ipc.h>", public ] },
{ include: [ "<bits/ipctypes.h>", private, "<sys/ipc.h>", public ] },
{ include: [ "<bits/libio-ldbl.h>", private, "<libio.h>", public ] },
{ include: [ "<bits/link.h>", private, "<link.h>", public ] },
{ include: [ "<bits/locale.h>", private, "<locale.h>", public ] },
{ include: [ "<bits/math-finite.h>", private, "<math.h>", public ] },
{ include: [ "<bits/mathcalls.h>", private, "<math.h>", public ] },
{ include: [ "<bits/mathdef.h>", private, "<math.h>", public ] },
{ include: [ "<bits/mathinline.h>", private, "<math.h>", public ] },
{ include: [ "<bits/mman.h>", private, "<sys/mman.h>", public ] },
{ include: [ "<bits/mman-shared.h>", private, "<sys/mman.h>", public ] },
{ include: [ "<bits/monetary-ldbl.h>", private, "<monetary.h>", public ] },
{ include: [ "<bits/mqueue.h>", private, "<mqueue.h>", public ] },
{ include: [ "<bits/mqueue2.h>", private, "<mqueue.h>", public ] },
{ include: [ "<bits/msq.h>", private, "<sys/msg.h>", public ] },
{ include: [ "<bits/nan.h>", private, "<math.h>", public ] },
{ include: [ "<bits/netdb.h>", private, "<netdb.h>", private ] },
{ include: [ "<bits/param.h>", private, "<sys/param.h>", public ] },
{ include: [ "<bits/poll.h>", private, "<sys/poll.h>", private ] },
{ include: [ "<bits/poll2.h>", private, "<sys/poll.h>", private ] },
{ include: [ "<bits/posix1_lim.h>", private, "<limits.h>", public ] },
{ include: [ "<bits/posix2_lim.h>", private, "<limits.h>", public ] },
{ include: [ "<bits/posix_opt.h>", private, "<unistd.h>", private ] },
{ include: [ "<bits/printf-ldbl.h>", private, "<printf.h>", public ] },
{ include: [ "<bits/pthreadtypes.h>", private, "<pthread.h>", private ] },
{ include: [ "<bits/resource.h>", private, "<sys/resource.h>", public ] },
{ include: [ "<bits/sched.h>", private, "<sched.h>", public ] },
{ include: [ "<bits/select.h>", private, "<sys/select.h>", public ] },
{ include: [ "<bits/select2.h>", private, "<sys/select.h>", public ] },
{ include: [ "<bits/sem.h>", private, "<sys/sem.h>", public ] },
{ include: [ "<bits/semaphore.h>", private, "<semaphore.h>", public ] },
{ include: [ "<bits/setjmp.h>", private, "<setjmp.h>", public ] },
{ include: [ "<bits/setjmp2.h>", private, "<setjmp.h>", public ] },
{ include: [ "<bits/shm.h>", private, "<sys/shm.h>", public ] },
{ include: [ "<bits/sigaction.h>", private, "<signal.h>", public ] },
{ include: [ "<bits/sigcontext.h>", private, "<signal.h>", public ] },
{ include: [ "<bits/siginfo.h>", private, "<signal.h>", public ] },
{ include: [ "<bits/signum.h>", private, "<signal.h>", public ] },
{ include: [ "<bits/sigset.h>", private, "<signal.h>", public ] },
{ include: [ "<bits/sigstack.h>", private, "<signal.h>", public ] },
{ include: [ "<bits/sigthread.h>", private, "<signal.h>", public ] },
{ include: [ "<bits/sockaddr.h>", private, "<sys/un.h>", public ] },
{ include: [ "<bits/socket.h>", private, "<sys/socket.h>", private ] },
{ include: [ "<bits/socket2.h>", private, "<sys/socket.h>", private ] },
{ include: [ "<bits/socket_type.h>", private, "<sys/socket.h>", private ] },
{ include: [ "<bits/stab.def>", private, "<stab.h>", public ] },
{ include: [ "<bits/stat.h>", private, "<sys/stat.h>", public ] },
{ include: [ "<bits/statfs.h>", private, "<sys/statfs.h>", public ] },
{ include: [ "<bits/statvfs.h>", private, "<sys/statvfs.h>", public ] },
{ include: [ "<bits/stdio-ldbl.h>", private, "<stdio.h>", public ] },
{ include: [ "<bits/stdio-lock.h>", private, "<libio.h>", public ] },
{ include: [ "<bits/stdio.h>", private, "<stdio.h>", public ] },
{ include: [ "<bits/stdio2.h>", private, "<stdio.h>", public ] },
{ include: [ "<bits/stdio_lim.h>", private, "<stdio.h>", public ] },
{ include: [ "<bits/stdlib-bsearch.h>", private, "<stdlib.h>", public ] },
{ include: [ "<bits/stdlib-float.h>", private, "<stdlib.h>", public ] },
{ include: [ "<bits/stdlib-ldbl.h>", private, "<stdlib.h>", public ] },
{ include: [ "<bits/stdlib.h>", private, "<stdlib.h>", public ] },
{ include: [ "<bits/string.h>", private, "<string.h>", public ] },
{ include: [ "<bits/string2.h>", private, "<string.h>", public ] },
{ include: [ "<bits/string3.h>", private, "<string.h>", public ] },
{ include: [ "<bits/stropts.h>", private, "<stropts.h>", public ] },
{ include: [ "<bits/struct_stat.h>", private, "<sys/stat.h>", public ] },
{ include: [ "<bits/struct_stat.h>", private, "<ftw.h>", public ] },
{ include: [ "<bits/sys_errlist.h>", private, "<stdio.h>", public ] },
{ include: [ "<bits/syscall.h>", private, "<sys/syscall.h>", public ] },
{ include: [ "<bits/sysctl.h>", private, "<sys/sysctl.h>", public ] },
{ include: [ "<bits/syslog-ldbl.h>", private, "<sys/syslog.h>", private ] },
{ include: [ "<bits/syslog-path.h>", private, "<sys/syslog.h>", private ] },
{ include: [ "<bits/syslog.h>", private, "<sys/syslog.h>", private ] },
{ include: [ "<bits/termios.h>", private, "<termios.h>", private ] },
{ include: [ "<bits/termios-c_lflag.h>", private, "<termios.h>", private ] },
{ include: [ "<bits/termios-struct.h>", private, "<termios.h>", private ] },
{ include: [ "<bits/termios-tcflow.h>", private, "<termios.h>", private ] },
{ include: [ "<bits/time.h>", private, "<time.h>", public ] },
{ include: [ "<bits/time.h>", private, "<sys/time.h>", public ] },
{ include: [ "<bits/timerfd.h>", private, "<sys/timerfd.h>", public ] },
{ include: [ "<bits/timex.h>", private, "<sys/timex.h>", public ] },
{ include: [ "<bits/types.h>", private, "<sys/types.h>", public ] },
{ include: [ "<bits/types/siginfo_t.h>", private, "<signal.h>", public ] },
{ include: [ "<bits/types/siginfo_t.h>", private, "<sys/wait.h>", public ] },
{ include: [ "<bits/uio.h>", private, "<sys/uio.h>", public ] },
{ include: [ "<bits/unistd.h>", private, "<unistd.h>", private ] },
{ include: [ "<bits/ustat.h>", private, "<sys/ustat.h>", private ] },
{ include: [ "<bits/utmp.h>", private, "<utmp.h>", public ] },
{ include: [ "<bits/utmpx.h>", private, "<utmpx.h>", public ] },
{ include: [ "<bits/utsname.h>", private, "<sys/utsname.h>", public ] },
{ include: [ "<bits/waitflags.h>", private, "<sys/wait.h>", public ] },
{ include: [ "<bits/waitstatus.h>", private, "<sys/wait.h>", public ] },
{ include: [ "<bits/wchar-ldbl.h>", private, "<wchar.h>", public ] },
{ include: [ "<bits/wchar.h>", private, "<wchar.h>", public ] },
{ include: [ "<bits/wchar2.h>", private, "<wchar.h>", public ] },
{ include: [ "<bits/wordsize.h>", private, "<limits.h>", public ] },
{ include: [ "<bits/xopen_lim.h>", private, "<limits.h>", public ] },
{ include: [ "<bits/xtitypes.h>", private, "<stropts.h>", public ] },
# Sometimes libc tells you what mapping to do via an '#error':
# # error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead."
# or
# # error "Never include <bits/socket_type.h> directly; use <sys/socket.h> instead."
# ( cd /usr/include && grep -R '^ *# *error "Never use\|include' * | perl -nle 'm/<([^>]+).*directly.*<([^>]+)/ && print qq@ { include: [ "<$1>", private, "<$2>", public ] },@' | sort )
{ include: [ "<bits/a.out.h>", private, "<a.out.h>", public ] },
{ include: [ "<bits/byteswap-16.h>", private, "<byteswap.h>", public ] },
{ include: [ "<bits/byteswap.h>", private, "<byteswap.h>", public ] },
{ include: [ "<bits/cmathcalls.h>", private, "<complex.h>", public ] },
{ include: [ "<bits/confname.h>", private, "<unistd.h>", private ] },
{ include: [ "<bits/dirent.h>", private, "<dirent.h>", public ] },
{ include: [ "<bits/dlfcn.h>", private, "<dlfcn.h>", public ] },
{ include: [ "<bits/elfclass.h>", private, "<link.h>", public ] },
{ include: [ "<bits/endian.h>", private, "<endian.h>", public ] },
{ include: [ "<bits/epoll.h>", private, "<sys/epoll.h>", public ] },
{ include: [ "<bits/eventfd.h>", private, "<sys/eventfd.h>", public ] },
{ include: [ "<bits/fcntl-linux.h>", private, "<fcntl.h>", public ] },
{ include: [ "<bits/fcntl.h>", private, "<fcntl.h>", public ] },
{ include: [ "<bits/fenv.h>", private, "<fenv.h>", public ] },
{ include: [ "<bits/huge_val.h>", private, "<math.h>", public ] },
{ include: [ "<bits/huge_valf.h>", private, "<math.h>", public ] },
{ include: [ "<bits/huge_vall.h>", private, "<math.h>", public ] },
{ include: [ "<bits/in.h>", private, "<netinet/in.h>", private ] },
{ include: [ "<bits/inf.h>", private, "<math.h>", public ] },
{ include: [ "<bits/inotify.h>", private, "<sys/inotify.h>", public ] },
{ include: [ "<bits/ioctl-types.h>", private, "<sys/ioctl.h>", public ] },
{ include: [ "<bits/ioctls.h>", private, "<sys/ioctl.h>", public ] },
{ include: [ "<bits/ipc.h>", private, "<sys/ipc.h>", public ] },
{ include: [ "<bits/ipctypes.h>", private, "<sys/ipc.h>", public ] },
{ include: [ "<bits/locale.h>", private, "<locale.h>", public ] },
{ include: [ "<bits/math-finite.h>", private, "<math.h>", public ] },
{ include: [ "<bits/mathdef.h>", private, "<math.h>", public ] },
{ include: [ "<bits/mathinline.h>", private, "<math.h>", public ] },
{ include: [ "<bits/mman-linux.h>", private, "<sys/mman.h>", public ] },
{ include: [ "<bits/mman.h>", private, "<sys/mman.h>", public ] },
{ include: [ "<bits/mqueue.h>", private, "<mqueue.h>", public ] },
{ include: [ "<bits/msq.h>", private, "<sys/msg.h>", public ] },
{ include: [ "<bits/nan.h>", private, "<math.h>", public ] },
{ include: [ "<bits/param.h>", private, "<sys/param.h>", public ] },
{ include: [ "<bits/poll.h>", private, "<sys/poll.h>", private ] },
{ include: [ "<bits/predefs.h>", private, "<features.h>", public ] },
{ include: [ "<bits/resource.h>", private, "<sys/resource.h>", public ] },
{ include: [ "<bits/select.h>", private, "<sys/select.h>", public ] },
{ include: [ "<bits/semaphore.h>", private, "<semaphore.h>", public ] },
{ include: [ "<bits/sigcontext.h>", private, "<signal.h>", public ] },
{ include: [ "<bits/signalfd.h>", private, "<sys/signalfd.h>", public ] },
{ include: [ "<bits/stdlib-float.h>", private, "<stdlib.h>", public ] },
{ include: [ "<bits/string.h>", private, "<string.h>", public ] },
{ include: [ "<bits/string2.h>", private, "<string.h>", public ] },
{ include: [ "<bits/string3.h>", private, "<string.h>", public ] },
{ include: [ "<bits/timerfd.h>", private, "<sys/timerfd.h>", public ] },
{ include: [ "<bits/typesizes.h>", private, "<sys/types.h>", public ] },
# Top-level #includes that just forward to another file:
# $ for i in /usr/include/*; do [ -f $i ] } && [ `wc -l < $i` = 1 ] } && echo $i; done
# (poll.h, syscall.h, syslog.h, ustat.h, wait.h).
# For each file, I looked at the list of canonical header files --
# http://www.opengroup.org/onlinepubs/9699919799/idx/head.html --
# to decide which of the two files is canonical. If neither is
# on the POSIX.1 1998 list, I just choose the top-level one.
{ include: [ "<sys/poll.h>", private, "<poll.h>", public ] },
{ include: [ "<sys/syslog.h>", private, "<syslog.h>", public ] },
{ include: [ "<sys/ustat.h>", private, "<ustat.h>", public ] },
{ include: [ "<wait.h>", private, "<sys/wait.h>", public ] },
# These are all files in bits/ that delegate to asm/ and linux/ to
# do all (or lots) of the work. Note these are private->private.
# $ for i in /usr/include/bits/*; do for dir in asm linux; do grep -H -e $dir/`basename $i` $i; done; done
{ include: [ "<linux/errno.h>", private, "<bits/errno.h>", private ] },
{ include: [ "<asm/ioctls.h>", private, "<bits/ioctls.h>", private ] },
{ include: [ "<asm/socket.h>", private, "<bits/socket.h>", private ] },
{ include: [ "<linux/socket.h>", private, "<bits/socket.h>", private ] },
# Some asm files have 32- and 64-bit variants:
# $ ls /usr/include/asm/*_{32,64}.h
{ include: [ "<asm/posix_types_32.h>", private, "<asm/posix_types.h>", public ] },
{ include: [ "<asm/posix_types_64.h>", private, "<asm/posix_types.h>", public ] },
{ include: [ "<asm/unistd_32.h>", private, "<asm/unistd.h>", private ] },
{ include: [ "<asm/unistd_64.h>", private, "<asm/unistd.h>", private ] },
# I don't know what grep would have found these. I found them
# via user report.
{ include: [ "<asm/errno.h>", private, "<errno.h>", public ] },
{ include: [ "<asm/errno-base.h>", private, "<errno.h>", public ] },
{ include: [ "<asm/ptrace-abi.h>", private, "<asm/ptrace.h>", public ] },
{ include: [ "<asm/unistd.h>", private, "<sys/syscall.h>", public ] },
{ include: [ "<linux/limits.h>", private, "<limits.h>", public ] }, # PATH_MAX
{ include: [ "<linux/prctl.h>", private, "<sys/prctl.h>", public ] },
{ include: [ "<sys/ucontext.h>", private, "<ucontext.h>", public ] },
# Exports guaranteed by the C standard
{ include: [ "<stdint.h>", public, "<inttypes.h>", public ] },
]
# vim: set ft=toml:

View File

@ -1,305 +0,0 @@
# This was initially taken from the IWYU repository:
# github.com/include-what-you-use/include-what-you-use/blob/164b8fe7597805ae55f029ecf6580dc46a74c7ed/gcc.symbols.imp
# It has useful mappings that are normally enabled by default, but there are
# other default mappings that conflict with our builds. The best solution seems
# to be to disable all defaults, import the defaults from the IWYU repo and
# modify the rules that conflict with our build.
#
# TODO(dundargoc): Check if there is a way to disable specific builtin maps as
# to avoid this file entirely.
# For library symbols that can be defined in more than one header
# file, maps from symbol-name to legitimate header files.
# This list was generated via
# grep -R '__.*_defined' /usr/include | perl -nle 'm,/usr/include/([^:]*):#\s*\S+ __(.*)_defined, and print qq@ { symbol: [ "$2", public, "<$1>", public ] },@' | sort -u
# I ignored all entries that only appeared once on the list (eg uint32_t).
# I then added in NULL, which according to [diff.null] C.2.2.3, can
# be defined in <clocale>, <cstddef>, <cstdio>, <cstdlib>,
# <cstring>, <ctime>, or <cwchar>. We also allow their C
# equivalents.
# In each case, I ordered them so <sys/types.h> was first, if it was
# an option for this type. That's the preferred #include all else
# equal. The same goes for <stdint.h>. The visibility on the
# symbol-name is ignored; by convention we always set it to private.
[
{ symbol: [ "aiocb", private, "<aio.h>", public ] },
{ symbol: [ "blkcnt_t", private, "<sys/types.h>", public ] },
{ symbol: [ "blkcnt_t", private, "<sys/stat.h>", public ] },
{ symbol: [ "blksize_t", private, "<sys/types.h>", public ] },
{ symbol: [ "blksize_t", private, "<sys/stat.h>", public ] },
{ symbol: [ "cc_t", private, "<termios.h>", private ] },
{ symbol: [ "clock_t", private, "<sys/types.h>", public ] },
{ symbol: [ "clock_t", private, "<sys/time.h>", public ] },
{ symbol: [ "clock_t", private, "<time.h>", public ] },
{ symbol: [ "clockid_t", private, "<sys/types.h>", public ] },
{ symbol: [ "clockid_t", private, "<time.h>", public ] },
{ symbol: [ "daddr_t", private, "<sys/types.h>", public ] },
{ symbol: [ "daddr_t", private, "<rpc/types.h>", public ] },
{ symbol: [ "dev_t", private, "<sys/types.h>", public ] },
{ symbol: [ "dev_t", private, "<sys/stat.h>", public ] },
{ symbol: [ "div_t", private, "<stdlib.h>", public ] },
{ symbol: [ "double_t", private, "<math.h>", public ] },
{ symbol: [ "error_t", private, "<errno.h>", public ] },
{ symbol: [ "error_t", private, "<argp.h>", public ] },
{ symbol: [ "error_t", private, "<argz.h>", public ] },
{ symbol: [ "fd_set", private, "<sys/select.h>", public ] },
{ symbol: [ "fd_set", private, "<sys/time.h>", public ] },
{ symbol: [ "fenv_t", private, "<fenv.h>", public ] },
{ symbol: [ "fexcept_t", private, "<fenv.h>", public ] },
{ symbol: [ "FILE", private, "<stdio.h>", public ] },
{ symbol: [ "FILE", private, "<wchar.h>", public ] },
{ symbol: [ "float_t", private, "<math.h>", public ] },
{ symbol: [ "fsblkcnt_t", private, "<sys/types.h>", public ] },
{ symbol: [ "fsblkcnt_t", private, "<sys/statvfs.h>", public ] },
{ symbol: [ "fsfilcnt_t", private, "<sys/types.h>", public ] },
{ symbol: [ "fsfilcnt_t", private, "<sys/statvfs.h>", public ] },
{ symbol: [ "getopt", private, "<unistd.h>", private ] },
{ symbol: [ "gid_t", private, "<sys/types.h>", public ] },
{ symbol: [ "gid_t", private, "<grp.h>", public ] },
{ symbol: [ "gid_t", private, "<pwd.h>", public ] },
{ symbol: [ "gid_t", private, "<signal.h>", public ] },
{ symbol: [ "gid_t", private, "<stropts.h>", public ] },
{ symbol: [ "gid_t", private, "<sys/ipc.h>", public ] },
{ symbol: [ "gid_t", private, "<sys/stat.h>", public ] },
{ symbol: [ "gid_t", private, "<unistd.h>", private ] },
{ symbol: [ "htonl", private, "<arpa/inet.h>", private ] },
{ symbol: [ "htons", private, "<arpa/inet.h>", private ] },
{ symbol: [ "id_t", private, "<sys/types.h>", public ] },
{ symbol: [ "id_t", private, "<sys/resource.h>", public ] },
{ symbol: [ "imaxdiv_t", private, "<inttypes.h>", public ] },
{ symbol: [ "intmax_t", private, "<stdint.h>", public ] },
{ symbol: [ "uintmax_t", private, "<stdint.h>", public ] },
{ symbol: [ "ino64_t", private, "<sys/types.h>", public ] },
{ symbol: [ "ino64_t", private, "<dirent.h>", public ] },
{ symbol: [ "ino_t", private, "<sys/types.h>", public ] },
{ symbol: [ "ino_t", private, "<dirent.h>", public ] },
{ symbol: [ "ino_t", private, "<sys/stat.h>", public ] },
{ symbol: [ "int8_t", private, "<stdint.h>", public ] },
{ symbol: [ "int16_t", private, "<stdint.h>", public ] },
{ symbol: [ "int32_t", private, "<stdint.h>", public ] },
{ symbol: [ "int64_t", private, "<stdint.h>", public ] },
{ symbol: [ "uint8_t", private, "<stdint.h>", public ] },
{ symbol: [ "uint16_t", private, "<stdint.h>", public ] },
{ symbol: [ "uint32_t", private, "<stdint.h>", public ] },
{ symbol: [ "uint64_t", private, "<stdint.h>", public ] },
{ symbol: [ "intptr_t", private, "<stdint.h>", public ] },
{ symbol: [ "uintptr_t", private, "<stdint.h>", public ] },
{ symbol: [ "iovec", private, "<sys/uio.h>", public ] },
{ symbol: [ "iovec", private, "<sys/socket.h>", private ] },
{ symbol: [ "itimerspec", private, "<time.h>", public ] },
{ symbol: [ "itimerspec", private, "<sys/timerfd.h>", public ] },
{ symbol: [ "key_t", private, "<sys/types.h>", public ] },
{ symbol: [ "key_t", private, "<sys/ipc.h>", public ] },
{ symbol: [ "lconv", private, "<locale.h>", public ] },
{ symbol: [ "ldiv_t", private, "<stdlib.h>", public ] },
{ symbol: [ "lldiv_t", private, "<stdlib.h>", public ] },
{ symbol: [ "max_align_t", private, "<stddef.h>", public ] },
{ symbol: [ "mode_t", private, "<sys/types.h>", public ] },
{ symbol: [ "mode_t", private, "<fcntl.h>", public ] },
{ symbol: [ "mode_t", private, "<ndbm.h>", public ] },
{ symbol: [ "mode_t", private, "<spawn.h>", public ] },
{ symbol: [ "mode_t", private, "<sys/ipc.h>", public ] },
{ symbol: [ "mode_t", private, "<sys/mman.h>", public ] },
{ symbol: [ "mode_t", private, "<sys/stat.h>", public ] },
{ symbol: [ "nlink_t", private, "<sys/types.h>", public ] },
{ symbol: [ "nlink_t", private, "<sys/stat.h>", public ] },
{ symbol: [ "ntohl", private, "<arpa/inet.h>", private ] },
{ symbol: [ "ntohs", private, "<arpa/inet.h>", private ] },
{ symbol: [ "off64_t", private, "<sys/types.h>", public ] },
{ symbol: [ "off64_t", private, "<unistd.h>", private ] },
{ symbol: [ "off_t", private, "<sys/types.h>", public ] },
{ symbol: [ "off_t", private, "<aio.h>", public ] },
{ symbol: [ "off_t", private, "<fcntl.h>", public ] },
{ symbol: [ "off_t", private, "<stdio.h>", public ] },
{ symbol: [ "off_t", private, "<sys/mman.h>", public ] },
{ symbol: [ "off_t", private, "<sys/stat.h>", public ] },
{ symbol: [ "off_t", private, "<unistd.h>", private ] },
{ symbol: [ "optarg", private, "<unistd.h>", private ] },
{ symbol: [ "opterr", private, "<unistd.h>", private ] },
{ symbol: [ "optind", private, "<unistd.h>", private ] },
{ symbol: [ "optopt", private, "<unistd.h>", private ] },
{ symbol: [ "pid_t", private, "<sys/types.h>", public ] },
{ symbol: [ "pid_t", private, "<fcntl.h>", public ] },
{ symbol: [ "pid_t", private, "<sched.h>", public ] },
{ symbol: [ "pid_t", private, "<signal.h>", public ] },
{ symbol: [ "pid_t", private, "<spawn.h>", public ] },
{ symbol: [ "pid_t", private, "<sys/msg.h>", public ] },
{ symbol: [ "pid_t", private, "<sys/sem.h>", public ] },
{ symbol: [ "pid_t", private, "<sys/shm.h>", public ] },
{ symbol: [ "pid_t", private, "<sys/wait.h>", public ] },
{ symbol: [ "pid_t", private, "<termios.h>", private ] },
{ symbol: [ "pid_t", private, "<time.h>", public ] },
{ symbol: [ "pid_t", private, "<unistd.h>", private ] },
{ symbol: [ "pid_t", private, "<utmpx.h>", public ] },
{ symbol: [ "ptrdiff_t", private, "<stddef.h>", public ] },
{ symbol: [ "regex_t", private, "<regex.h>", public ] },
{ symbol: [ "regmatch_t", private, "<regex.h>", public ] },
{ symbol: [ "regoff_t", private, "<regex.h>", public ] },
{ symbol: [ "sigevent", private, "<signal.h>", public ] },
{ symbol: [ "sigevent", private, "<aio.h>", public ] },
{ symbol: [ "sigevent", private, "<mqueue.h>", public ] },
{ symbol: [ "sigevent", private, "<time.h>", public ] },
{ symbol: [ "siginfo_t", private, "<signal.h>", public ] },
{ symbol: [ "siginfo_t", private, "<sys/wait.h>", public ] },
{ symbol: [ "sigset_t", private, "<signal.h>", public ] },
{ symbol: [ "sigset_t", private, "<spawn.h>", public ] },
{ symbol: [ "sigset_t", private, "<sys/select.h>", public ] },
{ symbol: [ "sigval", private, "<signal.h>", public ] },
{ symbol: [ "sockaddr", private, "<sys/socket.h>", private ] },
{ symbol: [ "socklen_t", private, "<sys/socket.h>", private ] },
{ symbol: [ "socklen_t", private, "<netdb.h>", private ] },
{ symbol: [ "ssize_t", private, "<sys/types.h>", public ] },
{ symbol: [ "ssize_t", private, "<aio.h>", public ] },
{ symbol: [ "ssize_t", private, "<monetary.h>", public ] },
{ symbol: [ "ssize_t", private, "<mqueue.h>", public ] },
{ symbol: [ "ssize_t", private, "<stdio.h>", public ] },
{ symbol: [ "ssize_t", private, "<sys/msg.h>", public ] },
{ symbol: [ "ssize_t", private, "<sys/socket.h>", private ] },
{ symbol: [ "ssize_t", private, "<sys/uio.h>", public ] },
{ symbol: [ "ssize_t", private, "<unistd.h>", private ] },
{ symbol: [ "stat", private, "<sys/stat.h>", public ] },
{ symbol: [ "stat", private, "<ftw.h>", public ] },
{ symbol: [ "suseconds_t", private, "<sys/types.h>", public ] },
{ symbol: [ "suseconds_t", private, "<sys/select.h>", public ] },
{ symbol: [ "suseconds_t", private, "<sys/time.h>", public ] },
{ symbol: [ "time_t", private, "<time.h>", public ] },
{ symbol: [ "time_t", private, "<sched.h>", public ] },
{ symbol: [ "time_t", private, "<sys/msg.h>", public ] },
{ symbol: [ "time_t", private, "<sys/select.h>", public ] },
{ symbol: [ "time_t", private, "<sys/sem.h>", public ] },
{ symbol: [ "time_t", private, "<sys/shm.h>", public ] },
{ symbol: [ "time_t", private, "<sys/stat.h>", public ] },
{ symbol: [ "time_t", private, "<sys/time.h>", public ] },
{ symbol: [ "time_t", private, "<sys/types.h>", public ] },
{ symbol: [ "time_t", private, "<utime.h>", public ] },
{ symbol: [ "timer_t", private, "<sys/types.h>", public ] },
{ symbol: [ "timer_t", private, "<time.h>", public ] },
{ symbol: [ "timespec", private, "<time.h>", public ] },
{ symbol: [ "timespec", private, "<aio.h>", public ] },
{ symbol: [ "timespec", private, "<mqueue.h>", public ] },
{ symbol: [ "timespec", private, "<sched.h>", public ] },
{ symbol: [ "timespec", private, "<signal.h>", public ] },
{ symbol: [ "timespec", private, "<sys/select.h>", public ] },
{ symbol: [ "timespec", private, "<sys/stat.h>", public ] },
{ symbol: [ "timeval", private, "<sys/time.h>", public ] },
{ symbol: [ "timeval", private, "<sys/resource.h>", public ] },
{ symbol: [ "timeval", private, "<sys/select.h>", public ] },
{ symbol: [ "timeval", private, "<utmpx.h>", public ] },
{ symbol: [ "tm", private, "<time.h>", public ] },
{ symbol: [ "u_char", private, "<sys/types.h>", public ] },
{ symbol: [ "u_char", private, "<rpc/types.h>", public ] },
{ symbol: [ "uid_t", private, "<sys/types.h>", public ] },
{ symbol: [ "uid_t", private, "<pwd.h>", public ] },
{ symbol: [ "uid_t", private, "<signal.h>", public ] },
{ symbol: [ "uid_t", private, "<stropts.h>", public ] },
{ symbol: [ "uid_t", private, "<sys/ipc.h>", public ] },
{ symbol: [ "uid_t", private, "<sys/stat.h>", public ] },
{ symbol: [ "uid_t", private, "<unistd.h>", private ] },
{ symbol: [ "useconds_t", private, "<sys/types.h>", public ] },
{ symbol: [ "useconds_t", private, "<unistd.h>", private ] },
{ symbol: [ "wchar_t", private, "<stddef.h>", public ] },
{ symbol: [ "wchar_t", private, "<stdlib.h>", public ] },
{ symbol: [ "size_t", private, "<stddef.h>", public ] },
{ symbol: [ "size_t", private, "<aio.h>", public ] },
{ symbol: [ "size_t", private, "<glob.h>", public ] },
{ symbol: [ "size_t", private, "<grp.h>", public ] },
{ symbol: [ "size_t", private, "<iconv.h>", public ] },
{ symbol: [ "size_t", private, "<monetary.h>", public ] },
{ symbol: [ "size_t", private, "<mqueue.h>", public ] },
{ symbol: [ "size_t", private, "<ndbm.h>", public ] },
{ symbol: [ "size_t", private, "<pwd.h>", public ] },
{ symbol: [ "size_t", private, "<regex.h>", public ] },
{ symbol: [ "size_t", private, "<search.h>", public ] },
{ symbol: [ "size_t", private, "<signal.h>", public ] },
{ symbol: [ "size_t", private, "<stdio.h>", public ] },
{ symbol: [ "size_t", private, "<stdlib.h>", public ] },
{ symbol: [ "size_t", private, "<string.h>", public ] },
{ symbol: [ "size_t", private, "<strings.h>", public ] },
{ symbol: [ "size_t", private, "<sys/mman.h>", public ] },
{ symbol: [ "size_t", private, "<sys/msg.h>", public ] },
{ symbol: [ "size_t", private, "<sys/sem.h>", public ] },
{ symbol: [ "size_t", private, "<sys/shm.h>", public ] },
{ symbol: [ "size_t", private, "<sys/socket.h>", private ] },
{ symbol: [ "size_t", private, "<sys/types.h>", public ] },
{ symbol: [ "size_t", private, "<sys/uio.h>", public ] },
{ symbol: [ "size_t", private, "<time.h>", public ] },
{ symbol: [ "size_t", private, "<uchar.h>", public ] },
{ symbol: [ "size_t", private, "<unistd.h>", private ] },
{ symbol: [ "size_t", private, "<wchar.h>", public ] },
{ symbol: [ "size_t", private, "<wordexp.h>", public ] },
# Macros that can be defined in more than one file, don't have the
# same __foo_defined guard that other types do, so the grep above
# doesn't discover them. Until I figure out a better way, I just
# add them in by hand as I discover them.
{ symbol: [ "EOF", private, "<stdio.h>", public ] },
{ symbol: [ "EOF", private, "<libio.h>", public ] },
{ symbol: [ "FILE", private, "<stdio.h>", public ] },
{ symbol: [ "MAP_POPULATE", private, "<sys/mman.h>", public ] },
{ symbol: [ "MAP_POPULATE", private, "<linux/mman.h>", public ] },
{ symbol: [ "MAP_STACK", private, "<sys/mman.h>", public ] },
{ symbol: [ "MAP_STACK", private, "<linux/mman.h>", public ] },
{ symbol: [ "MAXHOSTNAMELEN", private, "<sys/param.h>", public ] },
{ symbol: [ "MAXHOSTNAMELEN", private, "<protocols/timed.h>", public ] },
{ symbol: [ "SIGABRT", private, "<signal.h>", public ] },
{ symbol: [ "SIGCHLD", private, "<signal.h>", public ] },
{ symbol: [ "SIGCHLD", private, "<linux/signal.h>", public ] },
{ symbol: [ "va_list", private, "<stdarg.h>", public ] },
{ symbol: [ "va_list", private, "<stdio.h>", public ] },
{ symbol: [ "va_list", private, "<wchar.h>", public ] },
# These are symbols that could be defined in either stdlib.h or
# malloc.h, but we always want the stdlib location.
{ symbol: [ "malloc", private, "<stdlib.h>", public ] },
{ symbol: [ "calloc", private, "<stdlib.h>", public ] },
{ symbol: [ "realloc", private, "<stdlib.h>", public ] },
{ symbol: [ "free", private, "<stdlib.h>", public ] },
# Entries for NULL
{ symbol: [ "NULL", private, "<stddef.h>", public ] }, # 'canonical' location for NULL
{ symbol: [ "NULL", private, "<clocale>", public ] },
{ symbol: [ "NULL", private, "<cstddef>", public ] },
{ symbol: [ "NULL", private, "<cstdio>", public ] },
{ symbol: [ "NULL", private, "<cstdlib>", public ] },
{ symbol: [ "NULL", private, "<cstring>", public ] },
{ symbol: [ "NULL", private, "<ctime>", public ] },
{ symbol: [ "NULL", private, "<cwchar>", public ] },
{ symbol: [ "NULL", private, "<locale.h>", public ] },
{ symbol: [ "NULL", private, "<stdio.h>", public ] },
{ symbol: [ "NULL", private, "<stdlib.h>", public ] },
{ symbol: [ "NULL", private, "<string.h>", public ] },
{ symbol: [ "NULL", private, "<time.h>", public ] },
{ symbol: [ "NULL", private, "<unistd.h>", private ] },
{ symbol: [ "NULL", private, "<wchar.h>", public ] },
# Kludge time: almost all STL types take an allocator, but they
# almost always use the default value. Usually we detect that
# and don't try to do IWYU, but sometimes it passes through.
# For instance, when adding two strings, we end up calling
# template<_CharT,_Traits,_Alloc> ... operator+(
# basic_string<_CharT,_Traits,_Alloc>, ...)
# These look like normal template args to us, so we see they're
# used and declare an iwyu dependency, even though we don't need
# to #include the traits or alloc type ourselves. The surest way
# to deal with this is to just say that everyone provides
# std::allocator. We can add more here at need.
{ symbol: [ "std::allocator", private, "<memory>", public ] },
{ symbol: [ "std::allocator", private, "<string>", public ] },
{ symbol: [ "std::allocator", private, "<vector>", public ] },
{ symbol: [ "std::allocator", private, "<map>", public ] },
{ symbol: [ "std::allocator", private, "<set>", public ] },
# A similar kludge for std::char_traits. basic_string,
# basic_ostream and basic_istream have this as a default template
# argument, and sometimes it bleeds through when clang desugars the
# string/ostream/istream type.
{ symbol: [ "std::char_traits", private, "<string>", public ] },
{ symbol: [ "std::char_traits", private, "<ostream>", public ] },
{ symbol: [ "std::char_traits", private, "<istream>", public ] },
{ symbol: [ "std::size_t", private, "<cstddef>", public ] },
{ symbol: [ "std::size_t", private, "<cstdio>", public ] },
{ symbol: [ "std::size_t", private, "<cstdlib>", public ] },
{ symbol: [ "std::size_t", private, "<cstring>", public ] },
{ symbol: [ "std::size_t", private, "<ctime>", public ] },
{ symbol: [ "std::size_t", private, "<cuchar>", public ] },
{ symbol: [ "std::size_t", private, "<cwchar>", public ] }
]
# vim: set ft=toml:

View File

@ -1,238 +1,30 @@
[ [
# Generated to normal headers: header.h.generated.h -> nvim/header.h { ref: "c99.imp" },
{ include: [ '"api/autocmd.h.generated.h"', private, '"nvim/api/autocmd.h"', public ] }, { ref: "posix.imp" },
{ include: [ '"api/buffer.h.generated.h"', private, '"nvim/api/buffer.h"', public ] },
{ include: [ '"api/command.h.generated.h"', private, '"nvim/api/command.h"', public ] },
{ include: [ '"api/deprecated.h.generated.h"', private, '"nvim/api/deprecated.h"', public ] },
{ include: [ '"api/extmark.h.generated.h"', private, '"nvim/api/extmark.h"', public ] },
{ include: [ '"api/options.h.generated.h"', private, '"nvim/api/options.h"', public ] },
{ include: [ '"api/private/converter.h.generated.h"', private, '"nvim/api/private/converter.h"', public ] },
{ include: [ '"api/private/dispatch.h.generated.h"', private, '"nvim/api/private/dispatch.h"', public ] },
{ include: [ '"api/private/helpers.h.generated.h"', private, '"nvim/api/private/helpers.h"', public ] },
{ include: [ '"api/tabpage.h.generated.h"', private, '"nvim/api/tabpage.h"', public ] },
{ include: [ '"api/ui.h.generated.h"', private, '"nvim/api/ui.h"', public ] },
{ include: [ '"api/vim.h.generated.h"', private, '"nvim/api/vim.h"', public ] },
{ include: [ '"api/vimscript.h.generated.h"', private, '"nvim/api/vimscript.h"', public ] },
{ include: [ '"api/win_config.h.generated.h"', private, '"nvim/api/win_config.h"', public ] },
{ include: [ '"api/window.h.generated.h"', private, '"nvim/api/window.h"', public ] },
{ include: [ '"arabic.h.generated.h"', private, '"nvim/arabic.h"', public ] },
{ include: [ '"arglist.h.generated.h"', private, '"nvim/arglist.h"', public ] },
{ include: [ '"autocmd.h.generated.h"', private, '"nvim/autocmd.h"', public ] },
{ include: [ '"buffer.h.generated.h"', private, '"nvim/buffer.h"', public ] },
{ include: [ '"buffer_updates.h.generated.h"', private, '"nvim/buffer_updates.h"', public ] },
{ include: [ '"change.h.generated.h"', private, '"nvim/change.h"', public ] },
{ include: [ '"channel.h.generated.h"', private, '"nvim/channel.h"', public ] },
{ include: [ '"charset.h.generated.h"', private, '"nvim/charset.h"', public ] },
{ include: [ '"cmdexpand.h.generated.h"', private, '"nvim/cmdexpand.h"', public ] },
{ include: [ '"cmdhist.h.generated.h"', private, '"nvim/cmdhist.h"', public ] },
{ include: [ '"context.h.generated.h"', private, '"nvim/context.h"', public ] },
{ include: [ '"cursor.h.generated.h"', private, '"nvim/cursor.h"', public ] },
{ include: [ '"cursor_shape.h.generated.h"', private, '"nvim/cursor_shape.h"', public ] },
{ include: [ '"debugger.h.generated.h"', private, '"nvim/debugger.h"', public ] },
{ include: [ '"decoration.h.generated.h"', private, '"nvim/decoration.h"', public ] },
{ include: [ '"decoration_provider.h.generated.h"', private, '"nvim/decoration_provider.h"', public ] },
{ include: [ '"diff.h.generated.h"', private, '"nvim/diff.h"', public ] },
{ include: [ '"digraph.h.generated.h"', private, '"nvim/digraph.h"', public ] },
{ include: [ '"drawline.h.generated.h"', private, '"nvim/drawline.h"', public ] },
{ include: [ '"drawscreen.h.generated.h"', private, '"nvim/drawscreen.h"', public ] },
{ include: [ '"edit.h.generated.h"', private, '"nvim/edit.h"', public ] },
{ include: [ '"eval.h.generated.h"', private, '"nvim/eval.h"', public ] },
{ include: [ '"eval/buffer.h.generated.h"', private, '"nvim/eval/buffer.h"', public ] },
{ include: [ '"eval/decode.h.generated.h"', private, '"nvim/eval/decode.h"', public ] },
{ include: [ '"eval/encode.h.generated.h"', private, '"nvim/eval/encode.h"', public ] },
{ include: [ '"eval/executor.h.generated.h"', private, '"nvim/eval/executor.h"', public ] },
{ include: [ '"eval/funcs.h.generated.h"', private, '"nvim/eval/funcs.h"', public ] },
{ include: [ '"eval/typval.h.generated.h"', private, '"nvim/eval/typval.h"', public ] },
{ include: [ '"eval/userfunc.h.generated.h"', private, '"nvim/eval/userfunc.h"', public ] },
{ include: [ '"eval/vars.h.generated.h"', private, '"nvim/eval/vars.h"', public ] },
{ include: [ '"eval/window.h.generated.h"', private, '"nvim/eval/window.h"', public ] },
{ include: [ '"event/libuv_process.h.generated.h"', private, '"nvim/event/libuv_process.h"', public ] },
{ include: [ '"event/loop.h.generated.h"', private, '"nvim/event/loop.h"', public ] },
{ include: [ '"event/multiqueue.h.generated.h"', private, '"nvim/event/multiqueue.h"', public ] },
{ include: [ '"event/process.h.generated.h"', private, '"nvim/event/process.h"', public ] },
{ include: [ '"event/rstream.h.generated.h"', private, '"nvim/event/rstream.h"', public ] },
{ include: [ '"event/signal.h.generated.h"', private, '"nvim/event/signal.h"', public ] },
{ include: [ '"event/socket.h.generated.h"', private, '"nvim/event/socket.h"', public ] },
{ include: [ '"event/stream.h.generated.h"', private, '"nvim/event/stream.h"', public ] },
{ include: [ '"event/time.h.generated.h"', private, '"nvim/event/time.h"', public ] },
{ include: [ '"event/wstream.h.generated.h"', private, '"nvim/event/wstream.h"', public ] },
{ include: [ '"ex_cmds.h.generated.h"', private, '"nvim/ex_cmds.h"', public ] },
{ include: [ '"ex_cmds2.h.generated.h"', private, '"nvim/ex_cmds2.h"', public ] },
{ include: [ '"ex_docmd.h.generated.h"', private, '"nvim/ex_docmd.h"', public ] },
{ include: [ '"ex_eval.h.generated.h"', private, '"nvim/ex_eval.h"', public ] },
{ include: [ '"ex_getln.h.generated.h"', private, '"nvim/ex_getln.h"', public ] },
{ include: [ '"ex_session.h.generated.h"', private, '"nvim/ex_session.h"', public ] },
{ include: [ '"extmark.h.generated.h"', private, '"nvim/extmark.h"', public ] },
{ include: [ '"file_search.h.generated.h"', private, '"nvim/file_search.h"', public ] },
{ include: [ '"fileio.h.generated.h"', private, '"nvim/fileio.h"', public ] },
{ include: [ '"fold.h.generated.h"', private, '"nvim/fold.h"', public ] },
{ include: [ '"garray.h.generated.h"', private, '"nvim/garray.h"', public ] },
{ include: [ '"getchar.h.generated.h"', private, '"nvim/getchar.h"', public ] },
{ include: [ '"grid.h.generated.h"', private, '"nvim/grid.h"', public ] },
{ include: [ '"hashtab.h.generated.h"', private, '"nvim/hashtab.h"', public ] },
{ include: [ '"help.h.generated.h"', private, '"nvim/help.h"', public ] },
{ include: [ '"highlight.h.generated.h"', private, '"nvim/highlight.h"', public ] },
{ include: [ '"highlight_group.h.generated.h"', private, '"nvim/highlight_group.h"', public ] },
{ include: [ '"if_cscope.h.generated.h"', private, '"nvim/if_cscope.h"', public ] },
{ include: [ '"indent.h.generated.h"', private, '"nvim/indent.h"', public ] },
{ include: [ '"indent_c.h.generated.h"', private, '"nvim/indent_c.h"', public ] },
{ include: [ '"input.h.generated.h"', private, '"nvim/input.h"', public ] },
{ include: [ '"insexpand.h.generated.h"', private, '"nvim/insexpand.h"', public ] },
{ include: [ '"keycodes.h.generated.h"', private, '"nvim/keycodes.h"', public ] },
{ include: [ '"linematch.h.generated.h"', private, '"nvim/linematch.h"', public ] },
{ include: [ '"locale.h.generated.h"', private, '"nvim/locale.h"', public ] },
{ include: [ '"log.h.generated.h"', private, '"nvim/log.h"', public ] },
{ include: [ '"lua/converter.h.generated.h"', private, '"nvim/lua/converter.h"', public ] },
{ include: [ '"lua/executor.h.generated.h"', private, '"nvim/lua/executor.h"', public ] },
{ include: [ '"lua/spell.h.generated.h"', private, '"nvim/lua/spell.h"', public ] },
{ include: [ '"lua/stdlib.h.generated.h"', private, '"nvim/lua/stdlib.h"', public ] },
{ include: [ '"lua/treesitter.h.generated.h"', private, '"nvim/lua/treesitter.h"', public ] },
{ include: [ '"lua/xdiff.h.generated.h"', private, '"nvim/lua/xdiff.h"', public ] },
{ include: [ '"main.h.generated.h"', private, '"nvim/main.h"', public ] },
{ include: [ '"mapping.h.generated.h"', private, '"nvim/mapping.h"', public ] },
{ include: [ '"mark.h.generated.h"', private, '"nvim/mark.h"', public ] },
{ include: [ '"marktree.h.generated.h"', private, '"nvim/marktree.h"', public ] },
{ include: [ '"match.h.generated.h"', private, '"nvim/match.h"', public ] },
{ include: [ '"math.h.generated.h"', private, '"nvim/math.h"', public ] },
{ include: [ '"mbyte.h.generated.h"', private, '"nvim/mbyte.h"', public ] },
{ include: [ '"memfile.h.generated.h"', private, '"nvim/memfile.h"', public ] },
{ include: [ '"memline.h.generated.h"', private, '"nvim/memline.h"', public ] },
{ include: [ '"memory.h.generated.h"', private, '"nvim/memory.h"', public ] },
{ include: [ '"menu.h.generated.h"', private, '"nvim/menu.h"', public ] },
{ include: [ '"message.h.generated.h"', private, '"nvim/message.h"', public ] },
{ include: [ '"mouse.h.generated.h"', private, '"nvim/mouse.h"', public ] },
{ include: [ '"move.h.generated.h"', private, '"nvim/move.h"', public ] },
{ include: [ '"msgpack_rpc/channel.h.generated.h"', private, '"nvim/msgpack_rpc/channel.h"', public ] },
{ include: [ '"msgpack_rpc/helpers.h.generated.h"', private, '"nvim/msgpack_rpc/helpers.h"', public ] },
{ include: [ '"msgpack_rpc/server.h.generated.h"', private, '"nvim/msgpack_rpc/server.h"', public ] },
{ include: [ '"msgpack_rpc/unpacker.h.generated.h"', private, '"nvim/msgpack_rpc/unpacker.h"', public ] },
{ include: [ '"normal.h.generated.h"', private, '"nvim/normal.h"', public ] },
{ include: [ '"ops.h.generated.h"', private, '"nvim/ops.h"', public ] },
{ include: [ '"option.h.generated.h"', private, '"nvim/option.h"', public ] },
{ include: [ '"optionstr.h.generated.h"', private, '"nvim/optionstr.h"', public ] },
{ include: [ '"os/dl.h.generated.h"', private, '"nvim/os/dl.h"', public ] },
{ include: [ '"os/fileio.h.generated.h"', private, '"nvim/os/fileio.h"', public ] },
{ include: [ '"os/fs.h.generated.h"', private, '"nvim/os/fs.h"', public ] },
{ include: [ '"os/input.h.generated.h"', private, '"nvim/os/input.h"', public ] },
{ include: [ '"os/lang.h.generated.h"', private, '"nvim/os/lang.h"', public ] },
{ include: [ '"os/process.h.generated.h"', private, '"nvim/os/process.h"', public ] },
{ include: [ '"os/pty_process_unix.h.generated.h"', private, '"nvim/os/pty_process_unix.h"', private ] },
{ include: [ '"os/shell.h.generated.h"', private, '"nvim/os/shell.h"', public ] },
{ include: [ '"os/signal.h.generated.h"', private, '"nvim/os/signal.h"', public ] },
{ include: [ '"os/time.h.generated.h"', private, '"nvim/os/time.h"', public ] },
{ include: [ '"path.h.generated.h"', private, '"nvim/path.h"', public ] },
{ include: [ '"plines.h.generated.h"', private, '"nvim/plines.h"', public ] },
{ include: [ '"popupmenu.h.generated.h"', private, '"nvim/popupmenu.h"', public ] },
{ include: [ '"profile.h.generated.h"', private, '"nvim/profile.h"', public ] },
{ include: [ '"quickfix.h.generated.h"', private, '"nvim/quickfix.h"', public ] },
{ include: [ '"rbuffer.h.generated.h"', private, '"nvim/rbuffer.h"', public ] },
{ include: [ '"regexp.h.generated.h"', private, '"nvim/regexp.h"', public ] },
{ include: [ '"runtime.h.generated.h"', private, '"nvim/runtime.h"', public ] },
{ include: [ '"screen.h.generated.h"', private, '"nvim/screen.h"', public ] },
{ include: [ '"search.h.generated.h"', private, '"nvim/search.h"', public ] },
{ include: [ '"sha256.h.generated.h"', private, '"nvim/sha256.h"', public ] },
{ include: [ '"shada.h.generated.h"', private, '"nvim/shada.h"', public ] },
{ include: [ '"sign.h.generated.h"', private, '"nvim/sign.h"', public ] },
{ include: [ '"spell.h.generated.h"', private, '"nvim/spell.h"', public ] },
{ include: [ '"spellfile.h.generated.h"', private, '"nvim/spellfile.h"', public ] },
{ include: [ '"spellsuggest.h.generated.h"', private, '"nvim/spellsuggest.h"', public ] },
{ include: [ '"state.h.generated.h"', private, '"nvim/state.h"', public ] },
{ include: [ '"statusline.h.generated.h"', private, '"nvim/statusline.h"', public ] },
{ include: [ '"strings.h.generated.h"', private, '"nvim/strings.h"', public ] },
{ include: [ '"syntax.h.generated.h"', private, '"nvim/syntax.h"', public ] },
{ include: [ '"tag.h.generated.h"', private, '"nvim/tag.h"', public ] },
{ include: [ '"terminal.h.generated.h"', private, '"nvim/terminal.h"', public ] },
{ include: [ '"testing.h.generated.h"', private, '"nvim/testing.h"', public ] },
{ include: [ '"textformat.h.generated.h"', private, '"nvim/textformat.h"', public ] },
{ include: [ '"textobject.h.generated.h"', private, '"nvim/textobject.h"', public ] },
{ include: [ '"tui/input.h.generated.h"', private, '"nvim/tui/input.h"', public ] },
{ include: [ '"tui/terminfo.h.generated.h"', private, '"nvim/tui/terminfo.h"', public ] },
{ include: [ '"tui/tui.h.generated.h"', private, '"nvim/tui/tui.h"', public ] },
{ include: [ '"ugrid.h.generated.h"', private, '"nvim/ugrid.h"', public ] },
{ include: [ '"ui.h.generated.h"', private, '"nvim/ui.h"', public ] },
{ include: [ '"ui_bridge.h.generated.h"', private, '"nvim/ui_bridge.h"', public ] },
{ include: [ '"ui_client.h.generated.h"', private, '"nvim/ui_client.h"', public ] },
{ include: [ '"ui_compositor.h.generated.h"', private, '"nvim/ui_compositor.h"', public ] },
{ include: [ '"undo.h.generated.h"', private, '"nvim/undo.h"', public ] },
{ include: [ '"usercmd.h.generated.h"', private, '"nvim/usercmd.h"', public ] },
{ include: [ '"version.h.generated.h"', private, '"nvim/version.h"', public ] },
{ include: [ '"viml/parser/expressions.h.generated.h"', private, '"nvim/viml/parser/expressions.h"', public ] },
{ include: [ '"viml/parser/parser.h.generated.h"', private, '"nvim/viml/parser/parser.h"', public ] },
{ include: [ '"window.h.generated.h"', private, '"nvim/window.h"', public ] },
# Generated to normal headers with a different name: header.h.generated.h -> nvim/some_other_header.h { symbol: [ "FUNC_ATTR_ALLOC_ALIGN", private, '"nvim/func_attr.h"', public ] },
{ include: [ '"api/private/dispatch_wrappers.h.generated.h"', private, '"nvim/api/private/dispatch.h"', public ] }, { symbol: [ "FUNC_ATTR_ALLOC_SIZE", private, '"nvim/func_attr.h"', public ] },
{ include: [ '"auevents_enum.generated.h"', private, '"nvim/autocmd.h"', public ] }, { symbol: [ "FUNC_ATTR_ALLOC_SIZE_PROD", private, '"nvim/func_attr.h"', public ] },
{ include: [ '"ex_cmds_enum.generated.h"', private, '"nvim/ex_cmds_defs.h"', public ] }, { symbol: [ "FUNC_ATTR_ALWAYS_INLINE", private, '"nvim/func_attr.h"', public ] },
{ include: [ '"keysets.h.generated.h"', private, '"nvim/api/private/helpers.h"', public ] }, { symbol: [ "FUNC_ATTR_CONST", private, '"nvim/func_attr.h"', public ] },
{ include: [ '"keysets_defs.generated.h"', private, '"nvim/api/private/defs.h"', public ] }, { symbol: [ "FUNC_ATTR_MALLOC", private, '"nvim/func_attr.h"', public ] },
{ include: [ '"nvim/os/pty_process_unix.h"', private, '"nvim/os/pty_process.h"', public ] }, { symbol: [ "FUNC_ATTR_NONNULL_ALL", private, '"nvim/func_attr.h"', public ] },
{ include: [ '"nvim/os/pty_process_win.h"', private, '"nvim/os/pty_process.h"', public ] }, { symbol: [ "FUNC_ATTR_NONNULL_ARG", private, '"nvim/func_attr.h"', public ] },
{ include: [ '"nvim/os/unix_defs.h"', private, '"nvim/os/os_defs.h"', public ] }, { symbol: [ "FUNC_ATTR_NONNULL_RET", private, '"nvim/func_attr.h"', public ] },
{ include: [ '"nvim/os/win_defs.h"', private, '"nvim/os/os_defs.h"', public ] }, { symbol: [ "FUNC_ATTR_NORETURN", private, '"nvim/func_attr.h"', public ] },
{ include: [ '"os/env.h.generated.h"', private, '"nvim/os/os.h"', public ] }, { symbol: [ "FUNC_ATTR_NO_SANITIZE_ADDRESS", private, '"nvim/func_attr.h"', public ] },
{ include: [ '"os/fs.h.generated.h"', private, '"nvim/os/os.h"', public ] }, { symbol: [ "FUNC_ATTR_NO_SANITIZE_UNDEFINED", private, '"nvim/func_attr.h"', public ] },
{ include: [ '"os/mem.h.generated.h"', private, '"nvim/os/os.h"', public ] }, { symbol: [ "FUNC_ATTR_PRINTF", private, '"nvim/func_attr.h"', public ] },
{ include: [ '"os/stdpaths.h.generated.h"', private, '"nvim/os/os.h"', public ] }, { symbol: [ "FUNC_ATTR_PURE", private, '"nvim/func_attr.h"', public ] },
{ include: [ '"os/users.h.generated.h"', private, '"nvim/os/os.h"', public ] }, { symbol: [ "FUNC_ATTR_UNUSED", private, '"nvim/func_attr.h"', public ] },
{ include: [ '"regexp_bt.h.generated.h"', private, '"nvim/regexp.h"', public ] }, { symbol: [ "FUNC_ATTR_WARN_UNUSED_RESULT", private, '"nvim/func_attr.h"', public ] },
{ include: [ '"ui_events_call.h.generated.h"', private, '"nvim/ui.h"', public ] }, { symbol: [ "MAX", private, '"nvim/macros_defs.h"', public ] },
{ include: [ '"ui_events_client.h.generated.h"', private, '"nvim/ui_client.h"', public ] }, { symbol: [ "MIN", private, '"nvim/macros_defs.h"', public ] },
{ include: [ '"ui_events_remote.generated.h"', private, '"nvim/api/ui.h"', public ] }, { symbol: [ "extern_proc", private, '<uv.h>', public ] },
{ include: [ '"ui_events_remote.h.generated.h"', private, '"nvim/api/ui.h"', public ] }, { symbol: [ "iovec", private, '<sys/uio.h>', public ] },
{ symbol: [ "ssize_t", private, '<uv.h>', public ] },
# Def to normal headers: nvim/header_defs.h -> nvim/header.h
#
# This is a public to public mapping, meaning that while IWYU can use the
# headers on the left, it will use the headers on the right if possible. This
# isn't explicitly mentioned in the IWYU docs, this is just my interpretation
# of its behavior.
{ include: [ '"nvim/buffer_defs.h"', public, '"nvim/buffer.h"', public ] },
{ include: [ '"nvim/ex_cmds_defs.h"', public, '"nvim/ex_cmds.h"', public ] },
{ include: [ '"nvim/ex_eval_defs.h"', public, '"nvim/ex_eval.h"', public ] },
{ include: [ '"nvim/extmark_defs.h"', public, '"nvim/extmark.h"', public ] },
{ include: [ '"nvim/grid_defs.h"', public, '"nvim/grid.h"', public ] },
{ include: [ '"nvim/highlight_defs.h"', public, '"nvim/highlight.h"', public ] },
{ include: [ '"nvim/map_defs.h"', public, '"nvim/map.h"', public ] },
{ include: [ '"nvim/mark_defs.h"', public, '"nvim/mark.h"', public ] },
{ include: [ '"nvim/mbyte_defs.h"', public, '"nvim/mbyte.h"', public ] },
{ include: [ '"nvim/memfile_defs.h"', public, '"nvim/memfile.h"', public ] },
{ include: [ '"nvim/memline_defs.h"', public, '"nvim/memline.h"', public ] },
{ include: [ '"nvim/menu_defs.h"', public, '"nvim/menu.h"', public ] },
{ include: [ '"nvim/msgpack/channel_defs.h"', public, '"nvim/msgpack/channel.h"', public ] },
{ include: [ '"nvim/option_defs.h"', public, '"nvim/option.h"', public ] },
{ include: [ '"nvim/os/fs_defs.h"', public, '"nvim/os/fs.h"', public ] },
{ include: [ '"nvim/os/os_defs.h"', public, '"nvim/os/os.h"', public ] },
{ include: [ '"nvim/regexp_defs.h"', public, '"nvim/regexp.h"', public ] },
{ include: [ '"nvim/sign_defs.h"', public, '"nvim/sign.h"', public ] },
{ include: [ '"nvim/spell_defs.h"', public, '"nvim/spell.h"', public ] },
{ include: [ '"nvim/statusline_defs.h"', public, '"nvim/statusline.h"', public ] },
{ include: [ '"nvim/syntax_defs.h"', public, '"nvim/syntax.h"', public ] },
{ include: [ '"nvim/tui/input_defs.h"', public, '"nvim/tui/input.h"', public ] },
{ include: [ '"nvim/undo_defs.h"', public, '"nvim/undo.h"', public ] },
# Third party headers
{ include: [ "<bits/types/wint_t.h>", private, "<wchar.h>", public ] },
{ include: [ '<arpa/inet.h>', private, '<uv/unix.h>', private ] },
{ include: [ '<bits/termios-c_cc.h>', private, '<termios.h>', private ] },
{ include: [ '<bits/termios-c_cflag.h>', private, '<termios.h>', private ] },
{ include: [ '<bits/termios-c_iflag.h>', private, '<termios.h>', private ] },
{ include: [ '<bits/termios-c_oflag.h>', private, '<termios.h>', private ] },
{ include: [ '<libintl.h>', private, '"nvim/gettext.h"', public ] },
{ include: [ '<netdb.h>', private, '<uv/unix.h>', private ] },
{ include: [ '<netinet/in.h>', private, '<uv/unix.h>', private ] },
{ include: [ '<pthread.h>', private, '"nvim/os/unix_defs.h"', private ] },
{ include: [ '<sys/socket.h>', private, '<uv/unix.h>', private ] },
{ include: [ '<termios.h>', private, '"nvim/os/unix_defs.h"', private ] },
{ include: [ '<unistd.h>', private, '"nvim/os/unix_defs.h"', private ] },
{ include: [ '<uv/unix.h>', private, '<uv.h>', public ] }, { include: [ '<uv/unix.h>', private, '<uv.h>', public ] },
# Symbols
{ symbol: [ "MAX", private, '"nvim/macros.h"', public ] },
{ symbol: [ "MIN", private, '"nvim/macros.h"', public ] },
{ symbol: [ "SEEK_END", private, '<stdio.h>', public ] },
{ symbol: [ "SEEK_SET", private, '<stdio.h>', public ] },
{ symbol: [ "time_fd", private, '"nvim/globals.h"', public ] },
] ]
# vim: set ft=toml: # vim: set ft=toml:

View File

@ -0,0 +1,33 @@
[
{ include: [ "<arm/limits.h>", private, "<limits.h>", public ] },
{ include: [ "<asm/ioctls.h>", private, "<bits/ioctls.h>", private ] },
{ include: [ "<bits/termios-c_lflag.h>", private, "<termios.h>", public ] },
{ include: [ "<bits/termios-struct.h>", private, "<termios.h>", public ] },
{ include: [ "<sys/errno.h>", private, "<errno.h>", public ] },
{ include: [ "<sys/fcntl.h>", private, "<fcntl.h>", public ] },
{ include: [ "<sys/signal.h>", private, "<signal.h>", public ] },
{ include: [ "<sys/termios.h>", private, "<termios.h>", public ] },
{ include: [ '<asm/errno-base.h>', private, '<errno.h>', public ] },
{ include: [ '<asm/errno.h>', private, '<errno.h>', public ] },
{ include: [ '<bits/termios-c_cc.h>', private, '<termios.h>', public ] },
{ include: [ '<bits/termios-c_cflag.h>', private, '<termios.h>', public ] },
{ include: [ '<bits/termios-c_iflag.h>', private, '<termios.h>', public ] },
{ include: [ '<bits/termios-c_oflag.h>', private, '<termios.h>', public ] },
{ include: [ '<sys/ttycom.h>', private, '<sys/ioctl.h>', public ] },
{ include: [ '<sys/unistd.h>', private, '<unistd.h>', private ] },
{ symbol: ["SOCK_STREAM", private, "<sys/socket.h>", public ] },
{ symbol: ["SSIZE_MAX", private, "<limits.h>", public ] },
{ symbol: ["S_IREAD", private, "<sys/stat.h>", public ] },
{ symbol: ["S_IWRITE", private, "<sys/stat.h>", public ] },
{ symbol: ["_POSIX_VDISABLE", private, "<unistd.h>", private ] },
{ symbol: ["flock", private, "<sys/file.h>", public ] },
{ symbol: ["iovec", private, "<sys/uio.h>", public ] },
{ symbol: ["mode_t", private, "<sys/types.h>", public ] },
{ symbol: ["ntohs", private, "<arpa/inet.h>", public ] },
{ symbol: ["pthread_sigmask", private, "<signal.h>", public ] },
{ symbol: ["sigset_t", private, "<signal.h>", public ] },
{ symbol: ["uid_t", private, "<sys/types.h>", public ] },
]
# vim: set ft=toml:

View File

@ -1,6 +0,0 @@
// This is an open source non-commercial project. Dear PVS-Studio, please check
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
#include "${PROJECT_SOURCE_DIR}/src/nvim/vim.h"
char *default_vim_dir = "${CMAKE_INSTALL_FULL_DATAROOTDIR}/nvim";
char *default_vimruntime_dir = "";
char *default_lib_dir = "${CMAKE_INSTALL_FULL_LIBDIR}/nvim";

View File

@ -0,0 +1,3 @@
char *default_vim_dir = "${CMAKE_INSTALL_FULL_DATAROOTDIR}/nvim";
char *default_vimruntime_dir = "";
char *default_lib_dir = "${CMAKE_INSTALL_FULL_LIBDIR}/nvim";

View File

@ -11,11 +11,7 @@
# include "auto/versiondef_git.h" # include "auto/versiondef_git.h"
#endif #endif
#define NVIM_API_LEVEL @NVIM_API_LEVEL@ #define NVIM_VERSION_CFLAGS "${VERSION_STRING}"
#define NVIM_API_LEVEL_COMPAT @NVIM_API_LEVEL_COMPAT@
#define NVIM_API_PRERELEASE @NVIM_API_PRERELEASE@
#define NVIM_VERSION_CFLAGS "${CMAKE_C_COMPILER} $<$<CONFIG:Debug>:${CMAKE_C_FLAGS_DEBUG}>$<$<CONFIG:Release>:${CMAKE_C_FLAGS_RELEASE}>$<$<CONFIG:RelWithDebInfo>:${CMAKE_C_FLAGS_RELWITHDEBINFO}>$<$<CONFIG:MinSizeRel>:${CMAKE_C_FLAGS_MINSIZEREL}> $<JOIN:$<TARGET_PROPERTY:nvim,COMPILE_OPTIONS>, > -D$<JOIN:$<TARGET_PROPERTY:nvim,COMPILE_DEFINITIONS>, -D> -I$<JOIN:$<TARGET_PROPERTY:nvim,INCLUDE_DIRECTORIES>, -I>"
#define NVIM_VERSION_BUILD_TYPE "$<CONFIG>" #define NVIM_VERSION_BUILD_TYPE "$<CONFIG>"
#endif // AUTO_VERSIONDEF_H #endif // AUTO_VERSIONDEF_H

View File

@ -1,5 +1,5 @@
# This is not meant to be included by the top-level. # This is not meant to be included by the top-level.
cmake_minimum_required (VERSION 3.10) cmake_minimum_required(VERSION 3.16)
project(NVIM_DEPS C) project(NVIM_DEPS C)
if(POLICY CMP0135) if(POLICY CMP0135)
@ -10,19 +10,57 @@ endif()
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" "${PROJECT_SOURCE_DIR}/../cmake") list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" "${PROJECT_SOURCE_DIR}/../cmake")
include(CheckCCompilerFlag) include(CheckCCompilerFlag)
include(ExternalProject)
include(FindPackageHandleStandardArgs)
include(Deps)
include(Find)
include(Util) include(Util)
set(DEPS_CMAKE_ARGS #-------------------------------------------------------------------------------
-D CMAKE_C_COMPILER=${CMAKE_C_COMPILER} # User settings
-D CMAKE_C_STANDARD=99 #-------------------------------------------------------------------------------
-D CMAKE_GENERATOR=${CMAKE_GENERATOR}
-D CMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
-D CMAKE_POSITION_INDEPENDENT_CODE=ON)
set(DEPS_CMAKE_CACHE_ARGS -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES}) set(DEPS_IGNORE_SHA FALSE)
set_default_buildtype() # Options
option(USE_BUNDLED "Use bundled dependencies." ON)
option(USE_BUNDLED_LIBUV "Use the bundled libuv." ${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_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)
else()
option(USE_BUNDLED_GETTEXT "Use the bundled version of gettext." OFF)
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)
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(NOT isMultiConfig) if(NOT isMultiConfig)
list(APPEND DEPS_CMAKE_ARGS -D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}) list(APPEND DEPS_CMAKE_ARGS -D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
@ -35,87 +73,7 @@ if(HAS_OG_FLAG)
set(DEFAULT_MAKE_CFLAGS CFLAGS+=-Og ${DEFAULT_MAKE_CFLAGS}) set(DEFAULT_MAKE_CFLAGS CFLAGS+=-Og ${DEFAULT_MAKE_CFLAGS})
endif() endif()
set(DEPS_INSTALL_DIR "${CMAKE_BINARY_DIR}/usr") set(DEPS_INCLUDE_FLAGS "-I${DEPS_INSTALL_DIR}/include -I${DEPS_INSTALL_DIR}/include/luajit-2.1")
set(DEPS_BIN_DIR "${DEPS_INSTALL_DIR}/bin")
set(DEPS_LIB_DIR "${DEPS_INSTALL_DIR}/lib")
set(DEPS_BUILD_DIR "${CMAKE_BINARY_DIR}/build")
set(DEPS_DOWNLOAD_DIR "${DEPS_BUILD_DIR}/downloads")
list(APPEND DEPS_CMAKE_ARGS -D CMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR})
option(USE_BUNDLED "Use bundled dependencies." ON)
option(USE_BUNDLED_UNIBILIUM "Use the bundled unibilium." ${USE_BUNDLED})
option(USE_BUNDLED_LIBTERMKEY "Use the bundled libtermkey." ${USE_BUNDLED})
option(USE_BUNDLED_LIBVTERM "Use the bundled libvterm." ${USE_BUNDLED})
option(USE_BUNDLED_LIBUV "Use the bundled libuv." ${USE_BUNDLED})
option(USE_BUNDLED_MSGPACK "Use the bundled msgpack." ${USE_BUNDLED})
option(USE_BUNDLED_LUAJIT "Use the bundled version of luajit." ${USE_BUNDLED})
option(USE_BUNDLED_LUAROCKS "Use the bundled version of luarocks." ${USE_BUNDLED})
option(USE_BUNDLED_LUV "Use the bundled version of luv." ${USE_BUNDLED})
#XXX(tarruda): Lua is only used for debugging the functional test client, don't
# build it unless explicitly requested
option(USE_BUNDLED_LUA "Use the bundled version of lua." OFF)
option(USE_BUNDLED_TS_PARSERS "Use the bundled treesitter parsers." ${USE_BUNDLED})
option(USE_BUNDLED_TS "Use the bundled treesitter runtime." ${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)
else()
option(USE_BUNDLED_GETTEXT "Use the bundled version of gettext." OFF)
option(USE_BUNDLED_LIBICONV "Use the bundled version of libiconv." OFF)
endif()
if(WIN32)
option(USE_BUNDLED_NVIMQT "Bundle neovim-qt" ON)
endif()
option(USE_EXISTING_SRC_DIR "Skip download of deps sources in case of existing source directory." OFF)
find_package(Git)
if(NOT Git_FOUND)
message(FATAL_ERROR "Git is required to apply patches.")
endif()
if(UNIX)
find_program(MAKE_PRG NAMES gmake make)
if(NOT MAKE_PRG)
message(FATAL_ERROR "GNU Make is required to build the dependencies.")
else()
message(STATUS "Found GNU Make at ${MAKE_PRG}")
endif()
endif()
# When using make, use the $(MAKE) variable to avoid warning about the job
# server.
if(CMAKE_GENERATOR MATCHES "Makefiles")
set(MAKE_PRG "$(MAKE)")
endif()
if(MINGW AND CMAKE_GENERATOR MATCHES "Ninja")
find_program(MAKE_PRG NAMES mingw32-make)
if(NOT MAKE_PRG)
message(FATAL_ERROR "GNU Make for mingw32 is required to build the dependencies.")
else()
message(STATUS "Found GNU Make for mingw32: ${MAKE_PRG}")
endif()
endif()
set(DEPS_C_COMPILER "${CMAKE_C_COMPILER}")
if(CMAKE_OSX_SYSROOT)
set(DEPS_C_COMPILER "${DEPS_C_COMPILER} -isysroot${CMAKE_OSX_SYSROOT}")
endif()
if(CMAKE_OSX_ARCHITECTURES)
# The LuaJIT build does not like being passed multiple `-arch` flags
# so we handle a universal build the old-fashioned way.
set(LUAJIT_C_COMPILER "${DEPS_C_COMPILER}")
foreach(ARCH IN LISTS CMAKE_OSX_ARCHITECTURES)
set(DEPS_C_COMPILER "${DEPS_C_COMPILER} -arch ${ARCH}")
endforeach()
endif()
# If the macOS deployment target is not set manually (via $MACOSX_DEPLOYMENT_TARGET), # 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. # fall back to local system version. Needs to be done here and in top-level CMakeLists.txt.
@ -129,107 +87,32 @@ if(APPLE)
message(STATUS "Using deployment target ${CMAKE_OSX_DEPLOYMENT_TARGET}") message(STATUS "Using deployment target ${CMAKE_OSX_DEPLOYMENT_TARGET}")
endif() endif()
include(ExternalProject) if(USE_BUNDLED_LUAJIT)
set_directory_properties(PROPERTIES EP_PREFIX "${DEPS_BUILD_DIR}") set(LUA_ENGINE LuaJit)
elseif(USE_BUNDLED_LUA)
set(LIBUV_URL https://github.com/libuv/libuv/archive/62c2374a8c005ce9e42088965f8f8af2532c177b.tar.gz) set(LUA_ENGINE Lua)
set(LIBUV_SHA256 c7e89137da65a1cb550ba96b892dfeeabea982bf33b9237bcf9bbcd90f2e70a1) else()
find_package(Luajit)
set(MSGPACK_URL https://github.com/msgpack/msgpack-c/releases/download/c-6.0.0/msgpack-c-6.0.0.tar.gz) find_package(Lua 5.1 EXACT)
set(MSGPACK_SHA256 3654f5e2c652dc52e0a993e270bb57d5702b262703f03771c152bba51602aeba) if(LUAJIT_FOUND)
set(LUA_ENGINE LuaJit)
# https://github.com/LuaJIT/LuaJIT/tree/v2.1 string(APPEND DEPS_INCLUDE_FLAGS " -I${LUAJIT_INCLUDE_DIR}")
set(LUAJIT_URL https://github.com/LuaJIT/LuaJIT/archive/505e2c03de35e2718eef0d2d3660712e06dadf1f.tar.gz) elseif(LUA_FOUND)
set(LUAJIT_SHA256 67c88399b901a22e9a236f4b77e6fe39af00f6b7144ce9dd6f51141d921f1076) set(LUA_ENGINE Lua)
string(APPEND DEPS_INCLUDE_FLAGS " -I${LUA_INCLUDE_DIR}")
set(LUA_URL https://www.lua.org/ftp/lua-5.1.5.tar.gz) else()
set(LUA_SHA256 2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333) message(FATAL_ERROR "Could not find system lua or luajit")
endif()
set(LUAROCKS_URL https://github.com/luarocks/luarocks/archive/v3.9.2.tar.gz)
set(LUAROCKS_SHA256 a0b36cd68586cd79966d0106bb2e5a4f5523327867995fd66bee4237062b3e3b)
set(UNIBILIUM_URL https://github.com/neovim/unibilium/archive/d72c3598e7ac5d1ebf86ee268b8b4ed95c0fa628.tar.gz)
set(UNIBILIUM_SHA256 9c4747c862ab5e3076dcf8fa8f0ea7a6b50f20ec5905618b9536655596797487)
set(LIBTERMKEY_URL https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/libtermkey/0.22-1/libtermkey_0.22.orig.tar.gz)
set(LIBTERMKEY_SHA256 6945bd3c4aaa83da83d80a045c5563da4edd7d0374c62c0d35aec09eb3014600)
set(LIBVTERM_URL https://launchpad.net/libvterm/trunk/v0.3/+download/libvterm-0.3.1.tar.gz)
set(LIBVTERM_SHA256 25a8ad9c15485368dfd0a8a9dca1aec8fea5c27da3fa74ec518d5d3787f0c397)
set(LUV_URL https://github.com/luvit/luv/archive/093a977b82077591baefe1e880d37dfa2730bd54.tar.gz)
set(LUV_SHA256 222b38b6425f0926218e14e7da81481fdde6f9660c1feac25a53e6fb52e886e6)
set(LUA_COMPAT53_URL https://github.com/keplerproject/lua-compat-5.3/archive/v0.9.tar.gz)
set(LUA_COMPAT53_SHA256 ad05540d2d96a48725bb79a1def35cf6652a4e2ec26376e2617c8ce2baa6f416)
# Windows only: cat.exe diff.exe tee.exe xxd.exe
set(CAT_URL https://github.com/neovim/deps/raw/21c5e8bdda33521a6ed497b315e03265a2785cbc/opt/cat.exe)
set(CAT_SHA256 93b8d307bb15af3968920bdea3beb869a49d166f9164853c58a4e6ffdcae61c6)
set(DIFF_URL https://github.com/neovim/deps/raw/21c5e8bdda33521a6ed497b315e03265a2785cbc/opt/diff.exe)
set(DIFF_SHA256 4ceceebc8150422c6d8d9a06c2e9686d5a5d90f1033f60ad92ab81fe810e2a28)
set(TEE_URL https://github.com/neovim/deps/raw/21c5e8bdda33521a6ed497b315e03265a2785cbc/opt/tee.exe)
set(TEE_SHA256 950eea4e17fa3a7e89fa2c55374037b5797b3f1a54fea1304634884ab42ec14d)
set(XXD_URL https://github.com/neovim/deps/raw/21c5e8bdda33521a6ed497b315e03265a2785cbc/opt/xxd.exe)
set(XXD_SHA256 7a581e3882d28161cc52850f9a11d634b3eaf2c029276f093c1ed4c90e45a10c)
set(WINGUI_URL https://github.com/equalsraf/neovim-qt/releases/download/v0.2.17/neovim-qt.zip)
set(WINGUI_SHA256 502e386eef677c2c2e0c11d8cbb27f3e12b4d96818369417e8da4129c4580c25)
set(WIN32YANK_X86_64_URL https://github.com/equalsraf/win32yank/releases/download/v0.1.1/win32yank-x64.zip)
set(WIN32YANK_X86_64_SHA256 247c9a05b94387a884b49d3db13f806b1677dfc38020f955f719be6902260cd6)
set(GETTEXT_URL https://ftp.gnu.org/pub/gnu/gettext/gettext-0.20.1.tar.gz)
set(GETTEXT_SHA256 66415634c6e8c3fa8b71362879ec7575e27da43da562c798a8a2f223e6e47f5c)
set(LIBICONV_URL https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz)
set(LIBICONV_SHA256 ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc8913178)
set(TREESITTER_C_URL https://github.com/tree-sitter/tree-sitter-c/archive/v0.20.2.tar.gz)
set(TREESITTER_C_SHA256 af66fde03feb0df4faf03750102a0d265b007e5d957057b6b293c13116a70af2 )
set(TREESITTER_LUA_URL https://github.com/MunifTanjim/tree-sitter-lua/archive/v0.0.14.tar.gz)
set(TREESITTER_LUA_SHA256 930d0370dc15b66389869355c8e14305b9ba7aafd36edbfdb468c8023395016d)
set(TREESITTER_VIM_URL https://github.com/neovim/tree-sitter-vim/archive/v0.3.0.tar.gz)
set(TREESITTER_VIM_SHA256 403acec3efb7cdb18ff3d68640fc823502a4ffcdfbb71cec3f98aa786c21cbe2)
set(TREESITTER_VIMDOC_URL https://github.com/neovim/tree-sitter-vimdoc/archive/v2.0.0.tar.gz)
set(TREESITTER_VIMDOC_SHA256 1ff8f4afd3a9599dd4c3ce87c155660b078c1229704d1a254433e33794b8f274)
set(TREESITTER_QUERY_URL https://github.com/nvim-treesitter/tree-sitter-query/archive/v0.1.0.tar.gz)
set(TREESITTER_QUERY_SHA256 e2b806f80e8bf1c4f4e5a96248393fe6622fc1fc6189d6896d269658f67f914c)
set(TREESITTER_URL https://github.com/tree-sitter/tree-sitter/archive/v0.20.8.tar.gz)
set(TREESITTER_SHA256 6181ede0b7470bfca37e293e7d5dc1d16469b9485d13f13a605baec4a8b1f791)
if(USE_EXISTING_SRC_DIR)
get_cmake_property(VARS VARIABLES)
foreach (VAR ${VARS})
if(VAR MATCHES "^.*URL$")
unset(${VAR})
endif()
endforeach()
endif() endif()
if(USE_BUNDLED_UNIBILIUM) if(USE_BUNDLED_UNIBILIUM)
include(BuildUnibilium) include(BuildUnibilium)
endif() endif()
if(USE_BUNDLED_LIBTERMKEY)
include(BuildLibtermkey)
if(USE_BUNDLED_UNIBILIUM)
add_dependencies(libtermkey unibilium)
endif()
endif()
if(USE_BUNDLED_LIBVTERM)
include(BuildLibvterm)
endif()
if(USE_BUNDLED_LIBUV) if(USE_BUNDLED_LIBUV)
include(BuildLibuv) include(BuildLibuv)
endif() endif()
if(USE_BUNDLED_MSGPACK)
include(BuildMsgpack)
endif()
if(USE_BUNDLED_LUAJIT) if(USE_BUNDLED_LUAJIT)
include(BuildLuajit) include(BuildLuajit)
endif() endif()
@ -238,14 +121,14 @@ if(USE_BUNDLED_LUA)
include(BuildLua) include(BuildLua)
endif() endif()
if(USE_BUNDLED_LUAROCKS)
include(BuildLuarocks)
endif()
if(USE_BUNDLED_LUV) if(USE_BUNDLED_LUV)
include(BuildLuv) include(BuildLuv)
endif() endif()
if(USE_BUNDLED_LPEG)
include(BuildLpeg)
endif()
if(USE_BUNDLED_GETTEXT) if(USE_BUNDLED_GETTEXT)
include(BuildGettext) include(BuildGettext)
endif() endif()
@ -258,24 +141,23 @@ if(USE_BUNDLED_TS_PARSERS)
include(BuildTreesitterParsers) include(BuildTreesitterParsers)
endif() endif()
if(USE_BUNDLED_WASMTIME)
include(BuildWasmtime)
endif()
if(USE_BUNDLED_TS) if(USE_BUNDLED_TS)
include(BuildTreesitter) include(BuildTreesitter)
endif() endif()
if(USE_BUNDLED_UTF8PROC)
include(BuildUTF8proc)
endif()
if(WIN32) if(WIN32)
include(GetBinaryDeps) include(GetBinaryDeps)
GetExecutable(TARGET cat)
GetExecutable(TARGET diff)
GetExecutable(TARGET tee)
GetExecutable(TARGET xxd) GetExecutable(TARGET xxd)
if(USE_BUNDLED_NVIMQT)
GetBinaryDep(TARGET wingui
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory bin ${DEPS_BIN_DIR}
COMMAND ${CMAKE_COMMAND} -E copy_directory share ${DEPS_INSTALL_DIR}/share)
endif()
GetBinaryDep(TARGET win32yank_X86_64 GetBinaryDep(TARGET win32yank_X86_64
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy win32yank.exe ${DEPS_BIN_DIR}) INSTALL_COMMAND ${CMAKE_COMMAND} -E copy win32yank.exe ${DEPS_BIN_DIR})
endif() endif()

View File

@ -0,0 +1,26 @@
{
"version": 3,
"configurePresets": [
{
"name": "base",
"generator": "Ninja",
"binaryDir": "${sourceDir}/../.deps",
"hidden": true
},
{
"name": "ci",
"inherits": ["base"]
},
{
"name": "external_deps",
"description": "Build neovim with external deps on ubuntu",
"cacheVariables": {
"USE_BUNDLED":"OFF",
"USE_BUNDLED_TS":"ON",
"USE_BUNDLED_UTF8PROC":"ON",
"ENABLE_WASMTIME":"OFF"
},
"inherits": ["base"]
}
]
}

View File

@ -1,8 +1,6 @@
if(MSVC) if(MSVC)
get_externalproject_options(gettext ${DEPS_IGNORE_SHA})
ExternalProject_Add(gettext ExternalProject_Add(gettext
URL ${GETTEXT_URL}
URL_HASH SHA256=${GETTEXT_SHA256}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/gettext DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/gettext
PATCH_COMMAND ${CMAKE_COMMAND} -E copy PATCH_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/cmake/GettextCMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/cmake/GettextCMakeLists.txt
@ -10,7 +8,7 @@ if(MSVC)
CMAKE_ARGS ${DEPS_CMAKE_ARGS} CMAKE_ARGS ${DEPS_CMAKE_ARGS}
-D LIBICONV_INCLUDE_DIRS=${DEPS_INSTALL_DIR}/include -D LIBICONV_INCLUDE_DIRS=${DEPS_INSTALL_DIR}/include
-D LIBICONV_LIBRARIES=${DEPS_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}libcharset${CMAKE_STATIC_LIBRARY_SUFFIX}$<SEMICOLON>${DEPS_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}libiconv${CMAKE_STATIC_LIBRARY_SUFFIX} -D LIBICONV_LIBRARIES=${DEPS_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}libcharset${CMAKE_STATIC_LIBRARY_SUFFIX}$<SEMICOLON>${DEPS_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}libiconv${CMAKE_STATIC_LIBRARY_SUFFIX}
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS}) ${EXTERNALPROJECT_OPTIONS})
else() else()
message(FATAL_ERROR "Trying to build gettext in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}") message(FATAL_ERROR "Trying to build gettext in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}")
endif() endif()

View File

@ -1,14 +1,12 @@
if(MSVC) if(MSVC)
get_externalproject_options(libiconv ${DEPS_IGNORE_SHA})
ExternalProject_Add(libiconv ExternalProject_Add(libiconv
URL ${LIBICONV_URL}
URL_HASH SHA256=${LIBICONV_SHA256}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libiconv DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libiconv
PATCH_COMMAND ${CMAKE_COMMAND} -E copy PATCH_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibiconvCMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibiconvCMakeLists.txt
${DEPS_BUILD_DIR}/src/libiconv/CMakeLists.txt ${DEPS_BUILD_DIR}/src/libiconv/CMakeLists.txt
CMAKE_ARGS ${DEPS_CMAKE_ARGS} CMAKE_ARGS ${DEPS_CMAKE_ARGS}
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS}) ${EXTERNALPROJECT_OPTIONS})
else() else()
message(FATAL_ERROR "Trying to build libiconv in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}") message(FATAL_ERROR "Trying to build libiconv in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}")
endif() endif()

View File

@ -1,13 +0,0 @@
ExternalProject_Add(libtermkey
URL ${LIBTERMKEY_URL}
URL_HASH SHA256=${LIBTERMKEY_SHA256}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libtermkey
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibtermkeyCMakeLists.txt
${DEPS_BUILD_DIR}/src/libtermkey/CMakeLists.txt
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
-D CMAKE_SHARED_LIBRARY_LINK_C_FLAGS="" # Hack to avoid -rdynamic in Mingw
-D UNIBILIUM_INCLUDE_DIRS=${DEPS_INSTALL_DIR}/include
-D UNIBILIUM_LIBRARIES=${DEPS_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}unibilium${CMAKE_STATIC_LIBRARY_SUFFIX}
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})

View File

@ -1,10 +1,9 @@
get_externalproject_options(libuv ${DEPS_IGNORE_SHA})
ExternalProject_Add(libuv ExternalProject_Add(libuv
URL ${LIBUV_URL}
URL_HASH SHA256=${LIBUV_SHA256}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libuv DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libuv
CMAKE_ARGS ${DEPS_CMAKE_ARGS} CMAKE_ARGS ${DEPS_CMAKE_ARGS}
-D CMAKE_INSTALL_LIBDIR=lib -D CMAKE_INSTALL_LIBDIR=lib
-D BUILD_TESTING=OFF -D BUILD_TESTING=OFF
-D LIBUV_BUILD_SHARED=OFF -D LIBUV_BUILD_SHARED=OFF
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS}) -D UV_LINT_W4=OFF
${EXTERNALPROJECT_OPTIONS})

View File

@ -1,10 +0,0 @@
ExternalProject_Add(libvterm
URL ${LIBVTERM_URL}
URL_HASH SHA256=${LIBVTERM_SHA256}
DOWNLOAD_NO_PROGRESS TRUE
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}
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})

View File

@ -0,0 +1,14 @@
get_externalproject_options(lpeg ${DEPS_IGNORE_SHA})
ExternalProject_Add(lpeg
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/lpeg
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/cmake/LpegCMakeLists.txt
${DEPS_BUILD_DIR}/src/lpeg/CMakeLists.txt
CMAKE_ARGS ${DEPS_CMAKE_ARGS} -DCMAKE_C_FLAGS=${DEPS_INCLUDE_FLAGS}
${EXTERNALPROJECT_OPTIONS})
if(USE_BUNDLED_LUAJIT)
add_dependencies(lpeg luajit)
elseif(USE_BUNDLED_LUA)
add_dependencies(lpeg lua)
endif()

View File

@ -5,9 +5,9 @@ elseif(APPLE)
elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
set(LUA_TARGET freebsd) set(LUA_TARGET freebsd)
elseif(CMAKE_SYSTEM_NAME MATCHES "BSD") elseif(CMAKE_SYSTEM_NAME MATCHES "BSD")
set(CMAKE_LUA_TARGET bsd) set(LUA_TARGET bsd)
elseif(CMAKE_SYSTEM_NAME MATCHES "^MINGW") elseif(CMAKE_SYSTEM_NAME MATCHES "^MINGW")
set(CMAKE_LUA_TARGET mingw) set(LUA_TARGET mingw)
else() else()
if(UNIX) if(UNIX)
set(LUA_TARGET posix) set(LUA_TARGET posix)
@ -16,7 +16,7 @@ else()
endif() endif()
endif() endif()
set(LUA_CFLAGS "-O0 -g3 -fPIC") set(LUA_CFLAGS "-O2 -g3 -fPIC")
set(LUA_LDFLAGS "") set(LUA_LDFLAGS "")
if(ENABLE_ASAN_UBSAN) if(ENABLE_ASAN_UBSAN)
@ -40,23 +40,11 @@ set(LUA_CONFIGURE_COMMAND
-i ${DEPS_BUILD_DIR}/src/lua/src/luaconf.h) -i ${DEPS_BUILD_DIR}/src/lua/src/luaconf.h)
set(LUA_INSTALL_TOP_ARG "INSTALL_TOP=${DEPS_INSTALL_DIR}") set(LUA_INSTALL_TOP_ARG "INSTALL_TOP=${DEPS_INSTALL_DIR}")
message(STATUS "Lua target is ${LUA_TARGET}") get_externalproject_options(lua ${DEPS_IGNORE_SHA})
ExternalProject_Add(lua ExternalProject_Add(lua
URL ${LUA_URL}
URL_HASH SHA256=${LUA_SHA256}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/lua DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/lua
CONFIGURE_COMMAND "${LUA_CONFIGURE_COMMAND}" CONFIGURE_COMMAND "${LUA_CONFIGURE_COMMAND}"
BUILD_IN_SOURCE 1 BUILD_IN_SOURCE 1
BUILD_COMMAND ${MAKE_PRG} ${LUA_INSTALL_TOP_ARG} ${LUA_TARGET} BUILD_COMMAND ${MAKE_PRG} ${LUA_INSTALL_TOP_ARG} ${LUA_TARGET}
INSTALL_COMMAND ${MAKE_PRG} ${LUA_INSTALL_TOP_ARG} install) INSTALL_COMMAND ${MAKE_PRG} ${LUA_INSTALL_TOP_ARG} install
${EXTERNALPROJECT_OPTIONS})
set(BUSTED ${DEPS_BIN_DIR}/busted)
set(BUSTED_LUA ${BUSTED}-lua)
add_custom_command(OUTPUT ${BUSTED_LUA}
COMMAND sed -e 's/^exec/exec $$LUA_DEBUGGER/' -e 's/jit//g' < ${BUSTED} > ${BUSTED_LUA} && chmod +x ${BUSTED_LUA}
DEPENDS lua busted ${BUSTED})
add_custom_target(busted-lua ALL
DEPENDS ${DEPS_BIN_DIR}/busted-lua)

View File

@ -1,37 +1,19 @@
# BuildLuajit(TARGET targetname CONFIGURE_COMMAND ... BUILD_COMMAND ... INSTALL_COMMAND ...)
# Reusable function to build luajit, wraps ExternalProject_Add.
# Failing to pass a command argument will result in no command being run
function(BuildLuajit) function(BuildLuajit)
cmake_parse_arguments(_luajit cmake_parse_arguments(_luajit
"" ""
"TARGET" ""
"CONFIGURE_COMMAND;BUILD_COMMAND;INSTALL_COMMAND;DEPENDS" "CONFIGURE_COMMAND;BUILD_COMMAND;INSTALL_COMMAND;DEPENDS"
${ARGN}) ${ARGN})
if(NOT _luajit_CONFIGURE_COMMAND AND NOT _luajit_BUILD_COMMAND
AND NOT _luajit_INSTALL_COMMAND)
message(FATAL_ERROR "Must pass at least one of CONFIGURE_COMMAND, BUILD_COMMAND, INSTALL_COMMAND")
endif()
if(NOT _luajit_TARGET)
set(_luajit_TARGET "luajit")
endif()
ExternalProject_Add(${_luajit_TARGET} get_externalproject_options(luajit ${DEPS_IGNORE_SHA})
URL ${LUAJIT_URL} ExternalProject_Add(luajit
URL_HASH SHA256=${LUAJIT_SHA256}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/luajit DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/luajit
CONFIGURE_COMMAND "${_luajit_CONFIGURE_COMMAND}" CONFIGURE_COMMAND "${_luajit_CONFIGURE_COMMAND}"
BUILD_IN_SOURCE 1 BUILD_IN_SOURCE 1
BUILD_COMMAND "${_luajit_BUILD_COMMAND}" BUILD_COMMAND "${_luajit_BUILD_COMMAND}"
INSTALL_COMMAND "${_luajit_INSTALL_COMMAND}" INSTALL_COMMAND "${_luajit_INSTALL_COMMAND}"
DEPENDS "${_luajit_DEPENDS}") DEPENDS "${_luajit_DEPENDS}"
${EXTERNALPROJECT_OPTIONS})
# Create symlink for development version manually.
if(UNIX)
add_custom_command(
TARGET ${_luajit_TARGET}
COMMAND ${CMAKE_COMMAND} -E create_symlink luajit-2.1.0-beta3 ${DEPS_BIN_DIR}/${_luajit_TARGET})
endif()
endfunction() endfunction()
check_c_compiler_flag(-fno-stack-check HAS_NO_STACK_CHECK) check_c_compiler_flag(-fno-stack-check HAS_NO_STACK_CHECK)
@ -59,44 +41,11 @@ if(APPLE)
set(DEPLOYMENT_TARGET "MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}") set(DEPLOYMENT_TARGET "MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}")
endif() endif()
if((UNIX AND NOT APPLE) OR (APPLE AND NOT CMAKE_OSX_ARCHITECTURES)) if(UNIX)
BuildLuaJit(INSTALL_COMMAND ${BUILDCMD_UNIX} BuildLuaJit(INSTALL_COMMAND ${BUILDCMD_UNIX}
CC=${DEPS_C_COMPILER} PREFIX=${DEPS_INSTALL_DIR} CC=${DEPS_C_COMPILER} PREFIX=${DEPS_INSTALL_DIR}
${DEPLOYMENT_TARGET} install) ${DEPLOYMENT_TARGET} install)
elseif(CMAKE_OSX_ARCHITECTURES AND APPLE)
# Passing multiple `-arch` flags to the LuaJIT build will cause it to fail.
# To get a working universal build, we build each requested architecture slice
# individually then `lipo` them all up.
set(LUAJIT_SRC_DIR "${DEPS_BUILD_DIR}/src/luajit")
foreach(ARCH IN LISTS CMAKE_OSX_ARCHITECTURES)
set(STATIC_CC "${LUAJIT_C_COMPILER} -arch ${ARCH}")
set(DYNAMIC_CC "${LUAJIT_C_COMPILER} -arch ${ARCH} -fPIC")
set(TARGET_LD "${LUAJIT_C_COMPILER} -arch ${ARCH}")
list(APPEND LUAJIT_THIN_EXECUTABLES "${LUAJIT_SRC_DIR}-${ARCH}/src/luajit")
list(APPEND LUAJIT_THIN_STATIC_LIBS "${LUAJIT_SRC_DIR}-${ARCH}/src/libluajit.a")
list(APPEND LUAJIT_THIN_DYLIBS "${LUAJIT_SRC_DIR}-${ARCH}/src/libluajit.so")
list(APPEND LUAJIT_THIN_TARGETS "luajit-${ARCH}")
# See https://luajit.org/install.html#cross.
BuildLuaJit(TARGET "luajit-${ARCH}"
BUILD_COMMAND ${BUILDCMD_UNIX}
CC=${LUAJIT_C_COMPILER} STATIC_CC=${STATIC_CC}
DYNAMIC_CC=${DYNAMIC_CC} TARGET_LD=${TARGET_LD}
PREFIX=${DEPS_INSTALL_DIR}
${DEPLOYMENT_TARGET})
endforeach()
BuildLuaJit(
CONFIGURE_COMMAND ${BUILDCMD_UNIX} CC=${LUAJIT_C_COMPILER} PREFIX=${DEPS_INSTALL_DIR} ${DEPLOYMENT_TARGET}
COMMAND ${CMAKE_COMMAND} -E rm -f ${LUAJIT_SRC_DIR}/src/luajit ${LUAJIT_SRC_DIR}/src/libluajit.so ${LUAJIT_SRC_DIR}/src/libluajit.a
BUILD_COMMAND lipo ${LUAJIT_THIN_EXECUTABLES} -create -output ${LUAJIT_SRC_DIR}/src/luajit
COMMAND lipo ${LUAJIT_THIN_STATIC_LIBS} -create -output ${LUAJIT_SRC_DIR}/src/libluajit.a
COMMAND lipo ${LUAJIT_THIN_DYLIBS} -create -output ${LUAJIT_SRC_DIR}/src/libluajit.so
INSTALL_COMMAND ${BUILDCMD_UNIX} CC=${LUAJIT_C_COMPILER} PREFIX=${DEPS_INSTALL_DIR} ${DEPLOYMENT_TARGET} install
DEPENDS ${LUAJIT_THIN_TARGETS}
)
elseif(MINGW) elseif(MINGW)
if(CMAKE_GENERATOR MATCHES "Ninja") if(CMAKE_GENERATOR MATCHES "Ninja")
@ -122,8 +71,7 @@ elseif(MINGW)
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/libluajit.a ${DEPS_LIB_DIR} COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/libluajit.a ${DEPS_LIB_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/include/luajit-2.1 COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/include/luajit-2.1
COMMAND ${CMAKE_COMMAND} -DFROM_GLOB=${DEPS_BUILD_DIR}/src/luajit/src/*.h -DTO=${DEPS_INSTALL_DIR}/include/luajit-2.1 -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CopyFilesGlob.cmake COMMAND ${CMAKE_COMMAND} -DFROM_GLOB=${DEPS_BUILD_DIR}/src/luajit/src/*.h -DTO=${DEPS_INSTALL_DIR}/include/luajit-2.1 -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CopyFilesGlob.cmake
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_BIN_DIR}/lua/jit COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPS_BUILD_DIR}/src/luajit/src/jit ${DEPS_INSTALL_DIR}/share/luajit-2.1/jit
COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPS_BUILD_DIR}/src/luajit/src/jit ${DEPS_BIN_DIR}/lua/jit
) )
elseif(MSVC) elseif(MSVC)
@ -139,17 +87,8 @@ elseif(MSVC)
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/lua51.lib ${DEPS_LIB_DIR}/luajit.lib COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/lua51.lib ${DEPS_LIB_DIR}/luajit.lib
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/include/luajit-2.1 COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/include/luajit-2.1
COMMAND ${CMAKE_COMMAND} -DFROM_GLOB=${DEPS_BUILD_DIR}/src/luajit/src/*.h -DTO=${DEPS_INSTALL_DIR}/include/luajit-2.1 -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CopyFilesGlob.cmake COMMAND ${CMAKE_COMMAND} -DFROM_GLOB=${DEPS_BUILD_DIR}/src/luajit/src/*.h -DTO=${DEPS_INSTALL_DIR}/include/luajit-2.1 -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CopyFilesGlob.cmake
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_BIN_DIR}/lua/jit COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPS_BUILD_DIR}/src/luajit/src/jit ${DEPS_INSTALL_DIR}/share/luajit-2.1/jit
COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPS_BUILD_DIR}/src/luajit/src/jit ${DEPS_BIN_DIR}/lua/jit
) )
else() else()
message(FATAL_ERROR "Trying to build luajit in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}") message(FATAL_ERROR "Trying to build luajit in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}")
endif() endif()
if (NOT MSVC)
add_custom_target(clean_shared_libraries_luajit ALL
COMMAND ${CMAKE_COMMAND}
-D REMOVE_FILE_GLOB=${DEPS_LIB_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}*${CMAKE_SHARED_LIBRARY_SUFFIX}*
-P ${PROJECT_SOURCE_DIR}/cmake/RemoveFiles.cmake)
add_dependencies(clean_shared_libraries_luajit luajit)
endif()

View File

@ -1,160 +0,0 @@
# Luarocks recipe. Luarocks is only required when building Neovim.
# NOTE: LuaRocks rocks need to "DEPENDS" on the previous module, because
# running luarocks in parallel will break, e.g. when some rocks have
# the same dependency..
option(USE_BUNDLED_BUSTED "Use the bundled version of busted to run tests." ON)
# The luarocks binary location
set(LUAROCKS_BINARY ${DEPS_BIN_DIR}/luarocks)
# Arguments for calls to 'luarocks build'
if(NOT MSVC)
# In MSVC don't pass the compiler/linker to luarocks, the bundled
# version already knows, and passing them here breaks the build
set(LUAROCKS_BUILDARGS CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER})
endif()
# Lua version, used with rocks directories.
# Defaults to 5.1 for bundled LuaJIT/Lua.
set(LUA_VERSION "5.1")
if(UNIX)
if(USE_BUNDLED_LUAJIT)
list(APPEND LUAROCKS_OPTS
--with-lua=${DEPS_INSTALL_DIR}
--with-lua-include=${DEPS_INSTALL_DIR}/include/luajit-2.1
--with-lua-interpreter=luajit)
elseif(USE_BUNDLED_LUA)
list(APPEND LUAROCKS_OPTS
--with-lua=${DEPS_INSTALL_DIR})
else()
find_package(Luajit)
if(LUAJIT_FOUND)
list(APPEND LUAROCKS_OPTS
--with-lua-include=${LUAJIT_INCLUDE_DIRS}
--with-lua-interpreter=luajit)
endif()
# Get LUA_VERSION used with rocks output.
if(LUAJIT_FOUND)
set(LUA_EXE "luajit")
else()
set(LUA_EXE "lua")
endif()
execute_process(
COMMAND ${LUA_EXE} -e "print(string.sub(_VERSION, 5))"
OUTPUT_VARIABLE LUA_VERSION
ERROR_VARIABLE ERR
RESULT_VARIABLE RES)
if(NOT RES EQUAL 0)
message(FATAL_ERROR "Could not get LUA_VERSION with ${LUA_EXE}: ${ERR}")
endif()
endif()
set(LUAROCKS_CONFIGURE_COMMAND ${DEPS_BUILD_DIR}/src/luarocks/configure
--prefix=${DEPS_INSTALL_DIR} --force-config ${LUAROCKS_OPTS})
set(LUAROCKS_INSTALL_COMMAND ${MAKE_PRG} -j1 bootstrap)
elseif(MSVC OR MINGW)
if(MINGW)
set(COMPILER_FLAG /MW)
elseif(MSVC)
set(COMPILER_FLAG /MSVC)
endif()
# Ignore USE_BUNDLED_LUAJIT - always ON for native Win32
set(LUAROCKS_INSTALL_COMMAND install.bat /FORCECONFIG /NOREG /NOADMIN /Q /F
/LUA ${DEPS_INSTALL_DIR}
/LIB ${DEPS_LIB_DIR}
/BIN ${DEPS_BIN_DIR}
/INC ${DEPS_INSTALL_DIR}/include/luajit-2.1
/P ${DEPS_INSTALL_DIR}/luarocks /TREE ${DEPS_INSTALL_DIR}
/SCRIPTS ${DEPS_BIN_DIR}
/CMOD ${DEPS_BIN_DIR}
${COMPILER_FLAG}
/LUAMOD ${DEPS_BIN_DIR}/lua)
set(LUAROCKS_BINARY ${DEPS_INSTALL_DIR}/luarocks/luarocks.bat)
else()
message(FATAL_ERROR "Trying to build luarocks in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}")
endif()
ExternalProject_Add(luarocks
URL ${LUAROCKS_URL}
URL_HASH SHA256=${LUAROCKS_SHA256}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/luarocks
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND "${LUAROCKS_CONFIGURE_COMMAND}"
BUILD_COMMAND ""
INSTALL_COMMAND "${LUAROCKS_INSTALL_COMMAND}")
if(USE_BUNDLED_LUAJIT)
add_dependencies(luarocks luajit)
elseif(USE_BUNDLED_LUA)
add_dependencies(luarocks lua)
endif()
set(ROCKS_DIR ${DEPS_LIB_DIR}/luarocks/rocks-${LUA_VERSION})
if(MSVC)
# Workaround for luarocks failing to find the md5sum.exe it is shipped with.
list(APPEND LUAROCKS_BUILDARGS MD5SUM=md5sum)
set(PATH PATH=${DEPS_INSTALL_DIR}/luarocks/tools;$ENV{PATH})
endif()
# mpack
add_custom_command(OUTPUT ${ROCKS_DIR}/mpack
COMMAND ${CMAKE_COMMAND} -E env "${PATH}" ${LUAROCKS_BINARY} build mpack 1.0.10-0 ${LUAROCKS_BUILDARGS}
DEPENDS luarocks)
add_custom_target(mpack ALL DEPENDS ${ROCKS_DIR}/mpack)
# lpeg
add_custom_command(OUTPUT ${ROCKS_DIR}/lpeg
COMMAND ${CMAKE_COMMAND} -E env "${PATH}" ${LUAROCKS_BINARY} build lpeg 1.0.2-1 ${LUAROCKS_BUILDARGS}
DEPENDS mpack)
add_custom_target(lpeg ALL DEPENDS ${ROCKS_DIR}/lpeg)
if((NOT USE_BUNDLED_LUAJIT) AND USE_BUNDLED_LUA)
# luabitop
add_custom_command(OUTPUT ${ROCKS_DIR}/luabitop
COMMAND ${CMAKE_COMMAND} -E env "${PATH}" ${LUAROCKS_BINARY} build luabitop 1.0.2-3 ${LUAROCKS_BUILDARGS}
DEPENDS lpeg)
add_custom_target(luabitop ALL DEPENDS ${ROCKS_DIR}/luabitop)
endif()
if(USE_BUNDLED_BUSTED)
if((NOT USE_BUNDLED_LUAJIT) AND USE_BUNDLED_LUA)
set(BUSTED_DEPENDS luabitop)
else()
set(BUSTED_DEPENDS lpeg)
endif()
# busted
if(WIN32)
set(BUSTED_EXE "${DEPS_BIN_DIR}/busted.bat")
set(LUACHECK_EXE "${DEPS_BIN_DIR}/luacheck.bat")
else()
set(BUSTED_EXE "${DEPS_BIN_DIR}/busted")
set(LUACHECK_EXE "${DEPS_BIN_DIR}/luacheck")
endif()
add_custom_command(OUTPUT ${BUSTED_EXE}
COMMAND ${CMAKE_COMMAND} -E env "${PATH}" ${LUAROCKS_BINARY} build busted 2.1.1 ${LUAROCKS_BUILDARGS}
DEPENDS ${BUSTED_DEPENDS})
add_custom_target(busted ALL DEPENDS ${BUSTED_EXE})
# luacheck
add_custom_command(OUTPUT ${LUACHECK_EXE}
COMMAND ${CMAKE_COMMAND} -E env "${PATH}" ${LUAROCKS_BINARY} build luacheck 1.1.0-1 ${LUAROCKS_BUILDARGS}
DEPENDS busted)
add_custom_target(luacheck ALL DEPENDS ${LUACHECK_EXE})
if (USE_BUNDLED_LUA OR NOT USE_BUNDLED_LUAJIT)
# coxpcall
add_custom_command(OUTPUT ${ROCKS_DIR}/coxpcall
COMMAND ${CMAKE_COMMAND} -E env "${PATH}" ${LUAROCKS_BINARY} build coxpcall 1.17.0-1 ${LUAROCKS_BUILDARGS}
DEPENDS luarocks)
add_custom_target(coxpcall ALL DEPENDS ${ROCKS_DIR}/coxpcall)
endif()
endif()

View File

@ -1,62 +1,43 @@
set(LUV_INCLUDE_FLAGS
"-I${DEPS_INSTALL_DIR}/include -I${DEPS_INSTALL_DIR}/include/luajit-2.1")
set(LUV_CMAKE_ARGS set(LUV_CMAKE_ARGS
-D LUA_BUILD_TYPE=System -D LUA_BUILD_TYPE=System
-D LUA_COMPAT53_DIR=${DEPS_BUILD_DIR}/src/lua-compat-5.3 -D LUA_COMPAT53_DIR=${DEPS_BUILD_DIR}/src/lua_compat53
-D WITH_SHARED_LIBUV=ON -D WITH_SHARED_LIBUV=ON
-D BUILD_SHARED_LIBS=OFF
-D BUILD_STATIC_LIBS=ON -D BUILD_STATIC_LIBS=ON
-D BUILD_MODULE=OFF) -D BUILD_MODULE=OFF)
if(USE_BUNDLED_LUAJIT) list(APPEND LUV_CMAKE_ARGS -D WITH_LUA_ENGINE=${LUA_ENGINE})
list(APPEND LUV_CMAKE_ARGS -D WITH_LUA_ENGINE=LuaJit)
elseif(USE_BUNDLED_LUA)
list(APPEND LUV_CMAKE_ARGS -D WITH_LUA_ENGINE=Lua)
else()
find_package(Luajit)
if(LUAJIT_FOUND)
list(APPEND LUV_CMAKE_ARGS -D WITH_LUA_ENGINE=LuaJit)
else()
list(APPEND LUV_CMAKE_ARGS -D WITH_LUA_ENGINE=Lua)
endif()
endif()
if(USE_BUNDLED_LIBUV) if(USE_BUNDLED_LIBUV)
list(APPEND LUV_CMAKE_ARGS -D CMAKE_PREFIX_PATH=${DEPS_INSTALL_DIR}) list(APPEND LUV_CMAKE_ARGS -D CMAKE_PREFIX_PATH=${DEPS_INSTALL_DIR})
endif() endif()
list(APPEND LUV_CMAKE_ARGS list(APPEND LUV_CMAKE_ARGS "-DCMAKE_C_FLAGS:STRING=${DEPS_INCLUDE_FLAGS} -w")
"-DCMAKE_C_FLAGS:STRING=${LUV_INCLUDE_FLAGS}")
if(CMAKE_GENERATOR MATCHES "Unix Makefiles" AND if(CMAKE_GENERATOR MATCHES "Unix Makefiles" AND
(CMAKE_SYSTEM_NAME MATCHES ".*BSD" OR CMAKE_SYSTEM_NAME MATCHES "DragonFly")) (CMAKE_SYSTEM_NAME MATCHES ".*BSD" OR CMAKE_SYSTEM_NAME MATCHES "DragonFly"))
list(APPEND LUV_CMAKE_ARGS -D CMAKE_MAKE_PROGRAM=gmake) list(APPEND LUV_CMAKE_ARGS -D CMAKE_MAKE_PROGRAM=gmake)
endif() endif()
ExternalProject_Add(lua-compat-5.3 get_externalproject_options(lua_compat53 ${DEPS_IGNORE_SHA})
URL ${LUA_COMPAT53_URL} ExternalProject_Add(lua_compat53
URL_HASH SHA256=${LUA_COMPAT53_SHA256} DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/lua_compat53
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/lua-compat-5.3
CONFIGURE_COMMAND "" CONFIGURE_COMMAND ""
BUILD_COMMAND "" BUILD_COMMAND ""
INSTALL_COMMAND "") INSTALL_COMMAND ""
${EXTERNALPROJECT_OPTIONS})
ExternalProject_Add(luv-static get_externalproject_options(luv ${DEPS_IGNORE_SHA})
DEPENDS lua-compat-5.3 ExternalProject_Add(luv
URL ${LUV_URL} DEPENDS lua_compat53
URL_HASH SHA256=${LUV_SHA256}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/luv DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/luv
SOURCE_DIR ${DEPS_BUILD_DIR}/src/luv SOURCE_DIR ${DEPS_BUILD_DIR}/src/luv
CMAKE_ARGS ${DEPS_CMAKE_ARGS} ${LUV_CMAKE_ARGS} CMAKE_ARGS ${DEPS_CMAKE_ARGS} ${LUV_CMAKE_ARGS}
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS}) ${EXTERNALPROJECT_OPTIONS})
if(USE_BUNDLED_LUAJIT) if(USE_BUNDLED_LUAJIT)
add_dependencies(luv-static luajit) add_dependencies(luv luajit)
elseif(USE_BUNDLED_LUA) elseif(USE_BUNDLED_LUA)
add_dependencies(luv-static lua) add_dependencies(luv lua)
endif() endif()
if(USE_BUNDLED_LIBUV) if(USE_BUNDLED_LIBUV)
add_dependencies(luv-static libuv) add_dependencies(luv libuv)
endif() endif()

View File

@ -1,17 +0,0 @@
ExternalProject_Add(msgpack
URL ${MSGPACK_URL}
URL_HASH SHA256=${MSGPACK_SHA256}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/msgpack
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
-D MSGPACK_BUILD_TESTS=OFF
-D MSGPACK_BUILD_EXAMPLES=OFF
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})
if (NOT MSVC)
add_custom_target(clean_shared_libraries_msgpack ALL
COMMAND ${CMAKE_COMMAND}
-D REMOVE_FILE_GLOB=${DEPS_LIB_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}*${CMAKE_SHARED_LIBRARY_SUFFIX}*
-P ${PROJECT_SOURCE_DIR}/cmake/RemoveFiles.cmake)
add_dependencies(clean_shared_libraries_msgpack msgpack)
endif()

View File

@ -1,11 +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 ExternalProject_Add(treesitter
URL ${TREESITTER_URL}
URL_HASH SHA256=${TREESITTER_SHA256}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/treesitter DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/treesitter
INSTALL_DIR ${DEPS_INSTALL_DIR} SOURCE_SUBDIR lib
PATCH_COMMAND ${CMAKE_COMMAND} -E copy CMAKE_ARGS ${DEPS_CMAKE_ARGS} ${TREESITTER_ARGS}
${CMAKE_CURRENT_SOURCE_DIR}/cmake/TreesitterCMakeLists.txt ${EXTERNALPROJECT_OPTIONS})
${DEPS_BUILD_DIR}/src/treesitter/CMakeLists.txt
CMAKE_ARGS ${DEPS_CMAKE_ARGS} if(USE_BUNDLED_WASMTIME)
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS}) add_dependencies(treesitter wasmtime)
endif()

View File

@ -15,25 +15,20 @@ function(BuildTSParser)
set(TS_CMAKE_FILE TreesitterParserCMakeLists.txt) set(TS_CMAKE_FILE TreesitterParserCMakeLists.txt)
endif() endif()
set(NAME treesitter-${TS_LANG}) set(NAME treesitter_${TS_LANG})
string(TOUPPER "TREESITTER_${TS_LANG}_URL" URL_VARNAME)
set(URL ${${URL_VARNAME}})
string(TOUPPER "TREESITTER_${TS_LANG}_SHA256" HASH_VARNAME)
set(HASH ${${HASH_VARNAME}})
get_externalproject_options(${NAME} ${DEPS_IGNORE_SHA})
ExternalProject_Add(${NAME} ExternalProject_Add(${NAME}
URL ${URL}
URL_HASH SHA256=${HASH}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/${NAME} DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/${NAME}
PATCH_COMMAND ${CMAKE_COMMAND} -E copy PATCH_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/cmake/${TS_CMAKE_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${TS_CMAKE_FILE}
${DEPS_BUILD_DIR}/src/${NAME}/CMakeLists.txt ${DEPS_BUILD_DIR}/src/${NAME}/CMakeLists.txt
CMAKE_ARGS ${DEPS_CMAKE_ARGS} CMAKE_ARGS ${DEPS_CMAKE_ARGS}
-D PARSERLANG=${TS_LANG} -D PARSERLANG=${TS_LANG}
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS}) ${EXTERNALPROJECT_OPTIONS})
endfunction() endfunction()
foreach(lang c lua vim vimdoc query) foreach(lang c lua vim vimdoc query)
BuildTSParser(LANG ${lang}) BuildTSParser(LANG ${lang})
endforeach() 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

@ -1,7 +1,5 @@
get_externalproject_options(unibilium ${DEPS_IGNORE_SHA})
ExternalProject_Add(unibilium ExternalProject_Add(unibilium
URL ${UNIBILIUM_URL}
URL_HASH SHA256=${UNIBILIUM_SHA256}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/unibilium DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/unibilium
CMAKE_ARGS ${DEPS_CMAKE_ARGS} CMAKE_ARGS ${DEPS_CMAKE_ARGS}
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS}) ${EXTERNALPROJECT_OPTIONS})

View File

@ -0,0 +1,11 @@
# 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)
USES_TERMINAL_BUILD TRUE
${EXTERNALPROJECT_OPTIONS})

View File

@ -14,7 +14,7 @@ execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${TO})
file(GLOB files ${FROM_GLOB}) file(GLOB files ${FROM_GLOB})
foreach(file ${files}) foreach(file ${files})
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${file} ${TO} RESULT_VARIABLE rv) execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${file} ${TO} RESULT_VARIABLE rv)
if(NOT rv EQUAL 0) if(rv)
message(FATAL_ERROR "Error copying ${file}") message(FATAL_ERROR "Error copying ${file}")
endif() endif()
endforeach() endforeach()

View File

@ -5,7 +5,7 @@
# install root. # install root.
function(GetBinaryDep) function(GetBinaryDep)
cmake_parse_arguments(_gettool cmake_parse_arguments(_gettool
"BUILD_IN_SOURCE" ""
"TARGET" "TARGET"
"INSTALL_COMMAND" "INSTALL_COMMAND"
${ARGN}) ${ARGN})
@ -18,13 +18,13 @@ function(GetBinaryDep)
ExternalProject_Add(${_gettool_TARGET} ExternalProject_Add(${_gettool_TARGET}
URL ${URL} URL ${URL}
URL_HASH SHA256=${HASH} URL_HASH SHA256=${HASH}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR} DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}
CONFIGURE_COMMAND "" CONFIGURE_COMMAND ""
BUILD_IN_SOURCE 1 BUILD_IN_SOURCE 1
BUILD_COMMAND "" BUILD_COMMAND ""
INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_BIN_DIR} INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_BIN_DIR}
COMMAND "${_gettool_INSTALL_COMMAND}") COMMAND "${_gettool_INSTALL_COMMAND}"
DOWNLOAD_NO_PROGRESS TRUE)
endfunction() endfunction()
# Download executable and move it to DEPS_BIN_DIR # Download executable and move it to DEPS_BIN_DIR
@ -43,11 +43,11 @@ function(GetExecutable)
ExternalProject_Add(${ARG_TARGET} ExternalProject_Add(${ARG_TARGET}
URL ${URL} URL ${URL}
URL_HASH SHA256=${HASH} URL_HASH SHA256=${HASH}
DOWNLOAD_NO_PROGRESS TRUE
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR} DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}
DOWNLOAD_NO_EXTRACT TRUE DOWNLOAD_NO_EXTRACT TRUE
CONFIGURE_COMMAND "" CONFIGURE_COMMAND ""
BUILD_COMMAND "" BUILD_COMMAND ""
INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_BIN_DIR} INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_BIN_DIR}
COMMAND ${CMAKE_COMMAND} -E copy <DOWNLOADED_FILE> ${DEPS_BIN_DIR}) COMMAND ${CMAKE_COMMAND} -E copy <DOWNLOADED_FILE> ${DEPS_BIN_DIR}
DOWNLOAD_NO_PROGRESS TRUE)
endfunction() endfunction()

View File

@ -1,6 +1,9 @@
cmake_minimum_required(VERSION 3.10) cmake_minimum_required(VERSION 3.16)
project(gettext C) project(gettext C)
add_compile_options(-w)
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4006")
# Adds PREFIX to each item in LIST # Adds PREFIX to each item in LIST
macro(PREFIX_LIST_ITEMS LIST PREFIX) macro(PREFIX_LIST_ITEMS LIST PREFIX)
string(REPLACE ";" ";${PREFIX}" ${LIST} ";${${LIST}}") string(REPLACE ";" ";${PREFIX}" ${LIST} ";${${LIST}}")
@ -12,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_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 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 ICONV_CONST" "#define ICONV_CONST const" CONFIG_CONTENT ${CONFIG_CONTENT})
string(REPLACE "#undef uintmax_t" " if(MSVC)
#if _WIN64 string(REPLACE "#undef HAVE_STDINT_H_WITH_UINTMAX" "#define HAVE_STDINT_H_WITH_UINTMAX 1" CONFIG_CONTENT ${CONFIG_CONTENT})
# define intmax_t long long string(REPLACE "#undef HAVE_STDINT_H" "#define HAVE_STDINT_H 1" CONFIG_CONTENT ${CONFIG_CONTENT})
# define uintmax_t unsigned long long else()
#elif _WIN32 string(REPLACE "#undef uintmax_t" "
# define intmax_t long #if _WIN64
# define uintmax_t unsigned long # define intmax_t long long
#endif" # define uintmax_t unsigned long long
CONFIG_CONTENT ${CONFIG_CONTENT}) #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}) file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gettext-runtime/config.h ${CONFIG_CONTENT})
set(HAVE_NEWLOCALE 0) set(HAVE_NEWLOCALE 0)
@ -73,8 +81,7 @@ set_property(TARGET libintl APPEND PROPERTY COMPILE_DEFINITIONS
NO_XMALLOC NO_XMALLOC
set_relocation_prefix=libintl_set_relocation_prefix set_relocation_prefix=libintl_set_relocation_prefix
relocate=libintl_relocate relocate=libintl_relocate
HAVE_CONFIG_H HAVE_CONFIG_H)
_CRT_SECURE_NO_WARNINGS)
file(READ gettext-tools/config.h.in CONFIG_CONTENT) file(READ gettext-tools/config.h.in CONFIG_CONTENT)

View File

@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.10) cmake_minimum_required(VERSION 3.16)
project(libiconv C) project(libiconv C)
add_compile_options(-w)
include_directories( include_directories(
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/srclib ${CMAKE_CURRENT_SOURCE_DIR}/srclib
@ -31,7 +33,7 @@ set(USE_MBSTATE_T 0)
configure_file(libcharset/include/localcharset.h.build.in localcharset.h) configure_file(libcharset/include/localcharset.h.build.in localcharset.h)
configure_file(include/iconv.h.build.in iconv.h) configure_file(include/iconv.h.build.in iconv.h)
add_definitions(-DLIBDIR -D_CRT_SECURE_NO_WARNINGS) add_definitions(-DLIBDIR)
add_library(libcharset libcharset/lib/localcharset.c) add_library(libcharset libcharset/lib/localcharset.c)

View File

@ -1,20 +0,0 @@
cmake_minimum_required(VERSION 3.10)
project(libtermkey C)
add_definitions(-D _CRT_SECURE_NO_WARNINGS)
add_definitions(-DHAVE_UNIBILIUM)
include_directories(${PROJECT_BINARY_DIR}/t)
include_directories(SYSTEM ${UNIBILIUM_INCLUDE_DIRS})
add_library(termkey termkey.c driver-csi.c driver-ti.c)
set_target_properties(termkey PROPERTIES
PUBLIC_HEADER ${PROJECT_SOURCE_DIR}/termkey.h)
target_link_libraries(termkey ${UNIBILIUM_LIBRARIES})
include(GNUInstallDirs)
install(TARGETS termkey
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
# vim: set ft=cmake:

View File

@ -1,30 +0,0 @@
cmake_minimum_required(VERSION 3.10)
project(libvterm C)
include(GNUInstallDirs)
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
endif()
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

@ -0,0 +1,13 @@
cmake_minimum_required(VERSION 3.16)
project (lpeg C)
include(GNUInstallDirs)
file(GLOB LPEG_SOURCES ${CMAKE_SOURCE_DIR}/*.c)
add_library(lpeg ${LPEG_SOURCES})
target_compile_options(lpeg PRIVATE -w)
install(TARGETS lpeg ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
# vim: set ft=cmake:

View File

@ -0,0 +1,28 @@
cmake_minimum_required(VERSION 3.16)
project(${PARSERLANG} C)
add_compile_options(-w)
add_library(markdown MODULE
tree-sitter-markdown/src/parser.c
tree-sitter-markdown/src/scanner.c)
target_include_directories(markdown
PRIVATE
tree-sitter-markdown/src)
add_library(markdown_inline MODULE
tree-sitter-markdown-inline/src/parser.c
tree-sitter-markdown-inline/src/scanner.c)
target_include_directories(markdown_inline
PRIVATE
tree-sitter-markdown-inline/src)
set_target_properties(
markdown markdown_inline
PROPERTIES
PREFIX ""
)
install(TARGETS markdown markdown_inline LIBRARY DESTINATION lib/nvim/parser)
# vim: set ft=cmake:

View File

@ -1,5 +0,0 @@
file(GLOB_RECURSE FILES_TO_REMOVE ${REMOVE_FILE_GLOB})
if(FILES_TO_REMOVE)
file(REMOVE ${FILES_TO_REMOVE})
endif()

View File

@ -1,16 +0,0 @@
cmake_minimum_required(VERSION 3.10)
project(treesitter C)
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
lib/include/tree_sitter/parser.h
DESTINATION include/tree_sitter)
include(GNUInstallDirs)
install(TARGETS tree-sitter DESTINATION ${CMAKE_INSTALL_LIBDIR})
# vim: set ft=cmake:

View File

@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.10) cmake_minimum_required(VERSION 3.16)
project(parser C) project(parser C)
add_compile_options(-w)
file(GLOB source_files src/*.c) file(GLOB source_files src/*.c)
add_library(parser add_library(parser

Some files were not shown because too many files have changed in this diff Show More