mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
make sure file contents are in CRLF
This commit is contained in:
parent
14ee7015e6
commit
4d9c647edb
@ -133,10 +133,13 @@ namespace Bloxstrap.UI.Elements.Editor
|
||||
{
|
||||
CustomBootstrapperSchema.ParseSchema();
|
||||
|
||||
string themeContents = File.ReadAllText(Path.Combine(Paths.CustomThemes, name, "Theme.xml"));
|
||||
themeContents = ToCRLF(themeContents); // make sure the theme is in CRLF. a function expects CRLF.
|
||||
|
||||
var viewModel = new BootstrapperEditorWindowViewModel();
|
||||
viewModel.Name = name;
|
||||
viewModel.Title = $"Editing \"{name}\"";
|
||||
viewModel.Code = File.ReadAllText(Path.Combine(Paths.CustomThemes, name, "Theme.xml"));
|
||||
viewModel.Code = themeContents;
|
||||
|
||||
DataContext = viewModel;
|
||||
InitializeComponent();
|
||||
@ -145,6 +148,11 @@ namespace Bloxstrap.UI.Elements.Editor
|
||||
UIXML.TextArea.TextEntered += OnTextAreaTextEntered;
|
||||
}
|
||||
|
||||
private static string ToCRLF(string text)
|
||||
{
|
||||
return text.Replace("\r\n", "\n").Replace("\r", "\n").Replace("\n", "\r\n");
|
||||
}
|
||||
|
||||
private void OnCodeChanged(object sender, EventArgs e)
|
||||
{
|
||||
BootstrapperEditorWindowViewModel viewModel = (BootstrapperEditorWindowViewModel)DataContext;
|
||||
|
Loading…
Reference in New Issue
Block a user