Mercurial > vim
comparison src/highlight.c @ 18806:e966de1d0376 v8.1.2391
patch 8.1.2391: cannot build when __QNXNTO__ is defined
Commit: https://github.com/vim/vim/commit/c95e8d649045add4e77b423bc159dc0d845af559
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Dec 5 18:35:44 2019 +0100
patch 8.1.2391: cannot build when __QNXNTO__ is defined
Problem: Cannot build when __QNXNTO__ is defined. (Ian Wayne Larson)
Solution: Move the check for "qansi". (Ken Takata, closes https://github.com/vim/vim/issues/5317)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 05 Dec 2019 18:45:03 +0100 |
parents | 9e6d5a4abb1c |
children | 5c405689da3e |
comparison
equal
deleted
inserted
replaced
18805:84ee7a3e71a2 | 18806:e966de1d0376 |
---|---|
557 | 557 |
558 if (t_colors == 8) | 558 if (t_colors == 8) |
559 { | 559 { |
560 // t_Co is 8: use the 8 colors table | 560 // t_Co is 8: use the 8 colors table |
561 #if defined(__QNXNTO__) | 561 #if defined(__QNXNTO__) |
562 color = color_numbers_8_qansi[idx]; | 562 // On qnx, the 8 & 16 color arrays are the same |
563 #else | 563 if (STRNCMP(T_NAME, "qansi", 5) == 0) |
564 color = color_numbers_8[idx]; | 564 color = color_numbers_16[idx]; |
565 #endif | 565 else |
566 #endif | |
567 color = color_numbers_8[idx]; | |
566 if (foreground) | 568 if (foreground) |
567 { | 569 { |
568 // set/reset bold attribute to get light foreground | 570 // set/reset bold attribute to get light foreground |
569 // colors (on some terminals, e.g. "linux") | 571 // colors (on some terminals, e.g. "linux") |
570 if (color & 8) | 572 if (color & 8) |
1133 } | 1135 } |
1134 } | 1136 } |
1135 else | 1137 else |
1136 { | 1138 { |
1137 int bold = MAYBE; | 1139 int bold = MAYBE; |
1138 | |
1139 #if defined(__QNXNTO__) | |
1140 static int *color_numbers_8_qansi = color_numbers_8; | |
1141 // On qnx, the 8 & 16 color arrays are the same | |
1142 if (STRNCMP(T_NAME, "qansi", 5) == 0) | |
1143 color_numbers_8_qansi = color_numbers_16; | |
1144 #endif | |
1145 | 1140 |
1146 // reduce calls to STRICMP a bit, it can be slow | 1141 // reduce calls to STRICMP a bit, it can be slow |
1147 off = TOUPPER_ASC(*arg); | 1142 off = TOUPPER_ASC(*arg); |
1148 for (i = (sizeof(color_names) / sizeof(char *)); --i >= 0; ) | 1143 for (i = (sizeof(color_names) / sizeof(char *)); --i >= 0; ) |
1149 if (off == color_names[i][0] | 1144 if (off == color_names[i][0] |
3376 /* | 3371 /* |
3377 * Allow several hl_flags to be combined, like "bu" for | 3372 * Allow several hl_flags to be combined, like "bu" for |
3378 * bold-underlined. | 3373 * bold-underlined. |
3379 */ | 3374 */ |
3380 attr = 0; | 3375 attr = 0; |
3381 for ( ; *p && *p != ','; ++p) // parse upto comma | 3376 for ( ; *p && *p != ','; ++p) // parse up to comma |
3382 { | 3377 { |
3383 if (VIM_ISWHITE(*p)) // ignore white space | 3378 if (VIM_ISWHITE(*p)) // ignore white space |
3384 continue; | 3379 continue; |
3385 | 3380 |
3386 if (attr > HL_ALL) // Combination with ':' is not allowed. | 3381 if (attr > HL_ALL) // Combination with ':' is not allowed. |