diff options
| author | Michael Ennen <mike.ennen@gmail.com> | 2016-12-06 17:15:49 -0700 |
|---|---|---|
| committer | Michael Ennen <mike.ennen@gmail.com> | 2016-12-06 17:15:49 -0700 |
| commit | c5d2e442a34e090ed3e9294c4d1d51b3c23d8d24 (patch) | |
| tree | 39e0a8e0d99dd8df67b4991f87b787a6cceb47fd /src/nvim/testdir | |
| parent | 0064e9738aec725b9cf4b29f425b0da7ecc8fd46 (diff) | |
| download | rneovim-c5d2e442a34e090ed3e9294c4d1d51b3c23d8d24.tar.gz rneovim-c5d2e442a34e090ed3e9294c4d1d51b3c23d8d24.tar.bz2 rneovim-c5d2e442a34e090ed3e9294c4d1d51b3c23d8d24.zip | |
vim-patch:7.4.2269
Problem: Using 'hlsearch' highlighting instead of matchpos if there is no
search match.
Solution: Pass NULL as last item to next_search_hl() when searching for
'hlsearch' match. (Shane Harper, closes vim/vim#1013)
https://github.com/vim/vim/commit/e17bdffff78ebd6a4e3cff26754cc667557ea810
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_match.vim | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_match.vim b/src/nvim/testdir/test_match.vim index 67f3ea7373..ce06143bad 100644 --- a/src/nvim/testdir/test_match.vim +++ b/src/nvim/testdir/test_match.vim @@ -186,4 +186,31 @@ func Test_matchaddpos() set hlsearch& endfunc +func Test_matchaddpos_using_negative_priority() + set hlsearch + + call clearmatches() + + call setline(1, 'x') + let @/='x' + redraw! + let search_attr = screenattr(1,1) + + let @/='' + call matchaddpos('Error', [1], 10) + redraw! + let error_attr = screenattr(1,1) + + call setline(2, '-1 match priority') + call matchaddpos('Error', [2], -1) + redraw! + let negative_match_priority_attr = screenattr(2,1) + + call assert_notequal(negative_match_priority_attr, search_attr, "Match with negative priority is incorrectly highlighted with Search highlight.") + call assert_equal(negative_match_priority_attr, error_attr) + + nohl + set hlsearch& +endfunc + " vim: et ts=2 sw=2 |