diff --git a/src/dbg_tui.py b/src/dbg_tui.py new file mode 100644 index 0000000..87fc508 --- /dev/null +++ b/src/dbg_tui.py @@ -0,0 +1,35 @@ +from dpdebugger import Debugger +from dataclasses import dataclass +from rich import print as rprint +from rich.layout import Layout +from rich.live import Live + +@dataclass +class SourceLines: + active: int + begining_number: int + lines: list[str] + +def _get_source_lines( + srcline: int, + lines: list[str], + max_height: int + ) -> SourceLines: + """ + Собирает выборку из строк исходного кода так, чтобы она + подходила по количесту строчек + """ + start = max(srcline - max_height//2, 1) + 1 + upper_length = srcline - start + end = + + + +def main(debugger: Debugger, srcfile: str): + layout = Layout() + layout.split_column( + Layout(name="source"), + Layout(name="terminal") + ) + rprint(layout) +