Skip to content

Commit

Permalink
! Refactor constructor of SyntaxStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
wmjordan committed Aug 29, 2024
1 parent 487fc65 commit f04dfe0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Codist/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ public void SaveConfig(string path, bool stylesOnly = false) {
IEnumerable<SyntaxStyle> GetCustomizedStyles() {
return FormatStore.GetStyles()
.Where(i => i.Value?.IsSet == true)
.Select(i => { var s = new SyntaxStyle(i.Key); i.Value.CopyTo(s); return s; });
.Select(i => new SyntaxStyle(i.Key, i.Value));
}
}

Expand Down
3 changes: 3 additions & 0 deletions Codist/SyntaxHighlight/StyleBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,9 @@ public SyntaxStyle(string classificationType) {
Key = classificationType;
Category = "General";
}
public SyntaxStyle(string classificationType, StyleBase baseStyle) : this(classificationType) {
baseStyle.CopyTo(baseStyle);
}
}

abstract class StyleBase<TStyle> : StyleBase where TStyle : Enum
Expand Down

0 comments on commit f04dfe0

Please sign in to comment.