diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2015-02-27 20:07:41 +0300 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2015-02-27 20:07:41 +0300 |
commit | c0533578ad9c0b2ea1b88018cf481d01b9c2868a (patch) | |
tree | 2797c88eba7e5a3ecea7c5c5993c0f332b1d388c /main/src/addins/MonoDevelop.SourceEditor2 | |
parent | 27c58923b89c9b2057a4ec6a7110bf8b3424873d (diff) |
Fixed 'Bug 27462 - MD keeps asking about newline character
conversion'.
Diffstat (limited to 'main/src/addins/MonoDevelop.SourceEditor2')
-rw-r--r-- | main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/FileRegistry.cs | 3 | ||||
-rw-r--r-- | main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs | 52 |
2 files changed, 21 insertions, 34 deletions
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/FileRegistry.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/FileRegistry.cs index e6f7e0a66d..b6e97bb633 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/FileRegistry.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/FileRegistry.cs @@ -192,6 +192,7 @@ namespace MonoDevelop.SourceEditor public static void ConvertLineEndingsInAllFiles () { + DefaultSourceEditorOptions.Instance.LineEndingConversion = LineEndingConversion.ConvertAlways; foreach (var view in openFiles) { if (SkipView (view) || !view.SourceEditorWidget.HasIncorrectEolMarker) continue; @@ -205,6 +206,8 @@ namespace MonoDevelop.SourceEditor public static void IgnoreLineEndingsInAllFiles () { + DefaultSourceEditorOptions.Instance.LineEndingConversion = LineEndingConversion.LeaveAsIs; + foreach (var view in openFiles) { if (SkipView (view) || !view.SourceEditorWidget.HasIncorrectEolMarker) continue; diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs index 1bbece011a..4227e4653c 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs @@ -996,11 +996,9 @@ namespace MonoDevelop.SourceEditor var list = new List<string> (); list.Add (string.Format ("Convert to {0} line endings", GetEolString (textEditor.Options.DefaultEolMarker))); - if (multiple) - list.Add (string.Format ("Convert all files to {0} line endings", GetEolString (textEditor.Options.DefaultEolMarker))); + list.Add (string.Format ("Convert all files to {0} line endings", GetEolString (textEditor.Options.DefaultEolMarker))); list.Add (string.Format ("Keep {0} line endings", GetEolString (DetectedEolMarker))); - if (multiple) - list.Add (string.Format ("Keep {0} line endings in all files", GetEolString (DetectedEolMarker))); + list.Add (string.Format ("Keep {0} line endings in all files", GetEolString (DetectedEolMarker))); var combo = new ComboBox (list.ToArray ()); combo.Active = 0; hbox.PackEnd (combo, false, false, 0); @@ -1024,36 +1022,22 @@ namespace MonoDevelop.SourceEditor RemoveMessageBar (); }; okButton.Clicked += delegate { - if (multiple) { - switch (combo.Active) { - case 0: - ConvertLineEndings (); - view.WorkbenchWindow.ShowNotification = false; - view.Save (fileName, view.SourceEncoding); - break; - case 1: - FileRegistry.ConvertLineEndingsInAllFiles (); - break; - case 2: - UseIncorrectMarkers = true; - view.WorkbenchWindow.ShowNotification = false; - break; - case 3: - FileRegistry.IgnoreLineEndingsInAllFiles (); - break; - } - } else { - switch (combo.Active) { - case 0: - ConvertLineEndings (); - view.WorkbenchWindow.ShowNotification = false; - view.Save (fileName, view.SourceEncoding); - break; - case 1: - UseIncorrectMarkers = true; - view.WorkbenchWindow.ShowNotification = false; - break; - } + switch (combo.Active) { + case 0: + ConvertLineEndings (); + view.WorkbenchWindow.ShowNotification = false; + view.Save (fileName, view.SourceEncoding); + break; + case 1: + FileRegistry.ConvertLineEndingsInAllFiles (); + break; + case 2: + UseIncorrectMarkers = true; + view.WorkbenchWindow.ShowNotification = false; + break; + case 3: + FileRegistry.IgnoreLineEndingsInAllFiles (); + break; } RemoveMessageBar (); }; |