jaredpar/VsVim — pull request #1232 by ricksladkey (2014-01-08 22:56:02+00:00)
Title: Fixes #925

Here is an experimental and incomplete attempt to address issue #925 for review. It is not ready to be merged but if the general approach is workable, it could be cleaned up and finished without much more effort.

The basic idea is that we instantiate a `KeyProcessor` for **all** `IWpfTextView` objects, not just for ones with an `IVimBuffer`. If it **does** have an `IVimBuffer` things work as before; we instantiate a `VsKeyProcessor`. If it **does not** have an `IVimBuffer`, then we know that:

* this is a text buffer
* it obeys keyboard shortcuts for `Text Editor`
* we specifically removed certain `Text Editor` bindings that would have otherwise applied here

and so can we can manually process the keys we unbound by using a new `ForwardingKeyProcessor` that translates them into the corresponding Visual Studio commands to which they were previously bound.

In the branch so far, the look-up for the previously removed binding is not yet implemented. For demonstration purposes a handful of keys are hard-coded to their default bindings. The following keys are "Handled by VsVim" (and work as intended in VsVim), and yet "still work" in the output window and the immediate window:

* `Ctrl+F`
* `Ctrl+Home`
* `Ctrl+Left`
* `Ctrl+Right`
* `Shift+Left`
* `Shift+Right`

It works beautifully in the experimental instance but causes a prerequisite loop in my normal environment. I can try to iron out these problems if the approach deserved to be pursued.