aboutsummaryrefslogtreecommitdiff
path: root/test/functional/editor
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2024-09-29 10:05:27 +0200
committerbfredl <bjorn.linse@gmail.com>2024-11-04 13:12:33 +0100
commit23290e7676e6f0a5cb5d9dc9fa1933df815aed33 (patch)
treee712c30a591bd0a142e1411f76bb568a49e97057 /test/functional/editor
parent0da4d89558a05fb86186253e778510cfd859caea (diff)
downloadrneovim-23290e7676e6f0a5cb5d9dc9fa1933df815aed33.tar.gz
rneovim-23290e7676e6f0a5cb5d9dc9fa1933df815aed33.tar.bz2
rneovim-23290e7676e6f0a5cb5d9dc9fa1933df815aed33.zip
feat(editor): handle new multibyte sequences in normal mode replacement
while the implementation is not tied to screen chars, it is a reasonable expectation to support the same size. If nvim is able to display a multibyte character, it will accept the same character as input, including in normal mode commands like r{char}
Diffstat (limited to 'test/functional/editor')
-rw-r--r--test/functional/editor/mode_normal_spec.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/functional/editor/mode_normal_spec.lua b/test/functional/editor/mode_normal_spec.lua
index b3ef4866dc..cca244e06c 100644
--- a/test/functional/editor/mode_normal_spec.lua
+++ b/test/functional/editor/mode_normal_spec.lua
@@ -9,6 +9,7 @@ local feed = n.feed
local fn = n.fn
local command = n.command
local eq = t.eq
+local api = n.api
describe('Normal mode', function()
before_each(clear)
@@ -41,4 +42,23 @@ describe('Normal mode', function()
attr_ids = {},
})
end)
+
+ it('replacing with ZWJ emoji sequences', function()
+ local screen = Screen.new(30, 8)
+ screen:attach()
+ api.nvim_buf_set_lines(0, 0, -1, true, { 'abcdefg' })
+ feed('05rπŸ§‘β€πŸŒΎ') -- ZWJ
+ screen:expect([[
+ πŸ§‘β€πŸŒΎπŸ§‘β€πŸŒΎπŸ§‘β€πŸŒΎπŸ§‘β€πŸŒΎ^πŸ§‘β€πŸŒΎfg |
+ {1:~ }|*6
+ |
+ ]])
+
+ feed('2rπŸ³οΈβ€βš§οΈ') -- ZWJ and variant selectors
+ screen:expect([[
+ πŸ§‘β€πŸŒΎπŸ§‘β€πŸŒΎπŸ§‘β€πŸŒΎπŸ§‘β€πŸŒΎπŸ³οΈβ€βš§οΈ^πŸ³οΈβ€βš§οΈg |
+ {1:~ }|*6
+ |
+ ]])
+ end)
end)