aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-02-11 20:05:57 +0100
committerJustin M. Keyes <justinkz@gmail.com>2018-02-11 20:15:44 +0100
commit1257b047471bcb953db2ead6a3f0bf7244717078 (patch)
tree3eb7b12418875843b430b57bfa8f249d2c01cc0c /src/nvim/testdir
parentff4a628081c3fb50ea064353030a98375332cc23 (diff)
downloadrneovim-1257b047471bcb953db2ead6a3f0bf7244717078.tar.gz
rneovim-1257b047471bcb953db2ead6a3f0bf7244717078.tar.bz2
rneovim-1257b047471bcb953db2ead6a3f0bf7244717078.zip
vim-patch:8.0.0446: the ";" command does not work after some characters
Problem: The ";" command does not work after characters with a lower byte that is NUL. Solution: Properly check for not having a previous character. (Hirohito Higashi) https://github.com/vim/vim/commit/454709baffd3205bf2b7d2519419675a122f2bd2
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_alot_utf8.vim1
-rw-r--r--src/nvim/testdir/test_charsearch_utf8.vim44
2 files changed, 45 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_alot_utf8.vim b/src/nvim/testdir/test_alot_utf8.vim
index 90b2aab467..1da3e62b31 100644
--- a/src/nvim/testdir/test_alot_utf8.vim
+++ b/src/nvim/testdir/test_alot_utf8.vim
@@ -5,6 +5,7 @@
" runtest.vim. Checking for the multi_byte feature is in the individual
" files, so that they can be run by themselves.
+source test_charsearch_utf8.vim
source test_expr_utf8.vim
source test_matchadd_conceal_utf8.vim
source test_regexp_utf8.vim
diff --git a/src/nvim/testdir/test_charsearch_utf8.vim b/src/nvim/testdir/test_charsearch_utf8.vim
new file mode 100644
index 0000000000..b700a8c756
--- /dev/null
+++ b/src/nvim/testdir/test_charsearch_utf8.vim
@@ -0,0 +1,44 @@
+" Tests for related f{char} and t{char} using utf-8.
+if !has('multi_byte')
+ finish
+endif
+
+" Test for t,f,F,T movement commands
+function! Test_search_cmds()
+ new!
+ call setline(1, "・最初から最後まで最強のVimは最高")
+ 1
+ normal! f最
+ call assert_equal([0, 1, 4, 0], getpos('.'))
+ normal! ;
+ call assert_equal([0, 1, 16, 0], getpos('.'))
+ normal! 2;
+ call assert_equal([0, 1, 43, 0], getpos('.'))
+ normal! ,
+ call assert_equal([0, 1, 28, 0], getpos('.'))
+ bw!
+endfunction
+
+" vim: shiftwidth=2 sts=2 expandtab
+" Tests for related f{char} and t{char} using utf-8.
+if !has('multi_byte')
+ finish
+endif
+
+" Test for t,f,F,T movement commands
+function! Test_search_cmds()
+ new!
+ call setline(1, "・最初から最後まで最強のVimは最高")
+ 1
+ normal! f最
+ call assert_equal([0, 1, 4, 0], getpos('.'))
+ normal! ;
+ call assert_equal([0, 1, 16, 0], getpos('.'))
+ normal! 2;
+ call assert_equal([0, 1, 43, 0], getpos('.'))
+ normal! ,
+ call assert_equal([0, 1, 28, 0], getpos('.'))
+ bw!
+endfunction
+
+" vim: shiftwidth=2 sts=2 expandtab