0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

updated for version 7.3.032

Problem:    maparg() doesn't return the flags, such as <buffer>, <script>,
            <silent>.  These are needed to save and restore a mapping.
Solution:   Improve maparg(). (also by Christian Brabandt)
This commit is contained in:
Bram Moolenaar
2010-10-20 21:23:33 +02:00
parent 727c876b78
commit bd74325960
11 changed files with 196 additions and 74 deletions

View File

@@ -1477,6 +1477,27 @@ msg_outtrans_special(strstart, from)
return retval;
}
#if defined(FEAT_EVAL) || defined(PROTO)
/*
* Return the lhs or rhs of a mapping, with the key codes turned into printable
* strings, in an allocated string.
*/
char_u *
str2special_save(str, is_lhs)
char_u *str;
int is_lhs; /* TRUE for lhs, FALSE for rhs */
{
garray_T ga;
char_u *p = str;
ga_init2(&ga, 1, 40);
while (*p != NUL)
ga_concat(&ga, str2special(&p, is_lhs));
ga_append(&ga, NUL);
return (char_u *)ga.ga_data;
}
#endif
/*
* Return the printable string for the key codes at "*sp".
* Used for translating the lhs or rhs of a mapping to printable chars.