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

Is there a way to not remove whitespace at the end of file? #26

Open
computersarecool opened this issue Oct 18, 2016 · 9 comments
Open

Comments

@computersarecool
Copy link

I actually like the extra new line at the end of the file. Is there a way not to remove it?

@lewang
Copy link
Owner

lewang commented Oct 18, 2016

Not currently. What's the usecase?

On Tue, Oct 18, 2016 at 1:48 AM, Willy Nolan notifications@github.com
wrote:

I actually like the extra new line at the end of the file. Is there a way
not to remove it?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#26, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAjzbJsWQrVMRu2xARP_zP6OQ5Kl-SGNks5q1F2-gaJpZM4KZZnP
.

Le

@computersarecool
Copy link
Author

I have been told it is good practice

@lewang
Copy link
Owner

lewang commented Oct 19, 2016

Have you consulted the documentation for require-final-newline?

@computersarecool
Copy link
Author

computersarecool commented Oct 19, 2016

Yes and I currently have it set to t which means it should add a new line when the file is about to be saved. Unfortunately it looks like butler removes the newline after this.

@lewang
Copy link
Owner

lewang commented Oct 19, 2016

Ok, that's a bug then. I'll take a closer look when I get a chance.

@computersarecool
Copy link
Author

Thanks

@computersarecool
Copy link
Author

It looks like you have code here specifically trying to avoid this but it is removing the newline on my files.

@lewang
Copy link
Owner

lewang commented Apr 22, 2017

Can you give repro steps from emacs -Q? I just saved a file that had require-final-newline set to t and the final newline was added.

@computersarecool
Copy link
Author

computersarecool commented Apr 23, 2017

Steps to reproduce:

Start emacs -Q
Install ws-butler
Visit file testing.js
Enable linum-mode (to see line numbers)
Enable ws-butler-mode

Type const http = require('http') followed by 3 new lines
On line 2 type console.log(http)
Type C-x C-s

File will be truncated to two lines
wc -l testing.js = 2

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

2 participants