refactor: follow style guide

- reduce variable scope
- prefer initialization over declaration and assignment
- use bool to represent boolean values
This commit is contained in:
dundargoc
2023-11-12 15:54:54 +01:00
committed by dundargoc
parent 48bcc7b971
commit 28f4f3c484
42 changed files with 287 additions and 554 deletions

View File

@@ -420,7 +420,6 @@ 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);
int i;
char *s;
char *p = NULL;
int width;
@@ -499,7 +498,7 @@ void pum_redraw(void)
/ (pum_size - pum_height);
}
for (i = 0; i < pum_height; i++) {
for (int i = 0; i < pum_height; i++) {
int idx = i + pum_first;
const int *const attrs = (idx == pum_selected) ? attrsSel : attrsNorm;
int attr = attrs[0]; // start with "word" highlight