diff options
Diffstat (limited to 'src/nvim/popupmenu.c')
-rw-r--r-- | src/nvim/popupmenu.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/nvim/popupmenu.c b/src/nvim/popupmenu.c index 4ed5d64c60..a6eb32ecb1 100644 --- a/src/nvim/popupmenu.c +++ b/src/nvim/popupmenu.c @@ -420,10 +420,7 @@ void pum_redraw(void) int row = 0; int attr_scroll = win_hl_attr(curwin, HLF_PSB); int attr_thumb = win_hl_attr(curwin, HLF_PST); - char *s; char *p = NULL; - int width; - int w; int thumb_pos = 0; int thumb_height = 1; int n; @@ -524,8 +521,8 @@ void pum_redraw(void) for (int round = 0; round < 3; round++) { attr = attrs[round]; - width = 0; - s = NULL; + int width = 0; + char *s = NULL; switch (round) { case 0: @@ -541,7 +538,7 @@ void pum_redraw(void) if (s == NULL) { s = p; } - w = ptr2cells(p); + int w = ptr2cells(p); if ((*p == NUL) || (*p == TAB) || (totwidth + w > pum_width)) { // Display the text that fits or comes before a Tab. @@ -778,11 +775,10 @@ static bool pum_set_selected(int n, int repeat) } if (res == OK) { - char *p, *e; linenr_T lnum = 0; - for (p = pum_array[pum_selected].pum_info; *p != NUL;) { - e = vim_strchr(p, '\n'); + for (char *p = pum_array[pum_selected].pum_info; *p != NUL;) { + char *e = vim_strchr(p, '\n'); if (e == NULL) { ml_append(lnum++, p, 0, false); break; |