Fix wrong test: boolean variable is never negative

This has been spotted by clang++.
Reimplement inset-select-all in a generic way

There are 3 possible actions (in order)
* select current cell
* select all calls of inset
* select the inset from outside (in the containing inset)

This fixes completely #7727.