comparison src/terminal.c @ 12453:5d228b1cda64 v8.0.1106

patch 8.0.1106: terminal colors wrong on an MS-Windows console commit https://github.com/vim/vim/commit/69e8aa75112a0b12811a4f4d11061adceffbbabc Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 14 15:55:13 2017 +0200 patch 8.0.1106: terminal colors wrong on an MS-Windows console Problem: Terminal colors on an MS-Windows console are not matching the normal colors. Solution: Use the normal colors for the terminal. (Yasuhiro Matsumoto, closes #2087)
author Christian Brabandt <cb@256bit.org>
date Thu, 14 Sep 2017 16:00:06 +0200
parents b1877a367415
children dfb8254aa735
comparison
equal deleted inserted replaced
12452:687e401b4d7d 12453:5d228b1cda64
2495 # ifdef FEAT_TERMGUICOLORS 2495 # ifdef FEAT_TERMGUICOLORS
2496 || p_tgc 2496 || p_tgc
2497 # endif 2497 # endif
2498 ) 2498 )
2499 { 2499 {
2500 guicolor_T fg_rgb, bg_rgb; 2500 guicolor_T fg_rgb = INVALCOLOR;
2501 guicolor_T bg_rgb = INVALCOLOR;
2501 2502
2502 if (id != 0) 2503 if (id != 0)
2503 syn_id2colors(id, &fg_rgb, &bg_rgb); 2504 syn_id2colors(id, &fg_rgb, &bg_rgb);
2504 2505
2505 # ifdef FEAT_GUI 2506 # ifdef FEAT_GUI
2549 if (cterm_fg >= 0) 2550 if (cterm_fg >= 0)
2550 cterm_color2rgb(cterm_fg, fg); 2551 cterm_color2rgb(cterm_fg, fg);
2551 if (cterm_bg >= 0) 2552 if (cterm_bg >= 0)
2552 cterm_color2rgb(cterm_bg, bg); 2553 cterm_color2rgb(cterm_bg, bg);
2553 } 2554 }
2555 #if defined(WIN3264) && !defined(FEAT_GUI_W32)
2556 else
2557 {
2558 int tmp;
2559
2560 /* In an MS-Windows console we know the normal colors. */
2561 if (cterm_normal_fg_color > 0)
2562 {
2563 cterm_color2rgb(cterm_normal_fg_color - 1, fg);
2564 tmp = fg->red;
2565 fg->red = fg->blue;
2566 fg->blue = tmp;
2567 }
2568 if (cterm_normal_bg_color > 0)
2569 {
2570 cterm_color2rgb(cterm_normal_bg_color - 1, bg);
2571 tmp = bg->red;
2572 bg->red = bg->blue;
2573 bg->blue = tmp;
2574 }
2575 }
2576 #endif
2554 2577
2555 vterm_state_set_default_colors(vterm_obtain_state(vterm), fg, bg); 2578 vterm_state_set_default_colors(vterm_obtain_state(vterm), fg, bg);
2556 2579
2557 /* Required to initialize most things. */ 2580 /* Required to initialize most things. */
2558 vterm_screen_reset(screen, 1 /* hard */); 2581 vterm_screen_reset(screen, 1 /* hard */);