Fix line number on new line

Split from https://github.com/limetext/lime/pull/439
Merge pull request #441 from mmstick/patch-3

Fix line number on new line