[mono/monodevelop] b5d4ff0e: Fixed 'Bug 15149 - Source analysis should not underline whitespace at
| Newsgroups | gmane.comp.gnome.mono.patches |
|---|---|
| Message-ID | <000001418245e0a0-9d7d2e05-c14a-41fb-b5f4-8ee14b84800c-000000@email.amazonses.com> |
Branch: refs/heads/master
Home: https://github.com/mono/monodevelop
Compare: https://github.com/mono/monodevelop/compare/509a5109bbb8...b5d4ff0ee268
Commit: b5d4ff0ee268ce762d4aec29a320c3ef1b400847
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-04 07:00:47 GMT
URL: https://github.com/mono/monodevelop/commit/b5d4ff0ee268ce762d4aec29a320c3ef1b400847
Fixed 'Bug 15149 - Source analysis should not underline whitespace at
start of line'.
Changed paths:
M main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultMarker.cs
Modified: main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultMarker.cs
===================================================================
@@ -100,12 +100,21 @@ public override void Draw (TextEditor editor, Cairo.Context cr, Pango.Layout lay
double drawTo;
if (markerStart < startOffset && endOffset < markerEnd) {
- drawFrom = startXPos;
drawTo = endXPos;
+ var line = editor.GetLineByOffset (startOffset);
+ int offset = line.GetIndentation (editor.Document).Length;
+ drawFrom = startXPos + (layout.IndexToPos (offset).X / Pango.Scale.PangoScale);
} else {
- int start = startOffset < markerStart ? markerStart : startOffset;
+ int start;
+ if (startOffset < markerStart) {
+ start = markerStart;
+ } else {
+ var line = editor.GetLineByOffset (startOffset);
+ int offset = line.GetIndentation (editor.Document).Length;
+ start = startOffset + offset;
+ }
int end = endOffset < markerEnd ? endOffset : markerEnd;
- int /*lineNr,*/ x_pos;
+ int x_pos;
x_pos = layout.IndexToPos (start - startOffset).X;
drawFrom = startXPos + (int)(x_pos / Pango.Scale.PangoScale);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches