From ade8a87a3fed650d0630d9be803cea95ceab98df Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Wed, 30 Nov 2022 10:17:28 +0100 Subject: [PATCH] fullscreen message: use \n to force the next word on the next line Useful for printing short URLs since those contain punctuation characters, which get treated at the end of a word under usual circumstances --- Firmware/ultralcd.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index d2589aef8..6549cc3e5 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -3135,6 +3135,11 @@ static const char* lcd_display_message_fullscreen_nonBlocking_P(const char *msg, char c = char(pgm_read_byte(msg)); if (c == '~') c = ' '; + else if (c == '\n') { + // Abort early if '\n' is encontered. + // This character is used to force the following words to be printed on the next line. + break; + } lcd_print(c); } }