Mercurial > vim
diff src/testdir/test_gn.vim @ 18426:3b80bdbdc832 v8.1.2207
patch 8.1.2207: "gn" doesn't work quite right
Commit: https://github.com/vim/vim/commit/edaad6e0a0e3c1fcb6a5c2771e647c52475bb19c
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Oct 24 15:23:37 2019 +0200
patch 8.1.2207: "gn" doesn't work quite right
Problem: "gn" doesn't work quite right. (Jaehwang Jerry Jung)
Solution: Improve and simplify the search logic. (Christian Brabandt,
closes #5103, closes #5075)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 24 Oct 2019 15:30:03 +0200 |
parents | 3b5d401a58ce |
children | 35e0ab1f2975 |
line wrap: on
line diff
--- a/src/testdir/test_gn.vim +++ b/src/testdir/test_gn.vim @@ -128,6 +128,27 @@ func Test_gn_command() call assert_equal([' nnoremap', '', 'match'], getline(1,'$')) sil! %d_ + " make sure it works correctly for one-char wide search items + call setline('.', ['abcdefghi']) + let @/ = 'a' + exe "norm! 0fhvhhgNgU" + call assert_equal(['ABCDEFGHi'], getline(1,'$')) + call setline('.', ['abcdefghi']) + let @/ = 'b' + exe "norm! 0fhvhhgngU" + call assert_equal(['abcdefghi'], getline(1,'$')) + sil! %d _ + call setline('.', ['abcdefghi']) + let @/ = 'f' + exe "norm! 0vllgngU" + call assert_equal(['ABCDEFghi'], getline(1,'$')) + sil! %d _ + call setline('.', ['12345678']) + let @/ = '5' + norm! gg0f7vhhhhgnd + call assert_equal(['12348'], getline(1,'$')) + sil! %d _ + set wrapscan&vim endfu