comparison src/highlight.c @ 17474:f8c197962c1e v8.1.1735

patch 8.1.1735: can't build with tiny features commit https://github.com/vim/vim/commit/c61a48d25995e5ee2a3813f64c531b91bb23e9b9 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jul 22 23:16:33 2019 +0200 patch 8.1.1735: can't build with tiny features Problem: Can't build with tiny features. Solution: Add missing #ifdefs.
author Bram Moolenaar <Bram@vim.org>
date Mon, 22 Jul 2019 23:30:05 +0200
parents dfd87ef822aa
children 6cf077f59152
comparison
equal deleted inserted replaced
17473:466973ba4e87 17474:f8c197962c1e
3946 3946
3947 while (cur != NULL && cur->id != id) 3947 while (cur != NULL && cur->id != id)
3948 cur = cur->next; 3948 cur = cur->next;
3949 return cur; 3949 return cur;
3950 } 3950 }
3951 3951 #endif
3952
3953 #if defined(FEAT_EVAL) || defined(PROTO)
3954 # ifdef FEAT_SEARCH_EXTRA
3952 static int 3955 static int
3953 matchadd_dict_arg(typval_T *tv, char_u **conceal_char, win_T **win) 3956 matchadd_dict_arg(typval_T *tv, char_u **conceal_char, win_T **win)
3954 { 3957 {
3955 dictitem_T *di; 3958 dictitem_T *di;
3956 3959
3982 * "getmatches()" function 3985 * "getmatches()" function
3983 */ 3986 */
3984 void 3987 void
3985 f_getmatches(typval_T *argvars UNUSED, typval_T *rettv UNUSED) 3988 f_getmatches(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
3986 { 3989 {
3987 #ifdef FEAT_SEARCH_EXTRA 3990 # ifdef FEAT_SEARCH_EXTRA
3988 dict_T *dict; 3991 dict_T *dict;
3989 matchitem_T *cur; 3992 matchitem_T *cur;
3990 int i; 3993 int i;
3991 win_T *win = get_optional_window(argvars, 0); 3994 win_T *win = get_optional_window(argvars, 0);
3992 3995
4029 dict_add_string(dict, "pattern", cur->pattern); 4032 dict_add_string(dict, "pattern", cur->pattern);
4030 } 4033 }
4031 dict_add_string(dict, "group", syn_id2name(cur->hlg_id)); 4034 dict_add_string(dict, "group", syn_id2name(cur->hlg_id));
4032 dict_add_number(dict, "priority", (long)cur->priority); 4035 dict_add_number(dict, "priority", (long)cur->priority);
4033 dict_add_number(dict, "id", (long)cur->id); 4036 dict_add_number(dict, "id", (long)cur->id);
4034 # if defined(FEAT_CONCEAL) 4037 # if defined(FEAT_CONCEAL)
4035 if (cur->conceal_char) 4038 if (cur->conceal_char)
4036 { 4039 {
4037 char_u buf[MB_MAXBYTES + 1]; 4040 char_u buf[MB_MAXBYTES + 1];
4038 4041
4039 buf[(*mb_char2bytes)((int)cur->conceal_char, buf)] = NUL; 4042 buf[(*mb_char2bytes)((int)cur->conceal_char, buf)] = NUL;
4040 dict_add_string(dict, "conceal", (char_u *)&buf); 4043 dict_add_string(dict, "conceal", (char_u *)&buf);
4041 } 4044 }
4042 # endif 4045 # endif
4043 list_append_dict(rettv->vval.v_list, dict); 4046 list_append_dict(rettv->vval.v_list, dict);
4044 cur = cur->next; 4047 cur = cur->next;
4045 } 4048 }
4046 #endif 4049 # endif
4047 } 4050 }
4048 4051
4049 /* 4052 /*
4050 * "matchadd()" function 4053 * "matchadd()" function
4051 */ 4054 */
4052 void 4055 void
4053 f_matchadd(typval_T *argvars UNUSED, typval_T *rettv UNUSED) 4056 f_matchadd(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
4054 { 4057 {
4055 #ifdef FEAT_SEARCH_EXTRA 4058 # ifdef FEAT_SEARCH_EXTRA
4056 char_u buf[NUMBUFLEN]; 4059 char_u buf[NUMBUFLEN];
4057 char_u *grp = tv_get_string_buf_chk(&argvars[0], buf); /* group */ 4060 char_u *grp = tv_get_string_buf_chk(&argvars[0], buf); /* group */
4058 char_u *pat = tv_get_string_buf_chk(&argvars[1], buf); /* pattern */ 4061 char_u *pat = tv_get_string_buf_chk(&argvars[1], buf); /* pattern */
4059 int prio = 10; /* default priority */ 4062 int prio = 10; /* default priority */
4060 int id = -1; 4063 int id = -1;
4085 return; 4088 return;
4086 } 4089 }
4087 4090
4088 rettv->vval.v_number = match_add(win, grp, pat, prio, id, NULL, 4091 rettv->vval.v_number = match_add(win, grp, pat, prio, id, NULL,
4089 conceal_char); 4092 conceal_char);
4090 #endif 4093 # endif
4091 } 4094 }
4092 4095
4093 /* 4096 /*
4094 * "matchaddpos()" function 4097 * "matchaddpos()" function
4095 */ 4098 */
4096 void 4099 void
4097 f_matchaddpos(typval_T *argvars UNUSED, typval_T *rettv UNUSED) 4100 f_matchaddpos(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
4098 { 4101 {
4099 #ifdef FEAT_SEARCH_EXTRA 4102 # ifdef FEAT_SEARCH_EXTRA
4100 char_u buf[NUMBUFLEN]; 4103 char_u buf[NUMBUFLEN];
4101 char_u *group; 4104 char_u *group;
4102 int prio = 10; 4105 int prio = 10;
4103 int id = -1; 4106 int id = -1;
4104 int error = FALSE; 4107 int error = FALSE;
4143 return; 4146 return;
4144 } 4147 }
4145 4148
4146 rettv->vval.v_number = match_add(win, group, NULL, prio, id, l, 4149 rettv->vval.v_number = match_add(win, group, NULL, prio, id, l,
4147 conceal_char); 4150 conceal_char);
4148 #endif 4151 # endif
4149 } 4152 }
4150 4153
4151 /* 4154 /*
4152 * "matcharg()" function 4155 * "matcharg()" function
4153 */ 4156 */
4154 void 4157 void
4155 f_matcharg(typval_T *argvars UNUSED, typval_T *rettv) 4158 f_matcharg(typval_T *argvars UNUSED, typval_T *rettv)
4156 { 4159 {
4157 if (rettv_list_alloc(rettv) == OK) 4160 if (rettv_list_alloc(rettv) == OK)
4158 { 4161 {
4159 #ifdef FEAT_SEARCH_EXTRA 4162 # ifdef FEAT_SEARCH_EXTRA
4160 int id = (int)tv_get_number(&argvars[0]); 4163 int id = (int)tv_get_number(&argvars[0]);
4161 matchitem_T *m; 4164 matchitem_T *m;
4162 4165
4163 if (id >= 1 && id <= 3) 4166 if (id >= 1 && id <= 3)
4164 { 4167 {
4172 { 4175 {
4173 list_append_string(rettv->vval.v_list, NULL, -1); 4176 list_append_string(rettv->vval.v_list, NULL, -1);
4174 list_append_string(rettv->vval.v_list, NULL, -1); 4177 list_append_string(rettv->vval.v_list, NULL, -1);
4175 } 4178 }
4176 } 4179 }
4177 #endif 4180 # endif
4178 } 4181 }
4179 } 4182 }
4180 4183
4181 /* 4184 /*
4182 * "matchdelete()" function 4185 * "matchdelete()" function
4183 */ 4186 */
4184 void 4187 void
4185 f_matchdelete(typval_T *argvars UNUSED, typval_T *rettv UNUSED) 4188 f_matchdelete(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
4186 { 4189 {
4187 #ifdef FEAT_SEARCH_EXTRA 4190 # ifdef FEAT_SEARCH_EXTRA
4188 win_T *win = get_optional_window(argvars, 1); 4191 win_T *win = get_optional_window(argvars, 1);
4189 4192
4190 if (win == NULL) 4193 if (win == NULL)
4191 rettv->vval.v_number = -1; 4194 rettv->vval.v_number = -1;
4192 else 4195 else
4193 rettv->vval.v_number = match_delete(win, 4196 rettv->vval.v_number = match_delete(win,
4194 (int)tv_get_number(&argvars[0]), TRUE); 4197 (int)tv_get_number(&argvars[0]), TRUE);
4195 #endif 4198 # endif
4196 } 4199 }
4200 #endif