aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Seifferth <frankseifferth@posteo.net>2021-05-11 22:17:03 +0200
committerFrank Seifferth <frankseifferth@posteo.net>2021-05-11 22:18:11 +0200
commit95315bf43a92beb006c5503aadf47738d5375143 (patch)
treef5ad4baacdf3b42154972855ff5e5a63d20f1267
parentf217b81692932f5d7fd3b037df49d47f79084f08 (diff)
downloadvis-editorconfig-95315bf43a92beb006c5503aadf47738d5375143.tar.gz
Fix usage of `file:content` for insert_final_newline
-rw-r--r--edconf.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/edconf.lua b/edconf.lua
index 2ec800b..c60cdf6 100644
--- a/edconf.lua
+++ b/edconf.lua
@@ -36,7 +36,7 @@ function insert_final_newline(file, path)
-- therefore respect edconf_hooks_enabled. Since this function runs
-- blazingly fast and scales with a complexity of O(1), however,
-- there is no need to disable it.
- if file:content(file.size-1, file.size) ~= '\n' then
+ if file:content(file.size-1, 1) ~= '\n' then
file:insert(file.size, '\n')
end
end