Red lines coming up after strings in SublimeREPL (python)?

邮差的信 提交于 2019-12-07 03:13:20

The apostrophe ' character is causing Sublime's syntax highlighting engine to think that you're beginning a single-quoted string. Since ending a line with a string "open" is an error, it is being highlighted with the reddish invalid.illegal scope in your color scheme. It's nothing to worry about, it's just something you'll see happen with SublimeREPL when you have non-closing quotes on a line.

To verify this is the case, try opening a new file in Sublime, setting the syntax to Python, and pasting in the following code:

"This is a valid string"
"This is also valid even though it has a single quote ' char"
"This string is not valid
"""This string is valid, and doesn't have the red line
even though it has a newline, as it's triple-quoted"""

The middle (invalid Python syntax) line will have the red stripe from the end of the word valid to the right side of the window. The others won't.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!