Revert "editorconfig: fix trim_trailing_whitespace"

https://editorconfig.org says

> trim_trailing_whitespace: set to true to remove any whitespace
> characters preceding newline characters and false to ensure it
> doesn't.

We also trim trailing empty lines, which causes unnecessary formatting
discrepancies when working with other tools that implement the specification
only.

This backs out commit 33f44f6abc.

Cc: Jonathan Halmen <jonathan@halmen.org>
This commit is contained in:
Johannes Altmanninger 2025-03-23 16:08:43 +01:00 committed by Maxime Coste
parent 0785de6173
commit c7d688f578

View file

@ -45,7 +45,7 @@ define-command editorconfig-load -params ..1 -docstring "editorconfig-load [file
print "set-option buffer BOM utf8"
}
if (trim_trailing_whitespace == "true") {
print "hook buffer BufWritePre \"" file "\" -group editorconfig-hooks %{ try %{ execute-keys -draft %{%s\\h+$|\\n+\\z<ret>d} } }"
print "hook buffer BufWritePre \"" file "\" -group editorconfig-hooks %{ try %{ execute-keys -draft %{%s\\h+$<ret>d} } }"
}
if (max_line_length && max_line_length != "off") {
print "set window autowrap_column " max_line_length