diff options
author | David KarlasĖ <david.karlas@gmail.com> | 2019-11-07 15:03:40 +0300 |
---|---|---|
committer | monojenkins <jo.shields+jenkins@xamarin.com> | 2019-11-08 00:43:27 +0300 |
commit | cf3e82f84a09dd2039ec4e33f13de483c668fa50 (patch) | |
tree | 2e5f70b7eaf25d0c2659fa369912b183a04f4da9 /main | |
parent | 80be4a07b5212ba22204b2c360f939bfcc5f3033 (diff) |
Switch from `string` to `TextReader` overload
This is needed because only `TextReader` overload is loading new WhitespaceManager
Diffstat (limited to 'main')
-rw-r--r-- | main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/Document/TextDocument.cs | 2 | ||||
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Documents/TextBufferFileModel.cs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/Document/TextDocument.cs b/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/Document/TextDocument.cs index 9351121911..98c9ce593e 100644 --- a/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/Document/TextDocument.cs +++ b/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/Document/TextDocument.cs @@ -343,7 +343,7 @@ namespace Mono.TextEditor this.mimeType = mimeType;
var doc = PlatformCatalog.Instance.TextDocumentFactoryService.CreateTextDocument (
PlatformCatalog.Instance.TextBufferFactoryService.CreateTextBuffer (
- text ?? string.Empty,
+ new StringReader(text ?? string.Empty), GetContentTypeFromMimeType (fileName, mimeType)
),
fileName ?? string.Empty
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Documents/TextBufferFileModel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Documents/TextBufferFileModel.cs index 2941b70049..f2e496e342 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Documents/TextBufferFileModel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Documents/TextBufferFileModel.cs @@ -80,7 +80,7 @@ namespace MonoDevelop.Ide.Gui.Documents ThawChangeEvent (); } } else { - var buffer = PlatformCatalog.Instance.TextBufferFactoryService.CreateTextBuffer (text.Text, contentType); + var buffer = PlatformCatalog.Instance.TextBufferFactoryService.CreateTextBuffer (new System.IO.StringReader (text.Text), contentType); var doc = PlatformCatalog.Instance.TextDocumentFactoryService.CreateTextDocument (buffer, FilePath); doc.Encoding = text.Encoding; SetTextDocument (doc); |