Implement rendering display lines

This commit is contained in:
Joscha 2019-05-11 21:55:21 +00:00
parent 01a97c4147
commit 9df8338b0e
3 changed files with 88 additions and 11 deletions

View file

@ -40,9 +40,10 @@ class Element(abc.ABC):
@abc.abstractmethod
def render(self,
width: int,
depth: int,
highlighted: bool,
folded: bool,
highlighted: bool = False,
folded: bool = False,
) -> RenderedElement:
pass
@ -153,6 +154,10 @@ class RenderedElement:
def element(self) -> Element:
return self._element
@property
def lines(self) -> List[AttributedText]:
return self._lines
@property
def height(self) -> int:
return len(self._lines)