Skip to content

Conversation

vermiculus
Copy link
Contributor

As noted in the documentation, insert_final_newline = false is expected to remove final newlines, but editorconfig-mode does not do that.

Use a similar pattern to editorconfig-set-trailing-ws by setting a buffer-local before-save hook to remove any final newline.


Fix #360.

Copy link
Member

@xuhdev xuhdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! Please see the questions.

As noted in the documentation, `insert_final_newline = false` is
expected to remove final newlines, but `editorconfig-mode` does not do
that.

Use a similar pattern to `editorconfig-set-trailing-ws` by setting a
buffer-local before-save hook to remove any final newline.
@vermiculus vermiculus force-pushed the sa/insert-final-newline-false branch from 601381a to 8ae8509 Compare October 22, 2024 16:49
@xuhdev xuhdev requested a review from 10sr October 22, 2024 20:33
Copy link
Member

@xuhdev xuhdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I'm leaving this open for a couple of days in case @10sr wants to take a look. I'll merge if no response in 3 days.

@xuhdev xuhdev merged commit c707d8d into editorconfig:master Oct 25, 2024
13 checks passed
@vermiculus vermiculus deleted the sa/insert-final-newline-false branch October 27, 2024 10:40
@vermiculus
Copy link
Contributor Author

Thanks folks!

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

Successfully merging this pull request may close these issues.

Remove final newlines when insert_final_newline = false

3 participants