Created
October 28, 2019 10:55
-
-
Save anddam/009618b829beb607c94ba653bbf06106 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.../vis-strip-trailing-spaces/vis-strip-trailing-spaces.lua:30: bad argument #1 to 'ipairs' (table expected, got text) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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