Bugfix for floating_preview

Don't modify your inputs.
This commit is contained in:
Ashkan Kiani
2019-11-20 11:34:10 -08:00
parent 69a0712a9c
commit 3ae9b3781e

View File

@@ -262,6 +262,9 @@ function M.open_floating_preview(contents, filetype, opts)
opts = { opts, 't', true };
}
-- Don't modify our inputs.
contents = vim.deepcopy(contents)
-- Trim empty lines from the end.
for i = #contents, 1, -1 do
if #contents[i] == 0 then