Skip to content

Commit c114fcf

Browse files
committed
fix html loading
1 parent 22d4cee commit c114fcf

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
* GUI improvements.
1010

1111
### DEBUGGED
12-
* Fix command heightening unable to highlight `−` (a way to represent `-` in html)
12+
* Fix command heightening unable to highlight `−` (a way to represent `-` in html).
13+
* Fix Html not being loaded in some cases.
1314

1415
## Version 0.2.0 (Initial Development)
1516

cmdcompass/gui/manpagebox.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ def capture_original_scroll_bar_style(self):
5252
}
5353

5454
def set_man_page(self, command):
55-
html_content = ""
5655
self.command = command
5756
command_str = command.command_str
5857
if command.user_defined_man_page :
@@ -64,19 +63,19 @@ def set_man_page(self, command):
6463
existing_core_man_page = os.path.join(HTML_CORE_DIR, f"{command_name}.html")
6564
if os.path.exists(existing_core_man_page):
6665
with open(existing_core_man_page, "r") as f:
67-
html_content = f.read()
66+
self.html_content = f.read()
6867
elif os.path.exists(dynamically_downloaded_html):
6968
with open(dynamically_downloaded_html, "r") as f:
70-
html_content = f.read()
69+
self.html_content = f.read()
7170
else:
7271
def download_and_update():
7372
progress_window = self.create_progress_window()
7473
progress_window.update_progress(f"Downloading {command_name}...")
7574
download_and_process_package(command_name, progress_window)
7675
# After download and processing is complete, update the HTML
7776
with open(dynamically_downloaded_html, "r") as f:
78-
html_content = f.read()
79-
self.html_view.load_html(html_content)
77+
self.html_content = f.read()
78+
self.html_view.load_html(self.html_content)
8079
if progress_window:
8180
progress_window.update_progress("Complete! Closing Window in 5 seconds", 1)
8281
progress_window.close()
@@ -87,9 +86,9 @@ def download_and_update():
8786
download_thread.start()
8887
except Exception as e:
8988
print(f"Error getting man page: {e}")
90-
self.html_content = html_content
9189
self.options = command.extract_options()
9290
self.change_theme()
91+
self.highlight_switch.deselect()
9392
if self.options:
9493
self.highlight_switch.grid(row=0, column=0, pady=(10, 0), sticky="w")
9594
else:

0 commit comments

Comments
 (0)