Mercurial > vim
comparison src/terminal.c @ 16451:7ae2396cef62 v8.1.1230
patch 8.1.1230: a lot of code is shared between vim.exe and gvim.exe
commit https://github.com/vim/vim/commit/afde13b62b8fa25dac4635d5caee8d088b937ee0
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Apr 28 19:46:49 2019 +0200
patch 8.1.1230: a lot of code is shared between vim.exe and gvim.exe
Problem: A lot of code is shared between vim.exe and gvim.exe.
Solution: Optionally put the shared code in vim.dll. (Ken Takata,
closes #4287)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 28 Apr 2019 20:00:10 +0200 |
parents | 3d6b282e2d6e |
children | a1ba0bd74e7d |
comparison
equal
deleted
inserted
replaced
16450:bf74bce807e8 | 16451:7ae2396cef62 |
---|---|
3551 if (term_default_cterm_bg >= 0) | 3551 if (term_default_cterm_bg >= 0) |
3552 cterm_color2vterm(term_default_cterm_bg, bg); | 3552 cterm_color2vterm(term_default_cterm_bg, bg); |
3553 } | 3553 } |
3554 else | 3554 else |
3555 { | 3555 { |
3556 #if defined(MSWIN) && !defined(FEAT_GUI_MSWIN) | 3556 #if defined(MSWIN) && (!defined(FEAT_GUI_MSWIN) || defined(VIMDLL)) |
3557 int tmp; | 3557 int tmp; |
3558 #endif | 3558 #endif |
3559 | 3559 |
3560 /* In an MS-Windows console we know the normal colors. */ | 3560 /* In an MS-Windows console we know the normal colors. */ |
3561 if (cterm_normal_fg_color > 0) | 3561 if (cterm_normal_fg_color > 0) |
3562 { | 3562 { |
3563 cterm_color2vterm(cterm_normal_fg_color - 1, fg); | 3563 cterm_color2vterm(cterm_normal_fg_color - 1, fg); |
3564 # if defined(MSWIN) && !defined(FEAT_GUI_MSWIN) | 3564 # if defined(MSWIN) && (!defined(FEAT_GUI_MSWIN) || defined(VIMDLL)) |
3565 tmp = fg->red; | 3565 # ifdef VIMDLL |
3566 fg->red = fg->blue; | 3566 if (!gui.in_use) |
3567 fg->blue = tmp; | 3567 # endif |
3568 { | |
3569 tmp = fg->red; | |
3570 fg->red = fg->blue; | |
3571 fg->blue = tmp; | |
3572 } | |
3568 # endif | 3573 # endif |
3569 } | 3574 } |
3570 # ifdef FEAT_TERMRESPONSE | 3575 # ifdef FEAT_TERMRESPONSE |
3571 else | 3576 else |
3572 term_get_fg_color(&fg->red, &fg->green, &fg->blue); | 3577 term_get_fg_color(&fg->red, &fg->green, &fg->blue); |
3573 # endif | 3578 # endif |
3574 | 3579 |
3575 if (cterm_normal_bg_color > 0) | 3580 if (cterm_normal_bg_color > 0) |
3576 { | 3581 { |
3577 cterm_color2vterm(cterm_normal_bg_color - 1, bg); | 3582 cterm_color2vterm(cterm_normal_bg_color - 1, bg); |
3578 # if defined(MSWIN) && !defined(FEAT_GUI_MSWIN) | 3583 # if defined(MSWIN) && (!defined(FEAT_GUI_MSWIN) || defined(VIMDLL)) |
3579 tmp = bg->red; | 3584 # ifdef VIMDLL |
3580 bg->red = bg->blue; | 3585 if (!gui.in_use) |
3581 bg->blue = tmp; | 3586 # endif |
3587 { | |
3588 tmp = fg->red; | |
3589 fg->red = fg->blue; | |
3590 fg->blue = tmp; | |
3591 } | |
3582 # endif | 3592 # endif |
3583 } | 3593 } |
3584 # ifdef FEAT_TERMRESPONSE | 3594 # ifdef FEAT_TERMRESPONSE |
3585 else | 3595 else |
3586 term_get_bg_color(&bg->red, &bg->green, &bg->blue); | 3596 term_get_bg_color(&bg->red, &bg->green, &bg->blue); |
3885 } | 3895 } |
3886 else | 3896 else |
3887 #endif | 3897 #endif |
3888 { | 3898 { |
3889 // We roughly estimate the position of the terminal window inside | 3899 // We roughly estimate the position of the terminal window inside |
3890 // the Vim window by assuing a 10 x 7 character cell. | 3900 // the Vim window by assuming a 10 x 7 character cell. |
3891 x += wp->w_wincol * 7; | 3901 x += wp->w_wincol * 7; |
3892 y += W_WINROW(wp) * 10; | 3902 y += W_WINROW(wp) * 10; |
3893 } | 3903 } |
3894 } | 3904 } |
3895 | 3905 |