提交 e6089219 编写于 作者: S sangoh.hong

Page down key bug fixed.

Duplicate code reduced.
上级 f7e24b22
......@@ -47,3 +47,5 @@ _build
# web ui
node_modules/
bower_components/
.vscode/
\ No newline at end of file
......@@ -124,6 +124,8 @@ class GlancesCursesBrowser(_GlancesCurses):
"""Set next page."""
if self._current_page + 1 < self._page_max:
self._current_page += 1
else:
self._current_page = 0
self.cursor_position = 0
def __catch_key(self, stats):
......@@ -288,9 +290,7 @@ class GlancesCursesBrowser(_GlancesCurses):
self.cursor = len(stats) - 1
start_line = self._page_max_lines * self._current_page
end_line = start_line + self._page_max_lines
if end_line > stats_len:
end_line = stats_len
end_line = start_line + self.get_pagelines(stats)
current_page = stats[start_line:end_line]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册