Improve code completion:

  - fix issue where pop remains visible when there is only one completion and the prefix is the completion
  - fix issues where pressing shift hides the popup
  - care about the cursor position before hiding the popup if there is one completion and prefix match the only    selection (only hide if a the end of the word)