From 95315bf43a92beb006c5503aadf47738d5375143 Mon Sep 17 00:00:00 2001 From: Frank Seifferth Date: Tue, 11 May 2021 22:17:03 +0200 Subject: Fix usage of `file:content` for insert_final_newline --- edconf.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit