UI: UI: Anchor Right When Double-Clicking Last Word

Merging #113125 into blender-v4.0-release. Accidentally
committed to main first.
This commit is contained in:
Harley Acheson
2023-10-01 09:56:12 -07:00
parent fef8b38acb
commit 4d35344010

View File

@@ -3803,7 +3803,8 @@ static void ui_do_but_textedit(
but->pos = short(selend);
but->selsta = short(selsta);
but->selend = short(selend);
data->sel_pos_init = selsta;
/* Anchor selection to the left side unless the last word. */
data->sel_pos_init = ((selend == strlen(data->str)) && (selsta != 0)) ? selend : selsta;
retval = WM_UI_HANDLER_BREAK;
changed = true;
}