Refactoring for indexIgnoreLines()

Function is very complicated and it fails sometimes on multiline comments with several empty lines.
Remaked in more simply way.