Skip to content
Snippets Groups Projects
Commit 0b173db9 authored by Eric Oulashin's avatar Eric Oulashin Committed by Rob Swindell
Browse files

SlyEdit: Don't line-wrap poll messages for quoting. Also, minor fix for the...

SlyEdit: Don't line-wrap poll messages for quoting. Also, minor fix for the 'to' name length in DCT mode.
parent f8f85f1e
No related branches found
No related tags found
2 merge requests!455Update branch with changes from master,!435SlyEdit: Don't line-wrap poll messages for quoting. Also, minor fix for the 'to' name length in DCT mode.
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.
......
......@@ -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);
}
}
}
......
......@@ -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 " +
......
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment