I would remove the "cursorPos", since is not really that, but and object with the line and column position. It would also be nice to add that it returns null if there was a problem.