]> granicus.if.org Git - vim/commitdiff
patch 8.1.1759: no mode char for terminal mapping from maparg() v8.1.1759
authorBram Moolenaar <Bram@vim.org>
Sat, 27 Jul 2019 19:05:21 +0000 (21:05 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 27 Jul 2019 19:05:21 +0000 (21:05 +0200)
Problem:    No mode char for terminal mapping from maparg().
Solution:   Check for TERMINAL mode. (closes #4735)

src/getchar.c
src/testdir/test_maparg.vim
src/version.c

index e0c8fdad73d7ecc76a6b6d5281ac5d14422c33b0..0048ae0f6a05bd5eb7873dd844131cd743bcea0d 100644 (file)
@@ -4009,6 +4009,8 @@ map_mode_to_chars(int mode)
            ga_append(&mapmode, 'n');                   /* :nmap */
        if (mode & OP_PENDING)
            ga_append(&mapmode, 'o');                   /* :omap */
+       if (mode & TERMINAL)
+           ga_append(&mapmode, 't');                   /* :tmap */
        if ((mode & (VISUAL + SELECTMODE)) == VISUAL + SELECTMODE)
            ga_append(&mapmode, 'v');                   /* :vmap */
        else
index 86e046b5d609c56ee68832fcafc9f90c19c5c299..f7524f56d995d78b22f5bd3b4998339e9fd92d52 100644 (file)
@@ -29,6 +29,12 @@ function Test_maparg()
         \ 'nowait': 1, 'expr': 0, 'sid': sid, 'lnum': lnum + 1, 'rhs': 'bar',
        \ 'buffer': 1},
         \ maparg('foo', '', 0, 1))
+  let lnum = expand('<sflnum>')
+  tmap baz foo
+  call assert_equal({'silent': 0, 'noremap': 0, 'lhs': 'baz', 'mode': 't',
+        \ 'nowait': 0, 'expr': 0, 'sid': sid, 'lnum': lnum + 1, 'rhs': 'foo',
+       \ 'buffer': 0},
+        \ maparg('baz', 't', 0, 1))
 
   map abc x<char-114>x
   call assert_equal("xrx", maparg('abc'))
index 209f3c966db75d2c3f858f26fe08b9e49765da9d..2aedc6a273def54dd5f6f99d18a15c1d772b72c8 100644 (file)
@@ -777,6 +777,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1759,
 /**/
     1758,
 /**/