Issue with selection mode by word not including the started word in its entirety

Godot Version

v4.3.stable.official [77dcf97d8]

Question

Hi,

I’m trying to program a selection by word with a single click and drag within a textedit node. By changing the selection mode as soon as I click, I’m able to get mostly there. However, because the caret is set to where I click, the selection always leaves off part of the starting word. I think if I’m able to have the caret move to the start of the word I click on, I can fix the issue, but I’m not sure how to approach setting that up.


I saw that there’s some documentation about setting the exact line and column of the caret through code, but I’m not sure how to connect that to the starting point of a word I would click on.