/// <summary> /// Processes the snippet and template arguments /// </summary> public static Int32 PostProcessSnippets(ScintillaNet.ScintillaControl sci, Int32 currentPosition) { Int32 delta = 0; while (sci.SelectText(BOUNDARY, 0) != -1) { sci.ReplaceSel(""); delta -= BOUNDARY.Length; } String text = sci.Text; // Store text temporarily Int32 entryPosition = sci.MBSafePosition(text.IndexOf(ENTRYPOINT)); Int32 exitPosition = sci.MBSafePosition(text.IndexOf(EXITPOINT)); if (entryPosition != -1 && exitPosition != -1) { sci.SelectText(ENTRYPOINT, 0); sci.ReplaceSel(""); delta -= ENTRYPOINT.Length; sci.SelectText(EXITPOINT, 0); sci.ReplaceSel(""); delta -= EXITPOINT.Length; sci.SetSel(entryPosition, exitPosition - ENTRYPOINT.Length); } else if (entryPosition != -1 && exitPosition == -1) { sci.SelectText(ENTRYPOINT, 0); sci.ReplaceSel(""); delta -= ENTRYPOINT.Length; sci.SetSel(entryPosition, entryPosition); } else sci.SetSel(currentPosition, currentPosition); return delta; }