static IEnumerable <SourceEditorView> EnumerateViewsWithIncorrectEolMarkers() { foreach (var doc in DocumentRegistry.OpenFiles) { if (DocumentRegistry.SkipView(doc)) { continue; } var view = doc.GetContent <SourceEditorView> (); if (view?.SourceEditorWidget == null || !view.SourceEditorWidget.HasIncorrectEolMarker) { continue; } yield return(view); } }
public static void UpdateEolMessages() { var multiple = HasMultipleIncorrectEolMarkers; foreach (var doc in DocumentRegistry.OpenFiles) { if (DocumentRegistry.SkipView(doc)) { continue; } var view = doc.GetContent <SourceEditorView> (); if (!view.SourceEditorWidget.HasIncorrectEolMarker) { continue; } view.SourceEditorWidget.UpdateEolMarkerMessage(multiple); } }
public static void ConvertLineEndingsInAllFiles() { DefaultSourceEditorOptions.Instance.LineEndingConversion = LineEndingConversion.ConvertAlways; foreach (var doc in DocumentRegistry.OpenFiles) { if (DocumentRegistry.SkipView(doc)) { continue; } var view = doc.GetContent <SourceEditorView> (); if (!view.SourceEditorWidget.HasIncorrectEolMarker) { continue; } view.SourceEditorWidget.ConvertLineEndings(); view.SourceEditorWidget.RemoveMessageBar(); view.WorkbenchWindow.ShowNotification = false; view.Save(); } }