Skip to content

Commit

Permalink
fixes for working alongside the minimized flavor of v-p-s
Browse files Browse the repository at this point in the history
  • Loading branch information
fmoralesc committed May 15, 2020
1 parent 04f2fff commit e49f9e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion autoload/markdown/headers.vim
Expand Up @@ -6,7 +6,7 @@ function! markdown#headers#CheckValidHeader(lnum) abort "{{{1
if a:lnum != 0
if exists('g:vim_pandoc_syntax_exists')
let synId = synIDattr(synID(a:lnum, 1, 1), 'name')
if synId !~# '^pandoc' || synId ==# 'pandocDelimitedCodeBlock'
if synId !~# '\v^(pandoc|pdc)' || synId ==# 'pandocDelimitedCodeBlock'
return 0
endif
endif
Expand Down
9 changes: 6 additions & 3 deletions autoload/pandoc/formatting.vim
Expand Up @@ -18,13 +18,16 @@ function! pandoc#formatting#Init() abort "{{{1
let g:pandoc#formatting#smart_autoformat_blacklist = [
\ 'pandoc.+header',
\ 'pandoc\S{-}(code|title|line|math)block(title)?',
\ 'pdc(delimited|latex)?codeblock',
\ 'pandoc.+table',
\ 'pandoctable',
\ 'pandoc.+latex',
\ 'pandocreferencedefinition',
\ 'pandocreferencelabel',
\ 'tex.*',
\ 'pdclatex*',
\ 'yaml.*',
\ 'pdcyaml',
\ 'delimiter'
\]
endif
Expand Down Expand Up @@ -202,7 +205,7 @@ function! pandoc#formatting#AutoFormat(force) abort "{{{1
catch /E684/
let l:p_synName = ''
endtry
if match(l:synName.l:p_synName, '\c\vpandocu?list') >= 0
if match(l:synName.l:p_synName, '\c\v(pandoc|pdc)[uo]?list') >= 0
let l:context_prevents = 1
endif
else
Expand All @@ -211,7 +214,7 @@ function! pandoc#formatting#AutoFormat(force) abort "{{{1
let l:context_prevents = 1
elseif l:p_synName =~? '\c\vpandochrule'
let l:context_prevents = 1
elseif l:p_synName =~? '\c\vpandoccodeblock' && indent('.')%4 == 0
elseif l:p_synName =~? '\c\v(pandoc|pdc)codeblock' && indent('.')%4 == 0
let l:context_prevents = 1
elseif getline(l:line -1) =~? '^\w\+:'
let l:context_prevents = 1
Expand All @@ -226,7 +229,7 @@ function! pandoc#formatting#AutoFormat(force) abort "{{{1
setlocal formatoptions+=t
" block quotes are formatted like text comments (hackish, i know),
" so we want to make them break at textwidth
if l:stack != [] && l:synName ==? 'pandocBlockQuote'
if l:stack != [] && l:synName ==? '\c\v(pandoc|pdc)blockquote'
setlocal formatoptions+=c
endif
elseif l:should_enable == 0
Expand Down

0 comments on commit e49f9e7

Please sign in to comment.