Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong highlighting in "UNICODE_CHAR %02d:%02d" % val #15

Closed
averrin opened this issue Oct 21, 2015 · 10 comments
Closed

Wrong highlighting in "UNICODE_CHAR %02d:%02d" % val #15

averrin opened this issue Oct 21, 2015 · 10 comments

Comments

@averrin
Copy link

averrin commented Oct 21, 2015

mp_glitch

@1st1
Copy link
Member

1st1 commented Oct 21, 2015

Thanks for reporting.

Are you using the latest version of MagicPython -- v0.4.29?
Also, what color theme is it?
Is this Sublime Text or Atom?

@averrin
Copy link
Author

averrin commented Oct 21, 2015

Yeah, 0.4.29
Atom, Base16 Tomorrow Dark

@1st1
Copy link
Member

1st1 commented Oct 21, 2015

Can't reproduce :(

Could you please send me this snippet of code, preferably with +10 lines from above/below. Also, what's the package name for the theme in Atom?

And lastly, could you please double check that it's MagicPython that highlights this file? (In the bottom-right corner of the editor it should say "MagicPython")

@averrin
Copy link
Author

averrin commented Oct 21, 2015

t, delta = getTime(ret_delta=True)
if delta.startswith('-'):
    delta = 'Go home NOW!'
else:
    delta += ' left'
print("  🏠 Home time: %s (%s)" % (t, delta))
t, delta = getTime(True, ret_delta=True)
if delta.startswith('-'):
    delta = 'Go home NOW!'
else:
    delta += ' left'
print("  🕐 Ideal home time: %s (%s)" % (t, delta))
print("  🕐 Current average: %02d:%02d" % getAverage())

try:
    route = fetchRoute()
    while not route.strip():
        route = fetchRoute()
    route = json.loads(route)
    duration = route['data']['features'][0]['properties']['RouteMetaData']['Duration']['text']
    duration = duration.encode('utf8')
    print('  🚗 Route to home: %s' % duration)
    print('')
except:
    pass

https://atom.io/themes/base16-tomorrow-dark-theme

Yes, MagicPython. 100%

@averrin
Copy link
Author

averrin commented Oct 21, 2015

Reproduces with only one line and with Atom Dark theme

@1st1
Copy link
Member

1st1 commented Oct 21, 2015

Now I can reproduce it, thanks!

@1st1
Copy link
Member

1st1 commented Oct 21, 2015

@averrin This seems to be a bug in the oniguruma regex engine that Atom uses. It doesn't support multibyte unicode characters correctly. Sublime Text, for instance, works just fine.

At this point I doubt it's in our power to fix this, we should actually file a bug to Atom. BTW, the standard language-python syntax also breaks in exactly the same way.

@averrin
Copy link
Author

averrin commented Oct 21, 2015

Oh, u r right, standard highlighter breaks too.

@1st1
Copy link
Member

1st1 commented Oct 21, 2015

I'll close this issue, since the problem is not on our end :(

@1st1
Copy link
Member

1st1 commented Oct 31, 2015

Looks like this has been fixed in Atom 1.1!

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

No branches or pull requests

2 participants