mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 06:28:35 +00:00
vim-patch:9.1.0479: fuzzy_match_str_with_pos() does unnecessary list operations
Problem: fuzzy_match_str_with_pos() does unnecessary list operations.
Solution: Use fuzzy_match() directly (zeertzjq).
closes: vim/vim#14987
2f95ca9fce
N/A patch:
vim-patch:9.1.0478: potential deref of NULL pointer in fuzzy_match_str_with_pos
This commit is contained in:
@@ -438,7 +438,7 @@ void pum_display(pumitem_T *array, int size, int selected, bool array_changed, i
|
||||
}
|
||||
|
||||
/// Displays text on the popup menu with specific attributes.
|
||||
static void pum_puts_with_attr(int col, const char *text, int attr)
|
||||
static void pum_puts_with_attr(int col, char *text, int attr)
|
||||
{
|
||||
char *leader = ins_compl_leader();
|
||||
|
||||
@@ -472,8 +472,8 @@ static void pum_puts_with_attr(int col, const char *text, int attr)
|
||||
if (ga != NULL) {
|
||||
// Handle fuzzy matching
|
||||
for (int i = 0; i < ga->ga_len; i++) {
|
||||
int *match_pos = ((int *)ga->ga_data) + i;
|
||||
int actual_char_pos = 0;
|
||||
uint32_t *match_pos = ((uint32_t *)ga->ga_data) + i;
|
||||
uint32_t actual_char_pos = 0;
|
||||
const char *temp_ptr = text;
|
||||
while (temp_ptr < ptr) {
|
||||
temp_ptr += utfc_ptr2len(temp_ptr);
|
||||
|
Reference in New Issue
Block a user