[Monodevelop-patches-list] r1474 - trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Sat Apr 17 03:04:42 EDT 2004
Author: tberman
Date: 2004-04-17 03:04:41 -0400 (Sat, 17 Apr 2004)
New Revision: 1474
Modified:
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorBuffer.cs
Log:
i dunno if this approach will work, the line numbers are sometimes one off...
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorBuffer.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorBuffer.cs 2004-04-17 01:05:58 UTC (rev 1473)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorBuffer.cs 2004-04-17 07:04:41 UTC (rev 1474)
@@ -12,6 +12,7 @@
using System;
using System.IO;
+using System.Collections;
using System.Runtime.InteropServices;
namespace MonoDevelop.SourceEditor.Gui
@@ -101,8 +102,8 @@
complete_end = CreateMark (null, StartIter, true);
//ps.ParseInformationChanged += new ParseInformationEventHandler (parseChanged);
}
- int[] point = new int [2];
-
+
+ ArrayList points = new ArrayList ();
public void parseChanged (object o, ParseInformationEventArgs e)
{
if (view != null) {
@@ -113,10 +114,12 @@
string[] pieces = error.Split (' ');
if (pieces.Length == 1) continue;
Console.WriteLine ("line: {0} col: {1}", pieces[2], pieces[4]);
+ int[] point = new int[2];
point[0] = Convert.ToInt32 (pieces[2]) - 1;
point[1] = Convert.ToInt32 (pieces[4]);
- GLib.Idle.Add (new GLib.IdleHandler (addMarkup));
+ points.Add (point);
}
+ GLib.Idle.Add (new GLib.IdleHandler (addMarkup));
}
else {
//Clear errors
@@ -127,18 +130,17 @@
bool addMarkup ()
{
- if (point[0] == 0 && point[1] == 0)
- return false;
-
- Console.WriteLine ("line: {0} col: {1}", point[0], point[1]);
- TextIter start = GetIterAtLine (point[0]);
- start.LineOffset = point[1];
- Console.WriteLine (start.Char);
- TextIter end = start;
- end.ForwardToLineEnd ();
- ApplyTag (compilation_error, start, end);
- point[0] = 0;
- point[1] = 0;
+ foreach (int[] point in points) {
+ Console.WriteLine ("line: {0} col: {1}", point[0], point[1]);
+ TextIter start = GetIterAtLine (point[0]);
+ Console.WriteLine (start.Line);
+ //start.LineOffset = point[1] - 1;
+ Console.WriteLine (start.Line);
+ TextIter end = start;
+ end.ForwardToLineEnd ();
+ ApplyTag (compilation_error, start, end);
+ }
+ points.Clear ();
return false;
}
More information about the Monodevelop-patches-list
mailing list