JulianEberius / SublimeRope

ST2 only, use SublimePythonIDE with ST3: Adds Python completions and some IDE-like functions to Sublime Text 2, through the use of the Rope library
GNU General Public License v2.0
250 stars 26 forks source link

Can't click outside of jump-to-global list to cancel #59

Closed jasonmyers closed 11 years ago

jasonmyers commented 11 years ago

Clicking outside of the jump-to-global list (the second one, if there are multiple matches) selects the last one in the list.

Attaching fix

JulianEberius commented 11 years ago

Seems reasonable. (Although I don't know why you like "choice != -1" better than "choice is not -1" :-) )

Thanks!

jasonmyers commented 11 years ago

Though it may not matter for small integers, I think it is best to avoid the 'is' operator for anything except None, due to the potential gotcha of

>>> a = -1
>>> a is -1
True
>>> a = 1000
>>> a is 1000
False
JulianEberius commented 11 years ago

Ah I see, I knew there was some semantic difference... "is" checks for object identity and "==" for equality, while Python caches small integers. Thanks!