Commit Graph

19760 Commits

Author SHA1 Message Date
glepnir
ef0386fe9a fix(pum): adjust info window column offset when scrollbar is present (#37069)
Problem:
When the popupmenu has no border but includes a scrollbar, the info window
column is misaligned due to a missing column offset.

Solution:
Apply a one-column offset to the info window when the popup menu has no border
and a scrollbar is present.
2025-12-26 02:15:55 +00:00
zeertzjq
a565774bfc vim-patch:9.1.1483: not possible to translation position in buffer (#37099)
Problem:  not possible to translation position in buffer
Solution: use _() macro to mark the output as translatable
          (Emir SARI)

Row/Column indicator separator is currently not customizable. Some
languages have a space after the comma as the usual practice, plus this
would help translators use a custom separator like colons if necessary.

Additionally, after a save, the line and the byte indicator is also
hardcoded, this enables i18n for that as well.

closes: vim/vim#17608

81f9815831

Co-authored-by: Emir SARI <emir_sari@icloud.com>
2025-12-26 08:30:21 +08:00
github-actions[bot]
5a1a92cc7a docs: update version.c (#37059)
vim-patch:8.2.3793: using "g:Func" as a funcref does not work in script context
vim-patch:6ec7d40b7 runtime(getscript): GLVS plugin fails with wget.exe with PowerShell
vim-patch:2387c49f6 translation(zh_CN): Add license disclaimer
vim-patch:9.1.2002: Vim9: heap-use-after-free when when accessing protect class member
vim-patch:9.1.2010: Missing out-of-memory checks in vim9class.c
vim-patch:9.1.2011: crash when unreferencing gtk icon theme

Applicable patches became N/A due to previous ports (a4ea6027) and vim9:

vim-patch:8.2.0335: no completion for :disassemble
vim-patch:8.2.2033: Vim9: :def without argument gives compilation error
vim-patch:8.2.4288: preprocessor indents are inconsistent
vim-patch:8.2.4324: Vim9: script-local function name can start with "_"
vim-patch:8.2.4360: Vim9: allowing use of "s:" leads to inconsistencies
vim-patch:8.2.4957: text properties in a wrong position after a block change
vim-patch:9.0.0166: when using text properties line text length computed twice
vim-patch:9.0.0219: cannot make a funcref with "s:func" in a def function
vim-patch:9.0.1357: using null_object results in an internal error
vim-patch:9.0.1484: Coverity warns for using invalid array index
vim-patch:9.1.0274: MS-Windows: a few compiler warnings
vim-patch:9.1.1339: missing out-of-memory checks for enc_to_utf16()/utf16_to_enc()
vim-patch:9.1.1434: MS-Windows: missing out-of-memory checks in os_win32.c
2025-12-25 03:38:50 -05:00
Olivia Kinnear
29494f042c fix(ex): error handling for :lsp #37061 2025-12-25 03:19:12 -05:00
Jan Edmund Lazo
60a0e3d0a0 vim-patch:9.1.0151: ml_get_buf_len() does not consider text properties (#37094)
Problem:  ml_get_buf_len() does not consider text properties
          (zeertzj)
Solution: Store text length excluding text properties length
          in addition in the memline

related vim/vim#14123
closes: vim/vim#14133

a72d1be5a9

--------

Replace ml_line_len with ml_line_textlen to be explicit
that Nvim doesn't currently support Vim's text properties
and Nvim doesn't support lines with "ambiguous" length.

--------

vim-patch:9.1.0153: Text properties corrupted with fo+=aw and backspace

Problem:  Text properties corrupted with fo+=aw and backspace
Solution: Allocate line and move text properties
          (zeertzjq)

closes: vim/vim#14147

7ac1145fbe

vim-patch:9.1.0163: Calling STRLEN() to compute ml_line_textlen when not needed

Problem:  Calling STRLEN() to compute ml_line_textlen when not needed.
Solution: Use 0 when STRLEN() will be required and call STRLEN() later.
          (zeertzjq)

closes: vim/vim#14155

82e079df81

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-12-25 15:38:45 +08:00
Sean Dewar
1cde71233f fix(autocmd): skip empty comma-separated patterns properly
Problem: empty comma-separated patterns in an aupat aren't skipped correctly.
Solution: skip consecutive commas in an aupat.

Also simplify the logic.
2025-12-25 00:08:57 +00:00
Sean Dewar
6d2330f50d fix(autocmd): parsing of comma-separated buflocal patterns
Problem: patterns after a buffer-local pattern in a comma-separated aupat are
         ignored.
Solution: ensure pat refers to the original buffer after each pattern, not the
          buflocal_pat buffer, and when printing make sure it's normalized for
          each pattern, not just the first.

Also simplify the logic when printing all autocommands for an event, and ensure
headings aren't repeated for each event when printing autocommands.
2025-12-25 00:08:57 +00:00
Jan Edmund Lazo
ee717447dd vim-patch:9.1.1491: missing out-of-memory checks in cmdexpand.c
Problem:  missing out-of-memory checks in cmdexpand.c
Solution: add out-of-memory checks for expand_files_and_dirs(),
          ExpandUserDefined() and ExpandUserList()
          (John Marriott)

closes: vim/vim#17570

3b03b435a2

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-12-24 01:00:54 -05:00
Jan Edmund Lazo
9cc93b6def vim-patch:9.1.0974: typo in change of commit v9.1.0873
Problem:  typo in change of commit v9.1.0873
          (Christ van Willegen)
Solution: Add back the square brackets
          (John Marriott)

closes: vim/vim#16340

df4b3ca5dc

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-12-24 01:00:54 -05:00
Jan Edmund Lazo
3f62fe4bd8 vim-patch:partial:9.1.0973: too many strlen() calls in fileio.c
Problem:  too many strlen() calls in fileio.c
Solution: refactor fileio.c and remove calls to STRLEN(),
          check for out-of-memory condition in buf_check_timestamp()
          (John Marriott)

closes: vim/vim#16306

14ede1890f

Full port requires v8.2.0988 to update readdir_core().

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-12-24 00:59:31 -05:00
zeertzjq
d7b882697b vim-patch:9.1.2017: getregionpos() depends on 'linebreak' setting (#37088)
Problem:  getregionpos() depends on 'linebreak' setting
Solution: Reset linebreak setting temporarily (McAuley Penney)

When a line is wrapped on word boundaries, getregionpos() may report a
different end column for a visual block than the cursor position used to
define the selection.

Update the blockwise calculation in getregionpos() to use the same
wrapping assumptions as visual block mode, so the reported region
matches the selection boundaries.

Add a regression test that forces wrapping and checks that the end
position stays consistent under "setlocal wrap" and "setlocal
linebreak".

closes: vim/vim#19006

8ea0e7205c

Co-authored-by: McAuley Penney <jacobmpenney@gmail.com>
2025-12-24 09:48:59 +08:00
zeertzjq
2a2c366a3e vim-patch:9.1.2016: cindent wrong indentation after do-while loop (#37087)
Problem:  At "if(0) do if(0); while(0); else", else should be aligned
          with outer if, but is aligned with inner if.
Solution: In function find_match, ignore "if" and "else" inside a
          do-while loop, when looking for "if". (Anttoni Erkkilä)

closes: vim/vim#19004

9d661b057e

Co-authored-by: Anttoni Erkkilä <anttoni.erkkila@protonmail.com>
2025-12-24 09:43:42 +08:00
zeertzjq
20c96f1515 vim-patch:2006415: runtime(doc): add reference to searchcount() function
2006415016

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-24 08:53:31 +08:00
zeertzjq
a979a6237e vim-patch:8.2.4785: Visual mode not stopped if win_gotoid() goes to other buffer (#37073)
Problem:    Visual mode not stopped early enough if win_gotoid() goes to
            another buffer. (Sergey Vlasov)
Solution:   Stop Visual mode before jumping to another buffer. (closes vim/vim#10217)

3aca0916f0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-22 20:31:07 +08:00
Jaehwang Jung
033f1123cd fix(marks): wrong line('w$', win) with conceal_lines (#37047)
Background:
Suppose a window has concealed lines, and sets conceallevel>2,
concealcursor="". The concealed lines are displayed if the window is
curwin and the cursor is on the those lines.

Problem:
line('w$', win) switches curwin to win, and then does validate_botline
for curwin. It computes botline assuming the concealed lines displayed,
resulting in a smaller value than the actual botline that the user sees.

Solution:
Evaluate line('w$', win) without switching curwin.
Apply similar changes to other functions that switches curwin.

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-12-22 09:03:50 +00:00
Rob Pilling
8d3742ae8d vim-patch:8.2.1679: ":*" is not recognized as a range (#37052)
Problem:    Vim9: ":*" is not recognized as a range.
Solution:   Move recognizing "*" into skip_range(). (closes vim/vim#6938)

3bd8de40b4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-12-22 16:49:57 +08:00
Jan Edmund Lazo
1afdcb8f2b vim-patch:9.0.1899: potential buffer overflow in PBYTE macro
Problem:  potential buffer overflow in PBYTE macro
Solution: Check returned memline length

closes: vim/vim#13083

the PBYTE macro is used to put byte c at a position lp of the returned
memline. However, in case of unexpected errors ml_get_buf() may return
either "???" or an empty line in which case it is quite likely that we
are causing a buffer overrun.

Therefore, switch the macro PBYTE (which is only used in ops.c anyhow)
to a function, that verifies that we will only try to access within the
given length of the buffer.

Also, since the macro is only used in ops.c, move the definition from
macros.h to ops.c

ffb13674d1

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-12-22 00:17:09 -05:00
Jan Edmund Lazo
efacb10709 vim-patch:9.0.0154: text properties wrong after splitting a line
Problem:    Text properties wrong after splitting a line.
Solution:   Check for text properties after the line. (closes vim/vim#10857)

7d0f7e9524

textprop is N/A.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-21 23:36:57 -05:00
zeertzjq
b95848a8f1 vim-patch:8.2.1756: Vim9: :let will soon be disallowed (#37063)
Problem:    Vim9: :let will soon be disallowed.
Solution:   Add v:disallow_let temporarily.  Fix tests.

cfcd011fcd

The change to use checkforcmd() is already included in the port of patch
9.0.1505. This commit adds the missing :const check.

N/A patches:
vim-patch:8.2.1397: Vim9: return type of maparg() not adjusted for fourth arg
vim-patch:8.2.1623: Vim9: using :call where it is not needed
vim-patch:8.2.1766: Vim9: Some tests are still using :let
vim-patch:8.2.1788: Vim9: still allows :let for declarations
vim-patch:8.2.1882: Vim9: v:disallow_let is no longer needed

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-22 12:31:44 +08:00
Jan Edmund Lazo
3fc3f5f194 vim-patch:8.2.0223: some instructions not yet tested
Problem:    Some instructions not yet tested.
Solution:   Disassemble more instructions.  Move tests to a new file.  Compile
            call to s:function().

5cab73f8cc

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-21 21:17:34 -05:00
Jan Edmund Lazo
525c348c29 vim-patch:8.2.2992: Vim9: completion for :disassemble is incomplete
Problem:    Vim9: completion for :disassemble is incomplete.
Solution:   Recognize the "debug" and "profile" arguments.

4ee9d8e04d

Vim9 ":disassemble" is N/A.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-21 21:17:33 -05:00
Jan Edmund Lazo
2ba44af7e0 vim-patch:8.2.4548: script-local function is deleted when used in a funcref
Problem:    Script-local function is deleted when used in a funcref.
Solution:   Do not consider a function starting with "<SNR>" reference
            counted. (closes vim/vim#9916, closes vim/vim#9820)

fb43cfc2c6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-12-21 21:17:26 -05:00
Jan Edmund Lazo
ffb4526376 vim-patch:8.2.1667: local function name cannot shadow a global function name
Problem:    Local function name cannot shadow a global function name.
Solution:   Ignore global functions when checking a script-local or scoped
            function name. (closes vim/vim#6926)

0f769815c8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2025-12-21 21:12:26 -05:00
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