Reuse keyDownEditor variable so that we can call the hint provider with the correct editor.

This fixes issues #2620 and #2621.