Skip to content

Commit

Permalink
Update tag-matching regular expressions.
Browse files Browse the repository at this point in the history
  • Loading branch information
damiendart committed Jan 29, 2024
1 parent a089cc6 commit 3ba2361
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion .vim/after/ftplugin/markdown.vim
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ function! CompleteTags(findStart, base) abort
let l:currentLine = getline('.')
let l:start = col('.') - 1

while l:start > 0 && l:currentLine[l:start - 1] =~ '[a-zA-Z0-9_\-\:]'
" If updating the following regular expression, the tag-matching
" regular expressions in "$HOME/.vim/after/syntax/markdown.vim" and
" <https://github.com/damiendart/nt> may also require updating.
while l:start > 0 && l:currentLine[l:start - 1] =~ '[a-zA-Z0-9/:_-]'
let l:start -= 1
endwhile

Expand Down
10 changes: 5 additions & 5 deletions .vim/after/syntax/markdown.vim
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ if exists('b:enable_wikilinks_syntax')
endif

if exists('b:enable_tags_highlighting')
" Note: if updating the following regular expressions, the regular
" expression used to match tags in <https://github.com/damiendart/nt>
" may also require updating.
syntax match markdownHashtag ![ '(]#[0-9/:-]*[a-zA-Z][a-zA-Z0-9/:-]*!hs=s+1
syntax match markdownHashtag !^#[0-9/:-]*[a-zA-Z][a-zA-Z0-9/:-]*!
" If updating the following regular expressions, the tag-matching
" regular expressions in "$HOME/.vim/after/ftplugin/markdown.vim" and
" <https://github.com/damiendart/nt> may also require updating.
syntax match markdownHashtag ![ '(]#[0-9/:_-]*[a-zA-Z][a-zA-Z0-9/:_-]*!hs=s+1
syntax match markdownHashtag !^#[0-9/:_-]*[a-zA-Z][a-zA-Z0-9/:_-]*!
highlight link markdownHashtag Statement
endif

0 comments on commit 3ba2361

Please sign in to comment.