summaryrefslogtreecommitdiffstats
path: root/apps/plugins/lua/include_lua/printtable.lua
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lua/include_lua/printtable.lua')
-rw-r--r--apps/plugins/lua/include_lua/printtable.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/plugins/lua/include_lua/printtable.lua b/apps/plugins/lua/include_lua/printtable.lua
index bf81c7b060..7a883367b7 100644
--- a/apps/plugins/lua/include_lua/printtable.lua
+++ b/apps/plugins/lua/include_lua/printtable.lua
@@ -336,6 +336,16 @@ function print_table(t, t_count, settings)
table_p = init_position(15, 5)
line, maxline = _print.opt.area(5, 1, rb.LCD_WIDTH - 10 - sb_width, rb.LCD_HEIGHT - 2)
+
+ if curpos > maxline then
+ local c = maxline / 2
+ start = (start or 1) + curpos - maxline
+ curpos = maxline
+ while start + maxline <= t_count and curpos > c do
+ curpos = curpos - 1
+ start = start + 1
+ end
+ end
maxline = math.min(maxline, t_count)
-- allow user to start at a position other than the beginning