Single File Editor doesn't add trailing newline
Update - 2020-01-08
In this comment we propose resolving this issue by first letting the Single-File-Editor respect .editorconfig
, so that we aren't enforcing a behavior which the user can't override.
Summary
The Single File Editor doesn't add trailing newlines to edited files, while the Web IDE does.
Steps to reproduce
SFE shows one line when you create a new file:
Web IDE shows two lines:
But importantly, even if I remove this second line in the Web IDE:
It will still get added when committing (you can also see it in the diff view in the Web IDE), but not when doing the same through the SFE.
Example Project
- https://gitlab.com/toupeira/trailing-newlines/-/commit/90b975702fadbfbbc998539bb7037570666c6109 (Single File Editor)
- https://gitlab.com/toupeira/trailing-newlines/-/commit/67b4bc9d4fdc59874ed031eaed7dda0436ff1209 (Web IDE)
What is the current bug behavior?
The Single File Editor doesn't insert a trailing newline.
What is the expected correct behavior?
The Single File Editor should insert a trailing newline.
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com
Possible fixes
Edited by Paul Slaughter