paste: break lines at CR, CRLF #10877

Some terminals helpfully translate \n to \r.

fix #10872
ref #10223
This commit is contained in:
Justin M. Keyes
2019-08-29 23:45:02 +02:00
committed by GitHub
parent 00d46f6328
commit 9f81acc076
6 changed files with 97 additions and 49 deletions

View File

@@ -455,6 +455,12 @@ local SUBTBL = {
'\\030', '\\031',
}
-- Formats Lua value `v`.
--
-- TODO(justinmk): redundant with vim.inspect() ?
--
-- "Nice table formatting similar to screen:snapshot_util()".
-- Commit: 520c0b91a528
function module.format_luav(v, indent, opts)
opts = opts or {}
local linesep = '\n'
@@ -533,6 +539,9 @@ function module.format_luav(v, indent, opts)
return ret
end
-- Like Python repr(), "{!r}".format(s)
--
-- Commit: 520c0b91a528
function module.format_string(fmt, ...)
local i = 0
local args = {...}