Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Escaped braces in f-strings not rendered properly #329

Open
baloe opened this issue Jan 26, 2021 · 3 comments
Open

Escaped braces in f-strings not rendered properly #329

baloe opened this issue Jan 26, 2021 · 3 comments

Comments

@baloe
Copy link

baloe commented Jan 26, 2021

Description

f-strings with escape braces (i.e. '{{' instead of '{') are not rendered correctly.

Here is a code snippet that shows this glitch:

a=1.1
b='g'
f'{a:{b}}'     # → '1.1'
f'{{{a:{b}}}}' # → '{1.1}'
f'{{{a}}}'     # → '{1.1}'

Here is how it is rendered in atom:
Screenshot

I would expect the characters {a:{b}} to be rendered equally in lines 3-4 and {a} rendered non-green, but this does not happen.

Versions

language-python version 0.53.4

@baloe baloe changed the title f-string: escaped { not rendered properly Escaped braces f-strings not rendered properly Jan 26, 2021
@baloe baloe changed the title Escaped braces f-strings not rendered properly Escaped braces in f-strings not rendered properly Jan 26, 2021
@darangi
Copy link
Contributor

darangi commented Jan 27, 2021

What version of atom are you running? I can't reproduce this on atom 1.54.0

@baloe
Copy link
Author

baloe commented Jan 27, 2021

What version of atom are you running? I can't reproduce this on atom 1.54.0

I was observing this using atom 1.51.0, but still am after an upgrade to 1.54.0.

@baloe
Copy link
Author

baloe commented Jan 27, 2021

When manually changing to CMake Template Python it is rendered better.

This is the autodetected default:
Default

This is CMake Template Python highlighting:
CMakeTemplatePyton

The former is less bad but not quite brilliant either with those non-printed braces still being green, but this highlighting is unrelated to language-python I think, probably part of language-cmake.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants