Exemple #1
0
 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);
     }
 }
Exemple #2
0
        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);
            }
        }
Exemple #3
0
        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();
            }
        }