From c77cd7027f3597384f4474c049b28014027845b6 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Thu, 8 Apr 2021 00:03:18 -0400 Subject: lua print_table add ability to draw a line separator allows you to draw a line between items Change-Id: I7e6e2f56738e12ff06d06a24f0f9d0769932a7b1 --- apps/plugins/lua/include_lua/printtable.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'apps/plugins/lua/include_lua/printtable.lua') diff --git a/apps/plugins/lua/include_lua/printtable.lua b/apps/plugins/lua/include_lua/printtable.lua index 24c4f73b0a..b289beeb0e 100644 --- a/apps/plugins/lua/include_lua/printtable.lua +++ b/apps/plugins/lua/include_lua/printtable.lua @@ -152,14 +152,15 @@ function print_table(t, t_count, settings) end local wrap, justify, start, curpos, co_routine, hasheader, m_sel - local header_fgc, header_bgc, item_fgc, item_bgc, item_selc + local header_fgc, header_bgc, item_fgc, item_bgc, item_selc, drawsep do local s = settings or _print.get_settings() wrap, justify = s.wrap, s.justify start, curpos = s.start, s.curpos co_routine = s.co_routine hasheader = s.hasheader - m_sel = false + drawsep = s.drawsep + m_sel = false if co_routine == nil then --no multi select in incremental mode m_sel = s.msel @@ -351,6 +352,11 @@ function print_table(t, t_count, settings) _print.opt.overflow("manual") _print.opt.justify(justify) + local opts = _print.opt.get() + opts.drawsep = drawsep + _print.opt.set(opts) + + -- initialize vertical scrollbar set_vsb(); do local vsb =_print.opt.get() @@ -359,7 +365,7 @@ function print_table(t, t_count, settings) vsb.bg_pattern = 3 - vsb.bg_pattern end - set_vsb = function (item) + set_vsb = function (item) if t_count > (maxline or t_count) then rb.set_viewport(vsb) item = item or 0 -- cgit v1.2.3