Closed oeuftete closed 4 years ago
I can repro with:
---
- emotional intelligence
---
- Second Table
| -------- | -------------------------------- |
| T1 | T2 |
I suspect the problem is the liquid plugin, as when I set ft=markdown
before enabling it works.
Found it. The vim-markdown
plugin supports fenced languages to format inside code blocks. I had jinja2
as a supported language there. The Vim-Jinja2-Syntax
plugin does this in its syntax file:
setlocal commentstring={#%s#}
And that's what commentstring
was set to in my buffer. That gets read by tablemode#table#GetCommentStart()
, and ends up in a format in the syntax match that is not valid.
Not sure what the right fix is in this plugin, if any. The workaround for me was to do setlocal commentstring=<!--%s-->
, and things work again. And/or remove jinja2
from g:markdown_fenced_languages
.
@oeuftete Interesting, thanks for looking into this. Is setlocal commentstring={#%s#}
valid and / or is setlocal commentstring=<!--%s-->
a valid alternative for jinja2 ?
As a work around it is also possible to just alter that within the markdown ftplugin perhaps. If however, the former commentstring is the right one to be used, then it would require a bit of escaping within the regex builder that uses the comment string.
@dhruvasagar I believe {#%s#}
is the appropriate commentstring
for jinja2. <!--%s-->
is not appropriate for jinja2, but is of course perfectly sensible for markdown.
I think (?) the real problem here is that the syntax file for jinja2 is setting commentstring
, and this should not be set in a syntax file, but in an ftplugin file. Because it is in the syntax file, it gets sets when the markdown plugin reads it to format its fenced code blocks, overwriting the markdown setting in the buffer.
Anyway, I have opened the PR https://github.com/pallets/jinja/pull/1164 to fix the jinja2 syntax file in its project, which should eventually percolate down to the Vim-Jinja2-Syntax
plugin, which should make this go away for me.
@oeuftete Thanks a lot, I am going to close this issue for the time being, feel free to reopen this if you think otherwise and if there's something we'll need to do additionally in vim-table-mode
I've been seeing this in recent versions (currently, 0af25d72ebc0271648c8f91c0ce5c59174d2761b) in a couple of my environments. I suspect this may be an interaction with some other plugin since no one else seems to be seeing it, but at a loss into how I might fix it. I've tried some manual bisection with this plugin and the presence of other plugins, but not able to pin this down.
Enabling:
Realigning:
vi: