Mercurial > vim
diff src/testdir/test_terminal.vim @ 13557:4911058c43eb v8.0.1652
patch 8.0.1652: term_dumpwrite() does not output composing characters
commit https://github.com/vim/vim/commit/f06b0b6c8f85ea9c320f2be30b25ed084969c1e2
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Mar 29 17:22:24 2018 +0200
patch 8.0.1652: term_dumpwrite() does not output composing characters
Problem: term_dumpwrite() does not output composing characters.
Solution: Use the cell index.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 29 Mar 2018 17:30:06 +0200 |
parents | 78ead137b2ad |
children | af68603e213d |
line wrap: on
line diff
--- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -978,6 +978,28 @@ func Check_dump01(off) call assert_equal(':popup PopUp :', trim(getline(a:off + 20))) endfunc +func Test_terminal_dumpwrite_composing() + if !CanRunVimInTerminal() + return + endif + let save_enc = &encoding + set encoding=utf-8 + call assert_equal(1, winnr('$')) + + let text = " a\u0300 e\u0302 o\u0308" + call writefile([text], 'Xcomposing') + let buf = RunVimInTerminal('Xcomposing', {}) + call WaitFor({-> term_getline(buf, 1) =~ text}) + call term_dumpwrite(buf, 'Xdump') + let dumpline = readfile('Xdump')[0] + call assert_match('|à| |ê| |ö', dumpline) + + call StopVimInTerminal(buf) + call delete('Xcomposing') + call delete('Xdump') + let &encoding = save_enc +endfunc + " just testing basic functionality. func Test_terminal_dumpload() call assert_equal(1, winnr('$'))