From 34e630438b2598907baad80fb23e5f400d2f4374 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 10 Feb 2022 12:01:07 -0800 Subject: [PATCH] Use a constant to make code clearer Signed-off-by: Jesse Vincent --- .../src/kaleidoscope/plugin/FocusSerial.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.cpp b/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.cpp index 91a505d4..071183a1 100644 --- a/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.cpp +++ b/plugins/Kaleidoscope-FocusSerial/src/kaleidoscope/plugin/FocusSerial.cpp @@ -40,7 +40,9 @@ EventHandlerResult FocusSerial::afterEachCycle() { if (Runtime.serialPort().peek() == '\n') break; } while (command_[i - 1] != ' ' && i < 32); - if (command_[i - 1] == ' ') + + // If this was a command with a space-delimited payload, strip the space delimiter off + if (command_[i - 1] == SEPARATOR ) command_[i - 1] = '\0'; Runtime.onFocusEvent(command_);