Browse Source

Curses

pull/152/head
Jure Šorn 1 year ago
parent
commit
13b2f1c020
2 changed files with 2 additions and 2 deletions
  1. 2
      README.md
  2. 2
      index.html

2
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):

2
index.html

@ -1997,7 +1997,7 @@ print(table)
ch = screen.getch()
selected += (ch == KEY_DOWN) - (ch == KEY_UP)
selected = max(<span class="hljs-number">0</span>, min(len(paths)<span class="hljs-number">-1</span>, selected))
first += (first &lt;= selected - height) - (first &gt; selected)
first += (selected &gt;= first + height) - (selected &lt; first)
<span class="hljs-keyword">if</span> ch <span class="hljs-keyword">in</span> [KEY_LEFT, KEY_RIGHT, KEY_ENTER, <span class="hljs-number">10</span>, <span class="hljs-number">13</span>]:
new_dir = <span class="hljs-string">'..'</span> <span class="hljs-keyword">if</span> ch == KEY_LEFT <span class="hljs-keyword">else</span> paths[selected]
<span class="hljs-keyword">if</span> os.path.isdir(new_dir):

Loading…
Cancel
Save