diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2024-11-25 19:15:05 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2024-11-25 19:27:38 +0000 |
commit | c5d770d311841ea5230426cc4c868e8db27300a8 (patch) | |
tree | dd21f70127b4b8b5f109baefc8ecc5016f507c91 /test/functional/terminal/buffer_spec.lua | |
parent | 9be89f131f87608f224f0ee06d199fcd09d32176 (diff) | |
parent | 081beb3659bd6d8efc3e977a160b1e72becbd8a2 (diff) | |
download | rneovim-c5d770d311841ea5230426cc4c868e8db27300a8.tar.gz rneovim-c5d770d311841ea5230426cc4c868e8db27300a8.tar.bz2 rneovim-c5d770d311841ea5230426cc4c868e8db27300a8.zip |
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'test/functional/terminal/buffer_spec.lua')
-rw-r--r-- | test/functional/terminal/buffer_spec.lua | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua index 7a30367917..05258a9e50 100644 --- a/test/functional/terminal/buffer_spec.lua +++ b/test/functional/terminal/buffer_spec.lua @@ -411,7 +411,6 @@ describe(':terminal buffer', function() it('handles split UTF-8 sequences #16245', function() local screen = Screen.new(50, 7) - screen:attach() fn.termopen({ testprg('shell-test'), 'UTF-8' }) screen:expect([[ ^å | @@ -422,6 +421,43 @@ describe(':terminal buffer', function() |*2 ]]) end) + + it("handles bell respecting 'belloff' and 'visualbell'", function() + local screen = Screen.new(50, 7) + 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() @@ -662,7 +698,6 @@ describe('termopen()', function() local function test_term_colorterm(expected, opts) local screen = Screen.new(50, 4) - screen:attach() fn.termopen({ nvim_prog, '-u', |