aboutsummaryrefslogtreecommitdiff
path: root/src/lpm.lua
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2023-06-27 15:36:23 -0400
committerAdam Harrison <adamdharrison@gmail.com>2023-06-27 15:36:23 -0400
commit68bffd2b3bac0e2cecd62ee016cede743c721af4 (patch)
tree726e3f04e149f944246017a906461f2e1f9c066c /src/lpm.lua
parentfd0e1eb0c778650f7e8e54312da7e37fa33ed642 (diff)
downloadlite-xl-plugin-manager-68bffd2b3bac0e2cecd62ee016cede743c721af4.tar.gz
lite-xl-plugin-manager-68bffd2b3bac0e2cecd62ee016cede743c721af4.zip
Fixed warning and error.v1.0.6
Diffstat (limited to 'src/lpm.lua')
-rw-r--r--src/lpm.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lpm.lua b/src/lpm.lua
index a4a4373..eb61669 100644
--- a/src/lpm.lua
+++ b/src/lpm.lua
@@ -2116,7 +2116,7 @@ not commonly used publically.
last_read = nil
return
end
- if not start_time or total_read < last_read then start_time = system.time() end
+ if not start_time or not last_read or total_read < last_read then start_time = system.time() end
local status_line = string.format("%s [%s/s][%03d%%]: %s", format_bytes(total_read), format_bytes(total_read / (system.time() - start_time)), math.floor((received_objects and (received_objects/total_objects_or_content_length) or (total_read/total_objects_or_content_length) or 0)*100), progress_bar_label)
io.stdout:write("\r")
io.stdout:write(status_line)