Fixes #11848 Moving line up without line ending #12946
Fixes the bug described in issue #11848
From what I explored it looks like a previous dev has tried to fix this bug. Although because rows are 0 indexed, to select the penultimate row for the range it requires using
I wonder whether it's worth rewriting the line:
lines += '\n' unless lines[lines.length - 1] is '\n'
I've attempted to add a valid test. Suggestions to improve or better represent the test welcome