diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-12-03 13:20:29 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-12-03 13:20:29 +0000 |
commit | c14b57c0795671bafca14433bc376acfe6135a3a (patch) | |
tree | b3ae6ef9955b0707f6c159623bc15f72cc22011f /src/testdir/test_termcodes.vim | |
parent | c903695be54189fd7199121e9cd669e722fbc9c2 (diff) |
patch 8.2.3727: in a gnome terminal keys are recognized as mouse eventsv8.2.3727
Problem: In a gnome terminal keys are recognized as mouse events.
Solution: Only recognize DEC mouse events when four numbers are following.
(closes #9256)
Diffstat (limited to 'src/testdir/test_termcodes.vim')
-rw-r--r-- | src/testdir/test_termcodes.vim | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/testdir/test_termcodes.vim b/src/testdir/test_termcodes.vim index ba02584572..887093c807 100644 --- a/src/testdir/test_termcodes.vim +++ b/src/testdir/test_termcodes.vim @@ -2039,6 +2039,28 @@ func Test_modifyOtherKeys_no_mapping() set timeoutlen& endfunc +" Check that when DEC mouse codes are recognized a special key is handled. +func Test_ignore_dec_mouse() + + new + let save_mouse = &mouse + let save_term = &term + let save_ttymouse = &ttymouse + call test_override('no_query_mouse', 1) + set mouse=a term=gnome ttymouse= + + execute "set <xF1>=\<Esc>[1;*P" + nnoremap <S-F1> agot it<Esc> + call feedkeys("\<Esc>[1;2P", 'Lx!') + call assert_equal('got it', getline(1)) + + let &mouse = save_mouse + let &term = save_term + let &ttymouse = save_ttymouse + call test_override('no_query_mouse', 0) + bwipe! +endfunc + func RunTest_mapping_shift(key, func) call setline(1, '') if a:key == '|' |