also, move caret at end/start checks before choosing what to do also, selectHistory shouldn't return a promise