From 48a35106efefa8f74d850d3eac365dc76b008ca3 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 25 Apr 2022 06:41:01 +0800 Subject: vim-patch:8.2.4818: no test for what 8.2.4806 fixes Problem: No test for what 8.2.4806 fixes. Solution: Add a test. (closes vim/vim#10727) https://github.com/vim/vim/commit/ac92ab771952b2a9ee39ea6fa5e70e4c072942d5 Test cannot be used because it must use test_setmouse(). Use a Lua test. --- test/functional/legacy/mapping_spec.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'test/functional/legacy/mapping_spec.lua') diff --git a/test/functional/legacy/mapping_spec.lua b/test/functional/legacy/mapping_spec.lua index aa29698589..0f65d5eb65 100644 --- a/test/functional/legacy/mapping_spec.lua +++ b/test/functional/legacy/mapping_spec.lua @@ -129,10 +129,23 @@ describe('mapping', function() ]]) end) + it('dragging starts Select mode even if coming from mapping vim-patch:8.2.4806', function() + command('set mouse=a') + command('set selectmode=mouse') + + command('nnoremap ') + sleep(10) + meths.input_mouse('left', 'press', '', 0, 0, 0) + sleep(10) + meths.input_mouse('left', 'drag', '', 0, 0, 1) + sleep(10) + eq('s', eval('mode()')) + end) + it(' mapping in Insert mode works correctly vim-patch:8.2.4692', function() command('set mouse=a') - command([[inoremap let g:dragged = 1]]) + command('inoremap let g:dragged = 1') feed('i') sleep(10) meths.input_mouse('left', 'press', '', 0, 0, 0) -- cgit