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

PR: Preserve color scheme on kernel restart #6256

Merged
merged 3 commits into from
Jan 27, 2018

Conversation

csabella
Copy link
Contributor

@csabella csabella commented Jan 20, 2018

Fixes #6235.

@csabella csabella changed the base branch from master to 3.x January 20, 2018 17:51
@ccordoba12 ccordoba12 added this to the v3.2.7 milestone Jan 21, 2018
self.shellwidget.silent_execute("%colors linux")
else:
self.shellwidget.silent_execute("%colors lightbg")
self.set_console_scheme(self.shellwidget)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change set_console_scheme to set_color_scheme

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already a different method called set_color_scheme. Before submitting the PR, I wasn't sure if I should use it or not because it takes color_scheme as a parameter, which is a value from the plugin (ipythonconsole.py) and not the widget (client.py). It was a more complicated change, so I opted for directly fixing this one issue.

Do you want me to redo it using the existing set_color_scheme?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, please. I think it'd be easier to understand that way. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, will work on it soon.

@ccordoba12
Copy link
Member

I think this is good, just left a minor comment.

# For issue 6235. IPython was changing the setting of
# %colors on windows by assuming it was using a dark
# background. This corrects it based on the scheme.
self.set_color_scheme(sw.syntax_style)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed sw.reset(clear=True) because it's part of set_color_scheme.

@csabella
Copy link
Contributor Author

@ccordoba12 Good suggestions; it's much cleaner now.

@ccordoba12
Copy link
Member

@csabella, now tests for dedicated consoles are failing.

@csabella
Copy link
Contributor Author

@ccordoba12 Yes, sorry, trying to figure it out.

@csabella
Copy link
Contributor Author

Yay! I'm green! I also tested as much of that as I could think of to do manually. I hadn't thought of the dedicated console, so that was a good test case. :-)

Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot Cheryl! Great work here!

@ccordoba12 ccordoba12 merged commit 27fbfff into spyder-ide:3.x Jan 27, 2018
ccordoba12 added a commit that referenced this pull request Jan 27, 2018
@csabella csabella deleted the issue6235 branch January 27, 2018 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants