mirror of
https://github.com/aclist/dztui.git
synced 2026-08-28 18:57:12 +02:00
fix: abort on empty model
This commit is contained in:
parent
2e5860650f
commit
bc4fc8005d
@ -32,12 +32,12 @@ class CursorMixin:
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def _move_cursor(self, position: CursorPosition) -> bool:
|
def _move_cursor(self, position: CursorPosition) -> bool:
|
||||||
cur_row = self.get_focused_row_index() # type: ignore
|
|
||||||
model = self.get_model() # type: ignore
|
model = self.get_model() # type: ignore
|
||||||
if model:
|
if len(model) > 0:
|
||||||
end = len(model) - 1
|
end = len(model) - 1
|
||||||
else:
|
else:
|
||||||
return True
|
return False
|
||||||
|
cur_row = self.get_focused_row_index() # type: ignore
|
||||||
|
|
||||||
if position == CursorPosition.DOWN:
|
if position == CursorPosition.DOWN:
|
||||||
if cur_row == end:
|
if cur_row == end:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user