diff --git a/SourceGen/AppSettings.cs b/SourceGen/AppSettings.cs index 00174f5..f9309d7 100644 --- a/SourceGen/AppSettings.cs +++ b/SourceGen/AppSettings.cs @@ -65,6 +65,7 @@ namespace SourceGen { public const string FMT_PSEUDO_OP_NAMES = "fmt-pseudo-op-names"; public const string FMT_CHAR_DELIM = "fmt-char-delim"; public const string FMT_STRING_DELIM = "fmt-string-delim"; + public const string FMT_LOCAL_VARIABLE_PREFIX = "fmt-local-variable-prefix"; public const string CLIP_LINE_FORMAT = "clip-line-format"; @@ -297,7 +298,8 @@ namespace SourceGen { /// Sets a string setting. /// /// Setting name. - /// Setting value. + /// Setting value. If the value is null, the setting will be + /// removed. public void SetString(string name, string value) { if (value == null) { mSettings.Remove(name); diff --git a/SourceGen/AsmGen/GenCommon.cs b/SourceGen/AsmGen/GenCommon.cs index 1fc9801..f8bb8b0 100644 --- a/SourceGen/AsmGen/GenCommon.cs +++ b/SourceGen/AsmGen/GenCommon.cs @@ -420,6 +420,8 @@ namespace SourceGen.AsmGen { // Not doing the delimiter patterns here, because what's in the config file is // intended for on-screen display, and hence likely to be unsuited for an assembler. + + // Ditto for the local variable prefix. } } } diff --git a/SourceGen/MainController.cs b/SourceGen/MainController.cs index 4683e2f..a71f5e4 100644 --- a/SourceGen/MainController.cs +++ b/SourceGen/MainController.cs @@ -435,11 +435,13 @@ namespace SourceGen { mFormatterConfig = new Formatter.FormatConfig(); AsmGen.GenCommon.ConfigureFormatterFromSettings(AppSettings.Global, ref mFormatterConfig); - //mFormatterConfig.mLocalVariableLablePrefix = "\u00a4"; // CURRENCY SIGN mFormatterConfig.mEndOfLineCommentDelimiter = ";"; mFormatterConfig.mFullLineCommentDelimiterBase = ";"; mFormatterConfig.mBoxLineCommentDelimiter = string.Empty; + mFormatterConfig.mLocalVariableLablePrefix = + settings.GetString(AppSettings.FMT_LOCAL_VARIABLE_PREFIX, string.Empty); + string chrDelCereal = settings.GetString(AppSettings.FMT_CHAR_DELIM, null); if (chrDelCereal != null) { mFormatterConfig.mCharDelimiters = diff --git a/SourceGen/WpfGui/EditAppSettings.xaml b/SourceGen/WpfGui/EditAppSettings.xaml index f313d27..543a499 100644 --- a/SourceGen/WpfGui/EditAppSettings.xaml +++ b/SourceGen/WpfGui/EditAppSettings.xaml @@ -556,13 +556,21 @@ limitations under the License. - + + + + + + diff --git a/SourceGen/WpfGui/EditAppSettings.xaml.cs b/SourceGen/WpfGui/EditAppSettings.xaml.cs index 090bf72..9ea72a5 100644 --- a/SourceGen/WpfGui/EditAppSettings.xaml.cs +++ b/SourceGen/WpfGui/EditAppSettings.xaml.cs @@ -832,6 +832,19 @@ namespace SourceGen.WpfGui { get { return sExpStyleItems; } } + public string LocalVarPrefix { + get { return mLocalVarPrefix; } + set { + if (mLocalVarPrefix != value) { + mLocalVarPrefix = value; + OnPropertyChanged(); + mSettings.SetString(AppSettings.FMT_LOCAL_VARIABLE_PREFIX, value); + IsDirty = true; + } + } + } + private string mLocalVarPrefix; + private void Loaded_DisplayFormat() { PopulateWidthDisamSettings(); @@ -844,6 +857,9 @@ namespace SourceGen.WpfGui { // No need to set this to anything specific. displayFmtQuickComboBox.SelectedIndex = 0; + + LocalVarPrefix = mSettings.GetString(AppSettings.FMT_LOCAL_VARIABLE_PREFIX, + string.Empty); } /// @@ -932,12 +948,14 @@ namespace SourceGen.WpfGui { formatConfig.mForceAbsOperandPrefix, formatConfig.mForceLongOperandPrefix); SelectExpressionStyle(formatConfig.mExpressionMode); + LocalVarPrefix = formatConfig.mLocalVariableLablePrefix; // dirty flag set by change watchers if one or more fields have changed } private void QuickFmtDefaultButton_Click(object sender, RoutedEventArgs e) { SetWidthDisamSettings(null, "l", "a:", "f:"); SelectExpressionStyle(ExpressionMode.Common); + LocalVarPrefix = string.Empty; // dirty flag set by change watchers if one or more fields have changed }