aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-03-21 13:22:14 +0100
committerJustin M. Keyes <justinkz@gmail.com>2017-03-22 18:42:58 +0100
commit5ee211770d9c7999a01413f368e82588f3d0426d (patch)
treea5872cdc0b9dce385dcfd442a349b2ba06c48645
parent929859ed8156a45f5acb491d82f8c06ef5f57902 (diff)
downloadrneovim-5ee211770d9c7999a01413f368e82588f3d0426d.tar.gz
rneovim-5ee211770d9c7999a01413f368e82588f3d0426d.tar.bz2
rneovim-5ee211770d9c7999a01413f368e82588f3d0426d.zip
vim-patch:8.0.0033
Problem: Cannot use overlapping positions with matchaddpos(). Solution: Check end of match. (Ozaki Kiichi) Add a test (Hirohito Higashi) https://github.com/vim/vim/commit/a6c27ee6db2c328e0ab0e6d143e2a295a0bb9c9a
-rw-r--r--src/nvim/testdir/test_match.vim10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_match.vim b/src/nvim/testdir/test_match.vim
index 9398ef2f27..066bb2f6a1 100644
--- a/src/nvim/testdir/test_match.vim
+++ b/src/nvim/testdir/test_match.vim
@@ -198,6 +198,16 @@ func Test_matchaddpos()
call assert_equal(screenattr(2,2), screenattr(1,10))
call assert_notequal(screenattr(2,2), screenattr(1,11))
+ " Check overlapping pos
+ call clearmatches()
+ call setline(1, ['1234567890', 'NH'])
+ call matchaddpos('Error', [[1,1,5], [1,3,5], [2,2]])
+ redraw!
+ call assert_notequal(screenattr(2,2), 0)
+ call assert_equal(screenattr(2,2), screenattr(1,5))
+ call assert_equal(screenattr(2,2), screenattr(1,7))
+ call assert_notequal(screenattr(2,2), screenattr(1,8))
+
nohl
call clearmatches()
syntax off