nikitakit / hydrogen-python

Python-specific plugin for hydrogen. Make Python coding in the Atom editor even more interactive!
https://atom.io/packages/hydrogen-python
MIT License
54 stars 20 forks source link

Incorrect cursor movement with 'Extend Executable Code' enabled and enabled 'Watches' #25

Open alendit opened 5 years ago

alendit commented 5 years ago

When I set the 'Extend Executable Code' option and add a watch expression, running any code with 'Run Line and Move' jumps to the top of the file. Disabling 'Extend Executable Code' fixes the behaviour.

Atom 1.34.0, hydrogen-python 0.0.8, hydrogen 2.8.0.

EDIT: this is caused by watch statements being run through the expandCode method. The solution would seem to be to detect the origin of a statement and to not execute it in with code expansion.