aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/window.c
diff options
context:
space:
mode:
authorwatiko <service@mail.watiko.net>2016-02-09 17:03:27 +0900
committerwatiko <service@mail.watiko.net>2016-02-11 15:08:31 +0900
commit133ef7e4654c0a9946825ec7c09aec77a472d4c4 (patch)
treec3201183d9ef870029d93d7033cd253ff5f7edd7 /src/nvim/window.c
parent84281bf675f77f417d26a68611406ef43fd82f7f (diff)
downloadrneovim-133ef7e4654c0a9946825ec7c09aec77a472d4c4.tar.gz
rneovim-133ef7e4654c0a9946825ec7c09aec77a472d4c4.tar.bz2
rneovim-133ef7e4654c0a9946825ec7c09aec77a472d4c4.zip
vim-patch:7.4.792
Problem: Can only conceal text by defining syntax items. Solution: Use matchadd() to define concealing. (Christian Brabandt) https://github.com/vim/vim/commit/6561d52ecbe6e24d1b90403078cc8b76c53c42fc
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r--src/nvim/window.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index e84d8df36b..36cb48f3a1 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -5342,14 +5342,14 @@ void restore_buffer(buf_T *save_curbuf)
}
-/*
- * Add match to the match list of window 'wp'. The pattern 'pat' will be
- * highlighted with the group 'grp' with priority 'prio'.
- * Optionally, a desired ID 'id' can be specified (greater than or equal to 1).
- * If no particular ID is desired, -1 must be specified for 'id'.
- * Return ID of added match, -1 on failure.
- */
-int match_add(win_T *wp, char_u *grp, char_u *pat, int prio, int id, list_T *pos_list)
+// Add match to the match list of window 'wp'. The pattern 'pat' will be
+// highlighted with the group 'grp' with priority 'prio'.
+// Optionally, a desired ID 'id' can be specified (greater than or equal to 1).
+// If no particular ID is desired, -1 must be specified for 'id'.
+// Return ID of added match, -1 on failure.
+int match_add(win_T *wp, char_u *grp, char_u *pat,
+ int prio, int id, list_T *pos_list,
+ char_u *conceal_char)
{
matchitem_T *cur;
matchitem_T *prev;
@@ -5405,6 +5405,10 @@ int match_add(win_T *wp, char_u *grp, char_u *pat, int prio, int id, list_T *pos
m->match.regprog = regprog;
m->match.rmm_ic = FALSE;
m->match.rmm_maxcol = 0;
+ m->conceal_char = 0;
+ if (conceal_char != NULL) {
+ m->conceal_char = (*mb_ptr2char)(conceal_char);
+ }
// Set up position matches
if (pos_list != NULL)