[mono/monodevelop] 2676ea46: Fixed 'Bug 15415 - Error when SAVING in mono develop'.

Mike Krüger ([email protected]) <[email protected]>
Newsgroups gmane.comp.gnome.mono.patches
Message-ID <00000141bf7ddd07-9af8daa7-9d13-40f5-9ecb-63d170dd873b-000000@email.amazonses.com>
   Branch: refs/heads/master
     Home: https://github.com/mono/monodevelop
  Compare: https://github.com/mono/monodevelop/compare/7884a57b9acb...2676ea464f28

   Commit: 2676ea464f282cea3c1cfb156c0951d6ad1f7c2d
   Author: Mike Krüger <[email protected]> (mkrueger)
     Date: 2013-10-16 04:18:19 GMT
      URL: https://github.com/mono/monodevelop/commit/2676ea464f282cea3c1cfb156c0951d6ad1f7c2d

Fixed 'Bug 15415 - Error when SAVING in mono develop'.

Changed paths:
  M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs

Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs
===================================================================
@@ -645,12 +645,16 @@ public void Save (string fileName, Encoding encoding)
 			}
 			
 			if (PropertyService.Get ("AutoFormatDocumentOnSave", false)) {
-				var formatter = CodeFormatterService.GetFormatter (Document.MimeType);
-				if (formatter != null && formatter.SupportsOnTheFlyFormatting) {
-					using (var undo = TextEditor.OpenUndoGroup ()) {
-						formatter.OnTheFlyFormat (WorkbenchWindow.Document, 0, Document.TextLength);
-						wasEdited = false;
+				try {
+					var formatter = CodeFormatterService.GetFormatter (Document.MimeType);
+					if (formatter != null && formatter.SupportsOnTheFlyFormatting) {
+						using (var undo = TextEditor.OpenUndoGroup ()) {
+							formatter.OnTheFlyFormat (WorkbenchWindow.Document, 0, Document.TextLength);
+							wasEdited = false;
+						}
 					}
+				} catch (Exception e) {
+					LoggingService.LogError ("Error while formatting on save", e);
 				}
 			}
 
_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.