aboutsummaryrefslogtreecommitdiff
path: root/telem.lua
diff options
context:
space:
mode:
authorSolderpunk <solderpunk@sdf.org>2018-12-08 13:03:56 +0000
committerSolderpunk <solderpunk@sdf.org>2018-12-08 13:04:43 +0000
commitcafd7905db2acf9c81ecd4ac69f0c2794275beba (patch)
treef3b8a09dfa1ac2ceb5ba9618dea0decec04d2a18 /telem.lua
parentReduce code duplication and needless function argument. (diff)
Add "last" option to "type" command.
Diffstat (limited to '')
-rwxr-xr-xtelem.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/telem.lua b/telem.lua
index 5b7ebbd..140c930 100755
--- a/telem.lua
+++ b/telem.lua
@@ -212,6 +212,11 @@ function do_type_first()
do_type_show_post()
end
+function do_type_last()
+ current_thread_index = #current_thread_posts
+ do_type_show_post()
+end
+
function do_type_next()
if current_thread_index ~= #current_thread_posts then
current_thread_index = current_thread_index + 1
@@ -243,6 +248,7 @@ end
type_dispatch = {}
type_dispatch["f"] = do_type_first
+type_dispatch["l"] = do_type_last
type_dispatch["n"] = do_type_next
type_dispatch["p"] = do_type_prev
type_dispatch["r"] = do_type_reply
@@ -273,7 +279,7 @@ function do_type()
end
function show_type_prompt()
- io.write("[f]irst, [n]ext, [p]rev, [r]eply, [d]one > ")
+ io.write("[f]irst, [n]ext, [p]rev, [l]last, [r]eply, [d]one > ")
end
function do_type_show_post()