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

Remove whitespace-trimming code #12

Closed kylebarron closed 6 years ago

kylebarron commented 6 years ago

The suggestion I had last night didn't make it into that PR.

What would you think about having a simple code.replace(/^\n|\n$/g, '') to fix

image
nikitakit commented 6 years ago

Oh, so the issue here that the first line doesn't have any indentation, which trips up IPython's indentation detection?

In that case, there does need to be an update that's timed with the new hydrogen version that removes the trim. Hopefully IPython doesn't choke if there are non-indented empty lines in the middle of the code, or there will be even more work to be done...

kylebarron commented 6 years ago

IPython is fine if there are non-indented lines in the middle. But when the first line has no indentation, that causes an error.

nikitakit commented 6 years ago

Changes are currently staged on the master branch, to be released soon (hopefully I can test some more before releasing)

kylebarron commented 6 years ago

👍