vim-pandoc / vim-rmarkdown

Rmarkdown support for vim
98 stars 26 forks source link

Syntax highlighting broken by Python f-strings #38

Closed matthew-brett closed 3 years ago

matthew-brett commented 3 years ago

Thanks very much for this very useful plugin.

I have just noticed that syntax highlighting breaks down when I have a Python f-string in the a code block. With a file like this:

Python f-string with inline variable seems to break syntax highlighting.

```{python}
a = 1
print(f'{a}')
```

Syntax highlight still believes this is code.

I see the syntax highlighting appears to believe the last line is code. Removing the {a} from the f-string fixes this. So it appears to be an interaction between the Python and Rmarkdown parser.

matthew-brett commented 3 years ago

This turned out to be a problem in the python-syntax plugin, fixed by https://github.com/vim-python/python-syntax/commit/e82ed75