[Feature] Format Python f-strings with different color for code in { } brackets.
F-Strings were introduced in Python 3.6 as an easier-to-read way of formatting strings.
The code portion of f-strings (in { }
brackets) should be formatted in a different color than the rest of the string.
For example, using the Tango theme in Gedit, the entire f-string in the print
statement below is "pink".
However, it wold help readability if the "{variable}
" and "{number + 1}
" portions had a different color . (As a suggestion, this could be the same color as other code, such as "variable =
" and "number =
", in the code below).
variable = 'SOMETHING'
number = 100
# Here is the f-string...
print(f'This is an f-string that has {variable} with a value of {number + 1} in it.')
This is what it looks like now...
This is what it should look like...
- Gedit version: 40.1-1
- OS: Ubuntu
- OS version: 21.10
Edited by PJ Singh