To: vim_dev@googlegroups.com Subject: Patch 7.3.285 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.3.285 (after 7.3.284) Problem: Mapping no longer works. Solution: Properly check for "char-". Add a test for it. Files: src/misc2.c, src/testdir/test75.in, src/testdir/test75.ok *** ../vim-7.3.284/src/misc2.c 2011-08-17 20:33:18.000000000 +0200 --- src/misc2.c 2011-08-19 22:08:37.000000000 +0200 *************** *** 2781,2786 **** --- 2781,2792 ---- } if (bp[0] == 't' && bp[1] == '_' && bp[2] && bp[3]) bp += 3; /* skip t_xx, xx may be '-' or '>' */ + else if (STRNICMP(bp, "char-", 5) == 0) + { + vim_str2nr(bp + 5, NULL, &l, TRUE, TRUE, NULL, NULL); + bp += l + 5; + break; + } } if (*bp == '>') /* found matching '>' */ *************** *** 2810,2836 **** { /* or or */ vim_str2nr(last_dash + 6, NULL, NULL, TRUE, TRUE, NULL, &n); ! *modp = modifiers; ! *srcp = end_of_name; ! return (int)n; } - - /* - * Modifier with single letter, or special key name. - */ - #ifdef FEAT_MBYTE - if (has_mbyte) - l = mb_ptr2len(last_dash + 1); - else - #endif - l = 1; - if (modifiers != 0 && last_dash[l + 1] == '>') - key = PTR2CHAR(last_dash + 1); else { ! key = get_special_key_code(last_dash + 1); ! if (!keep_x_key) ! key = handle_x_keys(key); } /* --- 2816,2842 ---- { /* or or */ vim_str2nr(last_dash + 6, NULL, NULL, TRUE, TRUE, NULL, &n); ! key = (int)n; } else { ! /* ! * Modifier with single letter, or special key name. ! */ ! #ifdef FEAT_MBYTE ! if (has_mbyte) ! l = mb_ptr2len(last_dash + 1); ! else ! #endif ! l = 1; ! if (modifiers != 0 && last_dash[l + 1] == '>') ! key = PTR2CHAR(last_dash + 1); ! else ! { ! key = get_special_key_code(last_dash + 1); ! if (!keep_x_key) ! key = handle_x_keys(key); ! } } /* *** ../vim-7.3.284/src/testdir/test75.in 2010-10-20 21:22:17.000000000 +0200 --- src/testdir/test75.in 2011-08-19 22:05:13.000000000 +0200 *************** *** 2,7 **** --- 2,8 ---- STARTTEST :so small.vim + :set cpo-=< :" Test maparg() with a string result :map foo isfoo :vnoremap