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>
Problem: `q:` in visual mode does not insert `'<,'>` automatically in
the current line on cmdwin.
Solution: Insert `'<,'>` in the current line on cmdwin when `q:` is used
in visual mode.
Vim patches for Vim help files must use Vim tags as diff hunk header
to reliably detect if a hunk is N/A or not.
Git does not know which files are Vim help files
so that it can use custom "diff.<filetype>.xfuncname" regexp
to create the header.
Update Neovim's gitattributes to detect Vim help files
and then use it on vim-patch.sh to scan Vim patches.
Add non-function tags from ":h vim_diff"
to detect N/A Vim runtime patches.
Problem: `:browse edit` (and variants) without an argument fails instead
of opening a browser.
Solution: Dispatch to dir.lua using the cwd as the implied directory.
Replace the inherited GUI-only documentation with the supported
behavior. Support vsplit, split, tabedit variants.
Problem: Memory leak when a spell file has an SN_SAL section before an
SN_SOFO section: set_sofo() reuses sl_sal without freeing the
salitem_T entries left by read_sal_section() (after v9.2.0846).
Solution: Factor the SAL free loop into free_sal_items() and call it
before set_sofo() reuses sl_sal.
closes: vim/vim#20836
Supported by AI.
5a7ce2733a
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: [security]: heap buffer overflow in set_sofo()
(Yazan Balawneh)
Solution: Reset sl_sal_first (Yasuhiro Matsumoto).
A crafted spell file with an empty SN_SAL section before an SN_SOFO
section reaches set_sofo() with sl_sal_first[] already set to -1 by
set_sal_first(). The counting loop then under-counts colliding
multi-byte "from" characters, allocates an undersized list and writes
past its end.
Github Security Advisory:
https://github.com/vim/vim/security/advisories/GHSA-9jqx-hgpr-6v6405c41c9223
Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Problem: When a tagfunc returns a "cmd" that is neither a line number nor
a search pattern, the tag entry is corrupted: the "kind" field is
lost and taglist() returns a mangled "cmd".
Solution: Accept any Ex command in "cmd" as in a tags file, terminate a
generic command with a bar so the trailing fields are preserved,
and reject a value that cannot be stored in a tag line with E987
(Hirohito Higashi).
fixes: vim/vim#20781
related: vim/vim#20790
closes: vim/vim#2082886adef19fc
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Mao-Yining <mao.yining@outlook.com>
Update the Go syntax file with some recent changes made to vim-go to
correctly highlight the second and later lines of concatenated strings
in var or const blocks.
closes: vim/vim#20835e9234b9b4a
Co-authored-by: Billie Cleek <bhcleek@gmail.com>
Problem: [security]: arbitrary Ex command execution during C
omni-completion (Threonine)
Solution: Match tags typeref literally to block Ex command injection
(Yasuhiro Matsumoto).
Escaping only "/" and "\" left the typeref able to break out of the
:vimgrep pattern without a "/": an unclosed "[" makes vimgrep's pattern
skipping fail, and the parser then treats a following "|" as a command
separator, so the tag value runs as Ex commands during C omni-completion.
Match the field literally with \V so no regex metacharacter can affect
pattern parsing.
Github Security Advisory:
https://github.com/vim/vim/security/advisories/GHSA-cx73-phcg-3j5g2f628d8104
Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Problem: scripts/genappimage.sh runs `make` with no extra flags and
emits a fixed nvim-linux-<arch>.appimage filename, so packaging a
variant build (e.g. with the bundled PUC-Rio Lua interpreter)
requires editing the Makefile or post-renaming the AppImage, which
breaks the AppImage zsync URL.
Solution: forward DEPS_CMAKE_FLAGS and CMAKE_EXTRA_FLAGS to `make`,
accept OUTPUT so the AppImage (and its zsync Filename:) follows the
caller's chosen name, and mark CPACK_PACKAGE_FILE_NAME as CACHE
STRING on Linux so the resulting tarball/deb follow as well. Default
behavior is unchanged when none of these env vars are set.
Changes:
- Removed the blank line before the first healthcheck header.
- Fixed a bug where the entire "Terminal" section of `vim.health` would
not appear if the `infocmp` executable was not found.
- Fixed a typo in `vim.lsp` when displaying the LSP log level.
"vim-patch.sh -L" includes gpg signature for "log.showSignature=true"
in user's .gitconfig.
vim-patch.sh expects no signature for 1-line output per patch.
The parent commit made a valiant effort to store "dict options" in their
reified form, but this is more trouble than it's worth:
- inconsistent model for developers to understand.
- string lifetime issues (the "varp" convention is to pass around an
aliased, long-lived option value).
- lots of extra plumbing to deal with the 2 different option-storage
paradigms.