shell: handle split-up UTF-8 sequences

This commit is contained in:
Björn Linse
2018-02-08 15:11:56 +01:00
parent 01cdeff626
commit f75c4b39ec
3 changed files with 69 additions and 7 deletions

View File

@@ -9,6 +9,7 @@ local feed_command = helpers.feed_command
local iswin = helpers.iswin
local clear = helpers.clear
local command = helpers.command
local nvim_dir = helpers.nvim_dir
describe("shell command :!", function()
if helpers.pending_win32(pending) then return end
@@ -195,5 +196,29 @@ describe("shell command :!", function()
eq(true, screen.bell)
end)
end)
it('handles multibyte sequences split over buffer boundaries', function()
command('cd '..nvim_dir)
local cmd
if iswin() then
cmd = '!shell-test UTF-8 '
else
cmd = '!./shell-test UTF-8'
end
feed_command(cmd)
-- Note: only the first example of split composed char works
screen:expect([[
{1:~ }|
{1:~ }|
:]]..cmd..[[ |
å |
ref: å̲ |
1: å̲ |
2: å ̲ |
3: å ̲ |
|
{3:Press ENTER or type command to continue}^ |
]])
end)
end)
end)