OSDN Git Service

全置換えのアルゴリズムを高速化のために変更した
[fooeditengine/FooEditEngine.git] / Common / UndoCommands.cs
index 40a1445..50d43c9 100644 (file)
@@ -137,12 +137,14 @@ namespace FooEditEngine
         string targetPattern;
         string replacePattern;
         bool caseInsensitve;
-        public FastReplaceAllCommand(StringBuffer buffer,string targetPattern, string replacePattern,bool ci)
+        LineToIndexTable layoutLines;
+        public FastReplaceAllCommand(StringBuffer buffer,LineToIndexTable layoutlines,string targetPattern, string replacePattern,bool ci)
         {
             this.buffer = buffer;
             this.replacePattern = replacePattern;
             this.targetPattern = targetPattern;
             this.caseInsensitve = ci;
+            this.layoutLines = layoutlines;
         }
 
         public void undo()
@@ -153,7 +155,7 @@ namespace FooEditEngine
         public void redo()
         {
             this.oldBuffer = new StringBuffer(this.buffer);
-            this.buffer.Replace(this.targetPattern, this.replacePattern,this.caseInsensitve);
+            this.buffer.ReplaceAll(this.layoutLines, this.targetPattern, this.replacePattern,this.caseInsensitve);
         }
 
         public bool marge(ICommand a)