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

Remove unnecessary newlines in run cell #3992

Closed
talkaminker opened this issue Jan 18, 2017 · 4 comments
Closed

Remove unnecessary newlines in run cell #3992

talkaminker opened this issue Jan 18, 2017 · 4 comments

Comments

@talkaminker
Copy link
Contributor

When running a cell, the cell that is actually ran in the ipython contains 2 redundant newlines in the end.
this is inconvenient because it reduces the amount of text you see in ipython console.
here is a fix:
in: spyder/widgets/sourcecode/base.py in the function get_cell_as_executable_code
instead of
return text
write:
return text.rstrip()

This will also remove endlines added by the user which I think is actually a desired behavior anyway (for example, I tend to add newlines just to visually separate between one cell and the next one)

If you think this is good, I can create a pull request with the fix.

Note: right now, the newlines which are in the beginning of the cell are stripped anyway, so removing the trailing newlines just seems natural.

@ccordoba12
Copy link
Member

I think at least one new line is needed to get the console to evaluate the cell.

But if you make that work, please send us a pull request :-)

@talkaminker
Copy link
Contributor Author

talkaminker commented Jan 18, 2017

I tested it before opening the issue, it works. I added a pull request
I added the pull req to master but I don't know how you guys work, so please move it if it is wrong

talkaminker added a commit to talkaminker/spyder that referenced this issue Jan 18, 2017
@goanpeca
Copy link
Member

@ccordoba12 this should beagainst what branch ?

@ccordoba12
Copy link
Member

It's a very simple change, so I'd say 3.1.x.


We need to write a guide about how we manage our branches so that it's easier for external contributors to work with us.

@ccordoba12 ccordoba12 added this to the v3.1.3 milestone Feb 10, 2017
@ccordoba12 ccordoba12 changed the title remove unnecessary newlines in run cell Remove unnecessary newlines in run cell Feb 10, 2017
ccordoba12 added a commit that referenced this issue Feb 10, 2017
ccordoba12 added a commit that referenced this issue Feb 10, 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