diff options
author | Mike Krüger <mikkrg@microsoft.com> | 2019-01-18 17:28:51 +0300 |
---|---|---|
committer | Mike Krüger <mikkrg@microsoft.com> | 2019-01-18 17:28:51 +0300 |
commit | 8f5e563846e219e6d2e4b16525d4462aff07c9cc (patch) | |
tree | 00603b64e35d5a38924b813c4f7039325d736a6b /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor | |
parent | 8dd0b49e3cc6b07d35f3928485f60134d01fd955 (diff) |
Fixes VSTS Bug 770920: NRE in TextDocument.Rename
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/770920
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorViewContent.cs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorViewContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorViewContent.cs index 4f212b29e4..389906e2f0 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorViewContent.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorViewContent.cs @@ -83,7 +83,8 @@ namespace MonoDevelop.Ide.Editor base.OnContentNameChanged (); if (ContentName != textEditorImpl.ContentName && !string.IsNullOrEmpty (textEditorImpl.ContentName)) AutoSave.RemoveAutoSaveFile (textEditorImpl.ContentName); - textEditor.FileName = ContentName; + if (ContentName != null) // Happens when a file is converted to an untitled file, but even in that case the text editor should be associated with the old location, otherwise typing can be messed up due to change of .editconfig settings etc. + textEditor.FileName = ContentName; if (this.WorkbenchWindow?.Document != null) textEditor.InitializeExtensionChain (this.WorkbenchWindow.Document); UpdateTextEditorOptions (null, null); |