mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.0.1553: cannot see what digraph is used to insert a character
Problem: Cannot see what digraph is used to insert a character. Solution: Show the digraph with the "ga" command. (Christian Brabandt)
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user