Hello! This is my first post on discuss. (And excuse me that first post is about “Complaints”…)
Well, as the title says, when I first used <a-z>/<a-Z>, I was a little bit confused because I thought there’s no difference between “a: append lists” and “u: union.”
the union of a collection of sets is the set of all elements in the collection.
Yes, this definition is correct. And selection seems a kind of set contains characters as its elements. So I expected both <a-z>a and <a-z>u to “add” registered selections to current ones. However, you know, this exactly is what <a-z>a is doing, not <a-z>u is.
What “u: union” is doing is… for my poor English, I can’t find proper words… a sort of “connect each selections.” Hmm… in my intuition, “union” never add elements that are outside sets…
After that, I found these conventions came from vis’ pairwise combining operator. So now I don’t think we should rename these operators, but do think adding some more explanations to infobox helps newcomers.
Here’s what currently happen with this union operator:
case CombineOp::Union:
sel.set(std::min(sel.min(), other.min()),
std::max(sel.max(), other.max()));
break;
Example: the 2nd line of a buffer is selected and saved into register with Z. Then you go on the 5th line, select it and decide to do a union with <a-z>u. The result is one big selection starting on line 2 and finishing line on 5. Whereas an append operation <a-z>a would result in only the line 2 and the line 5 selected.
In fact, your issue (#3089) recalled me a kind of awkwardness of “union” operator and led to create this topic
Well, as you said, the infobox is too small for clear explanation, so now I also think it’s better to improve the wiki. (But I’m too lazy to make visual example of these…)
Also, I welcome “difference” (or “subtract”) operator! To be honest, in almost all interactive use-case, I chose only “append lists” other than pairwise operators because they are too complicated.
However, I think these are essential for “text manipulation language.” And I guess difference operator may be useful when to split selections manually.
I think part of the confusion is that the operators are pairwise intersection, union, and so forth. I suspect just adding that word to the UI would have cleared things up.