classlib: Fix for Document:selectLine when last line in doc

Signed-off-by: Scott Wilson <i@scottwilson.ca>