/// <summary>
 /// Does the cleanup tasks to the code
 /// </summary>
 public static void CleanUpCode(ScintillaControl sci)
 {
     try
     {
         if (Globals.Settings.EnsureLastLineEnd)
         {
             sci.AddLastLineEnd();
         }
         if (Globals.Settings.EnsureConsistentLineEnds)
         {
             sci.ConvertEOLs(sci.EOLMode);
         }
         if (Globals.Settings.StripTrailingSpaces)
         {
             sci.StripTrailingSpaces();
         }
     }
     catch (Exception ex)
     {
         ErrorManager.ShowError(ex);
     }
 }