diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-08-27 18:34:29 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-08-27 18:34:29 +0200 |
commit | e17bdffff78ebd6a4e3cff26754cc667557ea810 (patch) | |
tree | 10710296d3d60c51938e5f7e577abe2edccbdb47 /src/testdir/test_match.vim | |
parent | 1195669f9e434fa9ab8b57ee9470bf951e4990b8 (diff) | |
download | vim-git-e17bdffff78ebd6a4e3cff26754cc667557ea810.tar.gz |
patch 7.4.2269v7.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 #1013)
Diffstat (limited to 'src/testdir/test_match.vim')
-rw-r--r-- | src/testdir/test_match.vim | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/testdir/test_match.vim b/src/testdir/test_match.vim index 000893673..9ac1db157 100644 --- a/src/testdir/test_match.vim +++ b/src/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: shiftwidth=2 sts=2 expandtab |