public bool DoBackspace()
{
#if DEBUG
if (dbugEnableTextManRecorder)
{
dbug_BackSpaceCount++;
dbugTextManRecorder.WriteInfo("TxLMan::DoBackSpace");
dbugTextManRecorder.BeginContext();
}
#endif
VisualSelectionRangeSnapShot removeSelRange = this.RemoveSelectedText();
if (!removeSelRange.IsEmpty())
{
CancelSelect();
#if DEBUG
if (dbugEnableTextManRecorder) dbugTextManRecorder.EndContext();
#endif
return true;
}
else
{
updateJustCurrentLine = true;
char deletedChar = textLineWriter.DoBackspace();
if (deletedChar == '\0')
{
if (!IsOnFirstLine)
{
CurrentLineNumber--;
DoEnd();
commandHistory.AddDocAction(
new DocActionJoinWithNextLine(
textLineWriter.LineNumber, textLineWriter.CharIndex));
JoinWithNextLine();
}
#if DEBUG
if (dbugEnableTextManRecorder) dbugTextManRecorder.EndContext();
#endif
return false;
}
else
{
commandHistory.AddDocAction(
new DocActionDeleteChar(
deletedChar, textLineWriter.LineNumber, textLineWriter.CharIndex));
#if DEBUG
if (dbugEnableTextManRecorder) dbugTextManRecorder.EndContext();
#endif
return true;
}
}
}
public void DoEnd()