-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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: Make highlighting colors in the IPython Console match those used in the Spyder Editor #4813
Changes from 3 commits
306c67a
1c59108
8b17e37
6b8a894
d611287
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
from spyder.config.gui import config_shortcut | ||
from spyder.py3compat import to_text_string | ||
from spyder.utils import programs | ||
from spyder.utils import syntaxhighlighters as sh | ||
from spyder.utils.ipython.style import create_qss_style, create_style_class | ||
from spyder.widgets.ipythonconsole import (ControlWidget, DebuggingWidget, | ||
HelpWidget, NamepaceBrowserWidget, | ||
|
@@ -70,6 +71,9 @@ def __init__(self, ipyclient, additional_options, interpreter_versions, | |
# To save kernel replies in silent execution | ||
self._kernel_reply = None | ||
|
||
color_scheme = kw['config']['JupyterWidget']['syntax_style'] | ||
self.set_bracket_matcher_color_scheme(color_scheme) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe this two lines could be replaced by something like self.set_bracket_matcher_color_scheme(self.syntax_style) What do you guys think @jnsebgosselin @ccordoba12 ? Also, please add a comment above, something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes you are right and this works. I didn't see it because it is not obvious where this is inherited. |
||
|
||
#---- Public API ---------------------------------------------------------- | ||
def set_exit_callback(self): | ||
"""Set exit callback for this shell.""" | ||
|
@@ -110,9 +114,15 @@ def get_cwd(self): | |
return | ||
else: | ||
self.silent_exec_method(code) | ||
|
||
def set_bracket_matcher_color_scheme(self, color_scheme): | ||
bsh = sh.BaseSH(parent=self, color_scheme=color_scheme) | ||
mpcolor = bsh.get_matched_p_color() | ||
self._bracket_matcher.format.setBackground(mpcolor) | ||
|
||
def set_color_scheme(self, color_scheme): | ||
"""Set color scheme of the shell.""" | ||
self.set_bracket_matcher_color_scheme(color_scheme) | ||
self.style_sheet, dark_color = create_qss_style(color_scheme) | ||
self.syntax_style = color_scheme | ||
self._style_sheet_changed() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you have to remove this as part of this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I just saw you mentioned the reason in your description :-)