Micro: option: add newline to eof

Created on 23 Oct 2016  路  7Comments  路  Source: zyedidia/micro

Micro should have an option for automatically adding a newline to file on save.

Specifications

Version: 1.1.1
Commit hash: b09093f
OS: macOS 10.12.0
Terminal: hyper

Most helpful comment

@techtonik: If the goal is to offer micro as an alternative to, say, vi, vim, joe, nano, emacs or perhaps atom and/or sublime text -- I think exposing this option is a good idea. If you want to make micro opinionated - then I think leaving the option out is the right path.

All 7 comments

What if you don't want a new line for some reason though?

@onodera-punpun Wouldn't a boolean value toggle whether it should be inserted or not though? As-is, there is no way of enabling it. Happy for it to be false by default.

Micro should have an option for automatically adding a newline to file on save.

Why?

This seems to be in the posix standard and is quite common in other editors.

StackOverflow answer on that topic:
http://stackoverflow.com/a/729795/3700391

Still look like some legacy to me.

That's why some programs have problems processing the last line of a file if it isn't newline terminated.

Seems like a bad standard if it creates problems like this.

when displaying the file on the command line (e.g. via more), a newline-terminated file results in a correct display.

Shouldn't it be the job of shell like bash to cleanup screen, environment and error codes after child process exits?

@techtonik: If the goal is to offer micro as an alternative to, say, vi, vim, joe, nano, emacs or perhaps atom and/or sublime text -- I think exposing this option is a good idea. If you want to make micro opinionated - then I think leaving the option out is the right path.

well, that was quick :) thanks much, @zyedidia.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GeigerCounter picture GeigerCounter  路  3Comments

Rbagman picture Rbagman  路  4Comments

luis-lavaire picture luis-lavaire  路  3Comments

AndreyTheHacker picture AndreyTheHacker  路  3Comments

KhodeN picture KhodeN  路  3Comments