diff options
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r-- | src/ex_cmds.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c index e05215a596..5b8e2d5226 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -49,6 +49,9 @@ do_ascii(exarg_T *eap UNUSED) char buf1[20]; char buf2[20]; char_u buf3[7]; +#ifdef FEAT_DIGRAPHS + char_u *dig; +#endif #ifdef FEAT_MBYTE int cc[MAX_MCO]; int ci = 0; @@ -94,7 +97,15 @@ do_ascii(exarg_T *eap UNUSED) else #endif buf2[0] = NUL; - vim_snprintf((char *)IObuff, IOSIZE, +#ifdef FEAT_DIGRAPHS + dig = get_digraph_for_char(cval); + if (dig != NULL) + vim_snprintf((char *)IObuff, IOSIZE, + _("<%s>%s%s %d, Hex %02x, Oct %03o, Digr %s"), + transchar(c), buf1, buf2, cval, cval, cval, dig); + else +#endif + vim_snprintf((char *)IObuff, IOSIZE, _("<%s>%s%s %d, Hex %02x, Octal %03o"), transchar(c), buf1, buf2, cval, cval, cval); #ifdef FEAT_MBYTE @@ -121,9 +132,19 @@ do_ascii(exarg_T *eap UNUSED) ) IObuff[len++] = ' '; /* draw composing char on top of a space */ len += (*mb_char2bytes)(c, IObuff + len); - vim_snprintf((char *)IObuff + len, IOSIZE - len, - c < 0x10000 ? _("> %d, Hex %04x, Octal %o") - : _("> %d, Hex %08x, Octal %o"), c, c, c); +#ifdef FEAT_DIGRAPHS + dig = get_digraph_for_char(c); + if (dig != NULL) + vim_snprintf((char *)IObuff + len, IOSIZE - len, + c < 0x10000 ? _("> %d, Hex %04x, Oct %o, Digr %s") + : _("> %d, Hex %08x, Oct %o, Digr %s"), + c, c, c, dig); + else +#endif + vim_snprintf((char *)IObuff + len, IOSIZE - len, + c < 0x10000 ? _("> %d, Hex %04x, Octal %o") + : _("> %d, Hex %08x, Octal %o"), + c, c, c); if (ci == MAX_MCO) break; if (enc_utf8) |