mirror of
https://github.com/neovim/neovim.git
synced 2025-10-15 22:36:09 +00:00
refactor: follow style guide
- reduce variable scope - prefer initialization over declaration and assignment - use bool to represent boolean values
This commit is contained in:
@@ -354,11 +354,10 @@ void init_search_hl(win_T *wp, match_T *search_hl)
|
||||
static int next_search_hl_pos(match_T *shl, linenr_T lnum, matchitem_T *match, colnr_T mincol)
|
||||
FUNC_ATTR_NONNULL_ALL
|
||||
{
|
||||
int i;
|
||||
int found = -1;
|
||||
|
||||
shl->lnum = 0;
|
||||
for (i = match->mit_pos_cur; i < match->mit_pos_count; i++) {
|
||||
for (int i = match->mit_pos_cur; i < match->mit_pos_count; i++) {
|
||||
llpos_T *pos = &match->mit_pos_array[i];
|
||||
|
||||
if (pos->lnum == 0) {
|
||||
@@ -902,7 +901,6 @@ void f_clearmatches(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
|
||||
void f_getmatches(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
|
||||
{
|
||||
matchitem_T *cur;
|
||||
int i;
|
||||
win_T *win = get_optional_window(argvars, 0);
|
||||
|
||||
tv_list_alloc_ret(rettv, kListLenMayKnow);
|
||||
@@ -915,7 +913,7 @@ void f_getmatches(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
|
||||
dict_T *dict = tv_dict_alloc();
|
||||
if (cur->mit_match.regprog == NULL) {
|
||||
// match added with matchaddpos()
|
||||
for (i = 0; i < cur->mit_pos_count; i++) {
|
||||
for (int i = 0; i < cur->mit_pos_count; i++) {
|
||||
llpos_T *llpos;
|
||||
char buf[30]; // use 30 to avoid compiler warning
|
||||
|
||||
|
Reference in New Issue
Block a user