For example, with the buffer abcdef and selection bcd, with cursor on the right end:
commandline --selection-anchor should output 1;
commandline --selection-anchor 2 should switch selection to cd,
commandline --selection-anchor 3 --cursor 2 should select cd, but also swap the beginning and end of selection to backwards.
UPD fixed: --selection-anchor 3 in the last line example
For example, with the buffer
abcdefand selectionbcd, with cursor on the right end:commandline --selection-anchorshould output1;commandline --selection-anchor 2should switch selection tocd,commandline --selection-anchor 3 --cursor 2should selectcd, but also swap the beginning and end of selection to backwards.UPD fixed: --selection-anchor 3 in the last line example