mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 09:12:07 +00:00
feat(mbyte): support extended grapheme clusters including more emoji
Use the grapheme break algorithm from utf8proc to support grapheme clusters from recent unicode versions. Handle variant selector VS16 turning some codepoints into double-width emoji. This means we need to use ptr2cells rather than char2cells when possible.
This commit is contained in:
@@ -1436,6 +1436,41 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
|
||||
}
|
||||
end)
|
||||
|
||||
it('supports nvim_echo messages with emoji', function()
|
||||
-- stylua: ignore
|
||||
async_meths.nvim_echo(
|
||||
{ { 'wow, 🏳️⚧️🧑🌾❤️😂🏴☠️\nvariant ❤️ one\nvariant ❤ two' } }, true, {}
|
||||
)
|
||||
|
||||
screen:expect([[
|
||||
|
|
||||
{1:~ }|
|
||||
{3: }|
|
||||
wow, 🏳️⚧️🧑🌾❤️😂🏴☠️ |
|
||||
variant ❤️ one |
|
||||
variant ❤ two |
|
||||
{6:Press ENTER or type command to continue}^ |
|
||||
]])
|
||||
|
||||
feed '<cr>'
|
||||
screen:expect([[
|
||||
^ |
|
||||
{1:~ }|*5
|
||||
|
|
||||
]])
|
||||
|
||||
feed ':messages<cr>'
|
||||
screen:expect([[
|
||||
|
|
||||
{1:~ }|
|
||||
{3: }|
|
||||
wow, 🏳️⚧️🧑🌾❤️😂🏴☠️ |
|
||||
variant ❤️ one |
|
||||
variant ❤ two |
|
||||
{6:Press ENTER or type command to continue}^ |
|
||||
]])
|
||||
end)
|
||||
|
||||
it('prints lines in Ex mode correctly with a burst of carriage returns #19341', function()
|
||||
command('set number')
|
||||
api.nvim_buf_set_lines(0, 0, 0, true, { 'aaa', 'bbb', 'ccc' })
|
||||
|
Reference in New Issue
Block a user