Example #1
0
        bool SetBackgroundRenderer()
        {
            List <FoldSegment> curFolds = new List <FoldSegment> (foldings);

            if (oldFolds != null && oldFolds.Count == curFolds.Count)
            {
                bool same = true;
                for (int i = 0; i < curFolds.Count; i++)
                {
                    if (oldFolds[i] != curFolds [i])
                    {
                        same = false;
                        break;
                    }
                }

                if (same)
                {
                    timerId = 0;
                    return(false);
                }
            }

            oldFolds = curFolds;
            editor.TextViewMargin.DisposeLayoutDict();
            editor.TextViewMargin.BackgroundRenderer = new FoldingScreenbackgroundRenderer(editor, foldings);
            editor.QueueDraw();
            timerId = 0;
            return(false);
        }
Example #2
0
 public void ClearMarkers()
 {
     foreach (HighlightSegmentMarker m in _markers)
         _document.RemoveMarker(m);
     _markers.Clear();
     _editor.QueueDraw();
 }
Example #3
0
 public override void Update(MonoTextEditor editor)
 {
     if (RemoveLineCache)
     {
         editor.TextViewMargin.PurgeLayoutCache();
     }
     editor.QueueDraw();
 }
 bool UpdateLineHighlight(int lineNumber, HighlightedLine oldLine, HighlightedLine newLine)
 {
     if (oldLine != null && ShouldUpdateSpan(oldLine, newLine))
     {
         textEditor.TextViewMargin.PurgeLayoutCacheAfter(lineNumber);
         textEditor.QueueDraw();
         HasUpdatedMultilineSpan = true;
         return(false);
     }
     return(true);
 }
Example #5
0
 public FoldingScreenbackgroundRenderer(MonoTextEditor editor, IEnumerable <FoldSegment> foldSegments)
 {
     this.editor       = editor;
     this.foldSegments = new List <FoldSegment> (foldSegments);
     startTime         = DateTime.Now;
     timeout           = GLib.Timeout.Add(30, delegate {
         editor.QueueDraw();
         var cont = (DateTime.Now - startTime).TotalMilliseconds < animationLength;
         if (!cont)
         {
             timeout = 0;
         }
         return(cont);
     });
 }
 public override void Update(MonoTextEditor editor)
 {
     editor.QueueDraw();
 }
 void HandleVScroll(object sender, EventArgs e)
 {
     editor.QueueDraw();
 }