mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 07:28:34 +00:00
vim-patch: 7.4.344
Problem: Unnecessary initializations and other things related to matchaddpos(). Solution: Code cleanup. (Alexey Radkov) https://code.google.com/p/vim/source/detail?r=ce284c205558d103326a4c3f22f181774690b3eb
This commit is contained in:
@@ -251,7 +251,7 @@ static int included_patches[] = {
|
|||||||
//347,
|
//347,
|
||||||
346,
|
346,
|
||||||
//345,
|
//345,
|
||||||
//344,
|
344,
|
||||||
343,
|
343,
|
||||||
//342 NA
|
//342 NA
|
||||||
//341,
|
//341,
|
||||||
|
@@ -5242,7 +5242,6 @@ int match_add(win_T *wp, char_u *grp, char_u *pat, int prio, int id, list_T *pos
|
|||||||
m->id = id;
|
m->id = id;
|
||||||
m->priority = prio;
|
m->priority = prio;
|
||||||
m->pattern = pat == NULL ? NULL: vim_strsave(pat);
|
m->pattern = pat == NULL ? NULL: vim_strsave(pat);
|
||||||
m->pos.cur = 0;
|
|
||||||
m->hlg_id = hlg_id;
|
m->hlg_id = hlg_id;
|
||||||
m->match.regprog = regprog;
|
m->match.regprog = regprog;
|
||||||
m->match.rmm_ic = FALSE;
|
m->match.rmm_ic = FALSE;
|
||||||
@@ -5256,19 +5255,15 @@ int match_add(win_T *wp, char_u *grp, char_u *pat, int prio, int id, list_T *pos
|
|||||||
listitem_T *li;
|
listitem_T *li;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0, li = pos_list->lv_first; i < MAXPOSMATCH;
|
for (i = 0, li = pos_list->lv_first; li != NULL && i < MAXPOSMATCH;
|
||||||
i++, li = li->li_next) {
|
i++, li = li->li_next) {
|
||||||
linenr_T lnum = 0;
|
linenr_T lnum = 0;
|
||||||
colnr_T col = 0;
|
colnr_T col = 0;
|
||||||
int len = 1;
|
int len = 1;
|
||||||
list_T *subl;
|
list_T *subl;
|
||||||
listitem_T *subli;
|
listitem_T *subli;
|
||||||
int error = FALSE;
|
int error = false;
|
||||||
|
|
||||||
if (li == NULL) {
|
|
||||||
m->pos.pos[i].lnum = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (li->li_tv.v_type == VAR_LIST) {
|
if (li->li_tv.v_type == VAR_LIST) {
|
||||||
subl = li->li_tv.vval.v_list;
|
subl = li->li_tv.vval.v_list;
|
||||||
if (subl == NULL) {
|
if (subl == NULL) {
|
||||||
@@ -5279,18 +5274,18 @@ int match_add(win_T *wp, char_u *grp, char_u *pat, int prio, int id, list_T *pos
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
lnum = get_tv_number_chk(&subli->li_tv, &error);
|
lnum = get_tv_number_chk(&subli->li_tv, &error);
|
||||||
if (error == TRUE) {
|
if (error == true) {
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
m->pos.pos[i].lnum = lnum;
|
|
||||||
if (lnum == 0) {
|
if (lnum == 0) {
|
||||||
--i;
|
--i;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
m->pos.pos[i].lnum = lnum;
|
||||||
subli = subli->li_next;
|
subli = subli->li_next;
|
||||||
if (subli != NULL) {
|
if (subli != NULL) {
|
||||||
col = get_tv_number_chk(&subli->li_tv, &error);
|
col = get_tv_number_chk(&subli->li_tv, &error);
|
||||||
if (error == TRUE)
|
if (error == true)
|
||||||
goto fail;
|
goto fail;
|
||||||
subli = subli->li_next;
|
subli = subli->li_next;
|
||||||
if (subli != NULL) {
|
if (subli != NULL) {
|
||||||
@@ -5303,8 +5298,10 @@ int match_add(win_T *wp, char_u *grp, char_u *pat, int prio, int id, list_T *pos
|
|||||||
m->pos.pos[i].col = col;
|
m->pos.pos[i].col = col;
|
||||||
m->pos.pos[i].len = len;
|
m->pos.pos[i].len = len;
|
||||||
} else if (li->li_tv.v_type == VAR_NUMBER) {
|
} else if (li->li_tv.v_type == VAR_NUMBER) {
|
||||||
if (li->li_tv.vval.v_number == 0)
|
if (li->li_tv.vval.v_number == 0) {
|
||||||
|
--i;
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
m->pos.pos[i].lnum = li->li_tv.vval.v_number;
|
m->pos.pos[i].lnum = li->li_tv.vval.v_number;
|
||||||
m->pos.pos[i].col = 0;
|
m->pos.pos[i].col = 0;
|
||||||
m->pos.pos[i].len = 0;
|
m->pos.pos[i].len = 0;
|
||||||
|
Reference in New Issue
Block a user