Ability to split object selections


#1

Following #138 and the shrink feature of @occivink I tested what could look like a split object command:

asciicast

I quite a long discussed with @occivink about the implementation, so credits go also to him for his technical input.


<a-C> with setxkbmap -option "grp:lalt_lshift_toggle"
#2

how does it differ from builtin s? Automation?


#3

It selects every object in selection.

Honestly it looks like another must-have addon for me, great job @alexherbo2 :slight_smile:


#4

Just added support for custom objects.


#5

Wow, I am impressed you managed to implement that. It is a feature I think should be in core at some point, but kudos for making a plugin.


#6

I was mislead by split selection and select commands, now I got it. This is great thing to have


#7

holy guacamole! congratulations @occivink and @alexherbo2
the coolest plugin


#8

What do you think of the split feature suggested by @Delapouite and way to implement it?


#9

If we think of a selection as mathematical set, we could take the first selection as first set, and the selections after split as a subsets of the first selection. For example:

[aaa (bbb) ccc (ddd) eee]

Let’s assume that current selection is a set A. We need to save this set somewhere. After that we can split this selection by parenthesis:

aaa [(bbb)] ccc [(ddd)] eee

save current selections as set B and C, which are subsets of previous selections.
Now we need to take complement of sum of subsets B and C:

A’ = A \ (B U C)

Which results in the following sets:

[aaa ](bbb)[ ccc ](ddd)[ eee]

Since all splits are always subsets of main selection, and never exceed, I think this can be programmed without much awareness of corner cases.