[Monodevelop-patches-list] r971 - trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Fri Feb 20 20:20:50 EST 2004
Author: tberman
Date: 2004-02-20 20:20:50 -0500 (Fri, 20 Feb 2004)
New Revision: 971
Modified:
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/SearchReplaceInFilesManager.cs
Log:
alright, find/replace seems to be working a lot nicer now.
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/SearchReplaceInFilesManager.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/SearchReplaceInFilesManager.cs 2004-02-21 00:03:22 UTC (rev 970)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/SearchReplaceInFilesManager.cs 2004-02-21 01:20:50 UTC (rev 971)
@@ -32,7 +32,7 @@
static PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
static string currentFileName = String.Empty;
- static SourceEditor currentDocument = null;
+ static SourceEditorBuffer currentDocument = null;
public static SearchOptions SearchOptions {
get {
@@ -67,22 +67,20 @@
TaskService taskService = (TaskService)ICSharpCode.Core.Services.ServiceManager.Services.GetService(typeof(TaskService));
// check if the current document is up to date
- if (currentFileName != result.FileName) {
+ //if (currentFileName != result.FileName) {
// if not, create new document
currentFileName = result.FileName;
- currentDocument = result.CreateDocument();
- }
+ currentDocument = SourceEditorBuffer.CreateTextBufferFromFile (result.FileName);
+ //}
// get line out of the document and display it in the task list
- //int lineNumber = currentDocument.GetLineNumberForOffset(Math.Min(currentDocument.TextLength, result.Offset));
- TextIter resultIter = currentDocument.Buffer.GetIterAtOffset (result.Offset);
+ TextIter resultIter = currentDocument.GetIterAtOffset (result.Offset);
int lineNumber = resultIter.Line;
TextIter start_line = resultIter, end_line = resultIter;
start_line.LineOffset = 0;
end_line.ForwardToLineEnd ();
- //LineSegment line = currentDocument.GetLineSegment(lineNumber);
- taskService.Tasks.Add(new Task(result.FileName, currentDocument.Buffer.GetText(start_line.Offset, end_line.Offset - start_line.Offset), resultIter.LineOffset, lineNumber));
+ taskService.Tasks.Add(new Task(result.FileName, currentDocument.GetText(start_line.Offset, end_line.Offset - start_line.Offset), resultIter.LineOffset, lineNumber));
}
static bool InitializeSearchInFiles()
More information about the Monodevelop-patches-list
mailing list