diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-06-11 14:47:40 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-06-11 14:47:40 +0200 |
commit | 012270936c3c7df3bba45ad2b48938c23a2fd43a (patch) | |
tree | 49516acf5e48807dc57ee1b62ce5d5e596209e8e /src/testdir | |
parent | b8aefa46adf5e825118716e142fab7ef32076475 (diff) | |
download | vim-git-012270936c3c7df3bba45ad2b48938c23a2fd43a.tar.gz |
patch 7.4.1917v7.4.1917
Problem: History lines read from viminfo in different encoding than when
writing are not converted.
Solution: Convert the history lines.
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_viminfo.vim | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/testdir/test_viminfo.vim b/src/testdir/test_viminfo.vim index 279b1c3d1..1fefba1b6 100644 --- a/src/testdir/test_viminfo.vim +++ b/src/testdir/test_viminfo.vim @@ -179,3 +179,25 @@ func Test_cmdline_history_order() call delete('Xviminfo') endfunc + +func Test_viminfo_encoding() + if !has('multi_byte') + return + endif + set enc=latin1 + call histdel(':') + call histadd(':', "echo '\xe9'") + wviminfo Xviminfo + + set fencs=utf-8,latin1 + set enc=utf-8 + sp Xviminfo + call assert_equal('latin1', &fenc) + close + + call histdel(':') + rviminfo Xviminfo + call assert_equal("echo 'é'", histget(':', -1)) + + call delete('Xviminfo') +endfunc |