support empty selection, and handle focus and previous cursor position
Merge pull request #872 from jay-hodgson/SWC-1223-no-select

SWC-1223: support empty selection, and handle focus and previous cursor position