From 3ba2361e6ad58a095817775321a250d8f50fdc21 Mon Sep 17 00:00:00 2001 From: Damien Dart Date: Mon, 29 Jan 2024 22:22:32 +0000 Subject: [PATCH] Update tag-matching regular expressions. --- .vim/after/ftplugin/markdown.vim | 5 ++++- .vim/after/syntax/markdown.vim | 10 +++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.vim/after/ftplugin/markdown.vim b/.vim/after/ftplugin/markdown.vim index e4d5924..c912a6a 100644 --- a/.vim/after/ftplugin/markdown.vim +++ b/.vim/after/ftplugin/markdown.vim @@ -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 + " may also require updating. + while l:start > 0 && l:currentLine[l:start - 1] =~ '[a-zA-Z0-9/:_-]' let l:start -= 1 endwhile diff --git a/.vim/after/syntax/markdown.vim b/.vim/after/syntax/markdown.vim index f841893..d8aefb8 100644 --- a/.vim/after/syntax/markdown.vim +++ b/.vim/after/syntax/markdown.vim @@ -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 - " 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 + " 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