mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 06:58:35 +00:00
refactor: follow style guide
- reduce variable scope - prefer initialization over declaration and assignment
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user