diff options
| author | Jakob Schnitzer <mail@jakobschnitzer.de> | 2017-06-28 16:52:04 +0200 |
|---|---|---|
| committer | Jakob Schnitzer <mail@jakobschnitzer.de> | 2017-06-28 16:52:04 +0200 |
| commit | e8829710bc5f38208499e0ad38402eac24a67ac2 (patch) | |
| tree | 4e1ae954c2e301adadbfa7038b823ea9ea2fb08e /src/nvim/os/shell.c | |
| parent | ff8b2eb435c518f0eafd0e509afe1f5ee4a81fd1 (diff) | |
| parent | f0dafa89c2b7602cfedf0bd3409858e4c212b0a2 (diff) | |
| download | rneovim-e8829710bc5f38208499e0ad38402eac24a67ac2.tar.gz rneovim-e8829710bc5f38208499e0ad38402eac24a67ac2.tar.bz2 rneovim-e8829710bc5f38208499e0ad38402eac24a67ac2.zip | |
Merge branch 'master' into option-fixes
Diffstat (limited to 'src/nvim/os/shell.c')
| -rw-r--r-- | src/nvim/os/shell.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c index fc8ab7dc8f..9d80a43718 100644 --- a/src/nvim/os/shell.c +++ b/src/nvim/os/shell.c @@ -464,9 +464,10 @@ static void out_data_append_to_screen(char *output, size_t remaining, continue; } - // Translate NUL to SOH - if (output[off] == NUL) { - output[off] = 1; + // TODO(bfredl): using msg_puts would be better until + // terminal emulation is implemented. + if (output[off] < 0x20) { + output[off] = ' '; } off++; @@ -495,8 +496,12 @@ static void out_data_cb(Stream *stream, RBuffer *buf, size_t count, void *data, size_t cnt; char *ptr = rbuffer_read_ptr(buf, &cnt); - if (ptr != NULL && cnt > 0 - && out_data_decide_throttle(cnt)) { // Skip output above a threshold. + if (ptr == NULL || cnt == 0) { + // Nothing to read; + return; + } + + if (out_data_decide_throttle(cnt)) { // Skip output above a threshold. // Save the skipped output. If it is the final chunk, we display it later. out_data_ring(ptr, cnt); } else { @@ -684,7 +689,7 @@ static void shell_write_cb(Stream *stream, void *data, int status) uv_err_name(status)); } if (stream->closed) { // Process may have exited before this write. - ELOG("stream was already closed"); + WLOG("stream was already closed"); return; } stream_close(stream, NULL, NULL); |
