OSDN Git Service

無駄な再描写をしないようにした
[fooeditengine/FooEditEngine.git] / Core / LineToIndex.cs
index 1bf4fd8..8525b8a 100644 (file)
@@ -720,10 +720,11 @@ namespace FooEditEngine
                 return false;
             long nowTick = DateTime.Now.Ticks;
             bool sync = force || !this._IsSync;
-            if (sync || Math.Abs(nowTick - this.lastUpdateTicks) >= AllowCallTicks)
+            if (sync && Math.Abs(nowTick - this.lastUpdateTicks) >= AllowCallTicks)
             {
                 this.GenerateFolding(0, this.Document.Length - 1);
                 this.lastUpdateTicks = nowTick;
+                this._IsSync = true;
                 return true;
             }
             return false;
@@ -783,6 +784,8 @@ namespace FooEditEngine
 
                 this.lastUpdateTicks = nowTick;
 
+                this._IsSync = true;
+
                 return true;
             }
             return false;
@@ -796,6 +799,7 @@ namespace FooEditEngine
             foreach (LineToIndexTableData line in this.Lines)
                 line.Syntax = null;
             this.ClearLayoutCache();
+            this._IsSync = false;
         }
 
         /// <summary>