# HG changeset patch # User Bram Moolenaar # Date 1564254905 -7200 # Node ID e17cbc3e545dac70e77f383c4c9aad2acdbdac78 # Parent 759cc01b28b5e9c3c2f82864d79a5f95965cbcb5 patch 8.1.1759: no mode char for terminal mapping from maparg() commit https://github.com/vim/vim/commit/14371ed69778107654e39268d0d90982e53ad6e0 Author: Bram Moolenaar Date: Sat Jul 27 21:05:21 2019 +0200 patch 8.1.1759: no mode char for terminal mapping from maparg() Problem: No mode char for terminal mapping from maparg(). Solution: Check for TERMINAL mode. (closes https://github.com/vim/vim/issues/4735) diff --git a/src/getchar.c b/src/getchar.c --- a/src/getchar.c +++ b/src/getchar.c @@ -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 diff --git a/src/testdir/test_maparg.vim b/src/testdir/test_maparg.vim --- a/src/testdir/test_maparg.vim +++ b/src/testdir/test_maparg.vim @@ -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('') + 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 xx call assert_equal("xrx", maparg('abc')) diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -778,6 +778,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1759, +/**/ 1758, /**/ 1757,