Syntax: Stricter typeface and fix preCode (alias inline) nested in bold

Fix: Syntax bug precode nested in bold apperead bold

Problem:
1. `that_ HERE _was` italic
2. `__that ``HERE`` was__  bold => PreCode should not receive typeface
region changes

Solution:
1. Stricter regex (and add \* to VimwikiError)
2. Add VikiError and WikiPre to nestables syntaxes
This commit is contained in:
Tinmarino
2020-08-09 22:21:05 -04:00
parent a241d458ab
commit 39407014c8
6 changed files with 107 additions and 11 deletions

View File

@@ -1768,7 +1768,6 @@ endfunction
" Conceal
function! vimwiki#emoji#apply_conceal() abort
syn iskeyword 0-9,a-z,A-Z,:-:
for [name, emoji] in items(s:emoji_single)
exe 'syn keyword VimwikiEmoji :' . name . ': conceal cchar=' . emoji
endfor

View File

@@ -273,11 +273,11 @@ endfunction
" Helper: Expand regex from reduced typeface delimiters
" :param: list<list,delimiters>> with reduced regex
" Return: list with extended regex delimiters (not inside a word)
" -- [['\*_', '_\*']] -> [['\*_\S\@=', '\S\@<=_\*']]
" -- [['\*_', '_\*']] -> [['\*_\S\@=', '\S\@<=_\*\%(\s\|$\)\@=']]
function! vimwiki#u#hi_expand_regex(lst) abort
let res = []
for delimiters in a:lst
call add(res, [delimiters[0] . '\S\@=', '\S\@<=' . delimiters[1]])
call add(res, [delimiters[0] . '\S\@=', '\S\@<=' . delimiters[1] . '\%(\s\|\n\)\@='])
endfor
return res
endfunction
@@ -400,5 +400,5 @@ function! vimwiki#u#hi_typeface(dic) abort
" Prevent var_with_underscore to trigger italic text
" -- See $VIMRUNTIME/syntax/markdown.vim
syn match VimwikiError "\w\@<=_\w\@="
syn match VimwikiError "\w\@<=[_*]\w\@="
endfunction