Commit Graph

19737 Commits

Author SHA1 Message Date
Sean Dewar
d1189ea508 fix(window): win_move_after UAF from naughty autocmds (#37065)
Problem: use-after-free in win_move_after if win_enter autocommands free win1/2.
Solution: set w_pos_changed before calling win_enter.
2025-12-21 20:31:05 +00:00
Sean Dewar
a2b9720939 fix(api): open_win leak from naughty autocommands
Problem: error set by win_set_buf may leak if autocommands immediately close the
new window.

Solution: free the error set by win_set_buf. (prefer nvim_open_win's error as
it's more important and will cause 0 to be returned)
2025-12-21 15:35:30 +00:00
Sean Dewar
d788864cde fix(api): ignore split_disallowed when opening a float
Problem: split_disallowed seemingly exists to prevent issues from changing
frames to accomodate a split window, which doesn't apply to floats.

Solution: remove the restriction for nvim_open_win, but only for floats.
(continue to check b_locked_split though)

NOTE: like before, the buffer we check b_locked_split for may not actually be
the target buffer "buf", as the later call to win_set_buf can fail to switch to
"buf" due to autocommands. (among other things)

Maybe we could attempt to close the new window in that case (or switch to a
different buffer if that also fails), but this is safer. (and simpler)

Fixes #36857 (and possibly some spurious E242s I've observed from extui)
2025-12-21 15:35:30 +00:00
Justin M. Keyes
0d206da461 Merge #37057 docs 2025-12-21 00:22:36 -05:00
Olivia Kinnear
ad330e99d1 fix(statusline): diagnostics spacing #36897 2025-12-20 23:58:38 -05:00
zeertzjq
acecdbff1f fix(api,lua): handle converting NULL funcref/partial (#37060)
This fixes the Coverity warnings.
2025-12-21 11:41:33 +08:00
Justin M. Keyes
4485e715fb fix(options): deprecate 'gdefault', 'magic' 2025-12-20 22:07:27 -05:00
Justin M. Keyes
060993e438 docs: misc, lsp 2025-12-20 22:07:27 -05:00
zeertzjq
f89558848b vim-patch:9.1.2001: cursor may end up in wrong window after :botright copen (#37056)
Problem:  After :botright copen and closing the quikfix window, the
          cursor ends up in the wrong window. The problem is fr_child
          always points to the first (leftmost for FR_ROW, topmost for
          FR_COL) child frame. When do :vsplit, the new window is
          created on the left, and frame_insert() updates the parent's
          fr_child to point to this new left window.
Solution: Create a snapshot before open the quickfix window and restore
          it when close it (glepnir).

closes: vim/vim#18961

b43f9ded7e

Co-authored-by: glepnir <glephunter@gmail.com>
2025-12-21 10:41:53 +08:00
github-actions[bot]
69167006a4 docs: update version.c #36917
vim-patch:3a113e04d nsis: add Chinese translation to nsis installer
vim-patch:e1ea10a0a CI: Bump actions/cache from 4 to 5
vim-patch:9.0.1144: reading beyond text
vim-patch:9.0.1669: Crash syncing swapfile in new buffer when using sodium crypt
vim-patch:9.1.1977: MS-Windows: missing dependency on optiondefs.h in Make_cyg_ming.mak
vim-patch:9.1.1990: tests: Test_term_gettty() fails when using conpty on Windows
vim-patch:9.1.1997: Missing out-of-memory check in vim9class.c
vim-patch:9.1.1273: Coverity warns about using uninitialized value

vim-patch:8.2.0419: various memory leaks in Vim9 script code
vim-patch:8.2.0881: compiler warning for argument type
vim-patch:8.2.1532: compiler warning for conversion of size_t to long
vim-patch:8.2.1839: Vim9: memory leaks reported in assign test
vim-patch:8.2.2299: Vim9: invalid memory access making error message flaky
vim-patch:8.2.2673: Vim9: script-local funcref can have lower case name
vim-patch:8.2.3132: compiler warns for size_t to colnr_T conversion
vim-patch:8.2.3224: cannot call script-local function after :vim9cmd
2025-12-20 21:22:30 -05:00
Justin M. Keyes
9486e4f2e2 refactor(messages): encapsulate msg_delay logic
see also 9bbbeb60e3
2025-12-20 18:38:11 -05:00
Justin M. Keyes
2eb11f21eb test(messages): skip os_delay during tests
Problem:
Tests that trigger `os_delay` messages may take 1-3 seconds, wasting
build/CI time, since this serves no purpose in tests.

Solution:
- Introduce `msg_delay` for cases where `os_delay` is being used as
  a "UI feature".
- Skip `msg_delay` in tests.
2025-12-20 18:38:11 -05:00
zeertzjq
a274bdf2d1 vim-patch:8.2.3767: crash when using NULL partial
Problem:    Crash when using NULL partial.
Solution:   Check for NULL.

e8a92b6166

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-20 09:46:28 +08:00
zeertzjq
f15c28ed7a vim-patch:8.2.3766: converting a funcref to a string leaves out "g:"
Problem:    Converting a funcref to a string leaves out "g:", causing the
            meaning of the name depending on the context.
Solution:   Prepend "g:" for a global function.

c4ec338fb8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
Co-authored-by: Jan Edmund Lazo <jan.lazo@mail.utoronto.ca>
2025-12-20 09:45:47 +08:00
Sean Dewar
eac2f0443e feat(tag): respect jumpoptions=view when popping tagstack (#37021)
Problem: jumpoptions=view has no effect when popping from the tagstack.
Solution: make it work.
2025-12-19 23:32:09 +00:00
zeertzjq
c08139d790 fix(lua): don't remove first char of non-file stacktrace source (#37008) 2025-12-18 08:09:16 +08:00
zeertzjq
c172fd9f46 vim-patch:9.1.1991: :setlocal changes effective global 'omnifunc' (#37013)
Problem:  :setlocal changes effective global 'omnifunc' (Maxim Kim)
Solution: Don't change global callback when using :setlocal (zeertzjq).

fixes:  vim/vim#18948
closes: vim/vim#18951

3e82b0ebfe
2025-12-17 23:26:42 +00:00
yilisharcs
0c27c1175b refactor(editor): extract backup name generation logic #37001
Problem: The logic for generating backup file names is duplicated in
`buf_write_make_backup` and difficult to reuse.

Solution: Extract name generation logic into `buf_get_backup_name`.
2025-12-17 11:05:16 -05:00
Jan Edmund Lazo
d6607dae41 vim-patch:8.2.1939: invalid memory access in Ex mode with global command
Problem:    Invalid memory access in Ex mode with global command.
Solution:   Make sure the cursor is on a valid line. (closes vim/vim#7238)

3b6d57f2ce

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-17 00:46:41 -05:00
zeertzjq
544bde3acc vim-patch:9.1.1987: assert_equal() prepends unnecessary ':' when typed
Problem:  assert_equal() prepends unnecessary ':' when typed
          (after 9.0.1758).
Solution: Don't change a NULL stacktrace to an empty string (zeertzjq).

closes: vim/vim#18936

c4b3aefd0d
2025-12-17 06:47:34 +08:00
zeertzjq
6061169183 vim-patch:9.1.1983: Vim9: class_name definition can be improved
Problem:  Vim9: class_name definition can be improved
Solution: Use string_T to store class_name, avoid using STRLEN() calls,
          simplify code, remove unused definition of struct
          oc_newmember_S (John Marriott)

Use struct string_T to store the field class_name in struct class_T,
which means we can just use the .length field in struct string_T
instead of measuring it.

In addition:
1. In eval.c use string_T to store class_name and s in function
   class_tv2string().
2. In vim9type.c change some calls from ga_concat() to ga_concat_len()
   where the length is known.
3. In vim9class.c remove unused struct definition oc_newmember_S.
   Change some calls from ga_concat() to ga_concat_len() where the
   length is known.
4. In scriptfile.c use string_T to store type_name, class_name and
   es_name in function estack_sfile().
5. In function estack_sfile() simplify construction of the grow array ga
   and change some calls from ga_concat() to ga_concat_len() when the
   length is known.

closes: vim/vim#18925

2019321e0b

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-12-17 06:47:34 +08:00
zeertzjq
53fd3657cc vim-patch:9.0.1758: vim9 no class identifiers in stack dumps
Problem:  vim9 no class identifiers in stack dumps
Solution: Prefix class members in stack traces with the class name
          followed by a dot.

closes: vim/vim#12866
closes: vim/vim#12078

0ffc17aa47

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2025-12-17 06:47:33 +08:00
Olivia Kinnear
bd225422a5 fix(lsp): tests for :lsp, rename start/stop
- Rename :lsp start/stop to enable/disable
- Move lua section of `:lsp` to `vim/_core`
- Add tests
2025-12-16 13:46:08 -05:00
brianhuster
63abb1a88f feat(lsp): builtin :lsp command
Problem:
- Despite [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig)
  claims to be a "data-only" plugin, in fact it still provides some
  user-facing commands because they haven't been upstreamed to Nvim.

Solution:
- Upstream `:LspRestart`, `:LspStart` and `:LspStop` commands as `:lsp
  restart`, `:lsp start` and `:lsp stop` respectively.

Co-authored-by: glepnir <glephunter@gmail.com>
2025-12-16 13:46:04 -05:00
glepnir
6af8958055 fix(highlight): respect 'winhighlight' in CursorLine Normal check #36927
Problem:
CursorLine background check used global `normal_bg`, ignoring 'winhighlight'.

Solution:
Use `bg_attr` to get window-local Normal background instead.
2025-12-16 00:51:54 -05:00
zeertzjq
1d22b05f8d docs: update support.txt (#36903) 2025-12-16 12:55:32 +08:00
Yochem van Rosmalen
0e04f88081 ci(lintdocurls): ignore websites that block GHA #36982
Problem:
These URLs seem to be unreachable from GHA CI but are available locally.

Solution:
Ignore them for now.
2025-12-15 23:46:15 -05:00
Justin M. Keyes
9b768d6b3d Merge #36860 from justinmk/doc2 2025-12-15 23:10:33 -05:00
Ayaan
53aad276b6 fix(messages): exclude "search hit BOTTOM" msg from history #36961
Problem:
:messages history include the "search hit BOTTOM, continuing at TOP" message,
which is noise.

Solution:
Set msg_hist_off before giving the warning and reset it after warning.
2025-12-15 14:01:27 -05:00
Justin M. Keyes
d5cfca5b76 feat(docs): numbered listitems 2025-12-15 13:55:15 -05:00
Justin M. Keyes
a49bf5e1d3 fix(gen_help_html): parser override
Call `vim.treesitter.language.add()` before `get_helptags` (which
triggers filetype=help). And do this in the main routine, instead of
each gen/validate task.
2025-12-15 13:55:15 -05:00
Justin M. Keyes
31dfecb458 docs: misc, editorconfig
fix https://github.com/neovim/neovim/issues/36858
2025-12-15 13:55:15 -05:00
Riley Bruins
976a47e81b Revert "refactor(treesitter): use scratch buffer for string parser" #36964
This reverts commit 2a7cb32959.
2025-12-15 02:09:36 -05:00
Justin M. Keyes
981ea41abb feat(tui): ghostty builtin terminfo #36963
Problem:
The builtin terminfo defs don't include xterm-ghostty, so features like
`kTerm_set_underline_style` are missing when building without unibilium.

Solution:
- Add ghostty to `gen_terminfo.lua`.
  - Note: The ncurses defs are somewhat different than what ghostty ships.
- Special-case ghostty in `terminfo_from_builtin`.
2025-12-15 02:07:51 -05:00
zeertzjq
2700f6642a fix(buffer): switching buffer should respect jumpoptions+=view (#36969)
Also add missing change to buflist_findfmark() from #19224.
2025-12-15 14:45:11 +08:00
zeertzjq
3985257496 vim-patch:9.1.1979: :helpclose allows range and counts (#36966)
Problem:  :helpclose incorrectly accepts a range and a count.
Solution: Remove EX_COUNT and EX_RANGE from the command definition.
          (Doug Kearns)

closes: vim/vim#18917

4c141bae3b

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-12-15 08:38:42 +08:00
zeertzjq
592582ba48 fix(input): don't exit on EOF when peeking for input with -es (#36948)
Only exit on EOF when doing a blocking wait for input.
2025-12-15 08:00:40 +08:00
Jan Edmund Lazo
f4a33929d9 vim-patch:8.2.5161: might still access invalid memory
Problem:    Might still access invalid memory.
Solution:   Add extra check for negative value.

0fbc9260a7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-14 10:59:02 -05:00
Jan Edmund Lazo
7ce17cd2a2 vim-patch:8.2.4529: Vim9: comparing partial with function fails
Problem:    Vim9: comparing partial with function fails.
Solution:   Support this comparison.  Avoid a crash. (closes vim/vim#9909)
            Add more test cases.

ed0c62e7b1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-14 10:58:53 -05:00
Jan Edmund Lazo
ce05990823 vim-patch:8.2.4528: crash when using null_function for a partial
Problem:    Crash when using null_function for a partial.
Solution:   Don't call fname_trans_sid() with NULL. (closes vim/vim#9908)

673bcb10eb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-14 10:58:53 -05:00
zeertzjq
c2e0fd1c35 vim-patch:7.4.1886 (#36945)
Problem:    When waiting for a character is interrupted by receiving channel
            data and the first character of a mapping was typed, the mapping
            times out. (Ramel Eshed)
Solution:   When dealing with channel data don't return from mch_inchar().

cda7764d8e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-14 10:59:50 +08:00
Jan Edmund Lazo
2c560d8544 vim-patch:9.0.0025: accessing beyond allocated memory with the cmdline window
Problem:    Accessing beyond allocated memory when using the cmdline window in
            Ex mode.
Solution:   Use "*" instead of "'<,'>" for Visual mode.

c6fdb15d42

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-13 21:08:10 -05:00
Jan Edmund Lazo
edd99f09c7 vim-patch:8.2.5092: using "'<,'>" in Ex mode may compare unrelated pointers
Problem:    Using "'<,'>" in Ex mode may compare unrelated pointers.
Solution:   Set eap->cmd to "+" only later.

48ce135e6d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-13 21:08:10 -05:00
Jan Edmund Lazo
cd543d618d vim-patch:8.2.4763: using invalid pointer with "V:" in Ex mode
Problem:    Using invalid pointer with "V:" in Ex mode.
Solution:   Correctly handle the command being changed to "+".

f50808ed13

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-13 21:08:10 -05:00
Jan Edmund Lazo
0fa678c02f vim-patch:8.2.4637: warning for using uninitialized variable
Problem:    Warning for using uninitialized variable. (Tony Mechelynck)
Solution:   Initialize it.

565d1278cb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-13 21:02:17 -05:00
Jan Edmund Lazo
78292dcc3d vim-patch:8.2.4636: not using Visual range
Problem:    Not using Visual range.
Solution:   Put the command pointer back to the range.

1501b63f8d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-13 21:02:17 -05:00
Jan Edmund Lazo
0c70fbf0d6 vim-patch:8.2.4633: Visual range does not work before command modifiers
Problem:    Visual range does not work before command modifiers.
Solution:   Move Visual range to after command modifiers.

c75bca3ee9

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-13 21:02:17 -05:00
Jan Edmund Lazo
a331d187ba vim-patch:8.2.3662: illegal memory access if malloc() fails (#36939)
Problem:    Illegal memory access if malloc() fails.
Solution:   Check 'foldmethod' is not empty. (closes vim/vim#9207)

cf1e0239ce

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-14 09:28:13 +08:00
zeertzjq
e9da68effe vim-patch:9.1.1971: Crash when buffer gets deleted inside charconvert during save
Problem:  Crash when buffer gets deleted inside charconvert during save
Solution: Check for `b_saving` inside `can_unload_buffer()`, so we don’t try to
          unload a buffer while it’s still being saved (glepnir).

closes: vim/vim#18901

fe1c57cd2c

Co-authored-by: glepnir <glephunter@gmail.com>
2025-12-12 15:50:44 +08:00
zeertzjq
2b02dfa020 vim-patch:9.1.1970: visual end column returns wrong value after block edit (#36923)
Problem:  visual end column returns wrong value after block edit
Solution: update visual end column after block insert (phanium)

fixes:  vim/vim#18900
closes: vim/vim#18903

fa3bdc2501

Co-authored-by: phanium <91544758+phanen@users.noreply.github.com>
2025-12-12 09:38:11 +08:00