vim-markdown icon indicating copy to clipboard operation
vim-markdown copied to clipboard

code block syntax highlight disappears when new block is added

Open laoshaw opened this issue 4 years ago • 3 comments

Running default vim on ubuntu 20.04 with vim-markdown, here is what I got:

say I have two code blocks(one javascript one python) in one md file:

var x = 10
print("hi")

they're shown with color nicely. now if I add additional blocks (either javascript or python), all syntax-highlight will be gone immediately while I'm still typing.

this is reproducible easily.

re-open the code-block-becomes-colorless file, they're highlighted properly again.

laoshaw avatar Jan 30 '21 18:01 laoshaw

I found a workaround to this issue : first type the language, then go to the beginning of the line and add the backticks, like so:

1  python
1 ```python
2 ```

With this the blocks stay highlighted correctly.

g33kex avatar Mar 07 '21 17:03 g33kex

I confirm this workaround, looks like the back-ticks triggered something unnecessarily without this workaround.

laoshaw avatar Mar 10 '21 13:03 laoshaw

+1, same issue here.

danymat avatar Jun 01 '21 10:06 danymat