separate core function: get caret offset. related to issues #40