0
0
mirror of https://github.com/vim/vim.git synced 2025-07-04 23:07:33 -04:00

Merge dd26bc94662c43687be49779e429d8953d9f9c88 into a494ce1c64a2637719a5c1339abf19ec7c48089c

This commit is contained in:
zeertzjq 2025-07-04 16:14:17 +08:00 committed by GitHub
commit 892879c08f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 4 deletions

View File

@ -4609,14 +4609,11 @@ copy_substring_from_pos(pos_T *start, pos_T *end, char_u **match,
|| (start->lnum == end->lnum && start->col >= end->col))
return FAIL; // invalid range
// Get line pointers
start_line = ml_get(start->lnum);
end_line = ml_get(end->lnum);
// Use a growable string (ga)
ga_init2(&ga, 1, 128);
// Append start line from start->col to end
start_line = ml_get(start->lnum);
char_u *start_ptr = start_line + start->col;
int is_single_line = start->lnum == end->lnum;
@ -4643,6 +4640,7 @@ copy_substring_from_pos(pos_T *start, pos_T *end, char_u **match,
}
// Append partial end line (up to word end)
end_line = ml_get(end->lnum);
word_end = find_word_end(end_line + end->col);
segment_len = (int)(word_end - end_line);
if (ga_grow(&ga, segment_len) != OK)

View File

@ -4493,6 +4493,7 @@ func Test_search_wildmenu_screendump()
CheckScreendump
let lines =<< trim [SCRIPT]
call test_override('alloc_lines', 1)
set wildmenu wildcharm=<f5>
call setline(1, ['the', 'these', 'the', 'foobar', 'thethe', 'thethere'])
[SCRIPT]