diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2022-04-30 15:07:33 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2022-04-30 15:07:33 +0200 |
commit | 38282d58387cff48ac203f6912c05e4c8686141b (patch) | |
tree | fac41fbf9f014c63fb5c7d06b8a6ccd75aeade08 /ftplugin | |
parent | 36a2bf60adbf113cb6a096c9edd22c711782d912 (diff) | |
download | vim-polyglot-38282d58387cff48ac203f6912c05e4c8686141b.tar.gz vim-polyglot-38282d58387cff48ac203f6912c05e4c8686141b.zip |
Update
Diffstat (limited to 'ftplugin')
-rw-r--r-- | ftplugin/bicep.vim | 2 | ||||
-rw-r--r-- | ftplugin/markdown.vim | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/ftplugin/bicep.vim b/ftplugin/bicep.vim index 112c429e..08af66d8 100644 --- a/ftplugin/bicep.vim +++ b/ftplugin/bicep.vim @@ -15,7 +15,7 @@ set cpoptions&vim " Set the commentstring setlocal commentstring=//%s -let b:undo_ftplugin = ' commentstring<' +let b:undo_ftplugin = 'setlocal commentstring<' let &cpoptions = s:cpo_save unlet s:cpo_save diff --git a/ftplugin/markdown.vim b/ftplugin/markdown.vim index 7ed65fe8..d3129a87 100644 --- a/ftplugin/markdown.vim +++ b/ftplugin/markdown.vim @@ -792,7 +792,7 @@ function! s:MarkdownHighlightSources(force) " Look for code blocks in the current file let filetypes = {} for line in getline(1, '$') - let ft = matchstr(line, '```\s*\zs[0-9A-Za-z_+-]*\ze.*') + let ft = matchstr(line, '\(`\{3,}\|\~\{3,}\)\s*\zs[0-9A-Za-z_+-]*\ze.*') if !empty(ft) && ft !~# '^\d*$' | let filetypes[ft] = 1 | endif endfor if !exists('b:mkd_known_filetypes') @@ -823,8 +823,10 @@ function! s:MarkdownHighlightSources(force) else let include = '@' . toupper(filetype) endif - let command = 'syntax region %s matchgroup=%s start="^\s*```\s*%s.*$" matchgroup=%s end="\s*```$" keepend contains=%s%s' - execute printf(command, group, startgroup, ft, endgroup, include, has('conceal') && get(g:, 'vim_markdown_conceal', 1) && get(g:, 'vim_markdown_conceal_code_blocks', 1) ? ' concealends' : '') + let command_backtick = 'syntax region %s matchgroup=%s start="^\s*`\{3,}\s*%s.*$" matchgroup=%s end="\s*`\{3,}$" keepend contains=%s%s' + let command_tilde = 'syntax region %s matchgroup=%s start="^\s*\~\{3,}\s*%s.*$" matchgroup=%s end="\s*\~\{3,}$" keepend contains=%s%s' + execute printf(command_backtick, group, startgroup, ft, endgroup, include, has('conceal') && get(g:, 'vim_markdown_conceal', 1) && get(g:, 'vim_markdown_conceal_code_blocks', 1) ? ' concealends' : '') + execute printf(command_tilde, group, startgroup, ft, endgroup, include, has('conceal') && get(g:, 'vim_markdown_conceal', 1) && get(g:, 'vim_markdown_conceal_code_blocks', 1) ? ' concealends' : '') execute printf('syntax cluster mkdNonListItem add=%s', group) let b:mkd_known_filetypes[ft] = 1 |