patch 9.0.0449: there is no easy way to translate a key code into a string
Problem: There is no easy way to translate a string with a key code into a
readable string.
Solution: Add the keytrans() function. (closes #11114)
diff --git a/src/option.c b/src/option.c
index 5ce5218..37c81aa 100644
--- a/src/option.c
+++ b/src/option.c
@@ -3994,7 +3994,8 @@
if (stringval != NULL)
{
if ((char_u **)varp == &p_pt) // 'pastetoggle'
- *stringval = str2special_save(*(char_u **)(varp), FALSE);
+ *stringval = str2special_save(*(char_u **)(varp), FALSE,
+ FALSE);
#ifdef FEAT_CRYPT
// never return the value of the crypt key
else if ((char_u **)varp == &curbuf->b_p_key
@@ -4879,7 +4880,7 @@
{
s = *valuep;
while (*s != NUL)
- if (put_escstr(fd, str2special(&s, FALSE), 2) == FAIL)
+ if (put_escstr(fd, str2special(&s, FALSE, FALSE), 2) == FAIL)
return FAIL;
}
// expand the option value, replace $HOME by ~