1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-05-31 20:33:38 +02:00

formattedstring fixes

This commit is contained in:
Ellpeck 2019-09-06 18:10:11 +02:00
parent 6d236fa52c
commit 7d9da6c519

View file

@ -11,15 +11,16 @@ namespace MLEM.Formatting {
public string Value {
get => this.value;
set {
if (this.value != value) {
this.value = value;
var val = value ?? string.Empty;
if (this.value != val) {
this.value = val;
this.isDirty = true;
}
}
}
private Dictionary<int, FormattingCode> codeLocations;
private string textWithoutFormatting;
private bool isDirty;
private bool isDirty = true;
public FormattedString(string s = null) {
this.Value = s;
@ -32,8 +33,8 @@ namespace MLEM.Formatting {
private void CheckDirtyState() {
if (this.isDirty) {
this.isDirty = false;
this.codeLocations = this.value.GetFormattingCodes();
this.textWithoutFormatting = this.value.RemoveFormatting();
this.codeLocations = this.Value.GetFormattingCodes();
this.textWithoutFormatting = this.Value.RemoveFormatting();
}
}