Browse Source

pcbnew: Replace CR inserted on macOS instead of LF when CTRL+Enter is pressed.

6.0.7
Michal Schulz 5 years ago
committed by Jeff Young
parent
commit
aed0352828
  1. 6
      pcbnew/dialogs/dialog_text_properties.cpp

6
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", "" );

Loading…
Cancel
Save