diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-03-06 02:42:34 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-03-06 02:42:34 -0800 |
commit | a8d0c1a56a82684ec0db7b4fa622b3b34e50fffd (patch) | |
tree | ecc68c76c813db3894654c6e7c453cdceee409ca /commander.tlv | |
parent | af9d7a16f3d14faa494bb878e99d7bb4ce0d2375 (diff) | |
download | teliva-a8d0c1a56a82684ec0db7b4fa622b3b34e50fffd.tar.gz |
reconcile all apps with template.tlv
They may take more or less from it (sieve.tlv in particular takes nothing since call depth doesn't help at all there), but what they take is in the right order so that you can compare across apps.
Diffstat (limited to 'commander.tlv')
-rw-r--r-- | commander.tlv | 96 |
1 files changed, 7 insertions, 89 deletions
diff --git a/commander.tlv b/commander.tlv index 5416f64..6b80304 100644 --- a/commander.tlv +++ b/commander.tlv @@ -62,90 +62,10 @@ > >-- TODO: backport utf-8 support from Lua 5.3 - __teliva_timestamp: original - debugy: - >debugy = 5 -- __teliva_timestamp: original - dbg: - >-- helper for debug by print; overlay debug information towards the right - >-- reset debugy every time you refresh screen - >function dbg(window, s) - > local oldy = 0 - > local oldx = 0 - > oldy, oldx = window:getyx() - > window:mvaddstr(debugy, 60, s) - > debugy = debugy+1 - > window:mvaddstr(oldy, oldx, '') - >end -- __teliva_timestamp: original - check_eq: - >function check_eq(x, expected, msg) - > if x == expected then - > Window:addch('.') - > else - > print('F - '..msg) - > print(' expected '..tostring(expected)..' but got '..x) - > teliva_num_test_failures = teliva_num_test_failures + 1 - > -- overlay first test failure on editors - > if teliva_first_failure == nil then - > teliva_first_failure = msg - > end - > end - >end -- __teliva_timestamp: original - map: - >-- only for arrays - >function map(l, f) - > result = {} - > for _, x in ipairs(l) do - > table.insert(result, f(x)) - > end - > return result - >end -- __teliva_timestamp: original - reduce: - >-- only for arrays - >function reduce(l, f, init) - > result = init - > for _, x in ipairs(l) do - > result = f(result, x) - > end - > return result - >end -- __teliva_timestamp: original - filter: - >-- only for arrays - >function filter(l, f) - > result = {} - > for _, x in ipairs(l) do - > if f(x) then - > table.insert(result, x) - > end - > end - > return result - >end -- __teliva_timestamp: original - find_index: - >function find_index(arr, x) - > for n, y in ipairs(arr) do - > if x == y then - > return n - > end - > end - >end -- __teliva_timestamp: original - trim: - >function trim(s) - > return s:gsub('^%s*', ''):gsub('%s*$', '') - >end -- __teliva_timestamp: original - split: - >function split(s, d) - > result = {} - > for match in (s..d):gmatch("(.-)"..d) do - > table.insert(result, match); - > end - > return result - >end + menu: + >-- To show app-specific hotkeys in the menu bar, add hotkey/command + >-- arrays of strings to the menu array. + >menu = {} - __teliva_timestamp: original Window: >Window = curses.stdscr() @@ -162,11 +82,6 @@ > window:refresh() >end - __teliva_timestamp: original - menu: - >-- To show app-specific hotkeys in the menu bar, add hotkey/command - >-- arrays of strings to the menu array. - >menu = {} -- __teliva_timestamp: original update: >function update(window) > local key = window:getch() @@ -197,3 +112,6 @@ > update(Window) > end >end +- __teliva_timestamp: original + doc:blurb: + >beginnings of a file browser.. |