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
Merge pull request #300 from forki/Formatting

Fix issue when source code formatting reduces the number of lines