vrapper/vrapper — pull request #519 by albertdev (2014-09-05 13:45:29+00:00)
Title: Experimental visual mode from selection

As requested in issue #511, a setting which enables syncing an Eclipse selection with Vrapper's visual mode.

I noticed that it immediately went wrong if you would run something like `dd` `u`. The reason is because the following happens:

* Vrapper deletes a line of text. This action goes into the undo history.
* The deletion is undone. Eclipse puts back the text and selects it.
* The new selection handler change will put Vrapper into Visual mode.
* Vrapper's history manager deselects the text because that's how Vim does it.

It turns out that if you clear the selection of the textwidget instead of the ITextViewer, no selection change listeners on the ITextViewer will be called. Result: the selection is empty but Vrapper still thinks it should be in Visual mode.
I worked around that with the second commit.