Added support for returning caret positions in