comparison src/popupwin.c @ 17077:2546930657a9 v8.1.1538

patch 8.1.1538: cannot specify highlighting for notifications commit https://github.com/vim/vim/commit/dfa97f2aed3d8ca195d09e2ce91cef227f933961 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 15 14:31:55 2019 +0200 patch 8.1.1538: cannot specify highlighting for notifications Problem: Cannot specify highlighting for notifications. Solution: Use the PopupNotification group if it exists. Add a minimal width to notifications.
author Bram Moolenaar <Bram@vim.org>
date Sat, 15 Jun 2019 14:45:05 +0200
parents dacd46fbaa90
children 94007c802045
comparison
equal deleted inserted replaced
17076:edd03436c86d 17077:2546930657a9
256 int nr; 256 int nr;
257 char_u *str; 257 char_u *str;
258 dictitem_T *di; 258 dictitem_T *di;
259 int i; 259 int i;
260 260
261 wp->w_minwidth = dict_get_number(dict, (char_u *)"minwidth"); 261 di = dict_find(dict, (char_u *)"minwidth", -1);
262 if (di != NULL)
263 wp->w_minwidth = dict_get_number(dict, (char_u *)"minwidth");
262 wp->w_minheight = dict_get_number(dict, (char_u *)"minheight"); 264 wp->w_minheight = dict_get_number(dict, (char_u *)"minheight");
263 wp->w_maxwidth = dict_get_number(dict, (char_u *)"maxwidth"); 265 wp->w_maxwidth = dict_get_number(dict, (char_u *)"maxwidth");
264 wp->w_maxheight = dict_get_number(dict, (char_u *)"maxheight"); 266 wp->w_maxheight = dict_get_number(dict, (char_u *)"maxheight");
265 267
266 get_pos_options(wp, dict); 268 get_pos_options(wp, dict);
854 wp->w_wantline = 1; 856 wp->w_wantline = 1;
855 } 857 }
856 858
857 wp->w_wantcol = 10; 859 wp->w_wantcol = 10;
858 wp->w_zindex = POPUPWIN_NOTIFICATION_ZINDEX; 860 wp->w_zindex = POPUPWIN_NOTIFICATION_ZINDEX;
861 wp->w_minwidth = 20;
862 wp->w_popup_drag = 1;
859 for (i = 0; i < 4; ++i) 863 for (i = 0; i < 4; ++i)
860 wp->w_popup_border[i] = 1; 864 wp->w_popup_border[i] = 1;
861 wp->w_popup_padding[1] = 1; 865 wp->w_popup_padding[1] = 1;
862 wp->w_popup_padding[3] = 1; 866 wp->w_popup_padding[3] = 1;
867
868 nr = syn_name2id((char_u *)"PopupNotification");
863 set_string_option_direct_in_win(wp, (char_u *)"wincolor", -1, 869 set_string_option_direct_in_win(wp, (char_u *)"wincolor", -1,
864 (char_u *)"WarningMsg", OPT_FREE|OPT_LOCAL, 0); 870 (char_u *)(nr == 0 ? "WarningMsg" : "PopupNotification"),
865 wp->w_popup_drag = 1; 871 OPT_FREE|OPT_LOCAL, 0);
866 } 872 }
867 873
868 // Deal with options. 874 // Deal with options.
869 apply_options(wp, buf, argvars[1].vval.v_dict); 875 apply_options(wp, buf, argvars[1].vval.v_dict);
870 876