Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandy Armstrong <sandy@xamarin.com>2019-01-25 18:05:34 +0300
committerSandy Armstrong <sandy@xamarin.com>2019-01-25 18:24:42 +0300
commit2325b5d4c5f79fcbe37acf617eb87e23c56a1684 (patch)
treef9c8fd4da08b7bbac6b26ef1602fd35ec7ac4bd9 /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor
parent4a92358ddf393435c36fb742aeecda2e45d9c238 (diff)
parent2e188887d8e5ee2901fd803d4374f0c0fb8ad69a (diff)
Merge remote-tracking branch 'origin/master' into pr-sandy-md-master
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor')
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InternalExtensionAPI/ITextEditorImpl.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/OSXEditor.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditor.cs18
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorViewContent.cs3
4 files changed, 26 insertions, 5 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InternalExtensionAPI/ITextEditorImpl.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InternalExtensionAPI/ITextEditorImpl.cs
index 5f484ca83c..f47accabf2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InternalExtensionAPI/ITextEditorImpl.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InternalExtensionAPI/ITextEditorImpl.cs
@@ -178,7 +178,9 @@ namespace MonoDevelop.Ide.Editor
string GetMarkup (int offset, int length, MarkupOptions options);
- IndentationTracker IndentationTracker { get; set; }
+ Task<string> GetMarkupAsync (int offset, int length, MarkupOptions options, CancellationToken cancellationToken);
+
+ IndentationTracker IndentationTracker { get; set; }
void SetSelectionSurroundingProvider (SelectionSurroundingProvider surroundingProvider);
void SetTextPasteHandler (TextPasteHandler textPasteHandler);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/OSXEditor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/OSXEditor.cs
index c16e62ebb9..2aff415590 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/OSXEditor.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/OSXEditor.cs
@@ -67,8 +67,10 @@ namespace MonoDevelop.Ide.Editor
var editorFont = Xwt.Drawing.Font.FromName(fontName);
var nsFont = NSFont.FromFontName(editorFont.Family, (nfloat)editorFont.Size);
- using (var lm = new NSLayoutManager())
- return lm.DefaultLineHeightForFont(nsFont);
+ if (nsFont == null)
+ return -1;
+ using (var lm = new NSLayoutManager ())
+ return lm.DefaultLineHeightForFont (nsFont);
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditor.cs
index 2a9c71bebd..65610dcf2f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditor.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditor.cs
@@ -1274,7 +1274,7 @@ namespace MonoDevelop.Ide.Editor
return GetMarkup (offset, length, new MarkupOptions (MarkupFormat.Pango, fitIdeStyle));
}
- [Obsolete ("Use GetMarkup")]
+ [Obsolete ("Use GetMarkupAsync")]
public string GetPangoMarkup (ISegment segment, bool fitIdeStyle = false)
{
if (segment == null)
@@ -1298,6 +1298,22 @@ namespace MonoDevelop.Ide.Editor
return textEditorImpl.GetMarkup (segment.Offset, segment.Length, options);
}
+ public Task<string> GetMarkupAsync (int offset, int length, MarkupOptions options, CancellationToken cancellationToken = default)
+ {
+ if (options == null)
+ throw new ArgumentNullException (nameof (options));
+ return textEditorImpl.GetMarkupAsync (offset, length, options, cancellationToken);
+ }
+
+ public Task<string> GetMarkupAsync (ISegment segment, MarkupOptions options, CancellationToken cancellationToken = default)
+ {
+ if (options == null)
+ throw new ArgumentNullException (nameof (options));
+ if (segment == null)
+ throw new ArgumentNullException (nameof (segment));
+ return textEditorImpl.GetMarkupAsync (segment.Offset, segment.Length, options, cancellationToken);
+ }
+
public static implicit operator Microsoft.CodeAnalysis.Text.SourceText (TextEditor editor)
{
return new MonoDevelopSourceText (editor);
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 3a58a3156f..b4a27fa0df 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorViewContent.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorViewContent.cs
@@ -85,7 +85,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);