Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The previous PR #632 introduced an issue on empty files, because
"".split('\n')
would produce[""]
whereas"".lines()
would produce[]
resulting in a panic on the editor and the viewer.We can add back an empty line if a file contains no lines, but it's also the occasion to deal with something that could be improved: in POSIX the last line of a file must end with a newline, and this make sense so MOROS follows this rule. But the editor would explicitely show an empty line at the end of every file to save this trailing newline chars. And when editing a file you'd have to remember to always leave an empty line at the end.
In general it seems better to make that final newline implicit and avoid displaying an empty line at the end of every files.
The only caveat is that on some occasions we might want to produce a file without a trailing newline. This will now be impossible, we'll see if it's needed in the future and revisit that decision then. It could just be an option in the editor.