use editor.lineCount() instead of reading file for number of lines
v1.0.3