Fix various small things
A commit that fixes all of the little things I forgot about, but that are necessary for rendering to function properly. - (attr. lines) reverse lines before extending above - (attr. lines) clamp the AttributedLine offset so that there is always a line with offset 0 - (tree renderer) use meta spaces for the cursor too - (tree renderer) use correct indent text for cursor - (tree renderer) fix mypy error by safely ignoring it - (supply) sort by root id instead of value - (supply) return id, not list of ids
This commit is contained in:
parent
5a606a9191
commit
5e10fcecac
3 changed files with 10 additions and 6 deletions
|
|
@ -75,7 +75,7 @@ class AttributedLines:
|
|||
AttributedLines's offsets instead.
|
||||
"""
|
||||
|
||||
self._lines.extendleft(lines._lines)
|
||||
self._lines.extendleft(reversed(lines._lines))
|
||||
self.upper_offset -= len(lines)
|
||||
|
||||
def extend_below(self, lines: "AttributedLines") -> None:
|
||||
|
|
@ -105,6 +105,7 @@ class AttributedLines:
|
|||
|
||||
attr_lines = AttributedLines(lines)
|
||||
attr_lines.upper_offset = max(start_offset, self.upper_offset)
|
||||
attr_lines.lower_offset = min(end_offset, self.lower_offset)
|
||||
return attr_lines
|
||||
|
||||
def to_size(self, start_offset: int, end_offset: int) -> "AttributedLines":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue