comparison src/screen.c @ 16817:069ee8dc8c8d v8.1.1410

patch 8.1.1410: popup_move() is not implemented yet commit https://github.com/vim/vim/commit/60cdb3004abe683e5e8851fa6c5d67b337df4443 Author: Bram Moolenaar <Bram@vim.org> Date: Mon May 27 21:54:10 2019 +0200 patch 8.1.1410: popup_move() is not implemented yet Problem: Popup_move() is not implemented yet. Solution: Implement it. (Yasuhiro Matsumoto, closes https://github.com/vim/vim/issues/4441) Improve the positioning and resizing.
author Bram Moolenaar <Bram@vim.org>
date Mon, 27 May 2019 22:00:07 +0200
parents 4cfad94161f4
children ce04ebdf26b8
comparison
equal deleted inserted replaced
16816:b951a6ebd627 16817:069ee8dc8c8d
1032 lowest_wp->w_popup_flags |= POPF_REDRAWN; 1032 lowest_wp->w_popup_flags |= POPF_REDRAWN;
1033 } 1033 }
1034 } 1034 }
1035 #endif 1035 #endif
1036 1036
1037 /*
1038 * Get 'wincolor' attribute for window "wp". If not set and "wp" is a popup
1039 * window then get the "Pmenu" highlight attribute.
1040 */
1041 static int
1042 get_wcr_attr(win_T *wp)
1043 {
1044 int wcr_attr = 0;
1045
1046 if (*wp->w_p_wcr != NUL)
1047 wcr_attr = syn_name2attr(wp->w_p_wcr);
1048 #ifdef FEAT_TEXT_PROP
1049 if (bt_popup(wp->w_buffer) && wcr_attr == 0)
1050 wcr_attr = HL_ATTR(HLF_PNI);
1051 #endif
1052 return wcr_attr;
1053 }
1054
1037 #if defined(FEAT_GUI) || defined(PROTO) 1055 #if defined(FEAT_GUI) || defined(PROTO)
1038 /* 1056 /*
1039 * Update a single window, its status line and maybe the command line msg. 1057 * Update a single window, its status line and maybe the command line msg.
1040 * Used for the GUI scrollbar. 1058 * Used for the GUI scrollbar.
1041 */ 1059 */
2417 int endrow, 2435 int endrow,
2418 hlf_T hl) 2436 hlf_T hl)
2419 { 2437 {
2420 int n = 0; 2438 int n = 0;
2421 int attr = HL_ATTR(hl); 2439 int attr = HL_ATTR(hl);
2422 int wcr_attr = 0; 2440 int wcr_attr = get_wcr_attr(wp);
2423 2441
2424 if (*wp->w_p_wcr != NUL) 2442 attr = hl_combine_attr(wcr_attr, attr);
2425 {
2426 wcr_attr = syn_name2attr(wp->w_p_wcr);
2427 attr = hl_combine_attr(wcr_attr, attr);
2428 }
2429 2443
2430 if (draw_margin) 2444 if (draw_margin)
2431 { 2445 {
2432 #ifdef FEAT_FOLDING 2446 #ifdef FEAT_FOLDING
2433 int fdc = compute_foldcolumn(wp, 0); 2447 int fdc = compute_foldcolumn(wp, 0);
3113 int area_highlighting = FALSE; // Visual or incsearch highlighting 3127 int area_highlighting = FALSE; // Visual or incsearch highlighting
3114 // in this line 3128 // in this line
3115 int vi_attr = 0; // attributes for Visual and incsearch 3129 int vi_attr = 0; // attributes for Visual and incsearch
3116 // highlighting 3130 // highlighting
3117 int wcr_attr = 0; // attributes from 'wincolor' 3131 int wcr_attr = 0; // attributes from 'wincolor'
3132 int win_attr = 0; // background for whole window, except
3133 // margins and "~" lines.
3118 int area_attr = 0; // attributes desired by highlighting 3134 int area_attr = 0; // attributes desired by highlighting
3119 int search_attr = 0; // attributes desired by 'hlsearch' 3135 int search_attr = 0; // attributes desired by 'hlsearch'
3120 #ifdef FEAT_SYN_HL 3136 #ifdef FEAT_SYN_HL
3121 int vcol_save_attr = 0; /* saved attr for 'cursorcolumn' */ 3137 int vcol_save_attr = 0; /* saved attr for 'cursorcolumn' */
3122 int syntax_attr = 0; /* attributes desired by syntax */ 3138 int syntax_attr = 0; /* attributes desired by syntax */
3194 int did_line_attr = 0; 3210 int did_line_attr = 0;
3195 #endif 3211 #endif
3196 #ifdef FEAT_TERMINAL 3212 #ifdef FEAT_TERMINAL
3197 int get_term_attr = FALSE; 3213 int get_term_attr = FALSE;
3198 #endif 3214 #endif
3199 int win_attr = 0; // background for whole window
3200 3215
3201 /* draw_state: items that are drawn in sequence: */ 3216 /* draw_state: items that are drawn in sequence: */
3202 #define WL_START 0 /* nothing done yet */ 3217 #define WL_START 0 /* nothing done yet */
3203 #ifdef FEAT_CMDWIN 3218 #ifdef FEAT_CMDWIN
3204 # define WL_CMDLINE WL_START + 1 /* cmdline window column */ 3219 # define WL_CMDLINE WL_START + 1 /* cmdline window column */
3564 --trailcol; 3579 --trailcol;
3565 trailcol += (colnr_T) (ptr - line); 3580 trailcol += (colnr_T) (ptr - line);
3566 } 3581 }
3567 } 3582 }
3568 3583
3569 if (*wp->w_p_wcr != NUL) 3584 wcr_attr = get_wcr_attr(wp);
3570 { 3585 if (wcr_attr != 0)
3571 wcr_attr = syn_name2attr(wp->w_p_wcr); 3586 {
3572 3587 win_attr = wcr_attr;
3573 // 'wincolor' highlighting for the whole window 3588 area_highlighting = TRUE;
3574 if (wcr_attr != 0)
3575 {
3576 win_attr = wcr_attr;
3577 area_highlighting = TRUE;
3578 }
3579 } 3589 }
3580 #ifdef FEAT_TEXT_PROP 3590 #ifdef FEAT_TEXT_PROP
3581 if (bt_popup(wp->w_buffer)) 3591 if (bt_popup(wp->w_buffer))
3582 {
3583 screen_line_flags |= SLF_POPUP; 3592 screen_line_flags |= SLF_POPUP;
3584
3585 if (win_attr == 0)
3586 {
3587 win_attr = HL_ATTR(HLF_PNI);
3588 area_highlighting = TRUE;
3589 }
3590 }
3591 #endif 3593 #endif
3592 3594
3593 /* 3595 /*
3594 * 'nowrap' or 'wrap' and a single line that doesn't fit: Advance to the 3596 * 'nowrap' or 'wrap' and a single line that doesn't fit: Advance to the
3595 * first character to be displayed. 3597 * first character to be displayed.