TextPoint startTextPoint = this.View.GetLayoutLineFromIndex(start);
TextPoint endTextPoint = this.View.GetLayoutLineFromIndex(start + length);
this.SelectByRectangle(new TextRectangle(startTextPoint, endTextPoint));
- if (startTextPoint.col == endTextPoint.col)
- this.View.InsertPoint = new SelectCollection(this.View.Selections);
- else
- this.View.InsertPoint = null;
}
else if(length != 0)
{
this.View.Selections.Add(Selection.Create(start, length));
- this.View.InsertPoint = null;
}
this.SelectionChanged(this, null);
}
this.SelectByRectangle(new TextRectangle(tp,end));
- if (width == 0)
- this.View.InsertPoint = new SelectCollection(this.View.Selections);
- else
- this.View.InsertPoint = null;
-
this.SelectionChanged(this, null);
}
this.Document.UnLock();
}
+ public bool IsRectInsertMode()
+ {
+ if (!this.RectSelection)
+ return false;
+ foreach(Selection sel in this.View.Selections)
+ {
+ if (sel.length != 0)
+ return false;
+ }
+ return true;
+ }
+
/// <summary>
/// キャレット位置の文字を一文字削除し、キャレット位置を後ろにずらす
/// </summary>
public void DoBackSpaceAction()
{
- if (this.View.InsertPoint != null)
+ if (this.IsRectInsertMode())
{
this.ReplaceBeforeSelectionArea(this.View.Selections, 1, "");
return;
if (str == "\t" && this.IndentMode == IndentMode.Space)
str = this.GetIndentSpace(CaretPos.col);
- if (this.View.InsertPoint != null)
+ if (this.IsRectInsertMode())
{
this.ReplaceBeforeSelectionArea(this.View.Selections, 0, str);
return;
this.Select(this.AnchorIndex, CaretPostion - this.AnchorIndex);
}else{
this.AnchorIndex = CaretPostion;
- this.View.InsertPoint = null;
this.Select(CaretPostion, 0);
}
}
if (this.RectSelection == false || this.Document.FireUpdateEvent == false)
throw new InvalidOperationException();
- SelectCollection temp = this.View.InsertPoint;
+ SelectCollection temp = this.View.Selections;
int selectStart = temp.First().start;
int selectEnd = temp.Last().start + temp.Last().length;
}
this.JumpCaret(StartIndex);
if (updateInsertPoint && newInsertPoint.Count > 0)
- this.View.InsertPoint = newInsertPoint;
+ this.View.Selections = newInsertPoint;
}
private string GetTextFromLineSelectArea(SelectCollection Selections)