diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2018-02-07 10:23:19 +0100 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2018-02-10 22:28:12 +0100 |
commit | 60ce7d9e0a0606e20a17f90d78e9d8319114273b (patch) | |
tree | 54ceededd83da28ca5fd8eccca33a368172ffbe2 | |
parent | a6052c7307414045fbe2f55cd0c6a5017eb9f68e (diff) | |
download | rneovim-60ce7d9e0a0606e20a17f90d78e9d8319114273b.tar.gz rneovim-60ce7d9e0a0606e20a17f90d78e9d8319114273b.tar.bz2 rneovim-60ce7d9e0a0606e20a17f90d78e9d8319114273b.zip |
shell: support bell
-rw-r--r-- | src/nvim/os/shell.c | 2 | ||||
-rw-r--r-- | test/functional/ex_cmds/bang_filter_spec.lua | 8 | ||||
-rw-r--r-- | test/functional/ui/output_spec.lua | 7 |
3 files changed, 12 insertions, 5 deletions
diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c index 5b3cb64a4d..166e06b1a4 100644 --- a/src/nvim/os/shell.c +++ b/src/nvim/os/shell.c @@ -455,7 +455,7 @@ static void out_data_append_to_screen(char *output, size_t remaining, { char *p = output, *end = output + remaining; while (p < end) { - if (*p == '\n' || *p == '\r' || *p == TAB) { + if (*p == '\n' || *p == '\r' || *p == TAB || *p == BELL) { msg_putchar_attr((uint8_t)(*p), 0); p++; } else { diff --git a/test/functional/ex_cmds/bang_filter_spec.lua b/test/functional/ex_cmds/bang_filter_spec.lua index 636d732161..3559828aa8 100644 --- a/test/functional/ex_cmds/bang_filter_spec.lua +++ b/test/functional/ex_cmds/bang_filter_spec.lua @@ -4,6 +4,7 @@ local helpers = require('test.functional.helpers')(after_each) local feed, command, clear = helpers.feed, helpers.command, helpers.clear local mkdir, write_file, rmdir = helpers.mkdir, helpers.write_file, helpers.rmdir local feed_command = helpers.feed_command +local eq = helpers.eq if helpers.pending_win32(pending) then return end @@ -52,18 +53,21 @@ describe(':! command', function() it('handles binary and multibyte data', function() feed_command('!cat test/functional/fixtures/shell_data.txt') + screen.bell = false screen:expect([[ {1:~ }| {1:~ }| {1:~ }| :!cat test/functional/fixtures/shell_data.txt | - {2:^@^A^B^C^D^E^F^G^H} | + {2:^@^A^B^C^D^E^F^H} | {2:^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_} | ö 한글 {2:<a5><c3>} | t {2:<ff>} | | {3:Press ENTER or type command to continue}^ | - ]]) + ]], nil, nil, function() + eq(true, screen.bell) + end) end) end) diff --git a/test/functional/ui/output_spec.lua b/test/functional/ui/output_spec.lua index c42c0b26c6..de0b8ba69b 100644 --- a/test/functional/ui/output_spec.lua +++ b/test/functional/ui/output_spec.lua @@ -104,13 +104,16 @@ describe("shell command :!", function() ]]) feed([[<CR>]]) -- Print BELL control code. #4338 + screen.bell = false feed([[:!printf '\x07\x07\x07\x07text'<CR>]]) screen:expect([[ ~ | :!printf '\x07\x07\x07\x07text' | - ^G^G^G^Gtext | + text | Press ENTER or type command to continue^ | - ]]) + ]], nil, nil, function() + eq(true, screen.bell) + end) feed([[<CR>]]) -- Print BS control code. feed([[:echo system('printf ''\x08\n''')<CR>]]) |