scopatz / nanorc

Improved Nano Syntax Highlighting Files
Other
3.04k stars 556 forks source link

Feature Request [python.nanorc]: add f-string support #374

Open jwest75674 opened 3 years ago

jwest75674 commented 3 years ago

Newer versions of python have the super awesome format string / f-strings (https://www.python.org/dev/peps/pep-0498/)

However, these don't have syntax highlighting here just yet. This appears complicated due to f-strings appearing within strings in regard to color, but this would be an awesome funcitonality.

davidhcefx commented 8 months ago

There's a trick that by placing a highlighting rule after another, the text color will be applied by the latest rule. Maybe highlight strings first and then other syntaxes. But then the problem is we need lookahead assertions, which is not available in ERE regex. Maybe we need to look into how other editor done this.