mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge #8970 from janlazo/vim-8.0.0749
This commit is contained in:
commit
e50ff1b2e9
@ -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++;
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user