From 9318a7dc9f7def35a2e9d85ccffe63c06950be09 Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Sun, 2 Mar 2025 19:45:04 +0100 Subject: Release v0.5.0 --- docs/examples/compat.lua.html | 2 +- docs/examples/flag_debugging.lua.html | 2 +- docs/examples/password_input.lua.html | 2 +- docs/examples/read.lua.html | 2 +- docs/examples/readline.lua.html | 10 +++++++--- docs/examples/spinner.lua.html | 2 +- docs/examples/spiral_snake.lua.html | 2 +- docs/examples/terminalsize.lua.html | 2 +- 8 files changed, 14 insertions(+), 10 deletions(-) (limited to 'docs/examples') diff --git a/docs/examples/compat.lua.html b/docs/examples/compat.lua.html index b887c91..42928b0 100644 --- a/docs/examples/compat.lua.html +++ b/docs/examples/compat.lua.html @@ -112,7 +112,7 @@
generated by LDoc 1.5.0 -Last updated 2024-12-18 02:50:03 +Last updated 2025-03-02 19:43:40
diff --git a/docs/examples/flag_debugging.lua.html b/docs/examples/flag_debugging.lua.html index 8fcf0a9..862cd96 100644 --- a/docs/examples/flag_debugging.lua.html +++ b/docs/examples/flag_debugging.lua.html @@ -80,7 +80,7 @@
generated by LDoc 1.5.0 -Last updated 2024-12-18 02:50:03 +Last updated 2025-03-02 19:43:40
diff --git a/docs/examples/password_input.lua.html b/docs/examples/password_input.lua.html index f29e429..cf27497 100644 --- a/docs/examples/password_input.lua.html +++ b/docs/examples/password_input.lua.html @@ -132,7 +132,7 @@ useful for reading secrets from the user.
generated by LDoc 1.5.0 -Last updated 2024-12-18 02:50:03 +Last updated 2025-03-02 19:43:40
diff --git a/docs/examples/read.lua.html b/docs/examples/read.lua.html index 1d6bb3e..2ffcf1b 100644 --- a/docs/examples/read.lua.html +++ b/docs/examples/read.lua.html @@ -143,7 +143,7 @@ sys.setnonblock(io
generated by LDoc 1.5.0 -Last updated 2024-12-18 02:50:03 +Last updated 2025-03-02 19:43:40
diff --git a/docs/examples/readline.lua.html b/docs/examples/readline.lua.html index a78f5b3..ba453ad 100644 --- a/docs/examples/readline.lua.html +++ b/docs/examples/readline.lua.html @@ -213,10 +213,12 @@ readline.__index = readline -- @tparam[opt=""] string opts.value the default value -- @tparam[opt=#value] number opts.position of the cursor in the input -- @tparam[opt={"\10"/"\13"}] table opts.exit_keys an array of keys that will cause the readline to exit +-- @tparam[opt=system.sleep] function opts.fsleep the sleep function to use (see system.readansi) -- @treturn readline the new readline object function readline.new(opts) local value = utf8parse(opts.value or "") local prompt = utf8parse(opts.prompt or "") + local fsleep = opts.fsleep or sys.sleep local pos = math.floor(opts.position or (#value + 1)) pos = math.max(math.min(pos, (#value + 1)), 1) local len = math.floor(opts.max_length or 80) @@ -244,6 +246,7 @@ readline.__index = readline position = pos, -- the current position in the input drawn_before = false, -- if the prompt has been drawn exit_keys = exit_keys, -- the keys that will cause the readline to exit + fsleep = fsleep, -- the sleep function to use } setmetatable(self, readline) @@ -482,7 +485,7 @@ readline.__index = readline local timeout_end = sys.gettime() + timeout while true do - local key, keytype = sys.readansi(timeout_end - sys.gettime()) + local key, keytype = sys.readansi(timeout_end - sys.gettime(), self.fsleep) if not key then -- error or timeout return nil, keytype @@ -527,7 +530,8 @@ sys.setconsoleflags(io"Hello, 你-好 World 🚀!", -- position = 2, exit_keys = {key_sequences.enter, "\27", "\t", "\27[Z"}, -- enter, escape, tab, shift-tab -} + fsleep = sys.sleep, +} local result, key = rl() @@ -545,7 +549,7 @@ sys.setconsoleflags(io
generated by LDoc 1.5.0 -Last updated 2024-12-18 02:50:03 +Last updated 2025-03-02 19:43:40
diff --git a/docs/examples/spinner.lua.html b/docs/examples/spinner.lua.html index b56f1ed..ea992e3 100644 --- a/docs/examples/spinner.lua.html +++ b/docs/examples/spinner.lua.html @@ -137,7 +137,7 @@ sys.setnonblock(io
generated by LDoc 1.5.0 -Last updated 2024-12-18 02:50:03 +Last updated 2025-03-02 19:43:40
diff --git a/docs/examples/spiral_snake.lua.html b/docs/examples/spiral_snake.lua.html index 961f506..1f0d582 100644 --- a/docs/examples/spiral_snake.lua.html +++ b/docs/examples/spiral_snake.lua.html @@ -145,7 +145,7 @@ codes for moving the cursor around.
generated by LDoc 1.5.0 -Last updated 2024-12-18 02:50:03 +Last updated 2025-03-02 19:43:40
diff --git a/docs/examples/terminalsize.lua.html b/docs/examples/terminalsize.lua.html index c01a3d3..a8bb42b 100644 --- a/docs/examples/terminalsize.lua.html +++ b/docs/examples/terminalsize.lua.html @@ -110,7 +110,7 @@ sys.tcsetattr(io.
generated by LDoc 1.5.0 -Last updated 2024-12-18 02:50:03 +Last updated 2025-03-02 19:43:40
-- cgit v1.2.3-55-g6feb