Skip to content

Instantly share code, notes, and snippets.

@anddam
Created October 28, 2019 10:55
Show Gist options
  • Save anddam/009618b829beb607c94ba653bbf06106 to your computer and use it in GitHub Desktop.
Save anddam/009618b829beb607c94ba653bbf06106 to your computer and use it in GitHub Desktop.
.../vis-strip-trailing-spaces/vis-strip-trailing-spaces.lua:30: bad argument #1 to 'ipairs' (table expected, got text)
vis:command_register("sts", function(argv, force, win, selection, range)
if win.strip_trailing_spaces then
for index, line in ipairs(win.file.lines) do
win.file.lines[index] = line:gsub("%s+$", "")
end
vis:info("Line trailing spaces trimmed." .. type(win.file.lines))
end
return true;
end, "Strip line trailing spaces"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment