Mercurial > vim
comparison src/screen.c @ 16788:f7268ec2c889 v8.1.1396
patch 8.1.1396: 'wincolor' does not apply to lines below the buffer
commit https://github.com/vim/vim/commit/193ffd1d9f4f4d5412ce8d7a46bb2f89d47a56da
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat May 25 22:57:30 2019 +0200
patch 8.1.1396: 'wincolor' does not apply to lines below the buffer
Problem: 'wincolor' does not apply to lines below the buffer.
Solution: Also apply 'wincolor' to the "~" lines and the number column.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 25 May 2019 23:00:04 +0200 |
parents | fc58fee685e2 |
children | 5f98d80d116a |
comparison
equal
deleted
inserted
replaced
16787:7cde4330b0cb | 16788:f7268ec2c889 |
---|---|
2416 int row, | 2416 int row, |
2417 int endrow, | 2417 int endrow, |
2418 hlf_T hl) | 2418 hlf_T hl) |
2419 { | 2419 { |
2420 int n = 0; | 2420 int n = 0; |
2421 int attr = HL_ATTR(hl); | |
2422 int wcr_attr = 0; | |
2423 | |
2424 if (*wp->w_p_wcr != NUL) | |
2425 { | |
2426 wcr_attr = syn_name2attr(wp->w_p_wcr); | |
2427 attr = hl_combine_attr(wcr_attr, attr); | |
2428 } | |
2421 | 2429 |
2422 if (draw_margin) | 2430 if (draw_margin) |
2423 { | 2431 { |
2424 #ifdef FEAT_FOLDING | 2432 #ifdef FEAT_FOLDING |
2425 int fdc = compute_foldcolumn(wp, 0); | 2433 int fdc = compute_foldcolumn(wp, 0); |
2426 | 2434 |
2427 if (fdc > 0) | 2435 if (fdc > 0) |
2428 // draw the fold column | 2436 // draw the fold column |
2429 n = screen_fill_end(wp, ' ', ' ', n, fdc, | 2437 n = screen_fill_end(wp, ' ', ' ', n, fdc, |
2430 row, endrow, HL_ATTR(HLF_FC)); | 2438 row, endrow, hl_combine_attr(wcr_attr, HL_ATTR(HLF_FC))); |
2431 #endif | 2439 #endif |
2432 #ifdef FEAT_SIGNS | 2440 #ifdef FEAT_SIGNS |
2433 if (signcolumn_on(wp)) | 2441 if (signcolumn_on(wp)) |
2434 // draw the sign column | 2442 // draw the sign column |
2435 n = screen_fill_end(wp, ' ', ' ', n, 2, | 2443 n = screen_fill_end(wp, ' ', ' ', n, 2, |
2436 row, endrow, HL_ATTR(HLF_SC)); | 2444 row, endrow, hl_combine_attr(wcr_attr, HL_ATTR(HLF_SC))); |
2437 #endif | 2445 #endif |
2438 if ((wp->w_p_nu || wp->w_p_rnu) | 2446 if ((wp->w_p_nu || wp->w_p_rnu) |
2439 && vim_strchr(p_cpo, CPO_NUMCOL) == NULL) | 2447 && vim_strchr(p_cpo, CPO_NUMCOL) == NULL) |
2440 // draw the number column | 2448 // draw the number column |
2441 n = screen_fill_end(wp, ' ', ' ', n, number_width(wp) + 1, | 2449 n = screen_fill_end(wp, ' ', ' ', n, number_width(wp) + 1, |
2442 row, endrow, HL_ATTR(HLF_N)); | 2450 row, endrow, hl_combine_attr(wcr_attr, HL_ATTR(HLF_N))); |
2443 } | 2451 } |
2444 | 2452 |
2445 #ifdef FEAT_RIGHTLEFT | 2453 #ifdef FEAT_RIGHTLEFT |
2446 if (wp->w_p_rl) | 2454 if (wp->w_p_rl) |
2447 { | 2455 { |
2448 screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow, | 2456 screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow, |
2449 wp->w_wincol, W_ENDCOL(wp) - 1 - n, | 2457 wp->w_wincol, W_ENDCOL(wp) - 1 - n, |
2450 c2, c2, HL_ATTR(hl)); | 2458 c2, c2, attr); |
2451 screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow, | 2459 screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow, |
2452 W_ENDCOL(wp) - 1 - n, W_ENDCOL(wp) - n, | 2460 W_ENDCOL(wp) - 1 - n, W_ENDCOL(wp) - n, |
2453 c1, c2, HL_ATTR(hl)); | 2461 c1, c2, attr); |
2454 } | 2462 } |
2455 else | 2463 else |
2456 #endif | 2464 #endif |
2457 { | 2465 { |
2458 screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow, | 2466 screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow, |
2459 wp->w_wincol + n, (int)W_ENDCOL(wp), | 2467 wp->w_wincol + n, (int)W_ENDCOL(wp), |
2460 c1, c2, HL_ATTR(hl)); | 2468 c1, c2, attr); |
2461 } | 2469 } |
2462 | 2470 |
2463 set_empty_rows(wp, row); | 2471 set_empty_rows(wp, row); |
2464 } | 2472 } |
2465 | 2473 |
3098 pos_T *top, *bot; | 3106 pos_T *top, *bot; |
3099 int lnum_in_visual_area = FALSE; | 3107 int lnum_in_visual_area = FALSE; |
3100 pos_T pos; | 3108 pos_T pos; |
3101 long v; | 3109 long v; |
3102 | 3110 |
3103 int char_attr = 0; /* attributes for next character */ | 3111 int char_attr = 0; // attributes for next character |
3104 int attr_pri = FALSE; /* char_attr has priority */ | 3112 int attr_pri = FALSE; // char_attr has priority |
3105 int area_highlighting = FALSE; /* Visual or incsearch highlighting | 3113 int area_highlighting = FALSE; // Visual or incsearch highlighting |
3106 in this line */ | 3114 // in this line |
3107 int vi_attr = 0; /* attributes for Visual and incsearch | 3115 int vi_attr = 0; // attributes for Visual and incsearch |
3108 highlighting */ | 3116 // highlighting |
3109 int area_attr = 0; /* attributes desired by highlighting */ | 3117 int wcr_attr = 0; // attributes from 'wincolor' |
3110 int search_attr = 0; /* attributes desired by 'hlsearch' */ | 3118 int area_attr = 0; // attributes desired by highlighting |
3119 int search_attr = 0; // attributes desired by 'hlsearch' | |
3111 #ifdef FEAT_SYN_HL | 3120 #ifdef FEAT_SYN_HL |
3112 int vcol_save_attr = 0; /* saved attr for 'cursorcolumn' */ | 3121 int vcol_save_attr = 0; /* saved attr for 'cursorcolumn' */ |
3113 int syntax_attr = 0; /* attributes desired by syntax */ | 3122 int syntax_attr = 0; /* attributes desired by syntax */ |
3114 int has_syntax = FALSE; /* this buffer has syntax highl. */ | 3123 int has_syntax = FALSE; /* this buffer has syntax highl. */ |
3115 int save_did_emsg; | 3124 int save_did_emsg; |
3557 } | 3566 } |
3558 } | 3567 } |
3559 | 3568 |
3560 if (*wp->w_p_wcr != NUL) | 3569 if (*wp->w_p_wcr != NUL) |
3561 { | 3570 { |
3562 int attr = syn_name2attr(wp->w_p_wcr); | 3571 wcr_attr = syn_name2attr(wp->w_p_wcr); |
3563 | 3572 |
3564 // 'wincolor' highlighting for the whole window | 3573 // 'wincolor' highlighting for the whole window |
3565 if (attr != 0) | 3574 if (wcr_attr != 0) |
3566 { | 3575 { |
3567 win_attr = attr; | 3576 win_attr = wcr_attr; |
3568 area_highlighting = TRUE; | 3577 area_highlighting = TRUE; |
3569 } | 3578 } |
3570 } | 3579 } |
3571 #ifdef FEAT_TEXT_PROP | 3580 #ifdef FEAT_TEXT_PROP |
3572 if (bt_popup(wp->w_buffer)) | 3581 if (bt_popup(wp->w_buffer)) |
3848 { | 3857 { |
3849 /* Draw the cmdline character. */ | 3858 /* Draw the cmdline character. */ |
3850 n_extra = 1; | 3859 n_extra = 1; |
3851 c_extra = cmdwin_type; | 3860 c_extra = cmdwin_type; |
3852 c_final = NUL; | 3861 c_final = NUL; |
3853 char_attr = HL_ATTR(HLF_AT); | 3862 char_attr = hl_combine_attr(wcr_attr, HL_ATTR(HLF_AT)); |
3854 } | 3863 } |
3855 } | 3864 } |
3856 #endif | 3865 #endif |
3857 | 3866 |
3858 #ifdef FEAT_FOLDING | 3867 #ifdef FEAT_FOLDING |
3874 n_extra = fdc; | 3883 n_extra = fdc; |
3875 p_extra_free[n_extra] = NUL; | 3884 p_extra_free[n_extra] = NUL; |
3876 p_extra = p_extra_free; | 3885 p_extra = p_extra_free; |
3877 c_extra = NUL; | 3886 c_extra = NUL; |
3878 c_final = NUL; | 3887 c_final = NUL; |
3879 char_attr = HL_ATTR(HLF_FC); | 3888 char_attr = hl_combine_attr(wcr_attr, HL_ATTR(HLF_FC)); |
3880 } | 3889 } |
3881 } | 3890 } |
3882 } | 3891 } |
3883 #endif | 3892 #endif |
3884 | 3893 |
3896 # endif | 3905 # endif |
3897 | 3906 |
3898 /* Draw two cells with the sign value or blank. */ | 3907 /* Draw two cells with the sign value or blank. */ |
3899 c_extra = ' '; | 3908 c_extra = ' '; |
3900 c_final = NUL; | 3909 c_final = NUL; |
3901 char_attr = HL_ATTR(HLF_SC); | 3910 char_attr = hl_combine_attr(wcr_attr, HL_ATTR(HLF_SC)); |
3902 n_extra = 2; | 3911 n_extra = 2; |
3903 | 3912 |
3904 if (row == startrow | 3913 if (row == startrow |
3905 #ifdef FEAT_DIFF | 3914 #ifdef FEAT_DIFF |
3906 + filler_lines && filler_todo <= 0 | 3915 + filler_lines && filler_todo <= 0 |
4010 { | 4019 { |
4011 c_extra = ' '; | 4020 c_extra = ' '; |
4012 c_final = NUL; | 4021 c_final = NUL; |
4013 } | 4022 } |
4014 n_extra = number_width(wp) + 1; | 4023 n_extra = number_width(wp) + 1; |
4015 char_attr = HL_ATTR(HLF_N); | 4024 char_attr = hl_combine_attr(wcr_attr, HL_ATTR(HLF_N)); |
4016 #ifdef FEAT_SYN_HL | 4025 #ifdef FEAT_SYN_HL |
4017 /* When 'cursorline' is set highlight the line number of | 4026 /* When 'cursorline' is set highlight the line number of |
4018 * the current line differently. | 4027 * the current line differently. |
4019 * TODO: Can we use CursorLine instead of CursorLineNr | 4028 * TODO: Can we use CursorLine instead of CursorLineNr |
4020 * when CursorLineNr isn't set? */ | 4029 * when CursorLineNr isn't set? */ |
4021 if ((wp->w_p_cul || wp->w_p_rnu) | 4030 if ((wp->w_p_cul || wp->w_p_rnu) |
4022 && lnum == wp->w_cursor.lnum) | 4031 && lnum == wp->w_cursor.lnum) |
4023 char_attr = HL_ATTR(HLF_CLN); | 4032 char_attr = hl_combine_attr(wcr_attr, HL_ATTR(HLF_CLN)); |
4024 #endif | 4033 #endif |
4025 } | 4034 } |
4026 } | 4035 } |
4027 | 4036 |
4028 #ifdef FEAT_LINEBREAK | 4037 #ifdef FEAT_LINEBREAK |