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

Unicode symbols are not highlighted in the Editor #4943

Closed
laikh opened this issue Aug 11, 2017 · 3 comments
Closed

Unicode symbols are not highlighted in the Editor #4943

laikh opened this issue Aug 11, 2017 · 3 comments

Comments

@laikh
Copy link

laikh commented Aug 11, 2017

Description of the problem

When selecting a variable (double left click) in the editor all similar variables are highlighted. This does not work when the variable is a greek symbol.

What steps will reproduce the problem?

  1. select variable in editor by double clicking on it

Example
α = 15
y = 2
x = α+y

selecting y in line 2 will highlight y in line 3
selecting alpha in line 1 will not highlight alpha in line 3

Versions and main components

  • Spyder Version: 3.2
  • Python Version: 3.6.1 Anaconda custom (64 bit)
  • Qt Version: 5.6.2
  • PyQt Version: PyQt5
  • Operating system: Windows 10 x64

Dependencies

IPython >=4.0 : 5.3.0 (OK)
cython >=0.21 : 0.25.2 (OK)
jedi >=0.9.0 : 0.10.2 (OK)
nbconvert >=4.0 : 5.1.1 (OK)
numpy >=1.7 : 1.12.1 (OK)
pandas >=0.13.1 : 0.20.1 (OK)
pycodestyle >=2.3: 2.3.1 (OK)
pyflakes >=0.6.0 : 1.5.0 (OK)
pygments >=2.0 : 2.2.0 (OK)
pylint >=0.25 : 1.6.4 (OK)
qtconsole >=4.2.0: 4.3.0 (OK)
rope >=0.9.4 : 0.9.4-1 (OK)
sphinx >=0.6.6 : 1.5.6 (OK)
sympy >=0.7.3 : 1.0 (OK)

@stonebig
Copy link
Contributor

stonebig commented Aug 11, 2017

hum, it may come from variable detection being only ascii-minded (Python2 aera) , like:

varname = re.compile('[a-zA-Z0-9_]*') # matches valid variable names

revisiting the code may not be a simple task, see https://stackoverflow.com/questions/17043894/what-unicode-symbols-are-accepted-in-python3-variable-names

apparently there is a function str.isidentifier() https://stackoverflow.com/questions/12700893/how-to-check-if-a-string-is-a-valid-python-identifier-including-keyword-check

@goanpeca
Copy link
Member

Thanks for the info @stonebig. I have been bitten by this in the past :-p

@goanpeca
Copy link
Member

@rlaverde could you take a look at this one?

@ccordoba12 ccordoba12 changed the title Spyder Editor - Greek Symbols not highlighted Unicode symbols are not highlighted in the Editor Aug 11, 2017
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

4 participants