From 589ab5f19a9bfbcdaf2b14c4c500aded519d3fc1 Mon Sep 17 00:00:00 2001 From: Vanessa Dannenberg Date: Wed, 22 Aug 2018 18:29:14 -0400 Subject: [PATCH] don't reset scroll position if re-printing the same message --- init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 0075136..cb52e66 100644 --- a/init.lua +++ b/init.lua @@ -341,9 +341,12 @@ local on_digiline_receive_string = function(pos, node, channel, msg) else msg = string.gsub(msg, "//", string.char(30)) led_marquee.set_timer(pos, 0) + local last_msg = meta:get_string("last_msg") meta:set_string("last_msg", msg) led_marquee.display_msg(pos, channel, msg) - meta:set_int("index", 1) + if last_msg ~= msg then + meta:set_int("index", 1) + end end else local asc = string.byte(msg)