protected virtual void OnPositionChanged(EventArgs e)
{
ArrayList foldings = textArea.Document.FoldingManager.GetFoldingsFromPosition(line, column);
bool shouldUpdate = false;
foreach (FoldMarker foldMarker in foldings)
{
//Console.WriteLine(foldMarker);
shouldUpdate |= foldMarker.IsFolded;
foldMarker.IsFolded = false;
}
if (shouldUpdate)
{
textArea.BeginUpdate();
textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.WholeTextArea));
textArea.EndUpdate();
textArea.Document.FoldingManager.NotifyFoldingsChanged(EventArgs.Empty);
}
if (PositionChanged != null)
{
PositionChanged(this, e);
}
textArea.ScrollToCaret();
}