diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-10-20 07:59:43 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-20 07:59:43 +0800 |
commit | 3cf602486ce5cfaa50f33edbe179928f84527dc9 (patch) | |
tree | 68fbcc42cbdb1232a6154e50ef67b9e27232160c /test/functional/terminal/buffer_spec.lua | |
parent | 4833a63929a83c11379036ead33913711134015b (diff) | |
download | rneovim-3cf602486ce5cfaa50f33edbe179928f84527dc9.tar.gz rneovim-3cf602486ce5cfaa50f33edbe179928f84527dc9.tar.bz2 rneovim-3cf602486ce5cfaa50f33edbe179928f84527dc9.zip |
feat(terminal)!: make 'belloff' and 'visualbell' apply to terminal bell (#30859)
vim-patch:8.2.4744: a terminal window can't use the bell
vim-patch:8.2.4745: using wrong flag for using bell in the terminal
BREAKING CHANGE: Bells from :terminal are now silent by default, unless
'belloff' option doesn't contain "term" or "all".
Diffstat (limited to 'test/functional/terminal/buffer_spec.lua')
-rw-r--r-- | test/functional/terminal/buffer_spec.lua | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua index 7a30367917..8ed6d03c6b 100644 --- a/test/functional/terminal/buffer_spec.lua +++ b/test/functional/terminal/buffer_spec.lua @@ -422,6 +422,44 @@ describe(':terminal buffer', function() |*2 ]]) end) + + it("handles bell respecting 'belloff' and 'visualbell'", function() + local screen = Screen.new(50, 7) + screen:attach() + local chan = api.nvim_open_term(0, {}) + + command('set belloff=') + api.nvim_chan_send(chan, '\a') + screen:expect(function() + eq({ true, false }, { screen.bell, screen.visual_bell }) + end) + screen.bell = false + + command('set visualbell') + api.nvim_chan_send(chan, '\a') + screen:expect(function() + eq({ false, true }, { screen.bell, screen.visual_bell }) + end) + screen.visual_bell = false + + command('set belloff=term') + api.nvim_chan_send(chan, '\a') + screen:expect({ + condition = function() + eq({ false, false }, { screen.bell, screen.visual_bell }) + end, + unchanged = true, + }) + + command('set belloff=all') + api.nvim_chan_send(chan, '\a') + screen:expect({ + condition = function() + eq({ false, false }, { screen.bell, screen.visual_bell }) + end, + unchanged = true, + }) + end) end) describe('on_lines does not emit out-of-bounds line indexes when', function() |