comparison src/typval.c @ 20627:8bce783af0cb v8.2.0867

patch 8.2.0867: using {xxx} for encoding a modifier is not nice Commit: https://github.com/vim/vim/commit/fccd93f0917234b962ce07d1df3adf9d7105936f Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 31 22:06:51 2020 +0200 patch 8.2.0867: using \{xxx} for encoding a modifier is not nice Problem: Using \{xxx} for encoding a modifier is not nice. Solution: Use \<*xxx> instead, since it's the same as \<xxx> but producing a different code.
author Bram Moolenaar <Bram@vim.org>
date Sun, 31 May 2020 22:15:03 +0200
parents c2570baa2e4c
children 0aeac2b45846
comparison
equal deleted inserted replaced
20626:38f728a93c07 20627:8bce783af0cb
1283 *name = (*name << 3) + *p++ - '0'; 1283 *name = (*name << 3) + *p++ - '0';
1284 } 1284 }
1285 ++name; 1285 ++name;
1286 break; 1286 break;
1287 1287
1288 // Special key, e.g.: "\<C-W>" or "\{C-W}" 1288 // Special key, e.g.: "\<C-W>"
1289 case '<': 1289 case '<':
1290 case '{':
1291 { 1290 {
1292 int flags = FSK_KEYCODE | FSK_IN_STRING; 1291 int flags = FSK_KEYCODE | FSK_IN_STRING;
1293 1292
1294 if (*p == '<') 1293 if (p[1] != '*')
1295 flags |= FSK_SIMPLIFY; 1294 flags |= FSK_SIMPLIFY;
1296 else
1297 flags |= FSK_CURLY;
1298 extra = trans_special(&p, name, flags, NULL); 1295 extra = trans_special(&p, name, flags, NULL);
1299 if (extra != 0) 1296 if (extra != 0)
1300 { 1297 {
1301 name += extra; 1298 name += extra;
1302 if (name >= rettv->vval.v_string + len) 1299 if (name >= rettv->vval.v_string + len)