From 10cd073e1f7c2f287bb1090e2717be455091bced Mon Sep 17 00:00:00 2001
From: "Rob Swindell (on Debian Linux)" <rob@synchro.net>
Date: Sat, 28 Oct 2023 14:35:16 -0700
Subject: [PATCH] Fix for preview mode with narrow terminals

Longer messages would cause the "Preview lines" separator line to wrap.
Chasing 40 column issues is a bit of a rabbit hole, so I think I'll pause
for now.
---
 exec/msglist.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/exec/msglist.js b/exec/msglist.js
index 3fe0857358..e9de06bb0d 100644
--- a/exec/msglist.js
+++ b/exec/msglist.js
@@ -893,7 +893,7 @@ function list_msgs(msgbase, list, current, preview, grp_name, sub_name)
 			console.attributes = msg_ctrl ? color_cfg.preview_separator_active : color_cfg.preview_separator_inactive;
 			while(console.current_column < digits - 1)
 				write(options.preview_separator || default_separator);
-			write(options.preview_label || "\xd9 Preview");
+			write(options.preview_label || (console.screen_columns < 80 ? "\xd9" : "\xd9 Preview"));
 			var offset = pagesize + 4;
 			if(text) {
 				if(text.length) {
@@ -908,7 +908,7 @@ function list_msgs(msgbase, list, current, preview, grp_name, sub_name)
 					var max = Math.min(console.screen_rows - offset, text.length);
 					if(msg_line + max > text.length)
 						msg_line = text.length - max;
-					write(format(options.preview_lines_fmt || " lines %u-%u"
+					write(format(options.preview_lines_fmt || " Lines %u-%u"
 						, msg_line + 1, msg_line + max));
 					if(max < text.length)
 						write(format(options.preview_total_lines_fmt || " of %u", text.length));
-- 
GitLab