Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions mathicsscript/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ def fmt_fun(query: Any) -> Any:

full_form = definitions.get_ownvalue(
"Settings`$ShowFullFormInput"
).replace.to_python()
).to_python()
style = definitions.get_ownvalue("Settings`$PygmentsStyle")
fmt = identity
if style:
style = style.replace.get_string_value()
style = style.get_string_value()
if shell.terminal_formatter:
fmt = fmt_fun

Expand Down
16 changes: 7 additions & 9 deletions mathicsscript/termshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,15 @@ def __init__(

self.pygments_style = style
self.definitions = definitions
set_settings_value(
self.definitions, "Settings`$PygmentsShowTokens", from_python(False)
self.definitions.set_ownvalue(
"Settings`$PygmentsShowTokens", from_python(False)
)
set_settings_value(
self.definitions, "Settings`$UseUnicode", from_python(use_unicode)
)
set_settings_value(
self.definitions,
"Settings`PygmentsStylesAvailable",
from_python(ALL_PYGMENTS_STYLES),
self.definitions.set_ownvalue("Settings`$PygmentsStyle", from_python(style))
self.definitions.set_ownvalue("Settings`$UseUnicode", from_python(use_unicode))
self.definitions.set_ownvalue(
"Settings`PygmentsStylesAvailable", from_python(ALL_PYGMENTS_STYLES)
)

self.definitions.add_message(
"Settings`PygmentsStylesAvailable",
Rule(
Expand Down
6 changes: 3 additions & 3 deletions mathicsscript/termshell_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def bottom_toolbar(self):
if self.definitions.get_ownvalue("Settings`$GroupAutocomplete"):
app.group_autocomplete = self.definitions.get_ownvalue(
"Settings`$GroupAutocomplete"
).replace.to_python()
).to_python()

edit_mode = "Vi" if app.editing_mode == EditingMode.VI else "Emacs"
return HTML(
Expand Down Expand Up @@ -224,10 +224,10 @@ def print_result(
elif self.terminal_formatter: # pygmentize
show_pygments_tokens = self.definitions.get_ownvalue(
"Settings`$PygmentsShowTokens"
).replace.to_python()
).to_python()
pygments_style = self.definitions.get_ownvalue(
"Settings`$PygmentsStyle"
).replace.get_string_value()
).get_string_value()
if pygments_style != self.pygments_style:
if not self.change_pygments_style(pygments_style):
self.definitions.set_ownvalue(
Expand Down
Loading