Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds two new APIs -
drag_pair_forwards
and its companiondrag_pair_backwards
which allow dragging 'pairs' of elements within a form.An easy example is the key-value pairs within a map which typically are meant to stay together when reordering.
This can, however, be used for any form. This means if you have some vector containing logical pairs (because of the actual semantics of your code) you can use a dedicated keybinding to drag them around together.
This change also introduces a new config option at:
dragging.auto_drag_pairs = true|false
which will alter the behaviour of the existing
drag_element_forwards
anddrag_element_backwards
APIs in order to try infer whether they are contained within a node that is made up of pairs.For example if this setting is
true
and adrag_element_forwards
is used on the keys of a map then they will be dragged pairwise.This new config option defaults to
true
under the assumption that this is generally the desired behaviour.