// Based on VladSh's UndoAllNoScroll.js


	eval(AkelPad.ReadFile(AkelPad.GetAkelDir() + "\\AkelFiles\\Plugs\\Scripts\\" + "Neo!Common.JS"));
//----------------------------------------------------------------------------

if (hMainWnd
   && AkelPad.IsAkelEdit()
   && AkelPad.SendMessage(hEditWnd, 3075 /*AEM_CANUNDO*/, 0, 0)
   //&& AkelPad.SendMessage(hEditWnd, 3086 /*AEM_GETMODIFY*/, 0, 0)
)
{
   var lpPoint = AkelPad.MemAlloc(8 /*sizeof(POINT)*/, true);
   if (lpPoint)
   {
      AutoRedrawOff(hEditWnd)
      AkelPad.SendMessage(hEditWnd, 1245 /*EM_GETSCROLLPOS*/, 0, lpPoint);

      while (AkelPad.SendMessage(hEditWnd, 3075 /*AEM_CANUNDO*/, 0, 0))
      {
         AkelPad.SendMessage(hEditWnd, 3077 /*AEM_UNDO*/, 0, 0)
      }

      AkelPad.SendMessage(hEditWnd, 1246 /*EM_SETSCROLLPOS*/, 0, lpPoint);
      AutoRedrawOn(hEditWnd)

      AkelPad.MemFree(lpPoint, true);
   }
}
