From 7164d94513a43b0c5e77c8502e2a3f1173cf325f Mon Sep 17 00:00:00 2001 From: Eric Oulashin <nightfox@synchro.net> Date: Sat, 23 Jan 2021 22:47:17 -0800 Subject: [PATCH] [Issue 206] When using SlyEdit CTRL-Space on a MAC sends a 0x0 NUL character causing execution in the timeout logic With the addition of K_NUL (8b8ed215), this patch changes SlyEdit so that it no longer thinks a 0x0 is a timeout --- exec/SlyEdit.js | 15 ++++++++++----- exec/SlyEdit_Misc.js | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/exec/SlyEdit.js b/exec/SlyEdit.js index 244be2c279..d74a58b19a 100644 --- a/exec/SlyEdit.js +++ b/exec/SlyEdit.js @@ -123,6 +123,11 @@ * scrolling normally behaves in other apps. However, SlyEdit's * choice menu now is only used for the user settings * menu, where only 1 page of items is shown. + * 2021-01-23 Deon George Version 1.74 + * Making use of the new K_NUL and checking user input against null, + * SlyEdit no longer thinks a 0x0 (sent with CTRL-Space on a Mac) is + * a timeout. K_NUL was added on Jan. 21, 2021 by Rob Swindell: + * https://gitlab.synchro.net/main/sbbs/-/commit/8b8ed2159c31057764d260c0860335c85e33d6d8 */ /* Command-line arguments: @@ -219,8 +224,8 @@ if (console.screen_columns < 80) } // Constants -const EDITOR_VERSION = "1.73"; -const EDITOR_VER_DATE = "2020-03-31"; +const EDITOR_VERSION = "1.74"; +const EDITOR_VER_DATE = "2021-01-23"; // Program variables @@ -1084,7 +1089,7 @@ function doEditLoop() var continueOn = true; while (continueOn) { - userInput = getKeyWithESCChars(K_NOCRLF|K_NOSPIN, gConfigSettings); + userInput = getKeyWithESCChars(K_NOCRLF|K_NOSPIN|K_NUL, gConfigSettings) // If the cursor is at the end of the last line and the user // pressed the DEL key, then treat it as a backspace. Some @@ -1103,9 +1108,9 @@ function doEditLoop() returnCode = 1; // Aborted saveMessageToFile(); } - // If userInput is blank, then the input timeout was probably + // If userInput is null, then the input timeout was probably // reached, so abort. - else if (userInput == "") + else if (userInput == null) { returnCode = 1; // Aborted continueOn = false; diff --git a/exec/SlyEdit_Misc.js b/exec/SlyEdit_Misc.js index baec8e9105..0ebb38b6eb 100644 --- a/exec/SlyEdit_Misc.js +++ b/exec/SlyEdit_Misc.js @@ -178,7 +178,7 @@ var ESC_MENU_USER_SETTINGS = 12; var ESC_MENU_SPELL_CHECK = 13; -var COPYRIGHT_YEAR = 2020; +var COPYRIGHT_YEAR = 2021; // Store the full path & filename of the Digital Distortion Message // Lister, since it will be used more than once. -- GitLab