diff options
author | bfredl <bjorn.linse@gmail.com> | 2024-12-18 14:49:38 +0100 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2025-01-02 12:55:11 +0100 |
commit | e3bfcf2fd4a4ebf00b104b082cfe83c8144a842d (patch) | |
tree | 8c4e09f0995db6668e13b3508b112779bea1312d /test/functional/terminal/buffer_spec.lua | |
parent | 9d9ee3476e6478850ce8822c85154f0c98570371 (diff) | |
download | rneovim-e3bfcf2fd4a4ebf00b104b082cfe83c8144a842d.tar.gz rneovim-e3bfcf2fd4a4ebf00b104b082cfe83c8144a842d.tar.bz2 rneovim-e3bfcf2fd4a4ebf00b104b082cfe83c8144a842d.zip |
feat(terminal): support grapheme clusters, including emoji
Diffstat (limited to 'test/functional/terminal/buffer_spec.lua')
-rw-r--r-- | test/functional/terminal/buffer_spec.lua | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua index e209ed9025..b6de687af9 100644 --- a/test/functional/terminal/buffer_spec.lua +++ b/test/functional/terminal/buffer_spec.lua @@ -400,15 +400,28 @@ describe(':terminal buffer', function() assert_alive() end) - it('truncates number of composing characters to 5', function() + it('truncates the size of grapheme clusters', function() local chan = api.nvim_open_term(0, {}) local composing = ('a̳'):sub(2) - api.nvim_chan_send(chan, 'a' .. composing:rep(8)) + api.nvim_chan_send(chan, 'a' .. composing:rep(20)) retry(nil, nil, function() - eq('a' .. composing:rep(5), api.nvim_get_current_line()) + eq('a' .. composing:rep(14), api.nvim_get_current_line()) end) end) + it('handles extended grapheme clusters', function() + local screen = Screen.new(50, 7) + feed 'i' + local chan = api.nvim_open_term(0, {}) + api.nvim_chan_send(chan, '🏴☠️ yarrr') + screen:expect([[ + 🏴☠️ yarrr^ | + |*5 + {5:-- TERMINAL --} | + ]]) + eq('🏴☠️ yarrr', api.nvim_get_current_line()) + end) + it('handles split UTF-8 sequences #16245', function() local screen = Screen.new(50, 7) fn.jobstart({ testprg('shell-test'), 'UTF-8' }, { term = true }) |