aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Seifferth <frankseifferth@posteo.net>2021-05-11 22:39:52 +0200
committerFrank Seifferth <frankseifferth@posteo.net>2021-05-11 22:39:52 +0200
commit57703f7723691c21cc1e27bb3c4e5b51bc613332 (patch)
tree6ec4aa4421c05b825c8a77a0727fd582ae02c310
parent33425ed72d72edbc52036601a430e2d7af96bb03 (diff)
downloadvis-editorconfig-57703f7723691c21cc1e27bb3c4e5b51bc613332.tar.gz
Simplify handling of insert_final_newline
-rw-r--r--edconf.lua9
1 files changed, 2 insertions, 7 deletions
diff --git a/edconf.lua b/edconf.lua
index 6abe2c9..7b42173 100644
--- a/edconf.lua
+++ b/edconf.lua
@@ -124,13 +124,8 @@ OPTIONS = {
-- Quote: insert_final_newline Set to true ensure file ends with a
-- newline when saving and false to ensure it doesn’t.
--
- if value == "true" then
- set_pre_save(insert_final_newline, "true")
- set_pre_save(strip_final_newline, "false")
- elseif value == "false" then
- set_pre_save(strip_final_newline, "true")
- set_pre_save(insert_final_newline, "false")
- end
+ set_pre_save(insert_final_newline, tostring(value == "true"))
+ set_pre_save(strip_final_newline, tostring(value == "false"))
end,
trim_trailing_whitespace = function (value)