comparison src/window.c @ 6947:1efa7c2b9368 v7.4.792

patch 7.4.792 Problem: Can only conceal text by defining syntax items. Solution: Use matchadd() to define concealing. (Christian Brabandt)
author Bram Moolenaar <bram@vim.org>
date Tue, 21 Jul 2015 15:48:27 +0200
parents c0bc9b60fb8a
children 286fd54c7ae3
comparison
equal deleted inserted replaced
6946:c56ef0540cd5 6947:1efa7c2b9368
6941 * Optionally, a desired ID 'id' can be specified (greater than or equal to 1). 6941 * Optionally, a desired ID 'id' can be specified (greater than or equal to 1).
6942 * If no particular ID is desired, -1 must be specified for 'id'. 6942 * If no particular ID is desired, -1 must be specified for 'id'.
6943 * Return ID of added match, -1 on failure. 6943 * Return ID of added match, -1 on failure.
6944 */ 6944 */
6945 int 6945 int
6946 match_add(wp, grp, pat, prio, id, pos_list) 6946 match_add(wp, grp, pat, prio, id, pos_list, conceal_char)
6947 win_T *wp; 6947 win_T *wp;
6948 char_u *grp; 6948 char_u *grp;
6949 char_u *pat; 6949 char_u *pat;
6950 int prio; 6950 int prio;
6951 int id; 6951 int id;
6952 list_T *pos_list; 6952 list_T *pos_list;
6953 char_u *conceal_char UNUSED; /* pointer to conceal replacement char */
6953 { 6954 {
6954 matchitem_T *cur; 6955 matchitem_T *cur;
6955 matchitem_T *prev; 6956 matchitem_T *prev;
6956 matchitem_T *m; 6957 matchitem_T *m;
6957 int hlg_id; 6958 int hlg_id;
7007 m->pattern = pat == NULL ? NULL : vim_strsave(pat); 7008 m->pattern = pat == NULL ? NULL : vim_strsave(pat);
7008 m->hlg_id = hlg_id; 7009 m->hlg_id = hlg_id;
7009 m->match.regprog = regprog; 7010 m->match.regprog = regprog;
7010 m->match.rmm_ic = FALSE; 7011 m->match.rmm_ic = FALSE;
7011 m->match.rmm_maxcol = 0; 7012 m->match.rmm_maxcol = 0;
7013 #ifdef FEAT_CONCEAL
7014 m->conceal_char = 0;
7015 if (conceal_char != NULL)
7016 m->conceal_char = (*mb_ptr2char)(conceal_char);
7017 #endif
7012 7018
7013 /* Set up position matches */ 7019 /* Set up position matches */
7014 if (pos_list != NULL) 7020 if (pos_list != NULL)
7015 { 7021 {
7016 linenr_T toplnum = 0; 7022 linenr_T toplnum = 0;