vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit ac1626d8ab5d07f3bb312992410a52b894fe1884 parent d65d07b50e890a16fd44db61f007535f31349403 Author: Marc André Tanner <mat@brain-dump.org> Date: Thu, 1 Jun 2017 11:06:16 +0200 vis: use more portable format string for wchar_t Use upper case Unicode (U+XXXX) notation for `ga`. Fix #568 Diffstat:
| M | main.c | | | 3 | ++- |
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/main.c b/main.c @@ -6,6 +6,7 @@ #include <ctype.h> #include <errno.h> #include <fcntl.h> +#include <inttypes.h> #include <sys/stat.h> #include <sys/types.h> @@ -2004,7 +2005,7 @@ static const char *unicode_info(Vis *vis, const char *keys, const Arg *arg) { else buffer_appendf(&info, "<%s%.*s> ", combining ? " " : "", (int)len, codepoint); if (arg->i == VIS_ACTION_UNICODE_INFO) { - buffer_appendf(&info, "U+%04x ", wc); + buffer_appendf(&info, "U+%04"PRIX32" ", (uint32_t)wc); } else { for (size_t i = 0; i < len; i++) buffer_appendf(&info, "%02x ", (uint8_t)codepoint[i]);