You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was reading the source code and noticed some inconsistencies with how end of file was being handled. almost every file I opened has a blank line at the end of the file, but some files have two newlines and some have none.
I verified this with BBEdit 10.5, TextMate 2.0, and Sublime Text 2. Now when I open the same files via command line using vim, none of the end of file new lines were visible.
For example:
rails_apps_composer/sample.rb
Has two blank lines at the end of the file
These files have one blank line at the end of the file
rails_apps_composer/version.rb
rails_apps_composer/recipes/controllers.rb
This file does not have a blank line at the end of the file
rails_apps_composer/recipes/core.rb
@DanielKehoe Do you prefer to insert newlines at the end of the file or is this being caused by your text editor?
The text was updated successfully, but these errors were encountered:
BTW, @DanielKehoe's commit follows the standard practice (important for much Unix software) that newlines are line terminators, not line separators. Thus in each file the last line also is terminated by a newline.
By installation default, some editors (e.g. Sublime Text 2) omit that final newline from the file. (That is, unless the user correctly reconfigures the editor to include it.)
However, currently, Sublime Text 2 (even when correctly configured) shows a final blank line after that final newline. Maybe some other editors also do the same. This is incorrect. Obviously there is no extra line there. Unfortunately some editors still suggest to users that there is.
IMHO this happens from the editor developers' ignorance of this subtle point. Perhaps, at first thought, it's more intuitive for newlines to be line separators, rather than line terminators.
See also more support for Unix's practice in this Sublime Text 2 bug report.
tmock12
pushed a commit
to tmock12/rails_apps_composer
that referenced
this issue
Jun 19, 2014
I was reading the source code and noticed some inconsistencies with how end of file was being handled. almost every file I opened has a blank line at the end of the file, but some files have two newlines and some have none.
I verified this with BBEdit 10.5, TextMate 2.0, and Sublime Text 2. Now when I open the same files via command line using vim, none of the end of file new lines were visible.
For example:
rails_apps_composer/sample.rb
Has two blank lines at the end of the file
These files have one blank line at the end of the file
rails_apps_composer/version.rb
rails_apps_composer/recipes/controllers.rb
This file does not have a blank line at the end of the file
rails_apps_composer/recipes/core.rb
@DanielKehoe Do you prefer to insert newlines at the end of the file or is this being caused by your text editor?
The text was updated successfully, but these errors were encountered: