Fix issue when source code formatting reduces the number of lines 

fixes #41

The cursor would be moved over the end of the line and this results in ArgumentOutOfRange exception