Rely on caller to accept an only completion in completionResult:error:.
terminateWithKey:completion: uses passed completion instead of _selection.
Revert "Completion controller no longer handles backspace."

We're pursuing an approach that would have the completion controller
handle keys in addition to the text view, rather than relying on the
text view updating the completion controller's state.

This reverts commit 02c8dd2a80d00b149a04cfefd9fd3c6fe8f3d26f.
Return to triggering autocomplete on character input.

Before we were checking on all key commands; we now
once again only check on character input, and don't try to
do anything if the completion window is already up.
Expose the completion controller's completion view.

This is a table view right now, but the API only exposes it
as completionView, which is an NSView.
Forward handled ViCommands to the completion controller.

We only do this when the completion was showing before
this command was handled, and when the target of the
command wasn't already the completion controller. This lets
the completion controller also see the keystrokes that the
main text view sees, and try to handle them itself.
When looking for a handler for a command, fall back on completion view.

More broadly, this applies to the target for any selector. If
the completion view is showing and the text view can't
handle the given selector, we try to see if the completion
view can. This lets the completion controller deal with
selectors that the text view doesn't need to worry about.
Expose input_character: in ViTextView.

We'll be using this to pass on character input in certain
cases when completion is up.
presentCompletions:... does nothing if the completion window is already up.
Forward accept_completion_if_not_autocompleting: input to input_character:.

This is currently used by the space key, which accepts the
current completion if the completion popoup was explicitly
requested, but does not accept it if the popup was triggered
by autocomplete. Either way, we also want to insert a space,
which is handled by the input_character: method.
Match character and backspace methods from ViCompletionController to ViTextView.

This lets them execute in addition to ViTextView's when the
appropriate keys are hit, letting us filter when the user types
and backspaces.
Rename hideCompletionPopup to hideCompletionWindow.

hideCompletionWindow matches better with the
_showingCompletionWindow instance variable name.
Update setCaret:...'s handling for completion.

In particular, >1 character jumps in setCaret: always hide
the completion window if it's up.
Squash with 5b4e807381ce4190ed61ee9f8b5a5e21bf6301ad.
Map movement keys to unique methods in ViCompletionController.

We don't want to be triggering the standard up/down
movement in the text view when the completion window is
up; instead, we want to trigger movement through the
completions themselves. Because of how we have the key
handling wired up now, to do this, we just map the key
combos to unique methods in ViCompletionController, rather
than mapping them to methods that have the same name in
ViCompletionController and ViTextView, and everything
takes care of itself.
Don't pass on the terminating key stroke in completion termination.

Because certain termination paths shouldn't necessarily give
insert the terminating key into the document, we let the
ViTextView handler for the termination path decide what to
do with the key.
Remove existing key manager from ViCompletionController.

This was a vestige of the old reversed key handling
mechanism where input went to the completion controller
first and then was forwarded on conditionally to the text.
We now handle input in the text view first.