diff options
| author | Qiming zhao <chemzqm@gmail.com> | 2026-09-30 16:50:48 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-30 23:50:48 +0000 |
| commit | d7d11f86227522a959a44986820f2192fafb87ee (patch) | |
| tree | 08d96534c5bb9909f5c2f8e47febf85807e41274 /runtime/lua/vim/_ftplugin/lua.lua | |
| parent | e4cd1639f699033c8292ac258ea01ae3f08988a4 (diff) | |
| download | rneovim-d7d11f86227522a959a44986820f2192fafb87ee.tar.gz rneovim-d7d11f86227522a959a44986820f2192fafb87ee.tar.bz2 rneovim-d7d11f86227522a959a44986820f2192fafb87ee.zip | |
fix(search): correct patlen calculation for semicolon search (#42150)
Problem:
When repeating search using a semicolon (e.g. `/pat1/;/pat2`), `pat`
advances past both the semicolon and the delimiter ('/' or '?'),
consuming 2 characters, but `patlen` was only decremented by 1.
Consequently, `patlen` in the subsequent search is 1 byte too long and
includes the trailing NUL byte, corrupting `msgbuf` and causing ui2's
search_count handler to fail with 'attempt to concatenate a nil value'.
Solution:
Decrement `patlen` by 2 when skipping ';' and delimiter. Also ensure
ui2 safely guards search_count messages when extracting the search stat.
Fixes #41929
AI-assisted
Diffstat (limited to 'runtime/lua/vim/_ftplugin/lua.lua')
0 files changed, 0 insertions, 0 deletions