aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/popupmenu.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-06-14 04:28:41 +0800
committerzeertzjq <zeertzjq@outlook.com>2024-06-15 04:47:23 +0800
commite2ef5330252b3b52b816503cdcb01934b68f43a0 (patch)
treebce75acfc994bd995e6f77175577aade742c8485 /src/nvim/popupmenu.c
parentdc4037f612c6f3bbc76890adfa638d48ec238eee (diff)
downloadrneovim-e2ef5330252b3b52b816503cdcb01934b68f43a0.tar.gz
rneovim-e2ef5330252b3b52b816503cdcb01934b68f43a0.tar.bz2
rneovim-e2ef5330252b3b52b816503cdcb01934b68f43a0.zip
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 https://github.com/vim/vim/commit/2f95ca9fcef8495d60e298ac2cd6d702b90bfb18 N/A patch: vim-patch:9.1.0478: potential deref of NULL pointer in fuzzy_match_str_with_pos
Diffstat (limited to 'src/nvim/popupmenu.c')
-rw-r--r--src/nvim/popupmenu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/popupmenu.c b/src/nvim/popupmenu.c
index a7fdd44ef0..50569fbc42 100644
--- a/src/nvim/popupmenu.c
+++ b/src/nvim/popupmenu.c
@@ -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);