Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't remove the last empty line when beautify #16

Open
xieranmaya opened this issue May 28, 2014 · 9 comments
Open

Don't remove the last empty line when beautify #16

xieranmaya opened this issue May 28, 2014 · 9 comments

Comments

@xieranmaya
Copy link

You know on github when your code do not have a newline an the end of file, github will notice you with "\ No newline at end of file"
An example here:
https://gist.github.com/xieranmaya/ca6727bf2165bfbdc240/revisions

And some people do have the habit of leave a newline at the end of file.
Thank you!

@argshook
Copy link

Add this to Sublime user preferences: "ensure_newline_at_eof_on_save": true.

@xieranmaya
Copy link
Author

Thank you, I didn't find it in the default pref~~

@xieranmaya
Copy link
Author

I'm sorry I've added this line but it have no effect~

@argshook
Copy link

I'm using Sublime Text build 3059 on Linux and this options does work on my system. I'm not sure whether this options is Sublime 3 specific, but I guess it's not, so it should work on Sublime Text 2 as well.

Make sure you add this options into Preferences -> Settings - User. Double check for any syntax errors. You might, although unlikely, need to restart Sublime for this to take effect.

@xieranmaya
Copy link
Author

I'm using Sublime Text 3 build 3059 on Windows 7.
I restarted the sublime~~

@argshook
Copy link

I don't think I can help any further, I just checked this option on Win 7, same 3059 build and it does work for me. Perhaps some installed package is somehow overriding this option? I'd suggest simply disabling packages one by one and check whether anything changed. You can easily enable/disable packages via command pallete (ctrl + shift + p). Just enter disable (or enable) and you'll see an option to do just that.

This doesn't seem to be an issue with js-beautify-sublime package, so I'd suggest closing it.

@xieranmaya
Copy link
Author

I'll try it later~ thank you very much for helping!

@xieranmaya
Copy link
Author

Hi,I've tried that, but it still not work in Win 7 and Win 8, 64 bit version.
and, another word, your program will save my file with UTF-16 automaticly and github(both the default diff tool and the webpage do not recognise UTF-16 format file, instead it recognise it to binary file)do not show diff info in such files...

@pspi
Copy link

pspi commented Aug 28, 2014

I can confirm that adding the following line to Sublime Text 3 Preferences > Settings - User will fix this.

"ensure_newline_at_eof_on_save": true,

(note: this is a global sublime setting and not specific setting to this plugin)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants