vim-python/python-syntax

Strings not coloured across multiple lines

podfran opened this issue · 2 comments

Vim does not colour strings properly, when the string is broken across multiple lines.

E.g. if this line:
return "Name: {0.name}, Lives: {0.lives}, Level: {0.level}, Score: {0.score}".format(player)
is broken like so:
return ("Name: {0.name}, Lives: {0.lives},
_______Level: {0.level}, Score: {0.score}".format(player))
the string highlighting stops at the end of the first line and then starts again in the next after the double quote.

(Sorry for the underscores, couldn't find a better way to represent the indentation I needed.)

The code

return ("Name: {0.name}, Lives: {0.lives},
        Level: {0.level}, Score: {0.score}".format(player))

causes SyntaxError. I don't think error code should be correctly rendered.

(GitHub doesn't render as you wish, either.)

nfnty commented

Incorrect code is not guaranteed to highlight correctly.