Closed Konfekt closed 5 years ago
Looks good, thanks! Can you give an example where the current rules are bad? (I haven't seen it, so I'm just curious.)
If, for example, one indents a line because it belongs to the same item in a list, such as
1. This
belongs to the first item
2. This to the second one.
then the indentation in the second line is initially marked red.
Gotcha.
This commit produced a regression for me, I get the following error when opening any markdown file with vim 8.0.1453. (This is an older version of vim, but it's used in Ubuntu LTS 18.04, for example):
Error detected while processing function <SNR>57_WithConceal:
line 7:
E871: (NFA regexp) Can't have a multi follow a multi !
E62: Nested \@
E475: Invalid argument: pandocNewLine /\( \{4,4}\@<= \|\S\@<= \|\\\)$/ display
containedin=pandocEmphasis,pandocStrong,pandocStrongEmphasis,pandocStrongInEmph
asis,pandocEmphasisInStrong conceal cchar=↵
@dmoerner Can you try changing the code to
" New_lines: {{{3
if g:pandoc#syntax#newlines == 1
try " temporary fix for older vim versions
call s:WithConceal("newline", 'syn match pandocNewLine /\( \{4,4}\@<= \|\S\@<= \|\\\)$/ display containedin=pandocEmphasis,pandocStrong,pandocStrongEmphasis,pandocStrongInEmphasis,pandocEmphasisInStrong', 'conceal cchar='.s:cchars["newline"])
catch /E871/
call s:WithConceal("newline", 'syn match pandocNewLine /\( \|\\\)$/ display containedin=pandocEmphasis,pandocStrong,pandocStrongEmphasis,pandocStrongInEmphasis,pandocEmphasisInStrong', 'conceal cchar='.s:cchars["newline"])
endtry
endif
" }}}3
Thank you, that works for me. Thank you for accommodating older versions.
I am working on a fix.
@dmoerner, let's wait for @Konfekt's fix ;)
Since a line that contains only white spaces and at least two of them does not give additional line breaks after compilation by pandoc, I resorted to highlighting only double white space after a non-white space character.
Dear @dmoerner , the error was due to my oversight that \@<=
must be followed by a group \(...\)
. Mea culpa. This should be fixed.
do not highlight indentation and only after non-white space characters