comparison src/popupwin.c @ 16806:306766ed0f70 v8.1.1405

patch 8.1.1405: "highlight" option of popup windows not supported commit https://github.com/vim/vim/commit/20c023aee0ceafac9431fb8ab8d169747b5140dd Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 26 21:03:24 2019 +0200 patch 8.1.1405: "highlight" option of popup windows not supported Problem: "highlight" option of popup windows not supported. Solution: Implement the "highlight" option.
author Bram Moolenaar <Bram@vim.org>
date Sun, 26 May 2019 21:15:04 +0200
parents f5487021fdad
children 5ff14f96f1c9
comparison
equal deleted inserted replaced
16805:384375708770 16806:306766ed0f70
21 */ 21 */
22 static void 22 static void
23 apply_options(win_T *wp, buf_T *buf UNUSED, dict_T *dict) 23 apply_options(win_T *wp, buf_T *buf UNUSED, dict_T *dict)
24 { 24 {
25 int nr; 25 int nr;
26 char_u *str;
26 27
27 wp->w_maxwidth = dict_get_number(dict, (char_u *)"maxwidth"); 28 wp->w_maxwidth = dict_get_number(dict, (char_u *)"maxwidth");
28 wp->w_maxheight = dict_get_number(dict, (char_u *)"maxheight"); 29 wp->w_maxheight = dict_get_number(dict, (char_u *)"maxheight");
29 wp->w_winrow = dict_get_number(dict, (char_u *)"line"); 30 wp->w_winrow = dict_get_number(dict, (char_u *)"line");
30 wp->w_wincol = dict_get_number(dict, (char_u *)"col"); 31 wp->w_wincol = dict_get_number(dict, (char_u *)"col");
50 wp->w_popup_timer->tr_partial = tv.vval.v_partial; 51 wp->w_popup_timer->tr_partial = tv.vval.v_partial;
51 } 52 }
52 } 53 }
53 #endif 54 #endif
54 55
56 str = dict_get_string(dict, (char_u *)"highlight", TRUE);
57 if (str != NULL)
58 set_string_option_direct_in_win(wp, (char_u *)"wincolor", -1,
59 str, OPT_FREE|OPT_LOCAL, 0);
55 } 60 }
56 61
57 /* 62 /*
58 * popup_create({text}, {options}) 63 * popup_create({text}, {options})
59 */ 64 */
92 97
93 buf = buflist_new(NULL, NULL, (linenr_T)0, BLN_NEW|BLN_LISTED|BLN_DUMMY); 98 buf = buflist_new(NULL, NULL, (linenr_T)0, BLN_NEW|BLN_LISTED|BLN_DUMMY);
94 if (buf == NULL) 99 if (buf == NULL)
95 return; 100 return;
96 ml_open(buf); 101 ml_open(buf);
97 curbuf = buf; 102 set_string_option_direct_in_buf(buf, (char_u *)"buftype", -1,
98 set_string_option_direct((char_u *)"buftype", -1,
99 (char_u *)"popup", OPT_FREE|OPT_LOCAL, 0); 103 (char_u *)"popup", OPT_FREE|OPT_LOCAL, 0);
100 set_string_option_direct((char_u *)"bufhidden", -1, 104 set_string_option_direct_in_buf(buf, (char_u *)"bufhidden", -1,
101 (char_u *)"hide", OPT_FREE|OPT_LOCAL, 0); 105 (char_u *)"hide", OPT_FREE|OPT_LOCAL, 0);
102 curbuf = curwin->w_buffer;
103 buf->b_p_ul = -1; // no undo 106 buf->b_p_ul = -1; // no undo
104 buf->b_p_swf = FALSE; // no swap file 107 buf->b_p_swf = FALSE; // no swap file
105 buf->b_p_bl = FALSE; // unlisted buffer 108 buf->b_p_bl = FALSE; // unlisted buffer
106 109
107 win_init_popup_win(wp, buf); 110 win_init_popup_win(wp, buf);