From 13b2f1c020cb304508949af811fc5f2fcc131583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Thu, 2 Feb 2023 15:20:01 +0100 Subject: [PATCH] Curses --- README.md | 2 +- index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b06ffa3..08b7d14 100644 --- a/README.md +++ b/README.md @@ -2435,7 +2435,7 @@ def main(screen): ch = screen.getch() selected += (ch == KEY_DOWN) - (ch == KEY_UP) selected = max(0, min(len(paths)-1, selected)) - first += (first <= selected - height) - (first > selected) + first += (selected >= first + height) - (selected < first) if ch in [KEY_LEFT, KEY_RIGHT, KEY_ENTER, 10, 13]: new_dir = '..' if ch == KEY_LEFT else paths[selected] if os.path.isdir(new_dir): diff --git a/index.html b/index.html index 5db7fc4..8bbd5e7 100644 --- a/index.html +++ b/index.html @@ -1997,7 +1997,7 @@ print(table) ch = screen.getch() selected += (ch == KEY_DOWN) - (ch == KEY_UP) selected = max(0, min(len(paths)-1, selected)) - first += (first <= selected - height) - (first > selected) + first += (selected >= first + height) - (selected < first) if ch in [KEY_LEFT, KEY_RIGHT, KEY_ENTER, 10, 13]: new_dir = '..' if ch == KEY_LEFT else paths[selected] if os.path.isdir(new_dir):