diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-09-09 12:37:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-09 12:37:28 +0200 |
commit | e50ff1b2e9b91e10fce5781395a986a48be8d7b8 (patch) | |
tree | 20645adbd94909e30b011be7b744b411ab9e034f | |
parent | a8bd4de28a83d31f854684490c715be0df4044d6 (diff) | |
parent | 49647ae973dfc0b3448ee1e841d9bfd4af363873 (diff) | |
download | rneovim-e50ff1b2e9b91e10fce5781395a986a48be8d7b8.tar.gz rneovim-e50ff1b2e9b91e10fce5781395a986a48be8d7b8.tar.bz2 rneovim-e50ff1b2e9b91e10fce5781395a986a48be8d7b8.zip |
Merge #8970 from janlazo/vim-8.0.0749
-rw-r--r-- | src/nvim/digraph.c | 37 | ||||
-rw-r--r-- | test/functional/ex_cmds/digraphs_spec.lua | 14 |
2 files changed, 14 insertions, 37 deletions
diff --git a/src/nvim/digraph.c b/src/nvim/digraph.c index c0915224e5..8f7487262e 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 }, // @@ -1520,34 +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); - } - } - - // 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) { @@ -1654,8 +1632,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++; diff --git a/test/functional/ex_cmds/digraphs_spec.lua b/test/functional/ex_cmds/digraphs_spec.lua index f2d0b76739..37d3814136 100644 --- a/test/functional/ex_cmds/digraphs_spec.lua +++ b/test/functional/ex_cmds/digraphs_spec.lua @@ -23,13 +23,13 @@ describe(':digraphs', function() it('displays digraphs', function() feed(':digraphs<CR>') screen:expect([[ - A@ {6:Å} 197 E` {6:È} 200 E^ {6:Ê} 202 E" {6:Ë} 203 I` {6:Ì} 204 | - I^ {6:Î} 206 I" {6:Ï} 207 N~ {6:Ñ} 209 O` {6:Ò} 210 O^ {6:Ô} 212 | - O~ {6:Õ} 213 /\ {6:×} 215 U` {6:Ù} 217 U^ {6:Û} 219 Ip {6:Þ} 222 | - a` {6:à} 224 a^ {6:â} 226 a~ {6:ã} 227 a" {6:ä} 228 a@ {6:å} 229 | - e` {6:è} 232 e^ {6:ê} 234 e" {6:ë} 235 i` {6:ì} 236 i^ {6:î} 238 | - n~ {6:ñ} 241 o` {6:ò} 242 o^ {6:ô} 244 o~ {6:õ} 245 u` {6:ù} 249 | - u^ {6:û} 251 y" {6:ÿ} 255 | + E` {6:È} 200 E^ {6:Ê} 202 E" {6:Ë} 203 I` {6:Ì} 204 I^ {6:Î} 206 | + I" {6:Ï} 207 N~ {6:Ñ} 209 O` {6:Ò} 210 O^ {6:Ô} 212 O~ {6:Õ} 213 | + /\ {6:×} 215 U` {6:Ù} 217 U^ {6:Û} 219 Ip {6:Þ} 222 a` {6:à} 224 | + a^ {6:â} 226 a~ {6:ã} 227 a" {6:ä} 228 a@ {6:å} 229 e` {6:è} 232 | + e^ {6:ê} 234 e" {6:ë} 235 i` {6:ì} 236 i^ {6:î} 238 n~ {6:ñ} 241 | + o` {6:ò} 242 o^ {6:ô} 244 o~ {6:õ} 245 u` {6:ù} 249 u^ {6:û} 251 | + y" {6:ÿ} 255 | {3:Press ENTER or type command to continue}^ | ]]) end) |