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

@@ -1247,7 +1247,7 @@ Boolean nvim_paste(String data, Integer phase, Error *err)
// Skip remaining chunks. Report error only once per "stream".
goto theend;
}
Array lines = string_to_array(data);
Array lines = string_to_array(data, true);
ADD(args, ARRAY_OBJ(lines));
ADD(args, INTEGER_OBJ(phase));
rv = nvim_execute_lua(STATIC_CSTR_AS_STRING("return vim.paste(...)"), args,