⛏️ index : haiku.git

author Oscar Lesta <oscar.lesta@gmail.com> 2025-12-05 19:39:47.0 -03:00:00
committer Adrien Destugues <pulkomandy@pulkomandy.tk> 2025-12-09 10:15:55.0 +00:00:00
commit
82755a4c33a6aec549b75c7f61777b5f3eaaad0d [patch]
tree
9c895268113ee9a267532456200e02eaa58dc531
parent
9d587f4f3fb2573dc24f36a21398544161d535a7
download
82755a4c33a6aec549b75c7f61777b5f3eaaad0d.tar.gz

TextView: Move caret position to the end of selection on SelectAll().

This makes it consistent with the behaviour of double/triple click
selections.

Fixes #4094 / #19842.

Change-Id: Ibbbe36c9703207744e79c83447f95815ea5bf8fe
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10066
Reviewed-by: John Scipione <jscipione@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>

Diff

 src/kits/interface/TextView.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/kits/interface/TextView.cpp b/src/kits/interface/TextView.cpp
index 73efc39..ba82e74 100644
--- a/src/kits/interface/TextView.cpp
+++ b/src/kits/interface/TextView.cpp
@@ -1564,7 +1564,9 @@
void
BTextView::SelectAll()
{
	Select(0, fText->Length());
	// Place the cursor at the end of the selection.
	fCaretOffset = fText->Length();
	Select(0, fCaretOffset);
}