Problem: An insecurely-set 'indentexpr', 'formatexpr', 'includeexpr'
or 'complete' value can end up evaluated outside the
sandbox after buf_copy_options() and clears the flag.
Solution: Copy the insecure flag alongside the value in
buf_copy_options(), and make 'complete' a per-buffer
insecure-flags field
Supported by AI.
closes: vim/vim#2086135f7fdfdfb
I'm a bit hesitant to port this, but it's a follow-up to #39452.
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Installing plugins during lockfile synchronization always
writes the lockfile, even though its content is used during install.
This might be a problem if the lockfile (itself or its parent
directory) is not writeable (can only be read).
Solution: Do not write the lockfile when installing directly from it.
This is okay since the `src` and `rev` are used directly from the
lockfile and don't change at this step. While potential change in
`version` (that must be written to the lockfile) is handled in other
code path.
Problem:
commit_chars_str() reads a 0x80-0xBF byte as a 2-byte lead, so
"\xA9x" makes "x" a commit character. nvim_get_hl() returns
a dict, so `#` on it is 0 whether or not the group exists
Solution:
use vim.str_utf_end() and drop entries that are not one whole
character. use next check dict length.
Problem:
Cursor-relative floats can use stale screen coordinates after a cursor move is restored without a redraw.
Solution:
Validate the current cursor before converting cursor-relative coordinates.
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Nvim diverged from Vim's ":version".
- no date
- different compiled features list
- different config file and directory
- no compiler flags
* build(vim-patch): n/a doc for balloon feature (8.2.3917)
vim-patch:c74a87eea runtime(helptoc): reload cached g:helptoc.shell_prompt when starting toc
vim-patch:647d7f738 runtime(doc): fix typo in tag for helptoc package
vim-patch:1c00af2a2 runtime(doc): Remove obsolete labelling from 'h' occasion in :help 'highlight'
vim-patch:9.1.1537: helptoc: still some issues when markdown code blocks
vim-patch:958ae91f3 runtime(doc): typo in recent doc style tweaks in options.txt
vim-patch:9ade3f589 runtime(doc): Clarification in listener_add() doc
vim-patch:9.2.0344: channel: ch_listen() can bind to network interface
vim-patch:9.2.0669: GTK4: toolbar can be improved
vim-patch:9.2.0857: popup: opacity popup over a terminal is not cleared when closed
vim-patch:9.2.0858: MS-Windows GUI: white flash when VimEnter is slow
vim-patch:9.2.0859: GTK2: Link error
vim-patch:935fa240e runtime(doc): clarify vim9 script autoload mechanism
vim-patch:9.2.0861: GTK4: bleed region updates in jumps
vim-patch:9.2.0862: Missing test change from v9.2.0857
vim-patch:9.2.0863: MS-Windows GUI: window contents can be missing when VimEnter is slow
Problem:
Tree-sitter uses UINT32_MAX for full-document ranges, which becomes -1 on 32-bit platforms and reaches _foldupdate as an invalid end row.
Solution:
Treat negative changed-range end rows as unbounded and clamp them to the buffer line count. Add a regression test that simulates the 32-bit sentinel.
AI-assisted: Codex
Problem:
Want `gQ` for _le multicursor_.
Solution:
- Don't use `gQ` for exmode.
- Introduce `:exmode`.
- Introduce `[count]q:` as an alias to `:exmode`.
Problem:
On NetBSD, `man -w open` can return the exact manpage path, but `:Man`
may still fail when man directories cannot be discovered from `manpath
-q`, bare `man -w`, or `$MANPATH`.
Solution:
Fall back to the direct manpage lookup when directory discovery fails.
Add a test for resolving `open(2)` through `goto_tag()` without manpath
data.
Problem: A preselected item is inserted even with "noinsert", and the
first added preselected item wins over the first one shown
in the menu.
Solution: Use K_DOWN when "noinsert" is set; pick the first preselected
item that made it into the menu.
Problem:
POSIX-compatible Ex-mode requires special-cases all over the codebase to
match various quirks that don't actually matter to users.
- The main utility of *interactive* Ex-mode is its REPL behavior, and
that can be achieved with `cmdwin`, which also gains extra UX
benefits.
- The main utility of *non-interactive* `nvim -es` is for shell
scripting, where Ex-mode quirks are mostly unhelpful (e.g. the
"Entering Ex mode" message).
Solution:
- Reimplement *interactive* Ex-mode as a "persistent, insert-mode
cmdwin" in Lua.
- "nvim -e/-E" is simply an alias to "gQ".
- Reframe *non-interactive* Ex-mode (`nvim -es`) as "script mode".
- Drop POSIX Ex-mode quirks.
Improvements:
- "nvim -V1 -es" output ends with a final newline!
- "nvim -V1 -es" no longer shows the "Entering Ex mode" msg. (This was
pointless noise, unwanted for scripting purposes.)
- stdin is no longer typeahead. Scripts (":lua io.read()") can read
stdin as data.
- Empty line is a no-op: a stray blank line no longer moves the cursor
(deviates from POSIX ex "+1"), no longer exits 1 at EOF (E501).
Preserved behavior:
- cursor starts at "$"
- mode()=="cv" (for non-interactive)
- multiline commands (:append/:function/heredoc pull continuation lines)
- bare-range print
- :print=>stdout
- -V1=>stderr
- CRLF input
- continue-after-error and exit codes
Dropped (regressed) POSIX behavior (non-interactive):
- Event loop only ticks while/between commands, not while blocked
waiting for a stdin line.
- ":g/pat/visual...Q"
- input()/getchar()/":s/x/y/c" no longer consume stdin lines as
answers: Nvim stops at end-of-input, skipping the rest of the script,
exit 0. Use ":lua io.read()" instead.
- If users care about this they should use interactive Ex-mode (`gQ`).
- ":@r" stops at end of the register instead of continuing to read
cmdline input from stdin.
Lazy imports (PEP 810, to be released in Python 3.15) introduces a
`lazy` soft keyword that's recognized when it precedes a `from` or
`import` keyword.
closes: vim/vim#20342916809ae1e
Co-authored-by: Jon Parise <jon@indelible.org>
Problem: s:SearchBracket()'s skip-expression matches syntax group
names ending in "Comment", "Todo", or "String" to decide
whether a candidate bracket is inside a string/comment
and should be skipped for indentation purposes. Byte and
raw-byte string literals (b"...", rb"...") are highlighted
via the pythonBytes/pythonRawBytes syntax groups, which
don't end in "String", so brackets inside them (e.g.
b"[") were never skipped and were counted as real,
unmatched brackets, producing incorrect indentation.
Solution: Add "Bytes" to the indent script's existing suffix match,
so pythonBytes/pythonRawBytes are recognized directly, the
same way pythonString/pythonFString/pythonRawString
already are.
This supersedes an earlier version of this fix that
renamed pythonBytes/pythonRawBytes to
pythonBytesString/pythonRawBytesString in
runtime/syntax/python.vim.
fixes: vim/vim#20812closes: vim/vim#20827f88e7191da
Co-authored-by: qwavies <qwavsbusiness@gmail.com>
## Flicker cause
ui2's `check_targets()` function creates the hidden ui2 windows with this call chain:
```
nvim_open_win()
win_set_buf()
do_buffer()
set_curbuf()
enter_buffer()
```
and `enter_buffer()` sets `need_fileinfo`:
fdc09be03c/src/nvim/buffer.c (L1837-L1839)
This is then picked up by `normal_redraw`:
fdc09be03c/src/nvim/normal.c (L1381-L1385)
The fileinfo message then causes a ui2 window to appear to display it:
fdc09be03c/runtime/lua/vim/_core/ui2/messages.lua (L325-L330)
... which ends up calling `set_pos`, which registers an `on_key` handler:
fdc09be03c/runtime/lua/vim/_core/ui2/messages.lua (L726-L728)
This handler closes the ui2 window when the user presses, for example, `l` (because the user's not focusing said window).
The handler eventually calls `check_targets()`:
fdc09be03c/runtime/lua/vim/_core/ui2/messages.lua (L594-L595)
and `check_targets()` takes us back to the beginning, causing the ui2 window flicker
## Repro
```vim
=require("vim._core.ui2").enable()
set ch=0 shm-=F ve=all
e /tmp/x
```
Then hit `Ctrl-G` to show fileinfo (if not already shown) and hold `l`
## Fix
Effectively surround the ui2 window creating with `:silent`
Problem:
The code block query relied on a bug fixed in commit
7ed5609439, where a trailing newline was
not included in a node's text.
Solution:
Fix the query to expect the newline.
Problem:
The current check is intended to match DOS device paths starting with
`\\?` or `\\.` but will match any path starting with `?` or `.`,
including relative paths such as `.\`.
This is because the leading slashes are removed before the comparison.
Solution:
Changes the check to include the path's prefix, assuring the path has
the correct amount of separators for a DOS device path.
Problem:
After expanding tabs with the `expandtab` option, if the old indent
matches the requested one, `vim.text.indent()` returns the input
unchanged.
The optimization path assumes that if old_indent == size, the input
wouldn't be changed, which is not correct when old_indent is formed by
expanded tabs.
Solution:
Apply the optimization only when `expandtab` is not set.
vim-patch:8.2.4761: documentation for using LSP messages is incomplete
vim-patch:8.2.4780: parsing an LSP message fails when it is split
vim-patch:9.0.0979: ch_log() text can be hard to find in the log file
vim-patch:7c948644f runtime(doc): Update the version9.txt with a template for version 9.1 enhancements (#13165)
vim-patch:15935e7f5 runtime(doc): Add a place holder section for version 9.2 (#14060)
vim-patch:1a946044f runtime(doc): correct return types for job_start() and job_status()
vim-patch:1cd31a450 runtime(doc): update return type for job_info()
vim-patch:15141208e runtime(doc): -x is only available when compiled with crypt feature
vim-patch:a37fd7274 runtime(doc): Remove accidental option name highlighting from :help channel.txt
vim-patch:1ff963e15 runtime(doc): Update version9.txt with numbered patches
vim-patch:9.1.2134: Terminal doesn't handle split UTF-8 sequence after ASCII
vim-patch:9.1.2141: Truncation when serializing libsodium encryption parameters
vim-patch:9.1.2145: intstalltutor Makefile target does not create the tutor/sv dir
vim-patch:9.1.2148: [security]: Buffer overflow in netbeans interface
vim-patch:9.2.0021: channel: connection timeout fails to fall back to IPv4
vim-patch:9.2.0314: channel: can bind to all network interfaces
vim-patch:9.2.0317: listener functions do not check secure flag
vim-patch:60e925ca0 runtime(doc): Tweak documentation style in channel.txt
vim-patch:9.2.0843: [security]: popup: opacity mask indexed out of bounds
vim-patch:9.2.0844: [security]: use-after-free on json decode error
vim-patch:9.2.0847: [security]: vimball: code execution via .VimballRecord file
vim-patch:b0e6baab8 Update .gitignore and .hgignore files
vim-patch:9.2.0851: Focus autocommands triggered inconsistently
vim-patch:9.2.0852: GTK: ligatures not correctly displayed
vim-patch:9.2.0853: popup: popup images do not support scaling
vim-patch:3886a8ffc runtime(osc52): don't use osc52 provider if gui is running
vim-patch:f5882d534 CI: Bump the github-actions group across 1 directory with 3 updates
vim-patch:9.2.0856: GTK4: undercurl rendering is inefficient
vim-patch:9.2.0841: [security]: heap overflow when adding > 65535 text properties
vim-patch:9.2.0842: [security]: stack buffer overflow in socket server
Problem: Shortening the name of a buffer whose full name is the current
directory + path sep yields empty string -> buf unnamed.
This doesn't interact well with things like `:mksession`, which
for example could `:badd` with no arg -> E471.
Solution: Keep the full path when shortening yields an empty name, as
`path_try_shorten_fname()` already does.
'spellcapcheck' checks the first word in the file for a capital like any
sentence start: capcol is seeded to 0 for line 1 in spell_check_sblock().
This has been the case since the feature was added in v7.0100, so the note
that it "doesn't work for the first word in the file" is incorrect.
related: f9184a1d3151b5b727fec86c2ac0946c9c68df4d (code change)
related: 0d9c26dd8333aae4b20015f13fe2e8e1f07037bd (initial doc patch,
just a few minutes later)
related: vim/vim#20715e2d3e7818b
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: 'showcmd' not redrawn with empty mapping triggered on timeout.
Solution: Don't postpone redraw when inside vgetorpeek(). Also move test
for tabline 'showcmd' to test_tabline.vim.
fixes: vim/vim#20839closes: vim/vim#208402e9687647a
Problem: The `showcmd` statusline item may show internal command keys when a
`<Cmd>` or `<ScriptCmd>` mapping redraws the statusline, and may
leave stale text behind when `%S` is rendered directly.
Solution: Do not add these internal mapping dispatch keys to the `showcmd`
buffer, and keep the clear state in sync when `%S` renders it
(Barrett Ruth)
closes: vim/vim#20769bd730293dc
Co-authored-by: Barrett Ruth <br@barrettruth.com>