Skip to content

Instantly share code, notes, and snippets.

@sandyarmstrong
Created September 17, 2014 16:57
Show Gist options
  • Select an option

  • Save sandyarmstrong/11291466793314e59d34 to your computer and use it in GitHub Desktop.

Select an option

Save sandyarmstrong/11291466793314e59d34 to your computer and use it in GitHub Desktop.
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs
index d301d92..3990a45 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs
@@ -614,6 +614,11 @@ namespace MonoDevelop.SourceEditor
messageBubbleCache = null;
}
}
+
+ protected virtual string ProcessSaveText (string text)
+ {
+ return text;
+ }
public override void Save (string fileName)
{
@@ -694,7 +699,7 @@ namespace MonoDevelop.SourceEditor
try {
var writeEncoding = encoding;
var writeBom = hadBom;
- var writeText = Document.Text;
+ var writeText = ProcessSaveText (Document.Text);
if (writeEncoding == null) {
if (this.encoding != null) {
writeEncoding = this.encoding;
@@ -821,6 +826,11 @@ namespace MonoDevelop.SourceEditor
Load (fileName, loadEncoding);
}
+ protected virtual string ProcessLoadText (string text)
+ {
+ return text;
+ }
+
public void Load (string fileName, Encoding loadEncoding, bool reload = false)
{
// Handle the "reload" case.
@@ -848,6 +858,7 @@ namespace MonoDevelop.SourceEditor
encoding = loadEncoding;
text = TextFileUtility.ReadAllText (fileName, loadEncoding, out hadBom);
}
+ text = ProcessLoadText (text);
if (reload) {
Document.Replace (0, Document.TextLength, text);
Document.DiffTracker.Reset ();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment