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:
Joscha 2019-06-07 04:23:36 +00:00
parent 5a606a9191
commit 5e10fcecac
3 changed files with 10 additions and 6 deletions

View file

@ -174,7 +174,7 @@ class InMemorySupply(ElementSupply[E]):
return elem.parent_id
def _roots(self) -> List[Id]:
roots = (m for m in self._elements.values() if m.parent_id is None)
roots = (i for i, m in self._elements.items() if m.parent_id is None)
return list(sorted(roots))
def sibling_ids(self, elem_id: Id) -> List[Id]:
@ -189,6 +189,6 @@ class InMemorySupply(ElementSupply[E]):
roots = self._roots()
if roots:
return roots[:-1]
return roots[-1]
else:
return None