Don't add artificial newline to last line if --style=plain

This fixes #1438.

Note however, that using a pager such as less will add a newline itself.
So to actually not print a newline for such files, you need to either
disable paging:

  bat --style=plain --paging=never no-newline-at-end-of-file.txt

or use a "pager" that does not add a newline:

  bat --style=plain --pager=cat no-newline-at-end-of-file.txt

Note that we also update syntax tests file since a bunch of them had
missing newlines on the last lines.
This commit is contained in:
Martin Nordholts committed 2020-12-19 10:32:50 +01:00
1 parent c3fc1b88fe
commit 68d525cd8b
17 files changed
+16 -14

No files matched your search

@@ -72,4 +72,4 @@ package TestSyntax {
var sndChannel:SoundChannel = mySound.play();
}
}
}
}