js-beautify-sublime
js-beautify-sublime copied to clipboard
Don't remove the last empty line when beautify
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!
Add this to Sublime user preferences: "ensure_newline_at_eof_on_save": true.
Thank you, I didn't find it in the default pref~~
I'm sorry I've added this line but it have no effect~
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.
I'm using Sublime Text 3 build 3059 on Windows 7. I restarted the sublime~~
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.
I'll try it later~ thank you very much for helping!
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...
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)