aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_textformat.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/testdir/test_textformat.vim')
-rw-r--r--src/nvim/testdir/test_textformat.vim26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_textformat.vim b/src/nvim/testdir/test_textformat.vim
index f0a0f894c3..35a7887761 100644
--- a/src/nvim/testdir/test_textformat.vim
+++ b/src/nvim/testdir/test_textformat.vim
@@ -1060,7 +1060,7 @@ func Test_tw_2_fo_tm_replace()
endfunc
" Test for 'matchpairs' with multibyte chars
-func Test_mps()
+func Test_mps_multibyte()
new
let t =<< trim END
{
@@ -1084,6 +1084,30 @@ func Test_mps()
bwipe!
endfunc
+" Test for 'matchpairs' in latin1 encoding
+func Test_mps_latin1()
+ new
+ let save_enc = &encoding
+ " set encoding=latin1
+ call setline(1, 'abc(def)ghi')
+ normal %
+ call assert_equal(8, col('.'))
+ normal %
+ call assert_equal(4, col('.'))
+ call cursor(1, 6)
+ normal [(
+ call assert_equal(4, col('.'))
+ normal %
+ call assert_equal(8, col('.'))
+ call cursor(1, 6)
+ normal ])
+ call assert_equal(8, col('.'))
+ normal %
+ call assert_equal(4, col('.'))
+ let &encoding = save_enc
+ close!
+endfunc
+
func Test_empty_matchpairs()
split
set matchpairs= showmatch