From aed0352828336b77a4a93a5e502821f6fa289dd6 Mon Sep 17 00:00:00 2001 From: Michal Schulz Date: Tue, 15 Jun 2021 12:20:52 +0000 Subject: [PATCH] pcbnew: Replace CR inserted on macOS instead of LF when CTRL+Enter is pressed. --- pcbnew/dialogs/dialog_text_properties.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pcbnew/dialogs/dialog_text_properties.cpp b/pcbnew/dialogs/dialog_text_properties.cpp index 3195fcebcb..adaa0a1b0f 100644 --- a/pcbnew/dialogs/dialog_text_properties.cpp +++ b/pcbnew/dialogs/dialog_text_properties.cpp @@ -359,7 +359,11 @@ bool DIALOG_TEXT_PROPERTIES::TransferDataFromWindow() BOARD* board = m_Parent->GetBoard(); wxString txt = board->ConvertCrossReferencesToKIIDs( m_MultiLineText->GetValue() ); -#ifdef __WINDOWS__ +#ifdef __WXMAC__ + // On macOS CTRL+Enter produces '\r' instead of '\n' regardless of EOL setting. + // Replace it now. + txt.Replace( "\r", "\n" ); +#elif defined(__WINDOWS__) // On Windows, a new line is coded as \r\n. We use only \n in kicad files and in // drawing routines so strip the \r char. txt.Replace( "\r", "" );