summaryrefslogtreecommitdiffstats
path: root/after/ftplugin/lua.lua
diff options
context:
space:
mode:
Diffstat (limited to 'after/ftplugin/lua.lua')
-rw-r--r--after/ftplugin/lua.lua5
1 files changed, 1 insertions, 4 deletions
diff --git a/after/ftplugin/lua.lua b/after/ftplugin/lua.lua
index 2ffd62c..756026e 100644
--- a/after/ftplugin/lua.lua
+++ b/after/ftplugin/lua.lua
@@ -1,9 +1,6 @@
local function format()
local view = vim.fn.winsaveview()
- local buf_str = ""
- for _, v in ipairs(vim.api.nvim_buf_get_lines(0, 0, -1, false)) do
- buf_str = buf_str .. v .. "\n"
- end
+ local buf_str = table.concat(vim.api.nvim_buf_get_lines(0, 0, -1, false), "\n") .. "\n"
local tempname = vim.fn.tempname()
local tempfile = assert(io.open(tempname, "w"), "Could not open temporary file")
tempfile:write(buf_str)