void SetupInitialFileState(bool update)
        {
            if (baseDocument == null)
            {
                if (update)
                {
                    changeList.Transform(TransformLineChangeInfo);
                }
                else
                {
                    changeList.InsertRange(0, document.TotalNumberOfLines + 1, LineChangeInfo.Empty);
                }
            }
            else
            {
                changeList.Clear();

                Dictionary <string, int> hashes = new Dictionary <string, int>();

                MyersDiff.MyersDiff diff = new MyersDiff.MyersDiff(
                    new DocumentSequence(baseDocument, hashes),
                    new DocumentSequence(document, hashes)
                    );

                changeList.Add(LineChangeInfo.Empty);
                int lastEndLine = 0;

                foreach (Edit edit in diff.GetEdits())
                {
                    int beginLine = edit.BeginB;
                    int endLine   = edit.EndB;

                    changeList.InsertRange(changeList.Count, beginLine - lastEndLine, LineChangeInfo.Empty);

                    LineChangeInfo change = new LineChangeInfo(edit.EditType, edit.BeginA, edit.BeginB, edit.EndA, edit.EndB);
                    if (endLine == beginLine)
                    {
                        changeList[changeList.Count - 1] = change;
                    }
                    else
                    {
                        changeList.InsertRange(changeList.Count, endLine - beginLine, change);
                    }

                    lastEndLine = endLine;
                }

                changeList.InsertRange(changeList.Count, textDocument.LineCount - lastEndLine, LineChangeInfo.Empty);
            }

            OnChangeOccurred(EventArgs.Empty);
        }
		void SetupInitialFileState(bool update)
		{
			if (baseDocument == null) {
				if (update)
					changeList.Transform(TransformLineChangeInfo);
				else
					changeList.InsertRange(0, document.TotalNumberOfLines + 1, LineChangeInfo.Empty);
			} else {
				changeList.Clear();
				
				Dictionary<string, int> hashes = new Dictionary<string, int>();
				
				MyersDiff.MyersDiff diff = new MyersDiff.MyersDiff(
					new DocumentSequence(baseDocument, hashes),
					new DocumentSequence(document, hashes)
				);
				
				changeList.Add(LineChangeInfo.Empty);
				int lastEndLine = 0;
				
				foreach (Edit edit in diff.GetEdits()) {
					int beginLine = edit.BeginB;
					int endLine = edit.EndB;
					
					changeList.InsertRange(changeList.Count, beginLine - lastEndLine, LineChangeInfo.Empty);
					
					LineChangeInfo change = new LineChangeInfo(edit.EditType, edit.BeginA, edit.BeginB, edit.EndA, edit.EndB);
					if (endLine == beginLine)
						changeList[changeList.Count - 1] = change;
					else
						changeList.InsertRange(changeList.Count, endLine - beginLine, change);
					
					lastEndLine = endLine;
				}
				
				changeList.InsertRange(changeList.Count, textDocument.LineCount - lastEndLine, LineChangeInfo.Empty);
			}
			
			OnChangeOccurred(EventArgs.Empty);
		}
		void SetupInitialFileState(bool update)
		{
			if (baseDocument == null) {
				if (update)
					changeList.Transform(TransformLineChangeInfo);
				else
					changeList.InsertRange(0, document.TotalNumberOfLines + 1, LineChangeInfo.Empty);
			} else {
				changeList.Clear();
				
				Dictionary<string, int> hashes = new Dictionary<string, int>();
				
				MyersDiff.MyersDiff diff = new MyersDiff.MyersDiff(
					new DocumentSequence(baseDocument, hashes),
					new DocumentSequence(document, hashes)
				);
				
				changeList.Add(new LineChangeInfo(ChangeType.None, ""));
				int lastEndLine = 0;
				
				foreach (Edit edit in diff.GetEdits()) {
					int beginLine = edit.BeginB;
					int endLine = edit.EndB;
					
					changeList.InsertRange(changeList.Count, beginLine - lastEndLine, LineChangeInfo.Empty);
					
					if (edit.EditType == ChangeType.Deleted) {
						LineChangeInfo change = changeList[beginLine];
						
						for (int i = edit.BeginA; i < edit.EndA; i++) {
							var line = baseDocument.GetLine(i + 1);
							change.DeletedLinesAfterThisLine += line.Text;
						}
						
						changeList[beginLine] = change;
					} else {
						var change = new LineChangeInfo(edit.EditType, "");
						changeList.InsertRange(changeList.Count, endLine - beginLine, change);
					}
					
					lastEndLine = endLine;
				}
				
				changeList.InsertRange(changeList.Count, textDocument.LineCount - lastEndLine, LineChangeInfo.Empty);
			}
			
			OnChangeOccurred(EventArgs.Empty);
		}