public void ChangeLineEnding(TextEditor textEditor, LineEnding lineEnding) { if (lineEnding == textEditor.LineEnding) { return; } textEditor.LineEnding = lineEnding; MarkTextEditorSetNotSaved(textEditor); OnTextEditorLineEndingChanged?.Invoke(this, textEditor); }
private void EditorSettingsService_OnDefaultLineEndingChanged(object sender, LineEnding lineEnding) { if (Sets.Items == null) { return; } foreach (SetsViewItem setItem in Sets.Items) { if (!(setItem.Content is TextEditor textEditor)) { continue; } if (textEditor.EditingFile != null) { continue; } textEditor.LineEnding = lineEnding; OnTextEditorLineEndingChanged?.Invoke(this, textEditor); } }