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: Override RichJupyterWidget._get_color() because we use a custom style (IPython console) #16957

Merged
merged 4 commits into from
Feb 14, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions spyder/plugins/ipythonconsole/widgets/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
# Local imports
from spyder.config.base import (
_, is_pynsist, running_in_mac_app, running_under_pytest)
from spyder.config.gui import get_color_scheme
from spyder.py3compat import to_text_string
from spyder.utils.palette import SpyderPalette
from spyder.utils import encoding
Expand Down Expand Up @@ -945,6 +946,17 @@ def _syntax_style_changed(self):
else:
self._highlighter.set_style_sheet(self.style_sheet)

def _get_colors(self, color):
"""
Get a color as qtconsole.styles.get_colors() would return from
a builtin Pygments style
bnavigator marked this conversation as resolved.
Show resolved Hide resolved
"""
color_scheme = get_color_scheme(self.syntax_style)
return dict(
bgcolor=color_scheme['background'],
select=color_scheme['background'],
fgcolor=color_scheme['normal'][0])[color]

def _prompt_started_hook(self):
"""Emit a signal when the prompt is ready."""
if not self._reading:
Expand Down