Open Zoybean opened 2 years ago
I had no idea this feature even existed. What I would intuitively expect a count provided to those bindings to do is move all the contents like a train and move it by count cars if you will.
That's what I had figured at first as well, and in writing the Counts issue I was going to propose your train-car idea; before realising an alternate behaviour might be useful (which, as it turns out, is very close to the current behaviour)
Use primary selection as start point for group-transpose
When providing a count with
Alt-(
andAlt-)
, this cycles selections inn
tuples, counting from the "top" selection, and ignoring remainders. As an example, with 5 selections,2
Alt-(
will rotate the content of each pair, defining the first pair as the topmost two selections, continuing down the file until there is at most one unpaired selection. My proposal is that rather than starting with the selection at the top of the file, this should start from the primary selection. Example behaviour at the end. The intended usage would be to first use(
and)
to ensure the primary selection is at the start of a tuple before usingAlt-(
orAlt-)
, allowing for the current behaviour if it's desired, while also allowing some more unusual layouts of items, without unintuitive behaviour.Other considerations:
When there is a remainder, it may be difficult to determine where to place the primary selection so that the correct selections are excluded. It seems reasonable in general to expect the user to remove any selections that they do not want affected by a command, so perhaps this command should display a warning and do nothing if there is a remainder (that would otherwise be silently skipped)? This would ensure the user is aware of what selections will be skipped.
Example 1:
With the following selections marked with
_
, and the primary selection marked^
:Desired Behaviour:
2
Alt-)
swaps the following pairs (marked with matching brackets):Current behaviour:
2
Alt-)
swaps the following pairs (marked with matching brackets):Currently, in order to get the correct word order, this would have to be done in 2 steps:
Example 2:
With the following selections marked with
_
, and the primary selection marked^
:Desired Behaviour:
2
Alt-)
swaps the following pairs (marked with matching brackets):Optionally, the user would be required to deselect
seven
in addition to placing the primary selection on any ofare
,of
,these
.Current behaviour:
2
Alt-)
swaps the following pairs (marked with matching brackets):Currently, in order to get the correct word order, this would have to be done in 2 steps:
seven