1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
|
//
// SearchResultWidget.cs
//
// Author:
// Mike Krüger <mkrueger@novell.com>
//
// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Linq;
using Gtk;
using Mono.TextEditor;
using MonoDevelop.Ide.Gui;
using Mono.TextEditor.Highlighting;
using System.Collections.Generic;
using MonoDevelop.Core;
using MonoDevelop.Core.Gui;
using System.Text;
using MonoDevelop.Components.Commands;
using MonoDevelop.Ide.Commands;
using System.IO;
namespace MonoDevelop.Ide.FindInFiles
{
[System.ComponentModel.ToolboxItem(true)]
public partial class SearchResultWidget : Gtk.Bin
{
ListStore store;
ToolButton buttonStop;
ToggleToolButton buttonPin;
const int SearchResultColumn = 0;
const int DidReadColumn = 1;
public string BasePath {
get;
set;
}
public IAsyncOperation AsyncOperation {
get;
set;
}
public bool AllowReuse {
get {
return !buttonStop.Sensitive && !buttonPin.Active;
}
}
public SearchResultWidget ()
{
this.Build ();
store = new ListStore (typeof (SearchResult),
typeof (bool) // didRead
);
treeviewSearchResults.Model = store;
treeviewSearchResults.Selection.Mode = Gtk.SelectionMode.Multiple;
treeviewSearchResults.HeadersClickable = true;
treeviewSearchResults.PopupMenu += OnPopupMenu;
treeviewSearchResults.ButtonPressEvent += HandleButtonPressEvent;
treeviewSearchResults.RulesHint = true;
TreeViewColumn fileNameColumn = new TreeViewColumn ();
fileNameColumn.Resizable = true;
fileNameColumn.SortColumnId = 0;
fileNameColumn.Title = GettextCatalog.GetString ("File");
CellRendererPixbuf fileNamePixbufRenderer = new CellRendererPixbuf ();
fileNameColumn.PackStart (fileNamePixbufRenderer, false);
fileNameColumn.SetCellDataFunc (fileNamePixbufRenderer, new Gtk.TreeCellDataFunc (FileIconDataFunc));
CellRendererText fileNameRenderer = new CellRendererText ();
fileNameColumn.PackStart (fileNameRenderer, true);
fileNameColumn.SetCellDataFunc (fileNameRenderer, new Gtk.TreeCellDataFunc (FileNameDataFunc));
treeviewSearchResults.AppendColumn (fileNameColumn);
TreeViewColumn lineColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Line"), new Gtk.CellRendererText (), new Gtk.TreeCellDataFunc (ResultLineDataFunc));
lineColumn.SortColumnId = 1;
TreeViewColumn textColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Text"), new Gtk.CellRendererText (), new Gtk.TreeCellDataFunc (ResultTextDataFunc));
textColumn.SortColumnId = 2;
textColumn.Resizable = true;
TreeViewColumn pathColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Path"), new Gtk.CellRendererText (), new Gtk.TreeCellDataFunc (ResultPathDataFunc));
pathColumn.SortColumnId = 3;
pathColumn.Resizable = true;
store.SetSortFunc (0, new TreeIterCompareFunc (CompareFileNames));
store.SetSortFunc (1, new TreeIterCompareFunc (CompareLineNumbers));
store.SetSortFunc (3, new TreeIterCompareFunc (CompareFilePaths));
treeviewSearchResults.RowActivated += TreeviewSearchResultsRowActivated;
buttonStop = new ToolButton ("gtk-stop");
buttonStop.Sensitive = false;
buttonStop.Clicked += ButtonStopClicked;
buttonStop.TooltipText = GettextCatalog.GetString ("Stop");
toolbar.Insert (buttonStop, -1);
ToolButton buttonClear = new ToolButton ("gtk-clear");
buttonClear.Clicked += ButtonClearClicked;
buttonClear.TooltipText = GettextCatalog.GetString ("Clear results");
toolbar.Insert (buttonClear, -1);
ToggleToolButton buttonOutput = new ToggleToolButton (MonoDevelop.Core.Gui.Stock.OutputIcon);
buttonOutput.Clicked += ButtonOutputClicked;
buttonOutput.TooltipText = GettextCatalog.GetString ("Show output");
toolbar.Insert (buttonOutput, -1);
buttonPin = new ToggleToolButton ("md-pin-up");
buttonPin.Clicked += ButtonPinClicked;
buttonPin.TooltipText = GettextCatalog.GetString ("Pin results pad");
toolbar.Insert (buttonPin, -1);
store.SetSortColumnId (3, SortType.Ascending);
ShowAll ();
scrolledwindowLogView.Hide ();
}
void ButtonPinClicked (object sender, EventArgs e)
{
buttonPin.StockId = buttonPin.Active ? "md-pin-down" : "md-pin-up";
}
void ButtonOutputClicked (object sender, EventArgs e)
{
if (((ToggleToolButton)sender).Active) {
scrolledwindowLogView.Show ();
} else {
scrolledwindowLogView.Hide ();
}
}
void ButtonClearClicked (object sender, EventArgs e)
{
this.Reset ();
}
void ButtonStopClicked (object sender, EventArgs e)
{
if (AsyncOperation != null)
AsyncOperation.Cancel ();
}
void TreeviewSearchResultsRowActivated(object o, RowActivatedArgs args)
{
OpenSelectedMatches ();
}
public void BeginProgress ()
{
Reset ();
buttonStop.Sensitive = true;
treeviewSearchResults.FreezeChildNotify ();
store.SetSortFunc (0, new TreeIterCompareFunc (DefaultSortFunc));
store.SetSortFunc (1, new TreeIterCompareFunc (DefaultSortFunc));
store.SetSortFunc (3, new TreeIterCompareFunc (DefaultSortFunc));
}
public void EndProgress ()
{
buttonStop.Sensitive = false;
store.SetSortFunc (0, new TreeIterCompareFunc (CompareFileNames));
store.SetSortFunc (1, new TreeIterCompareFunc (CompareLineNumbers));
store.SetSortFunc (3, new TreeIterCompareFunc (CompareFilePaths));
treeviewSearchResults.ThawChildNotify ();
}
public void FocusPad ()
{
treeviewSearchResults.GrabFocus ();
Gtk.TreeIter iter;
if (store.GetIterFirst (out iter))
treeviewSearchResults.Selection.SelectIter (iter);
}
public void Reset ()
{
ResultCount = 0;
documents.Clear ();
store.Clear ();
labelStatus.Text = "";
textviewLog.Buffer.Clear ();
}
protected override void OnDestroyed ()
{
Reset ();
base.OnDestroyed ();
}
[GLib.ConnectBefore]
void HandleButtonPressEvent(object sender, ButtonPressEventArgs args)
{
if (args.Event.Button == 3) {
OnPopupMenu (this, null);
args.RetVal = treeviewSearchResults.Selection.GetSelectedRows ().Length > 1;
}
}
static double Brightness (Gdk.Color c)
{
double r = c.Red / (double)ushort.MaxValue;
double g = c.Green / (double)ushort.MaxValue;
double b = c.Blue / (double)ushort.MaxValue;
return Math.Sqrt (r * .241 + g * .691 + b * .068) / 1000.0;
}
Gdk.Color AdjustColor (Gdk.Color color)
{
double b1 = Brightness (color);
double b2 = Brightness (Style.Base (StateType.Normal));
double delta = Math.Abs (b1 - b2);
if (delta < 1e-4) {
HslColor color1 = color;
color1.L -= 0.5;
if (Math.Abs (Brightness (color1) - b2) < delta) {
color1 = color;
color1.L += 0.5;
}
return color1;
}
return color;
}
string AdjustColors (string markup)
{
StringBuilder result = new StringBuilder ();
int idx = markup.IndexOf ("foreground=\"");
int offset = 0;
while (idx > 0) {
idx += "foreground=\"".Length;
result.Append (markup.Substring (offset, idx - offset));
if (idx + 7 >= markup.Length) {
offset = idx;
break;
}
offset = idx + 7;
string colorStr = markup.Substring (idx, 7);
Gdk.Color color = Gdk.Color.Zero;
if (Gdk.Color.Parse (colorStr, ref color)) {
colorStr = SyntaxMode.ColorToPangoMarkup (AdjustColor (color));
}
result.Append (colorStr);
idx = markup.IndexOf ("foreground=\"", idx);
}
result.Append (markup.Substring (offset, markup.Length - offset));
return result.ToString ();
}
void OnPopupMenu (object sender, PopupMenuArgs args)
{
CommandEntrySet contextMenu = new CommandEntrySet ();
contextMenu.AddItem (ViewCommands.Open);
contextMenu.AddItem (EditCommands.Copy);
contextMenu.AddItem (EditCommands.SelectAll);
IdeApp.CommandService.ShowContextMenu (contextMenu, this);
}
public void ShowStatus (string text)
{
labelStatus.Text = text;
}
void FileIconDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
{
CellRendererPixbuf fileNamePixbufRenderer = (CellRendererPixbuf)cell;
SearchResult searchResult = (SearchResult)store.GetValue (iter, SearchResultColumn);
fileNamePixbufRenderer.Pixbuf = DesktopService.GetPixbufForFile (searchResult.FileName, Gtk.IconSize.Menu);
}
string MarkupText (string text, bool didRead, bool isSelected)
{
return string.Format ("<span weight=\"{1}\">{0}</span>", GLib.Markup.EscapeText (text), didRead ? "normal" : "bold");
}
void FileNameDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
{
CellRendererText fileNameRenderer = (CellRendererText)cell;
bool didRead = (bool)store.GetValue (iter, DidReadColumn);
SearchResult searchResult = (SearchResult)store.GetValue (iter, SearchResultColumn);
bool isSelected = treeviewSearchResults.Selection.IterIsSelected (iter);
fileNameRenderer.Markup = MarkupText (System.IO.Path.GetFileName (searchResult.FileName), didRead, isSelected);
}
int CompareLineNumbers (TreeModel model, TreeIter first, TreeIter second)
{
DocumentLocation loc1 = GetLocation ((SearchResult)model.GetValue (first, SearchResultColumn));
DocumentLocation loc2 = GetLocation ((SearchResult)model.GetValue (second, SearchResultColumn));
return loc1.Line.CompareTo (loc2.Line);
}
static int DefaultSortFunc (TreeModel model, TreeIter first, TreeIter second)
{
return 0;
}
static int CompareFileNames (TreeModel model, TreeIter first, TreeIter second)
{
SearchResult searchResult1 = (SearchResult)model.GetValue (first, SearchResultColumn);
SearchResult searchResult2 = (SearchResult)model.GetValue (second, SearchResultColumn);
return System.IO.Path.GetFileName (searchResult1.FileName).CompareTo (System.IO.Path.GetFileName (searchResult2.FileName));
}
static int CompareFilePaths (TreeModel model, TreeIter first, TreeIter second)
{
SearchResult searchResult1 = (SearchResult)model.GetValue (first, SearchResultColumn);
SearchResult searchResult2 = (SearchResult)model.GetValue (second, SearchResultColumn);
return System.IO.Path.GetDirectoryName (searchResult1.FileName).CompareTo (System.IO.Path.GetDirectoryName (searchResult2.FileName));
}
void ResultPathDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
{
CellRendererText pathRenderer = (CellRendererText)cell;
SearchResult searchResult = (SearchResult)store.GetValue (iter, SearchResultColumn);
bool didRead = (bool)store.GetValue (iter, DidReadColumn);
bool isSelected = treeviewSearchResults.Selection.IterIsSelected (iter);
pathRenderer.Markup = MarkupText (System.IO.Path.GetDirectoryName (searchResult.FileName), didRead, isSelected);
}
void ResultLineDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
{
CellRendererText lineRenderer = (CellRendererText)cell;
SearchResult searchResult = (SearchResult)store.GetValue (iter, SearchResultColumn);
Mono.TextEditor.Document doc = GetDocument (searchResult);
int lineNr = doc.OffsetToLineNumber (searchResult.Offset) + 1;
bool didRead = (bool)store.GetValue (iter, DidReadColumn);
bool isSelected = treeviewSearchResults.Selection.IterIsSelected (iter);
lineRenderer.Markup = MarkupText (lineNr.ToString (), didRead, isSelected);
}
void ResultTextDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
{
CellRendererText textRenderer = (CellRendererText)cell;
SearchResult searchResult = (SearchResult)store.GetValue (iter, SearchResultColumn);
Mono.TextEditor.Document doc = GetDocument (searchResult);
int lineNr = doc.OffsetToLineNumber (searchResult.Offset);
LineSegment line = doc.GetLine (lineNr);
bool isSelected = treeviewSearchResults.Selection.IterIsSelected (iter);
Mono.TextEditor.Highlighting.Style style = SyntaxModeService.GetColorStyle (this, PropertyService.Get ("ColorScheme", "Default"));
string markup;
if (doc.SyntaxMode != null) {
markup = doc.SyntaxMode.GetMarkup (doc, new TextEditorOptions (), style, line.Offset, line.EditableLength, true, !isSelected, false);
} else {
markup = GLib.Markup.EscapeText (doc.GetTextAt (line.Offset, line.EditableLength));
}
if (!isSelected) {
int col = searchResult.Offset - line.Offset;
string tag;
int pos1 = FindPosition (markup, col, out tag);
int pos2 = FindPosition (markup, col + searchResult.Length, out tag);
if (pos1 >= 0 && pos2 >= 0) {
if (tag.StartsWith ("span")) {
markup = markup.Insert (pos2, "</span></span><" + tag + ">");
} else {
markup = markup.Insert (pos2, "</span>");
}
Gdk.Color searchColor = style.SearchTextBg;
double b1 = Brightness (searchColor);
double b2 = Brightness (AdjustColor (style.Default.Color));
double delta = Math.Abs (b1 - b2);
if (delta < 0.0001) {
HslColor color1 = style.SearchTextBg;
if (color1.L + 0.5 > 1.0) {
color1.L -= 0.5;
} else {
color1.L += 0.5;
}
searchColor = color1;
}
markup = markup.Insert (pos1, "<span background=\"" + SyntaxMode.ColorToPangoMarkup (searchColor) + "\">");
}
}
textRenderer.Markup = AdjustColors (markup.Replace ("\t", new string (' ', TextEditorOptions.DefaultOptions.TabSize)));
}
static int FindPosition (string markup, int pos, out string tag)
{
bool inTag = false;
bool inChar = false;
int realPos = 0;
StringBuilder lastTag = new StringBuilder ();
for (int i = 0; i < markup.Length; i++) {
char ch = markup[i];
if (ch != '<' && ch != '&' && !inTag && !inChar && realPos >= pos) {
tag = lastTag.ToString ();
return i;
}
switch (ch) {
case '&':
inChar = true;
break;
case ';':
inChar = false;
if (!inTag)
realPos++;
break;
case '<':
lastTag.Length = 0;
inTag = true;
break;
case '>':
inTag = false;
break;
default:
if (!inTag && !inChar)
realPos++;
if (inTag)
lastTag.Append (ch);
break;
}
}
tag = lastTag.ToString ();
if (realPos >= pos)
return markup.Length;
return -1;
}
Dictionary<string, Mono.TextEditor.Document> documents = new Dictionary<string, Mono.TextEditor.Document> ();
Mono.TextEditor.Document GetDocument (SearchResult result)
{
Mono.TextEditor.Document doc;
if (!documents.TryGetValue (result.FileName, out doc)) {
doc = new Mono.TextEditor.Document ();
doc.MimeType = DesktopService.GetMimeTypeForUri (result.FileName);
TextReader reader = result.FileProvider.Open ();
doc.Text = reader.ReadToEnd ();
reader.Close ();
documents[result.FileName] = doc;
}
return doc;
}
public void WriteText (string text)
{
TextIter iter = textviewLog.Buffer.EndIter;
textviewLog.Buffer.Insert (ref iter, text);
if (text.EndsWith ("\n"))
textviewLog.ScrollMarkOnscreen (textviewLog.Buffer.InsertMark);
}
public int ResultCount {
get;
private set;
}
public void Add (SearchResult result)
{
store.InsertWithValues (ResultCount, result, false);
ResultCount++;
}
void OpenDocumentAt (Gtk.TreeIter iter)
{
SearchResult result = store.GetValue (iter, SearchResultColumn) as SearchResult;
if (result != null) {
DocumentLocation loc = GetLocation (result);
store.SetValue (iter, DidReadColumn, true);
IdeApp.Workbench.OpenDocument (result.FileName, loc.Line, loc.Column, true);
}
}
DocumentLocation GetLocation (SearchResult searchResult)
{
Mono.TextEditor.Document doc = GetDocument (searchResult);
int lineNr = doc.OffsetToLineNumber (searchResult.Offset);
LineSegment line = doc.GetLine (lineNr);
return new DocumentLocation (lineNr + 1, searchResult.Offset - line.Offset + 1);
}
public void OpenSelectedMatches ()
{
foreach (Gtk.TreePath path in treeviewSearchResults.Selection.GetSelectedRows ()) {
Gtk.TreeIter iter;
if (!store.GetIter (out iter, path))
continue;
OpenDocumentAt (iter);
}
}
public void SelectAll ()
{
treeviewSearchResults.Selection.SelectAll ();
}
public void CopySelection ()
{
TreeModel model;
StringBuilder sb = new StringBuilder ();
foreach (Gtk.TreePath p in treeviewSearchResults.Selection.GetSelectedRows (out model)) {
TreeIter iter;
if (!model.GetIter (out iter, p))
continue;
SearchResult result = store.GetValue (iter, SearchResultColumn) as SearchResult;
if (result == null)
continue;
DocumentLocation loc = GetLocation (result);
Mono.TextEditor.Document doc = GetDocument (result);
LineSegment line = doc.GetLine (loc.Line - 1);
sb.AppendFormat ("{0} ({1}, {2}):{3}", result.FileName, loc.Line, loc.Column, doc.GetTextAt (line.Offset, line.EditableLength));
sb.AppendLine ();
}
Gtk.Clipboard clipboard = Clipboard.Get (Gdk.Atom.Intern ("CLIPBOARD", false));
clipboard.Text = sb.ToString ();
clipboard = Clipboard.Get (Gdk.Atom.Intern ("PRIMARY", false));
clipboard.Text = sb.ToString ();
}
public bool GetNextLocation (out string file, out int line, out int column)
{
TreeIter iter = TreeIter.Zero;
TreePath[] path = treeviewSearchResults.Selection.GetSelectedRows ();
if (path != null && path.Length > 0 && store.GetIter (out iter, path[0])) {
if (!store.IterNext (ref iter))
store.GetIterFirst (out iter);
} else {
store.GetIterFirst (out iter);
}
return GetLocation (iter, out file, out line, out column);
}
public bool GetPreviousLocation (out string file, out int line, out int column)
{
TreeIter iter;
TreeIter prevIter = TreeIter.Zero;
TreePath selPath = treeviewSearchResults.Selection.GetSelectedRows ().LastOrDefault ();
bool hasNext = store.GetIterFirst (out iter);
if (hasNext && IsIterSelected (selPath, iter))
selPath = null;
while (hasNext) {
if (IsIterSelected (selPath, iter))
break;
prevIter = iter;
hasNext = store.IterNext (ref iter);
}
return GetLocation (prevIter, out file, out line, out column);
}
bool IsIterSelected (TreePath selPath, TreeIter iter)
{
return selPath != null && store.GetPath (iter).Equals (selPath);
}
bool GetLocation (TreeIter iter, out string file, out int line, out int column)
{
this.treeviewSearchResults.Selection.UnselectAll ();
if (!store.IterIsValid (iter)) {
file = null;
line = column = 0;
return false;
}
this.treeviewSearchResults.Selection.SelectIter (iter);
this.treeviewSearchResults.ScrollToCell (store.GetPath (iter), this.treeviewSearchResults.Columns[0], false, 0, 0);
SearchResult searchResult = (SearchResult)store.GetValue (iter, SearchResultColumn);
file = searchResult.FileName;
Mono.TextEditor.Document doc = GetDocument (searchResult);
DocumentLocation location = doc.OffsetToLocation (searchResult.Offset);
line = location.Line;
column = location.Column;
return true;
}
}
}
|