diff options
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextMarkerFactory.cs')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextMarkerFactory.cs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextMarkerFactory.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextMarkerFactory.cs index 999d5a2a49..469e9e2b1f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextMarkerFactory.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextMarkerFactory.cs @@ -109,10 +109,18 @@ namespace MonoDevelop.Ide.Editor { int offset = editor.LocationToOffset (info.Region.BeginLine, info.Region.BeginColumn); int endOffset = editor.LocationToOffset (info.Region.EndLine, info.Region.EndColumn); - if (endOffset < offset) { + if (endOffset <= offset) { endOffset = offset + 1; - while (endOffset < editor.Length && IsIdentifierPart (editor.GetCharAt (endOffset))) + while (endOffset < editor.Length && IsIdentifierPart (editor.GetCharAt (endOffset))) { endOffset++; + } + if (endOffset == offset + 1) { + var c = editor.GetCharAt (endOffset - 1); + while ((c == '\n' || c == '\r') && endOffset < editor.Length) { + c = editor.GetCharAt (endOffset); + endOffset++; + } + } } return editor.TextMarkerFactory.CreateErrorMarker (editor, info, offset, endOffset - offset); } |