balanced selecting with the mouse must be handled differently

The mouse sets the end offset of the selection absolutely. Balancing
only depends on the mark and the end offset. In contrast using the
cursor keys moves the end offset of the selection relative to the caret
offset. Therefor we must take the direction of movement into account in
order to extend/reduce the balanced range correctly. 

Signed-off-by: Florian Thienel <>
13 files changed