TextEditor: Correct line up/down on first/last line.
* Move to beginning of first line, or end of last line respectively.
This commit is contained in:
@@ -134,7 +134,7 @@ TextEditor::SetCharacterStyle(::CharacterStyle style)
|
|||||||
|
|
||||||
fStyleAtCaret = style;
|
fStyleAtCaret = style;
|
||||||
|
|
||||||
if (fSelection.Caret() != fSelection.Anchor()) {
|
if (HasSelection()) {
|
||||||
// TODO: Apply style to selection range
|
// TODO: Apply style to selection range
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -368,8 +368,14 @@ TextEditor::SelectionLength() const
|
|||||||
void
|
void
|
||||||
TextEditor::_MoveToLine(int32 lineIndex, bool select)
|
TextEditor::_MoveToLine(int32 lineIndex, bool select)
|
||||||
{
|
{
|
||||||
if (lineIndex < 0 || lineIndex >= fLayout->CountLines())
|
if (lineIndex < 0) {
|
||||||
|
_SetCaretOffset(0, false, select, true);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
if (lineIndex >= fLayout->CountLines()) {
|
||||||
|
_SetCaretOffset(fDocument->Length(), false, select, true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
float x1;
|
float x1;
|
||||||
float y1;
|
float y1;
|
||||||
|
|||||||
Reference in New Issue
Block a user