diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/TextView.cs b/ICSharpCode.TextEditorLinux/Src/Gui/TextView.cs index c631eb41c..cdf21d4cd 100644 --- a/ICSharpCode.TextEditorLinux/Src/Gui/TextView.cs +++ b/ICSharpCode.TextEditorLinux/Src/Gui/TextView.cs @@ -778,9 +778,10 @@ namespace ICSharpCode.TextEditor public int GetVisualColumn(int logicalLine, int logicalColumn) { int column = 0; - using (Graphics g = textArea.CreateGraphics()) { - CountColumns(ref column, 0, logicalColumn, logicalLine, g); - } + if (TextArea.Document.TextContent.Length > 0) //fix crush under linux after clear document content - no content = zero columns + using (Graphics g = textArea.CreateGraphics()) { + CountColumns(ref column, 0, logicalColumn, logicalLine, g); + } return column; } diff --git a/TreeConverter/NetWrappers/AssemblyResolveScope.cs b/TreeConverter/NetWrappers/AssemblyResolveScope.cs index 972fcadb5..6148b51b9 100644 --- a/TreeConverter/NetWrappers/AssemblyResolveScope.cs +++ b/TreeConverter/NetWrappers/AssemblyResolveScope.cs @@ -146,6 +146,8 @@ namespace PascalABCCompiler.NetHelper private Assembly OnAssemblyResolve(object obj, ResolveEventArgs args) { + if (args.RequestingAssembly == null) //fix Linux/Mono IDE missworking after loading a huge pas source such as GraphABC.pas or GraphABCHelper.pas + return null; var requestedName = new AssemblyName(args.Name); if (_assembliesByName.TryGetValue(requestedName.Name, out var assembly)) return assembly; @@ -177,4 +179,4 @@ namespace PascalABCCompiler.NetHelper return null; } } -} \ No newline at end of file +}