Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/3.x' into find_in_files_case_sens
Browse files Browse the repository at this point in the history
Merge!
  • Loading branch information
andfoy committed Jul 28, 2017
2 parents b1e5cb5 + 01d3313 commit 0df03eb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion spyder/plugins/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1929,7 +1929,7 @@ def print_file(self):
header_font=self.get_plugin_font('printer_header'))
printDialog = QPrintDialog(printer, editor)
if editor.has_selected_text():
printDialog.addEnabledOption(QAbstractPrintDialog.PrintSelection)
printDialog.setOption(QAbstractPrintDialog.PrintSelection, True)
self.redirect_stdio.emit(False)
answer = printDialog.exec_()
self.redirect_stdio.emit(True)
Expand Down
3 changes: 0 additions & 3 deletions spyder/utils/ipython/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def give_font_style(is_italic):
in_prompt_color = 'lime'
out_prompt_color = 'red'
background_color = color_scheme['background']
selection_background_color = '#ccc'
error_color = 'red'
in_prompt_number_font_weight = 'bold'
out_prompt_number_font_weight = 'bold'
Expand All @@ -59,7 +58,6 @@ def give_font_style(is_italic):
sheet = """QPlainTextEdit, QTextEdit, ControlWidget {{
color: {} ;
background-color: {};
selection-background-color: {}
}}
.error {{ color: {}; }}
.in-prompt {{ color: {}; }}
Expand All @@ -70,7 +68,6 @@ def give_font_style(is_italic):
"""

sheet_formatted = sheet.format(font_color, background_color,
selection_background_color,
error_color,
in_prompt_color, in_prompt_color,
in_prompt_number_font_weight,
Expand Down
13 changes: 13 additions & 0 deletions spyder/widgets/ipythonconsole/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -70,6 +71,11 @@ def __init__(self, ipyclient, additional_options, interpreter_versions,
# To save kernel replies in silent execution
self._kernel_reply = None

# Set the color of the matched parentheses here since the qtconsole
# uses a hard-coded value that is not modified when the color scheme is
# set in the qtconsole constructor. See issue #4806.
self.set_bracket_matcher_color_scheme(self.syntax_style)

#---- Public API ----------------------------------------------------------
def set_exit_callback(self):
"""Set exit callback for this shell."""
Expand Down Expand Up @@ -110,9 +116,16 @@ def get_cwd(self):
return
else:
self.silent_exec_method(code)

def set_bracket_matcher_color_scheme(self, color_scheme):
"""Set color scheme for matched parentheses."""
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()
Expand Down

0 comments on commit 0df03eb

Please sign in to comment.