From d707a037ad9b7f9ec35585412db7a4a8807ff8b5 Mon Sep 17 00:00:00 2001
From: Eric Oulashin <eric.oulashin@gmail.com>
Date: Fri, 30 Dec 2022 10:45:53 -0800
Subject: [PATCH] Simplified the reading of the quote wrap setting from
 xtrn.ini a bit

---
 xtrn/DDMsgReader/DDMsgReader.js | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/xtrn/DDMsgReader/DDMsgReader.js b/xtrn/DDMsgReader/DDMsgReader.js
index 13c9da00c5..f9127a3f3f 100644
--- a/xtrn/DDMsgReader/DDMsgReader.js
+++ b/xtrn/DDMsgReader/DDMsgReader.js
@@ -20240,12 +20240,9 @@ function getExternalEditorQuoteWrapCfgFromSCFG(pEditorCode)
 				var xtrnIniFile = new File(system.ctrl_dir + "xtrn.ini");
 				if (xtrnIniFile.open("r"))
 				{
-					var editorCfg = xtrnIniFile.iniGetObject("editor:" + pEditorCode.toUpperCase());
-					if (typeof(editorCfg) === "object" && editorCfg.hasOwnProperty("quotewrap_cols"))
-					{
-						if (editorCfg.quotewrap_cols > 0)
-							retObj.quoteWrapCols = editorCfg.quotewrap_cols;
-					}
+					var quoteWrapCols = xtrnIniFile.iniGetValue("editor:" + pEditorCode.toUpperCase(), "quotewrap_cols", console.screen_columns - 1);
+					if (quoteWrapCols > 0)
+						retObj.quoteWrapCols = quoteWrapCols;
 					xtrnIniFile.close();
 				}
 			}
-- 
GitLab