Recalculate number of lines needed on resizing

The issue with #bufferlines on mobile has been fixed in 0d580cc, so calculate
the number of (non-wrapping) lines that fit in the window and add a buffer of 10
for hidden lines and to allow scrolling up to fetch more lines (#202)
Merge pull request #204 from lorenzhs/numlines

Recalculate number of lines needed on resizing