comparison src/testdir/test_langmap.vim @ 30944:109aa4913cba v9.0.0806

patch 9.0.0806: 'langmap' works differently when there are modifiers Commit: https://github.com/vim/vim/commit/49660f5139d3fd55326a54eadf6bb31a3ffec2bf Author: zeertzjq <zeertzjq@outlook.com> Date: Thu Oct 20 17:59:38 2022 +0100 patch 9.0.0806: 'langmap' works differently when there are modifiers Problem: 'langmap' works differently when there are modifiers. Solution: Only apply 'langmap' to a character where modifiers have no effect. (closes #11395, closes #11404)
author Bram Moolenaar <Bram@vim.org>
date Thu, 20 Oct 2022 19:00:04 +0200
parents 08940efa6b4e
children 360f286b5869
comparison
equal deleted inserted replaced
30943:60aced971a03 30944:109aa4913cba
47 call feedkeys('ggfo,', 'tx') 47 call feedkeys('ggfo,', 'tx')
48 call assert_equal(8, col('.')) 48 call assert_equal(8, col('.'))
49 call feedkeys(';', 'tx') 49 call feedkeys(';', 'tx')
50 call assert_equal(5, col('.')) 50 call assert_equal(5, col('.'))
51 51
52 set langmap=RL
53 let g:counter = 0
54 nnoremap L;L <Cmd>let g:counter += 1<CR>
55 nnoremap <C-L> <Cmd>throw 'This mapping shoud not be triggered'<CR>
56
57 " 'langmap' is applied to keys without modifiers when matching a mapping
58 call feedkeys('R;R', 'tx')
59 call assert_equal(1, g:counter)
60 nunmap L;L
61 unlet g:counter
62
63 delete
64 call assert_equal('', getline(1))
65 undo
66 call assert_equal('Hello World', getline(1))
67 " 'langmap' does not change Ctrl-R to Ctrl-L for consistency
68 call feedkeys("\<*C-R>", 'tx')
69 call assert_equal('', getline(1))
70
71 set langmap=6L
72 undo
73 setlocal bufhidden=hide
74 let oldbuf = bufnr()
75 enew
76 call assert_notequal(oldbuf, bufnr())
77 " 'langmap' does not change Ctrl-6 to Ctrl-L for consistency
78 " Ctrl-6 becomes Ctrl-^ after merging the Ctrl modifier
79 call feedkeys("\<*C-6>", 'tx')
80 call assert_equal(oldbuf, bufnr())
81 setlocal bufhidden&
82
83 nunmap <C-L>
84
52 set langmap& 85 set langmap&
53 quit! 86 quit!
54 endfunc 87 endfunc
55 88
56 " vim: shiftwidth=2 sts=2 expandtab 89 " vim: shiftwidth=2 sts=2 expandtab