Mercurial > vim
comparison src/gui_photon.c @ 15595:1ec942f1b648 v8.1.0805
patch 8.1.0805: too many #ifdefs
commit https://github.com/vim/vim/commit/135059724f140ceac889c9f8136bd1bf5c41d49d
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jan 24 15:04:48 2019 +0100
patch 8.1.0805: too many #ifdefs
Problem: Too many #ifdefs.
Solution: Graduate FEAT_MBYTE, part 1.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 24 Jan 2019 15:15:06 +0100 |
parents | 55ccc2d353bd |
children | 31367ce5aac7 |
comparison
equal
deleted
inserted
replaced
15594:7a8983fe4f97 | 15595:1ec942f1b648 |
---|---|
511 | 511 |
512 /* Is this not a special key? */ | 512 /* Is this not a special key? */ |
513 if (special_keys[i].key_sym == 0) | 513 if (special_keys[i].key_sym == 0) |
514 { | 514 { |
515 ch = PhTo8859_1(key); | 515 ch = PhTo8859_1(key); |
516 if (ch == -1 | 516 if (ch == -1 || (enc_utf8 && ch > 127)) |
517 #ifdef FEAT_MBYTE | |
518 || (enc_utf8 && ch > 127) | |
519 #endif | |
520 ) | |
521 { | 517 { |
522 #ifdef FEAT_MBYTE | |
523 len = PhKeyToMb(string, key); | 518 len = PhKeyToMb(string, key); |
524 if (len > 0) | 519 if (len > 0) |
525 { | 520 { |
526 static char buf[6]; | 521 static char buf[6]; |
527 int src_taken, dst_made; | 522 int src_taken, dst_made; |
544 } | 539 } |
545 | 540 |
546 return Pt_CONSUME; | 541 return Pt_CONSUME; |
547 } | 542 } |
548 len = 0; | 543 len = 0; |
549 #endif | |
550 ch = key->key_cap; | 544 ch = key->key_cap; |
551 if (ch < 0xff) | 545 if (ch < 0xff) |
552 { | 546 { |
553 /* FIXME: is this the right thing to do? */ | 547 /* FIXME: is this the right thing to do? */ |
554 if (modifiers & MOD_MASK_CTRL) | 548 if (modifiers & MOD_MASK_CTRL) |
1072 return Pt_CONTINUE; | 1066 return Pt_CONTINUE; |
1073 } | 1067 } |
1074 | 1068 |
1075 /****************************************************************************/ | 1069 /****************************************************************************/ |
1076 | 1070 |
1077 #ifdef FEAT_MBYTE | |
1078 void | 1071 void |
1079 gui_ph_encoding_changed(int new_encoding) | 1072 gui_ph_encoding_changed(int new_encoding) |
1080 { | 1073 { |
1081 /* Default encoding is latin1 */ | 1074 /* Default encoding is latin1 */ |
1082 char *charset = "latin1"; | 1075 char *charset = "latin1"; |
1098 charset = charsets[ i ].name; | 1091 charset = charsets[ i ].name; |
1099 } | 1092 } |
1100 | 1093 |
1101 charset_translate = PxTranslateSet(charset_translate, charset); | 1094 charset_translate = PxTranslateSet(charset_translate, charset); |
1102 } | 1095 } |
1103 #endif | |
1104 | 1096 |
1105 /****************************************************************************/ | 1097 /****************************************************************************/ |
1106 /****************************************************************************/ | 1098 /****************************************************************************/ |
1107 | 1099 |
1108 void | 1100 void |
2139 } | 2131 } |
2140 | 2132 |
2141 if (flags & DRAW_UNDERL) | 2133 if (flags & DRAW_UNDERL) |
2142 PgSetUnderline(gui.norm_pixel, Pg_TRANSPARENT, 0); | 2134 PgSetUnderline(gui.norm_pixel, Pg_TRANSPARENT, 0); |
2143 | 2135 |
2144 if (charset_translate != NULL | 2136 if (charset_translate != NULL && enc_utf8 == 0) |
2145 #ifdef FEAT_MBYTE | |
2146 && enc_utf8 == 0 | |
2147 #endif | |
2148 ) | |
2149 { | 2137 { |
2150 int src_taken, dst_made; | 2138 int src_taken, dst_made; |
2151 | 2139 |
2152 /* Use a static buffer to avoid large amounts of de/allocations */ | 2140 /* Use a static buffer to avoid large amounts of de/allocations */ |
2153 if (utf8_len < len) | 2141 if (utf8_len < len) |