diff options
| author | Alexej Kowalew <616b2f@gmail.com> | 2026-05-08 09:54:30 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-08 03:54:30 -0400 |
| commit | 832a68835b741bf874b936f933d662a5e1159e32 (patch) | |
| tree | 189498c71f1ad469419829f58e2faad0c1c59151 /runtime/plugin/python_setup.vim | |
| parent | a61c8f3580a7efb38cda6199a3ef9cfd6a098726 (diff) | |
| download | rneovim-832a68835b741bf874b936f933d662a5e1159e32.tar.gz rneovim-832a68835b741bf874b936f933d662a5e1159e32.tar.bz2 rneovim-832a68835b741bf874b936f933d662a5e1159e32.zip | |
fix(shell): preserve CR when `:!` outputs to binary-mode buffer #39558
Problem:
When `:!` writes shell output to a buffer, write_output() splits on `\r`, `\n`,
and `\r\n`, replacing the terminator byte with NUL. For a binary-mode buffer
this is wrong: `\r` should be preserved verbatim, not treated as a line
terminator. This wrong behavior causes a file like `\r\n` round-trips through
`:%!cat` to `\n`.
This was masked when 'shelltemp' was enabled, because output went through a temp
file and the regular file I/O path handled binary-mode correctly. Switching the
default to 'noshelltemp' exposed the bug, since output is now piped directly
into write_output().
Solution:
In `write_output()`, skip the `\r` and `\r\n` splits for a binary-mode buffer;
only split on `\n`.
Diffstat (limited to 'runtime/plugin/python_setup.vim')
0 files changed, 0 insertions, 0 deletions