diff --git a/docs/slyedit_readme.txt b/docs/slyedit_readme.txt index f17cb2c11515617625d3249f75e30eeec2e75e2a..376d4b8a345de657ea44e9dec09f933dc8d4fafb 100644 --- a/docs/slyedit_readme.txt +++ b/docs/slyedit_readme.txt @@ -1,6 +1,6 @@ SlyEdit message editor - Version 1.89 - Release date: 2024-04-30 + Version 1.89a + Release date: 2024-05-04 by @@ -934,6 +934,19 @@ message to lower-case and comparing them with the words in the dictionary. =================== Version Date Description ------- ---- ----------- +1.89a 2024-05-04 Don't line-wrap poll messages for quoting, as that could + mess up the formatting of the poll options. Also, a + minor fix for the 'to' name length in DCT mode when using + a wide terminal. +1.89 2024-04-30 Quote wrapping length: When re-wrapping quote lines, read + the editor configuration settings for "word-wrap quoted + text" as specified in xtrn.ini (settable in scfg) - Wrap + quote lines to the width specified there, or if not + specified, default to 79 columns. This is to help ensure + quoted text is a reasonable width for many terminals. The + wrapping logic is also called for prepending quoted text + with the quote prefix, so (for now) there needs to be a + default quote wrap width. 1.88c 2024-02-12 UTF-8 support in the displayed header and when quoting text and when quoting message text 1.88b 2024-02-11 Previous change reverted; now has "real" UTF-8 support. diff --git a/exec/SlyEdit.js b/exec/SlyEdit.js index 5412ef9610229a494da3b669bebecf4f00d36d6c..efba0f2d86aace5d963d0c707956e45e24adea20 100644 --- a/exec/SlyEdit.js +++ b/exec/SlyEdit.js @@ -69,6 +69,10 @@ * width for many terminals. The wrapping logic is also called for * prepending quoted text with the quote prefix, so (for now) * there needs to be a default quote wrap width. + * 2024-05-04 Eric Oulashin Version 1.89a + * Don't line-wrap poll messages for quoting, as that could mess + * up the formatting of the poll options. Also, a minor fix for + * the 'to' name length in DCT mode when using a wide terminal. */ "use strict"; @@ -159,8 +163,8 @@ if (console.screen_columns < 80) } // Version information -var EDITOR_VERSION = "1.89"; -var EDITOR_VER_DATE = "2024-04-30"; +var EDITOR_VERSION = "1.89a"; +var EDITOR_VER_DATE = "2024-05-04"; // Program variables @@ -3056,11 +3060,12 @@ function doQuoteSelection(pCurpos, pCurrentWordLength) gQuoteLinesIndex = 0; gQuoteLinesTopIndex = 0; - // If configured to do so, ensure the quote lines are wrapped according - // to the editor configuration, or by default to 79 columns + // If configured to do so, and the message is not a poll, ensure the + // quote lines are wrapped according to the editor configuration, or + // by default to 79 columns var maxQuoteLineLength = 79; setQuotePrefix(); - if (gConfigSettings.reWrapQuoteLines) + if (gConfigSettings.reWrapQuoteLines && !curMsgIsPoll(gMsgAreaInfo)) { // If the settings for the user's configured editor have quote wrapping // enabled with a number of columns, then use that number of columns. @@ -3079,6 +3084,12 @@ function doQuoteSelection(pCurpos, pCurrentWordLength) for (var i = 0; i < gQuoteLines.length; ++i) gQuoteLines[i] = quote_msg(gQuoteLines[i], maxQuoteLineWidth, gQuotePrefix); } + else + { + // Quote with the default quote prefix (no initials) + for (var i = 0; i < gQuoteLines.length; ++i) + gQuoteLines[i] = quote_msg(gQuoteLines[i], maxQuoteLineLength); + } } } diff --git a/exec/SlyEdit_DCTStuff.js b/exec/SlyEdit_DCTStuff.js index d1240a14f842faea0e5cbe5db1533460883d0894..9f038f4f2c31364ecd0f44051b985c958d9edded 100644 --- a/exec/SlyEdit_DCTStuff.js +++ b/exec/SlyEdit_DCTStuff.js @@ -175,6 +175,7 @@ function redrawScreen_DCTStyle(pEditLeft, pEditRight, pEditTop, pEditBottom, pEd var toNameLineNum = ++lineNum; console.gotoxy(1, lineNum); // To name + fieldWidth = Math.floor(console.screen_columns * (28/80)) - 2; console.print(randomTwoColorString(VERTICAL_SINGLE, gConfigSettings.DCTColors.TopBorderColor1, gConfigSettings.DCTColors.TopBorderColor2) + " " + gConfigSettings.DCTColors.TopLabelColor + "To " + diff --git a/exec/SlyEdit_Misc.js b/exec/SlyEdit_Misc.js index eac6ac03df69e9b9c2bd7152ad374dd9a1095710..8a032b84101149116c10286fe802e2a99e9fb08d 100644 --- a/exec/SlyEdit_Misc.js +++ b/exec/SlyEdit_Misc.js @@ -3385,6 +3385,51 @@ function getFromNameForCurMsg(pMsgInfo) return fromName; } +// Returns whether the current message being replied to is a poll. +// Only for use when replying to a message in a public sub-board. +// The message information is retrieved from DDML_SyncSMBInfo.txt +// in the node dir if it exists or from the bbs object's properties. +// On error, the string returned will be blank. +// +// Parameters: +// pMsgInfo: Optional: An object returned by getCurMsgInfo(). If this +// parameter is not specified, this function will call +// getCurMsgInfo() to get it. +// +// Return value: Whether or not the message being replied to is a poll +function curMsgIsPoll(pMsgInfo) +{ + if (typeof(MSG_TYPE_POLL) == "undefined") + return false; + + var msgIsPoll = false; + + // Get the information about the current message from + // DDML_SyncSMBInfo.txt in the node dir if it exists or from + // the bbs object's properties. Then open the message header + // and get the 'from' name from it. + var msgInfo = null; + if ((pMsgInfo != null) && (typeof(pMsgInfo) != "undefined")) + msgInfo = pMsgInfo; + else + msgInfo = getCurMsgInfo(); + + if (msgInfo.subBoardCode.length > 0) + { + var msgBase = new MsgBase(msgInfo.subBoardCode); + if (msgBase != null) + { + msgBase.open(); + var hdr = msgBase.get_msg_header(msgInfo.msgNumIsOffset, msgInfo.curMsgNum, true); + if (hdr != null) + msgIsPoll = Boolean(hdr.type & MSG_TYPE_POLL); + msgBase.close(); + } + } + + return msgIsPoll; +} + // Calculates & returns a page number. // // Parameters: