https://github.com/vim/vim/pull/18598
(2 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
@MiguelBarro pushed 2 commits.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
I don't think this makes sense. The documentation clearly says that systemlist()
output lines are separately by NL. They aren't separated by CRNL.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I don't think this makes sense. The documentation clearly says that
systemlist()
output lines are separately by NL. They aren't separated by CRNL.
You are right. This is tricky. The docs on systemlist
says:
Same as |system()|, but returns a |List| with lines (parts of
output separated by NL) with NULs transformed into NLs.
And this is meant to be crossplatform because the system
docs says:
To make the result more system-independent, the shell output
is filtered to replace <CR> with <NL> for Macintosh, and
<CR><NL> with <NL> for DOS-like systems.
and because systemlist
works on system
output, it should split the command output in lines properly in any platform.
The issue is that system
does not follow the claimed behaviour (returns the OS line endings).
This is understandable because:
system
implementation relies on output redirection. Parsing the output to remove <CR><NL>
would be an overhead.system
result.system
and break backward compatibility (is the ony actually working on Windows).systemlist
to workaround the system
error.—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.