diff --git a/exec/SlyEdit.js b/exec/SlyEdit.js index 2d9874ee6ae8109969b69745f1c5729b04675f5c..0bc3285461f423a163d9e2603680b495438e4113 100644 --- a/exec/SlyEdit.js +++ b/exec/SlyEdit.js @@ -32,6 +32,12 @@ * Updated the cross-post selection box to use the * PageUp & PageDown keys for paging instead of P * and N. + * 2015-01-11 Eric Oulashin Version 1.43 Beta + * Bug fixes in wrapTextLines() in SlyEdit_Misc: + * No more extra blank lines added to quote lines, + * and no more leading spaces added to quote lines. + * 2015-11-16 Eric Oulashin Version 1.43 + * Releasing this version after several days of testing. */ /* Command-line arguments: @@ -109,8 +115,8 @@ if (!console.term_supports(USER_ANSI)) } // Constants -const EDITOR_VERSION = "1.42"; -const EDITOR_VER_DATE = "2014-11-15"; +const EDITOR_VERSION = "1.43"; +const EDITOR_VER_DATE = "2015-01-16"; // Program variables diff --git a/exec/SlyEdit_IceStuff.js b/exec/SlyEdit_IceStuff.js index 7ef827193dba9358882b769dc4c9728fb5b417f8..e9210afbc84fd3f6f6a62a1b76fc4f9c561fd534 100644 --- a/exec/SlyEdit_IceStuff.js +++ b/exec/SlyEdit_IceStuff.js @@ -399,7 +399,7 @@ function DisplayBottomHelpLine_IceStyle(pLineNum, pUsingQuotes) // This line contains the copyright mesage & ESC key help var screenText = iceText(EDITOR_PROGRAM_NAME + " v", "w") + "ch" + EDITOR_VERSION.toString() + " " - + iceText("Copyright", "w") + " ch2014 " + + iceText("Copyright", "w") + " ch2015 " + iceText("Eric Oulashin", "w") + " nb" + DOT_CHAR + " " + iceText("Press ESCape For Help", "w"); // Calculate the starting position to center the help text, and front-pad diff --git a/exec/SlyEdit_Misc.js b/exec/SlyEdit_Misc.js index ade4bf7b1471159bc3e18539d7e4ee2002dca181..ac57032fe338926c231a5e437d1e57574649103c 100644 --- a/exec/SlyEdit_Misc.js +++ b/exec/SlyEdit_Misc.js @@ -34,6 +34,16 @@ * whole sections of quote lines that start with * several spaces. Also made a similar update to * wrapQuoteLines_NoAuthorInitials(). + * 2015-11-11 Eric Oulashin Bug fix in wrapTextLines(): After wrapping a line + * of text, there was a section of code that would + * check to see if the next line is blank and add + * another line if so, which was causing an extra + * blank line to be added in some situations where + * that shouldn't happen. Seems to be fixed after + * an update. Also, made another bug fix in that + * function where sometimes a leading space would + * be added to wrapped text on a new line. That + * seems to be fixed as well. */ // Note: These variables are declared with "var" instead of "const" to avoid @@ -2352,9 +2362,16 @@ function wrapTextLines(pLineArr, pStartLineIndex, pEndIndex, pLineWidth, pIdxesR pLineArr[i] = pLineArr[i].substr(0, trimIndex); if (i < pLineArr.length - 1) { + // Append a space to the end of the trimmed text if it doesn't have one. + if ((trimmedText.length > 0) && (trimmedText.charAt(trimmedText.length-1) != " ")) + trimmedText += " " + // 2015-01-11: The following commented-out code is older - It has a bug + // that would sometmies cause an extra empty line to be inserted. + /* // If the next line is blank, then append another blank // line there to preserve the message's formatting. - if (pLineArr[i+1].length == 0) + //if (pLineArr[i+1].length == 0) + if (false) // For testing, to see if the above check really isn't necessary { pLineArr.splice(i+1, 0, ""); // If the current line index is before the specified end index, then @@ -2370,9 +2387,10 @@ function wrapTextLines(pLineArr, pStartLineIndex, pEndIndex, pLineWidth, pIdxesR { // Since the next line is not blank, then append a space // to the end of the trimmed text if it doesn't have one. - if (trimmedText.charAt(trimmedText.length-1) != " ") + if ((trimmedText.length > 0) && (trimmedText.charAt(trimmedText.length-1) != " ")) trimmedText += " " } + */ // Prepend the trimmed text to the next line. If the next line's index // is within the paragraph we're wrapping, then go ahead and prepend the // text to the next line. Otherwise, add a new line to the array and @@ -2398,6 +2416,9 @@ function wrapTextLines(pLineArr, pStartLineIndex, pEndIndex, pLineWidth, pIdxesR } else { + // New on 2015-01-11 + // Remove any leading spaces + // End new on 2015-01-11 pLineArr.push(trimmedText); // If the current line index is before the specified end index, then // increment the end index since we've added a line in order to continue