Mercurial > vim
diff src/typval.c @ 20603:c2570baa2e4c v8.2.0855
patch 8.2.0855: GUI tests fail because the test doesn't use a modifier
Commit: https://github.com/vim/vim/commit/ebe9d34aa07037cff2188a8dd424ee1f59cbb0bf
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat May 30 21:52:54 2020 +0200
patch 8.2.0855: GUI tests fail because the test doesn't use a modifier
Problem: GUI tests fail because the test doesn't use a modifier.
Solution: Add "\{xxx}" to be able to encode a modifier.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 30 May 2020 22:00:04 +0200 |
parents | f502455965c0 |
children | 8bce783af0cb |
line wrap: on
line diff
--- a/src/typval.c +++ b/src/typval.c @@ -1285,15 +1285,24 @@ get_string_tv(char_u **arg, typval_T *re ++name; break; - // Special key, e.g.: "\<C-W>" - case '<': extra = trans_special(&p, name, TRUE, TRUE, - TRUE, NULL); - if (extra != 0) + // Special key, e.g.: "\<C-W>" or "\{C-W}" + case '<': + case '{': { - name += extra; - if (name >= rettv->vval.v_string + len) - iemsg("get_string_tv() used more space than allocated"); - break; + int flags = FSK_KEYCODE | FSK_IN_STRING; + + if (*p == '<') + flags |= FSK_SIMPLIFY; + else + flags |= FSK_CURLY; + extra = trans_special(&p, name, flags, NULL); + if (extra != 0) + { + name += extra; + if (name >= rettv->vval.v_string + len) + iemsg("get_string_tv() used more space than allocated"); + break; + } } // FALLTHROUGH