From 46181c505b8380a56de7d9317d6f8530302f7552 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Tue, 16 Apr 2019 08:57:27 +0000
Subject: [PATCH] Better support for terminals > 80 columns wide: Don't use a
 hard-coded value of 76 for word_wrap length argument. Don't use the default
 length of 79 for the quote_msg() call. Display a full bar across the screen
 for the quote window separator

---
 exec/fseditor.js | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/exec/fseditor.js b/exec/fseditor.js
index 4eb3e8fa52..02509c5c78 100644
--- a/exec/fseditor.js
+++ b/exec/fseditor.js
@@ -1180,7 +1180,9 @@ function draw_quote_window()
 	/* Draw seperater */
 	console.gotoxy(1,quote_sep_pos);
 	console.attributes=7;
-	console.write("\xc4\xc4\xb4 "+(quote_ontop?"^^^":"vvv")+" Quote "+(quote_ontop?"^^^":"vvv")+" \xc3\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4");
+	console.write(format("%.*s", console.screen_columns - 1, "\xc4\xc4\xb4 "+(quote_ontop?"^^^":"vvv")+" Quote "+(quote_ontop?"^^^":"vvv")
+		+" \xc3\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4"
+		+"\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4"));
 	for(i=0; i<quote_height; i++) {
 		draw_quote_line(quote_topline+i);
 	}
@@ -1783,7 +1785,7 @@ function edit(quote_first)
 				 * this was the first word on the line, or the one before the
 				 * word otherwise.  This puts the cursor on the previous word
 				 * if there is one and the next word if there isn't.  This
-				 * allows multiple ^W to keep deleteing words in all cases.
+				 * allows multiple ^W to keep deleting words in all cases.
 				 */
 				if(xpos) {
 					/* Delete space before the deleted word */
@@ -1906,9 +1908,10 @@ console.clear();
 var f=new File(input_filename);
 if(f.open("r",false)) {
 	ypos=0;
-	if(use_quotes)
-		quote_line=make_lines(quote_msg(word_wrap(f.read(),76)),'');
-	else
+	if(use_quotes) {
+		var quote_width = console.screen_columns - 4;
+		quote_line=make_lines(quote_msg(word_wrap(f.read(), quote_width), quote_width),'');
+	} else
 		line=make_lines(word_wrap(f.read()),'');
 	f.close();
 }
-- 
GitLab