Fix byte position input for complete
Add tests for CRLF/LF/Mixed endings.