ARCed.Scripting.ScriptEditorForm.RemoveEmptyLines C# (CSharp) Method

RemoveEmptyLines() public method

Make the script shorter by deleting all unneeded lines
public RemoveEmptyLines ( ) : void
return void
		public void RemoveEmptyLines()
		{
			this._scintilla.UndoRedo.BeginUndoAction();
			for (int i = this._scintilla.Lines.Count - 1; i >= 0; i--)
				if (this._scintilla.Lines[i].Text.Trim().Length == 0)
				{
					this._scintilla.CurrentPos = this._scintilla.Lines[i].StartPosition;
					this._scintilla.Commands.Execute(BindableCommand.LineDelete);
				}
			Line lastLine = this._scintilla.Lines[this._scintilla.Lines.Count - 1];
			if (lastLine.Text.Length == 0)
			{
				this._scintilla.CurrentPos = lastLine.StartPosition;
				this._scintilla.Commands.Execute(BindableCommand.DeleteBack);
			}
			this._scintilla.UndoRedo.EndUndoAction();
		}