diff --git a/common/string_utils.cpp b/common/string_utils.cpp index 27593d4d4c..6fdcc344f1 100644 --- a/common/string_utils.cpp +++ b/common/string_utils.cpp @@ -142,7 +142,15 @@ bool ConvertSmartQuotesAndDashes( wxString* aString ) wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext ) { - wxString converted; + wxString converted; + std::vector braceStack; // true == formatting construct + + auto hasFormattingPrefix = + [&]() + { + static wxString prefixes = wxT( "~_^" ); + return !converted.IsEmpty() && prefixes.Find( converted.Last() ) >= 0; + }; converted.reserve( aSource.length() ); @@ -159,7 +167,7 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext ) } else if( aContext == CTX_LIBID ) { - if( c == '{' ) + if( c == '{' && !hasFormattingPrefix() ) converted += "{brace}"; else if( c == '/' ) converted += "{slash}"; @@ -238,7 +246,9 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext ) converted += c; } else + { converted += c; + } } return converted; diff --git a/eeschema/dialogs/dialog_lib_symbol_properties.cpp b/eeschema/dialogs/dialog_lib_symbol_properties.cpp index f4410236f0..38d17ede6e 100644 --- a/eeschema/dialogs/dialog_lib_symbol_properties.cpp +++ b/eeschema/dialogs/dialog_lib_symbol_properties.cpp @@ -446,7 +446,7 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::OnGridCellChanging( wxGridEvent& event ) void DIALOG_LIB_SYMBOL_PROPERTIES::OnSymbolNameText( wxCommandEvent& event ) { - if( !m_Parent->IsSymbolFromSchematic() ) + if( !m_Parent->IsSymbolFromSchematic() || m_OptionPower->IsChecked() ) m_grid->SetCellValue( VALUE_FIELD, FDC_VALUE, m_SymbolNameCtrl->GetValue() ); } diff --git a/eeschema/fields_grid_table.cpp b/eeschema/fields_grid_table.cpp index 0c0aaa767c..098a25d257 100644 --- a/eeschema/fields_grid_table.cpp +++ b/eeschema/fields_grid_table.cpp @@ -561,7 +561,7 @@ void FIELDS_GRID_TABLE::SetValue( int aRow, int aCol, const wxString &aValue value = fn.GetFullPath(); } } - else if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) && aRow == VALUE_FIELD ) + else if( m_parentType == SCH_SYMBOL_T && aRow == VALUE_FIELD ) { value = EscapeString( value, CTX_LIBID ); }