comparison src/testdir/test_mapping.vim @ 19178:f7081bd2680e v8.2.0148

patch 8.2.0148: mapping related function in wrong source file Commit: https://github.com/vim/vim/commit/7f51bbe0d19f1f0cb0321326f45a17b4f5155f89 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jan 24 20:21:19 2020 +0100 patch 8.2.0148: mapping related function in wrong source file Problem: Mapping related function in wrong source file. Solution: Move the function. Add a few more test cases. (Yegappan Lakshmanan, closes #5528)
author Bram Moolenaar <Bram@vim.org>
date Fri, 24 Jan 2020 20:30:04 +0100
parents ad40333f2ec0
children 02111977dd05
comparison
equal deleted inserted replaced
19177:0d7b7b121ca6 19178:f7081bd2680e
474 " List <Nop> mapping 474 " List <Nop> mapping
475 nmap ,n <Nop> 475 nmap ,n <Nop>
476 call assert_equal(['n ,n <Nop>'], 476 call assert_equal(['n ,n <Nop>'],
477 \ execute('nmap ,n')->trim()->split("\n")) 477 \ execute('nmap ,n')->trim()->split("\n"))
478 478
479 " verbose map
480 call assert_match("\tLast set from .*/test_mapping.vim line \\d\\+$",
481 \ execute('verbose map ,n')->trim()->split("\n")[1])
482
483 " map to CTRL-V
484 exe "nmap ,k \<C-V>"
485 call assert_equal(['n ,k <Nop>'],
486 \ execute('nmap ,k')->trim()->split("\n"))
487
479 nmapclear 488 nmapclear
480 endfunc 489 endfunc
481 490
482 func Test_expr_map_restore_cursor() 491 func Test_expr_map_restore_cursor()
483 CheckScreendump 492 CheckScreendump
810 abbr foo bar 819 abbr foo bar
811 unabbr foo<space><tab> 820 unabbr foo<space><tab>
812 call assert_equal({}, maparg('foo', 'i', 1, 1)) 821 call assert_equal({}, maparg('foo', 'i', 1, 1))
813 endfunc 822 endfunc
814 823
824 " Trigger an abbreviation using a special key
825 func Test_abbr_trigger_special()
826 new
827 iabbr teh the
828 call feedkeys("iteh\<F2>\<Esc>", 'xt')
829 call assert_equal('the<F2>', getline(1))
830 iunab teh
831 close!
832 endfunc
833
834 " Test for '<' in 'cpoptions'
835 func Test_map_cpo_special_keycode()
836 set cpo-=<
837 imap x<Bslash>k Test
838 let d = maparg('x<Bslash>k', 'i', 0, 1)
839 call assert_equal(['x\k', 'Test', 'i'], [d.lhs, d.rhs, d.mode])
840 call feedkeys(":imap x\<C-A>\<C-B>\"\<CR>", 'tx')
841 call assert_equal('"imap x\k', @:)
842 iunmap x<Bslash>k
843 set cpo+=<
844 imap x<Bslash>k Test
845 let d = maparg('x<Bslash>k', 'i', 0, 1)
846 call assert_equal(['x<Bslash>k', 'Test', 'i'], [d.lhs, d.rhs, d.mode])
847 call feedkeys(":imap x\<C-A>\<C-B>\"\<CR>", 'tx')
848 call assert_equal('"imap x<Bslash>k', @:)
849 iunmap x<Bslash>k
850 set cpo-=<
851 " Modifying 'cpo' above adds some default mappings, remove them
852 mapclear
853 mapclear!
854 endfunc
855
815 " vim: shiftwidth=2 sts=2 expandtab 856 " vim: shiftwidth=2 sts=2 expandtab