diff options
Diffstat (limited to 'test/functional/legacy/mapping_spec.lua')
-rw-r--r-- | test/functional/legacy/mapping_spec.lua | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/functional/legacy/mapping_spec.lua b/test/functional/legacy/mapping_spec.lua index 92a757ca85..aa29698589 100644 --- a/test/functional/legacy/mapping_spec.lua +++ b/test/functional/legacy/mapping_spec.lua @@ -3,6 +3,8 @@ local helpers = require('test.functional.helpers')(after_each) local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert local feed_command, expect, poke_eventloop = helpers.feed_command, helpers.expect, helpers.poke_eventloop +local command, eq, eval, meths = helpers.command, helpers.eq, helpers.eval, helpers.meths +local sleep = helpers.sleep describe('mapping', function() before_each(clear) @@ -126,4 +128,28 @@ describe('mapping', function() new line here ]]) end) + + it('<LeftDrag> mapping in Insert mode works correctly vim-patch:8.2.4692', function() + command('set mouse=a') + + command([[inoremap <LeftDrag> <LeftDrag><Cmd>let g:dragged = 1<CR>]]) + feed('i') + sleep(10) + meths.input_mouse('left', 'press', '', 0, 0, 0) + sleep(10) + meths.input_mouse('left', 'drag', '', 0, 0, 1) + sleep(10) + eq(1, eval('g:dragged')) + eq('v', eval('mode()')) + feed([[<C-\><C-N>]]) + + command([[inoremap <LeftDrag> <LeftDrag><C-\><C-N>]]) + feed('i') + sleep(10) + meths.input_mouse('left', 'press', '', 0, 0, 0) + sleep(10) + meths.input_mouse('left', 'drag', '', 0, 0, 1) + sleep(10) + eq('n', eval('mode()')) + end) end) |