aboutsummaryrefslogtreecommitdiff
path: root/runtime/syntax/lsp_markdown.vim
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-07-18 19:37:18 +0000
committerJosh Rahm <rahm@google.com>2022-07-18 19:37:18 +0000
commit308e1940dcd64aa6c344c403d4f9e0dda58d9c5c (patch)
tree35fe43e01755e0f312650667004487a44d6b7941 /runtime/syntax/lsp_markdown.vim
parent96a00c7c588b2f38a2424aeeb4ea3581d370bf2d (diff)
parente8c94697bcbe23a5c7b07c292b90a6b70aadfa87 (diff)
downloadrneovim-308e1940dcd64aa6c344c403d4f9e0dda58d9c5c.tar.gz
rneovim-308e1940dcd64aa6c344c403d4f9e0dda58d9c5c.tar.bz2
rneovim-308e1940dcd64aa6c344c403d4f9e0dda58d9c5c.zip
Merge remote-tracking branch 'upstream/master' into rahm
Diffstat (limited to 'runtime/syntax/lsp_markdown.vim')
-rw-r--r--runtime/syntax/lsp_markdown.vim27
1 files changed, 19 insertions, 8 deletions
diff --git a/runtime/syntax/lsp_markdown.vim b/runtime/syntax/lsp_markdown.vim
index 90d3185673..4be7595807 100644
--- a/runtime/syntax/lsp_markdown.vim
+++ b/runtime/syntax/lsp_markdown.vim
@@ -1,23 +1,34 @@
" Vim syntax file
-" Language: lsp_markdown
-" Maintainer: Michael Lingelbach <m.j.lbach@gmail.com
-" URL: http://neovim.io
-" Remark: Uses markdown syntax file
+" Language: Markdown-like LSP docstrings
+" Maintainer: https://github.com/neovim/neovim
+" URL: http://neovim.io
+" Remark: Uses markdown syntax file
-" always source the system included markdown instead of any other installed
-" markdown.vim syntax files
+" Source the default Nvim markdown syntax, not other random ones.
execute 'source' expand('<sfile>:p:h') .. '/markdown.vim'
syn cluster mkdNonListItem add=mkdEscape,mkdNbsp
+" Don't highlight invalid markdown syntax in LSP docstrings.
+syn clear markdownError
+
syn clear markdownEscape
syntax region markdownEscape matchgroup=markdownEscape start=/\\\ze[\\\x60*{}\[\]()#+\-,.!_>~|"$%&'\/:;<=?@^ ]/ end=/./ containedin=ALL keepend oneline concealends
-" conceal html entities
+" Conceal backticks (which delimit code fragments).
+" We ignore g:markdown_syntax_conceal here.
+syn region markdownCode matchgroup=markdownCodeDelimiter start="`" end="`" keepend contains=markdownLineStart concealends
+syn region markdownCode matchgroup=markdownCodeDelimiter start="`` \=" end=" \=``" keepend contains=markdownLineStart concealends
+syn region markdownCode matchgroup=markdownCodeDelimiter start="^\s*````*.*$" end="^\s*````*\ze\s*$" keepend concealends
+
+" Highlight code fragments.
+hi def link markdownCode Special
+
+" Conceal HTML entities.
syntax match mkdNbsp /&nbsp;/ conceal cchar=
syntax match mkdLt /&lt;/ conceal cchar=<
syntax match mkdGt /&gt;/ conceal cchar=>
syntax match mkdAmp /&amp;/ conceal cchar=&
syntax match mkdQuot /&quot;/ conceal cchar="
-hi def link mkdEscape special
+hi def link mkdEscape Special