Skip to content

Commit b342935

Browse files
committed
Adjust style="" to do the right thing...
and squelch "set:raw" error in trying set PygmentsStyle
1 parent 4fc3781 commit b342935

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

mathicsscript/autoload/settings.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
Settings`$ShowFullFormInput = False
1818

19-
(* This is a workarund for a bug in mathicsscript of mathics-core.
19+
(* This is a workaround for a bug in mathicsscript of mathics-core.
2020
Remove this and we get error:
2121
Set::setraw: Cannot assign to raw object colorful. *)
22-
Settings`$PygmentsStyle = False
22+
Settings`$PygmentsStyle = Null
2323

2424
Settings`$PygmentsStyle::usage = "This variable sets the Pygments style used to colorize output. The value should be a string.
2525

mathicsscript/termshell.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright (C) 2020-2022, 2024 Rocky Bernstein <[email protected]>
2+
# Copyright (C) 2020-2022, 2024, 2025 Rocky Bernstein <[email protected]>
33

44
from columnize import columnize
55

@@ -67,7 +67,7 @@
6767
SymbolPygmentsStylesAvailable = Symbol("Settings`PygmentsStylesAvailable")
6868

6969

70-
def is_pygments_style(style: str):
70+
def is_pygments_style(style: str) -> bool:
7171
if style not in ALL_PYGMENTS_STYLES:
7272
print(f"Pygments style name '{style}' not found.")
7373
print(f"Style names are:\n{columnize(ALL_PYGMENTS_STYLES)}")
@@ -154,7 +154,7 @@ def __init__(
154154
)
155155

156156
def change_pygments_style(self, style: str):
157-
if style == self.pygments_style:
157+
if not style or style == self.pygments_style:
158158
return False
159159
if is_pygments_style(style):
160160
self.terminal_formatter = Terminal256Formatter(style=style)

screenshots/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ I hit the _Tab_ key after `Inte` to get the completions
1212

1313
Ater adding `gr` though there was just one completion: `Integrate`.
1414

15-
To get the theta (θ), I entered: _escape_ theta _escape_.
15+
To get the theta (θ), I entered: _escape_ .Theta _escape_.
1616

1717
The next time around I entered `\[The` and the _Tab_ key.
1818

0 commit comments

Comments
 (0)