mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 05:05:00 -07:00
[Backport release-0.7] feat(lsp): hide backticks in LSP docstrings (#19378)
feat(lsp): hide backticks in LSP docstrings
Also clear `markdownError`: don't want to highlight invalid markdown
syntax in LSP docstrings.
fix #16114
(cherry picked from commit e9edee229d
)
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
This commit is contained in:
parent
b8da4303f4
commit
0cede3b9df
@ -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 / / conceal cchar=
|
||||
syntax match mkdLt /</ conceal cchar=<
|
||||
syntax match mkdGt />/ conceal cchar=>
|
||||
syntax match mkdAmp /&/ conceal cchar=&
|
||||
syntax match mkdQuot /"/ conceal cchar="
|
||||
|
||||
hi def link mkdEscape special
|
||||
hi def link mkdEscape Special
|
||||
|
Loading…
Reference in New Issue
Block a user