diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-04-17 16:33:46 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-04-17 16:33:46 +0200 |
commit | 696d6377289eb7c703263aaabe58134968335c4b (patch) | |
tree | 8645555353c1ed4a7b7fca3118af87d813d8a6af | |
parent | 4945219b99f8e191c599f80dedc0c4be02ed821e (diff) | |
download | vim-git-696d6377289eb7c703263aaabe58134968335c4b.tar.gz |
patch 8.1.1179: no test for mouse clicks in the fold columnv8.1.1179
Problem: No test for mouse clicks in the fold column.
Solution: Add a test. (Dominique Pelle, closes #4261)
-rw-r--r-- | src/testdir/test_termcodes.vim | 51 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 53 insertions, 0 deletions
diff --git a/src/testdir/test_termcodes.vim b/src/testdir/test_termcodes.vim index 7fff535d1..578dacf96 100644 --- a/src/testdir/test_termcodes.vim +++ b/src/testdir/test_termcodes.vim @@ -395,3 +395,54 @@ func Test_xterm_mouse_double_click_to_create_tab() let &ttymouse = save_ttymouse set mousetime& endfunc + +func Test_xterm_mouse_click_in_fold_columns() + new + let save_mouse = &mouse + let save_term = &term + let save_ttymouse = &ttymouse + let save_foldcolumn = &foldcolumn + set mouse=a term=xterm foldcolumn=3 + + " Create 2 nested folds. + call setline(1, range(1, 7)) + 2,6fold + norm! zR + 4,5fold + call assert_equal([-1, -1, -1, 4, 4, -1, -1], + \ map(range(1, 7), 'foldclosed(v:val)')) + + " Click in "+" of inner fold in foldcolumn should open it. + redraw + let row = 4 + let col = 2 + call MouseLeftClick(row, col) + call MouseLeftRelease(row, col) + call assert_equal([-1, -1, -1, -1, -1, -1, -1], + \ map(range(1, 7), 'foldclosed(v:val)')) + + " Click in "-" of outer fold in foldcolumn should close it. + redraw + let row = 2 + let col = 1 + call MouseLeftClick(row, col) + call MouseLeftRelease(row, col) + call assert_equal([-1, 2, 2, 2, 2, 2, -1], + \ map(range(1, 7), 'foldclosed(v:val)')) + norm! zR + + " Click in "|" of inner fold in foldcolumn should close it. + redraw + let row = 5 + let col = 2 + call MouseLeftClick(row, col) + call MouseLeftRelease(row, col) + call assert_equal([-1, -1, -1, 4, 4, -1, -1], + \ map(range(1, 7), 'foldclosed(v:val)')) + + let &foldcolumn = save_foldcolumn + let &ttymouse = save_ttymouse + let &term = save_term + let &mouse = save_mouse + bwipe! +endfunc diff --git a/src/version.c b/src/version.c index 585f2fd39..87a4e47c5 100644 --- a/src/version.c +++ b/src/version.c @@ -772,6 +772,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1179, +/**/ 1178, /**/ 1177, |