summaryrefslogtreecommitdiffstats
path: root/ui/gfx/render_text.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ui/gfx/render_text.cc')
-rw-r--r--ui/gfx/render_text.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc
index fc9353f..7d55f0c 100644
--- a/ui/gfx/render_text.cc
+++ b/ui/gfx/render_text.cc
@@ -475,6 +475,9 @@ void RenderText::SelectWord() {
return;
size_t selection_start = cursor_pos;
+ if (selection_start == text().length() && selection_start != 0)
+ --selection_start;
+
for (; selection_start != 0; --selection_start) {
if (iter.IsStartOfWord(selection_start) ||
iter.IsEndOfWord(selection_start))