fix(incsearch): include compsing characters with Ctrl-L

Cherry-picked from Vim patch 8.1.0579.

(cherry picked from commit f348c0ebba)
This commit is contained in:
zeertzjq
2025-07-04 06:45:30 +08:00
committed by github-actions[bot]
parent d1214da08f
commit 282f9fb816

View File

@ -608,6 +608,16 @@ static int may_add_char_to_search(int firstc, int *c, incsearch_state_T *s)
stuffcharReadbuff(*c);
*c = '\\';
}
// add any composing characters
if (utf_char2len(*c) != utfc_ptr2len(get_cursor_pos_ptr())) {
const int save_c = *c;
while (utf_char2len(*c) != utfc_ptr2len(get_cursor_pos_ptr())) {
curwin->w_cursor.col += utf_char2len(*c);
*c = gchar_cursor();
stuffcharReadbuff(*c);
}
*c = save_c;
}
return FAIL;
}
}