vim-patch:9.1.1086: completion doesn't work with multi lines (#32377)

Problem:  completion doesn't work with multi lines
          (Łukasz Jan Niemier)
Solution: handle linebreaks in completion code as expected
          (glepnir)

fixes: vim/vim#2505
closes: vim/vim#15373

76bdb82527
This commit is contained in:
glepnir
2025-02-09 10:43:02 +08:00
committed by GitHub
parent ec3071ffad
commit 53e737748e
4 changed files with 267 additions and 11 deletions

View File

@@ -1539,7 +1539,8 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int col_rows, s
ptr = line + v; // "line" may have been updated
}
if ((State & MODE_INSERT) && in_curline && ins_compl_win_active(wp)) {
if ((State & MODE_INSERT) && ins_compl_win_active(wp)
&& (in_curline || ins_compl_lnum_in_range(lnum))) {
area_highlighting = true;
}
@@ -1787,8 +1788,9 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int col_rows, s
}
// Check if ComplMatchIns highlight is needed.
if ((State & MODE_INSERT) && in_curline && ins_compl_win_active(wp)) {
int ins_match_attr = ins_compl_col_range_attr((int)(ptr - line));
if ((State & MODE_INSERT) && ins_compl_win_active(wp)
&& (in_curline || ins_compl_lnum_in_range(lnum))) {
int ins_match_attr = ins_compl_col_range_attr(lnum, (int)(ptr - line));
if (ins_match_attr > 0) {
search_attr = hl_combine_attr(search_attr, ins_match_attr);
}