Transferring max available height and tag to debugger, typos
This commit is contained in:
@@ -82,7 +82,7 @@ def run_test():
|
||||
from itertools import cycle
|
||||
from random import randint, random
|
||||
|
||||
from prompt_toolkit import Application, print_formatted_text
|
||||
from prompt_toolkit import Application
|
||||
from prompt_toolkit.key_binding import KeyBindings
|
||||
from prompt_toolkit.key_binding.bindings.focus import (focus_next,
|
||||
focus_previous)
|
||||
@@ -187,7 +187,7 @@ def run_test():
|
||||
info("[INFO] aboba")
|
||||
warn("[WARN] aboba")
|
||||
error("[ERROR] aboba")
|
||||
pretty_print("Wow! You are wonderful!".center(55), style="selection")
|
||||
pretty_print("Wow! You are wonderful!".center(55), style="class:selection")
|
||||
|
||||
contents = [
|
||||
task1.content,
|
||||
|
||||
@@ -521,6 +521,7 @@ class Debugger(Interactable):
|
||||
dont_extend_width=True,
|
||||
align=align,
|
||||
wrap_lines=False,
|
||||
tag=tag,
|
||||
)
|
||||
|
||||
def preferred_width(self, max_available_width: int) -> int:
|
||||
@@ -559,10 +560,10 @@ class Debugger(Interactable):
|
||||
buffer.append(f"{len(app.layout.visible_windows)}vw")
|
||||
buffer.append(f"{sum(1 for _ in app.layout.find_all_windows())}w")
|
||||
text = " " + "".join(buffer) + " "
|
||||
if len(text) > self._max_available_width:
|
||||
text = text[:self._max_available_width - 2] + "+ "
|
||||
if len(text) > max_available_width:
|
||||
text = text[:max_available_width - 2] + "+ "
|
||||
return [
|
||||
("class:debugger-overlay", text.center(self._max_available_width, "▄").replace("▄▄", "▄▀")),
|
||||
("class:debugger-overlay", text.center(max_available_width, "▄").replace("▄▄", "▄▀")),
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user