atom / language-python

Python package for Atom
Other
190 stars 146 forks source link

Two format string precision specifiers in one string breaks syntax highlighting #305

Closed trvrmcs closed 5 years ago

trvrmcs commented 5 years ago

Description

Syntax highlighting gets confused when given a string that contains two precision specifiers.

This works:

def s():
    return f"{1000:,.2f} {2000}"

print(s())

This doesn't:

def s():
    return f"{1000:,.2f} {2000:,.2f}"

print(s())

syntax_highlighting_error

I've simplified this example as much as possible; in longer files every line after the bad one fails highlight correctly.

Versions

atom: 1.34.0 language-python: 0.51.8

Arcanemagus commented 5 years ago

atom: 1.34.0

Atom v1.37.0 is the current stable release, you should try updating to that to see if this is resolved for you.

I'm unable to reproduce this in Atom 1.39.0-dev-1d9a4cafc, so if the fix isn't in Atom v1.37.0 it will be in a later release soon 😉: image

Thanks for taking the time to file an issue and provide a minimal reproduction case!

trvrmcs commented 5 years ago

Thank you, upgrading to atom 1.37.0 fixed the problem.