aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/syntax.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r--src/nvim/syntax.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index b7a485598b..3deda0a8c9 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -5157,22 +5157,21 @@ get_id_list (
regmatch.rm_ic = TRUE;
id = 0;
for (int i = highlight_ga.ga_len; --i >= 0; ) {
- if (!vim_regexec(&regmatch, HL_TABLE()[i].sg_name, (colnr_T)0)) {
- continue;
- }
- if (round == 2) {
- /* Got more items than expected; can happen
- * when adding items that match:
- * "contains=a.*b,axb".
- * Go back to first round */
- if (count >= total_count) {
- free(retval);
- round = 1;
- } else
- retval[count] = i + 1;
+ if (vim_regexec(&regmatch, HL_TABLE()[i].sg_name, (colnr_T)0)) {
+ if (round == 2) {
+ /* Got more items than expected; can happen
+ * when adding items that match:
+ * "contains=a.*b,axb".
+ * Go back to first round */
+ if (count >= total_count) {
+ free(retval);
+ round = 1;
+ } else
+ retval[count] = i + 1;
+ }
+ ++count;
+ id = -1; /* remember that we found one */
}
- ++count;
- id = -1; /* remember that we found one */
}
vim_regfree(regmatch.regprog);
}