aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal/buffer_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-07-30 21:40:30 +0800
committerGitHub <noreply@github.com>2022-07-30 21:40:30 +0800
commitd36d9be8ff0e03a7cbba087abb9167056f9c56c7 (patch)
treeb78cbdab274822e3236e40119a61b548a7cab561 /test/functional/terminal/buffer_spec.lua
parentc34d72bf7cc149db7b17ef57f2c961b54cd46ff7 (diff)
downloadrneovim-d36d9be8ff0e03a7cbba087abb9167056f9c56c7.tar.gz
rneovim-d36d9be8ff0e03a7cbba087abb9167056f9c56c7.tar.bz2
rneovim-d36d9be8ff0e03a7cbba087abb9167056f9c56c7.zip
fix(terminal): avoid reading over the end of cell.chars (#19580)
Diffstat (limited to 'test/functional/terminal/buffer_spec.lua')
-rw-r--r--test/functional/terminal/buffer_spec.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua
index 1cef771f0d..ec3066c20d 100644
--- a/test/functional/terminal/buffer_spec.lua
+++ b/test/functional/terminal/buffer_spec.lua
@@ -5,6 +5,8 @@ local feed, clear, nvim = helpers.feed, helpers.clear, helpers.nvim
local poke_eventloop = helpers.poke_eventloop
local eval, feed_command, source = helpers.eval, helpers.feed_command, helpers.source
local eq, neq = helpers.eq, helpers.neq
+local meths = helpers.meths
+local retry = helpers.retry
local write_file = helpers.write_file
local command = helpers.command
local exc_exec = helpers.exc_exec
@@ -364,3 +366,11 @@ describe('on_lines does not emit out-of-bounds line indexes when', function()
eq('', exec_lua([[return _G.cb_error]]))
end)
end)
+
+it('terminal truncates number of composing characters to 5', function()
+ clear()
+ local chan = meths.open_term(0, {})
+ local composing = ('a̳'):sub(2)
+ meths.chan_send(chan, 'a' .. composing:rep(8))
+ retry(nil, nil, function() eq('a' .. composing:rep(5), meths.get_current_line()) end)
+end)