i attempted to modify
$:/core/ui/EditTemplate/body/editor
(using an external editor)
to add
focusSelect=“start”
(or rather) focusSelect=\\\"start\\\"\\n
I don’t have the opportunity to investigate at present, but it is possible that the implementation that got merged does not match what was discussed.
A missing focusSelectFromEnd defaults to 0, i.e. the end of the text, rather than defaulting to the same position as the focusSelectFromStart attribute. As such I cannot see a means to create a zero length selection at the beginning or end of the text.
where $tw.utils.setSelectionRangeSafe(node,selectFromStart,node.value.length - selectFromEnd);
probably cannot accept a negative number?
thus a large value for selectFromStart is ok, and if arbitrarily large enough, will result in a cursor at the end of the tiddler text with no selection
but a large value for selectFromEnd is not ok, as the result is a negative number? thus in the current implementation there is no way to specify a cursor at the beginning of the tiddler text with no selection (without using a known value (already stored somewhere?) for the length of the existing text; such that subtracting it makes the result 0, non-negative, or otherwise acceptable)
i did try but as far as i can tell the current implementation does not work as intended for the scenario the OP and i ask about
try editing https://tiddlywiki.com/#EditTextWidget and substituting the values above; they don’t work as expected to give no selection and a cursor at the beginning of the text
$:/core/ui/EditTemplate/body/editor
(using an external text editor)
to add focusSelectFromEnd={{{ [<currentTiddler>get[text]length[]] }}}\\n
before
cancelPopups=“yes”
making sure (in control panel) to select default focus for new tiddlers to “text”
usability improvement for new users, being able to select this option in core (or have it be default) would be very helpful
to stop accidental erasure of tiddler contents (since the default for text selects the entire text field, any input will swiftly overwrite the contents)
i.e. a GUI dropdown to select “focus and cursor at start, nothing selected” i.e. focusSelectFromEnd to equal {{{ [get[text]length[]] }}}