From 5f1a5d264aac36d3b943956de8033ef7abc2e14c Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 8 Sep 2018 21:28:22 -0400 Subject: vim-patch:8.0.0749: some unicode digraphs are hard to remember Problem: Some unicode digraphs are hard to remember. Solution: Add alternatives with a backtick. (Chris Harding, closes vim/vim#1861) https://github.com/vim/vim/commit/816e7660e1efb918ad85b5c78d21b957d1bcad17 --- src/nvim/digraph.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/nvim/digraph.c b/src/nvim/digraph.c index c0915224e5..aa533edf6c 100644 --- a/src/nvim/digraph.c +++ b/src/nvim/digraph.c @@ -1359,6 +1359,12 @@ static digr_T digraphdefault[] = { 'f', 't', 0xfb05 }, { 's', 't', 0xfb06 }, + // extra alternatives, easier to remember + { 'W', '`', 0x1e80 }, + { 'w', '`', 0x1e81 }, + { 'Y', '`', 0x1ef2 }, + { 'y', '`', 0x1ef3 }, + // Vim 5.x compatible digraphs that don't conflict with the above { '~', '!', 161 }, // ¡ { 'c', '|', 162 }, // ¢ -- cgit From 03bcfb54dbdcb90087c020b5d1256f2d6c2df14c Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 8 Sep 2018 23:32:33 -0400 Subject: digraph: refactor code that checks has_mbyte has_mbyte is always true in nvim. --- src/nvim/digraph.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src') diff --git a/src/nvim/digraph.c b/src/nvim/digraph.c index aa533edf6c..7adb54cb6a 100644 --- a/src/nvim/digraph.c +++ b/src/nvim/digraph.c @@ -1549,11 +1549,6 @@ static int getexactdigraph(int char1, int char2, int meta_char) } } - // Ignore multi-byte characters when not in multi-byte mode. - if (!has_mbyte && (retval > 0xff)) { - retval = 0; - } - if (retval == 0) { // digraph deleted or not found if ((char1 == ' ') && meta_char) { @@ -1660,8 +1655,7 @@ void listdigraphs(void) tmp.result = getexactdigraph(tmp.char1, tmp.char2, FALSE); if ((tmp.result != 0) - && (tmp.result != tmp.char2) - && (has_mbyte || (tmp.result <= 255))) { + && (tmp.result != tmp.char2)) { printdigraph(&tmp); } dp++; -- cgit From 49647ae973dfc0b3448ee1e841d9bfd4af363873 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 8 Sep 2018 23:38:17 -0400 Subject: digraph: delete code that checks enc_utf8 enc_utf8 is always true in nvim. --- src/nvim/digraph.c | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'src') diff --git a/src/nvim/digraph.c b/src/nvim/digraph.c index 7adb54cb6a..8f7487262e 100644 --- a/src/nvim/digraph.c +++ b/src/nvim/digraph.c @@ -1526,29 +1526,6 @@ static int getexactdigraph(int char1, int char2, int meta_char) } } - if ((retval != 0) && !enc_utf8) { - char_u buf[6], *to; - vimconv_T vc; - - // Convert the Unicode digraph to 'encoding'. - int i = utf_char2bytes(retval, buf); - retval = 0; - vc.vc_type = CONV_NONE; - - if (convert_setup(&vc, (char_u *)"utf-8", p_enc) == OK) { - vc.vc_fail = true; - assert(i >= 0); - size_t len = (size_t)i; - to = string_convert(&vc, buf, &len); - - if (to != NULL) { - retval = utf_ptr2char(to); - xfree(to); - } - (void)convert_setup(&vc, NULL, NULL); - } - } - if (retval == 0) { // digraph deleted or not found if ((char1 == ' ') && meta_char) { -- cgit