Single Quote string for Python
-
Hello, is there a way I can hack functionList so that I can have single-quoted string literals highlight in my editor? I tried (?s:\x27.*?\x27) but it doesnt seem to work. thanks!
-
I’m not sure what kind of highlighting you are looking for. The Python lexer (not the Function List) will highlight a single-quoted Python string when you type the closing single-quote, example:

-
Further to what @Scott-Sumner said: When the Python Lexer is selected (either by automatic filename-extension detection when you load a
.pyfile, or by manually selecting Language > Python or Language > P > Python), if you want single-quoted literals to be highlighted differently than double-quoted, you can change the Settings > Style Configurator > Python settings: the Style: STRING will define what highlighting gets applied to"double-quoted"strings, and Style: CHARACTER will define what highlighting gets applied to'single-quoted'literals. By default, both those have the same color (in the “Default (stylers.xml)” theme), so if you want to distinguish those, you will have to make a change.For example, here I show what happens when you change CHARACTER foreground to RED instead of GREY:

-
Thanks! MINDBLOWN :O :O :O
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login