From f8c399bf50c21f4c8a4864ff14965550eb0aac17 Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 19 Aug 2024 10:06:29 -0700 Subject: [PATCH] \#timeout for regions Support tab separation for the region portion of #timeout output. This works ok under Qt. However, the output from #timeout uses a fixed-width font so tab separation isn't necessary. No idea how well it will work for mswin. --- src/region.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/region.c b/src/region.c index 3a65e583e..7a034f612 100644 --- a/src/region.c +++ b/src/region.c @@ -659,6 +659,7 @@ visible_region_summary(winid win) NhRegion *reg; char buf[BUFSZ], typbuf[QBUFSZ]; int i, damg, hdr_done = 0; + const char *fldsep = iflags.menu_tab_sep ? "\t" : " "; for (i = 0; i < svn.n_regions; i++) { reg = gr.regions[i]; @@ -684,8 +685,8 @@ visible_region_summary(winid win) Sprintf(typbuf, "poison gas (%d)", damg); else Strcpy(typbuf, "vapor"); - Sprintf(eos(buf), " %-16s", typbuf); - Sprintf(eos(buf), " @[%d,%d..%d,%d]", + Sprintf(eos(buf), "%s%-16s", fldsep, typbuf); + Sprintf(eos(buf), "%s@[%d,%d..%d,%d]", fldsep, reg->bounding_box.lx, reg->bounding_box.ly, reg->bounding_box.hx, reg->bounding_box.hy); putstr(win, 0, buf);