@@ -849,7 +849,7 @@ expand_set_opt_generic(
849849 return ret ;
850850}
851851
852- # if defined(FEAT_GUI_MSWIN ) || defined(FEAT_GUI_GTK )
852+ # if defined(FEAT_GUI_MSWIN ) || defined(FEAT_GUI_GTK ) || defined( FEAT_GUI_MACVIM )
853853static garray_T * expand_cb_ga ;
854854static optexpand_T * expand_cb_args ;
855855
@@ -2351,7 +2351,7 @@ expand_set_guifont(optexpand_T *args, int *numMatches, char_u ***matches)
23512351 if (!gui .in_use )
23522352 return FAIL ;
23532353
2354- # if defined(FEAT_GUI_MSWIN ) || defined(FEAT_GUI_GTK )
2354+ # if defined(FEAT_GUI_MSWIN ) || defined(FEAT_GUI_GTK ) || defined( FEAT_GUI_MACVIM )
23552355 char_u * * varp = (char_u * * )args -> oe_varp ;
23562356 int wide = (varp == & p_guifontwide );
23572357
@@ -4259,6 +4259,45 @@ did_set_fuoptions(optset_T *args UNUSED)
42594259 return e_invalid_argument ;
42604260 return NULL ;
42614261}
4262+
4263+ static char_u *
4264+ get_fuopt_background_value (expand_T * xp , int idx )
4265+ {
4266+ // "background:" supports '#' for expicit RGB color, or highlight names.
4267+ if (idx == 0 )
4268+ return (char_u * )"#" ;
4269+ return get_highlight_name (xp , idx - 1 );
4270+ }
4271+
4272+ int
4273+ expand_set_fuoptions (optexpand_T * args , int * numMatches , char_u * * * matches )
4274+ {
4275+ expand_T * xp = args -> oe_xp ;
4276+
4277+ if (xp -> xp_pattern > args -> oe_set_arg && * (xp -> xp_pattern - 1 ) == ':' )
4278+ {
4279+ // Within "background:", we have a subgroup of possible options.
4280+ int bg_len = STRLEN ("background:" );
4281+ if (xp -> xp_pattern - args -> oe_set_arg >= bg_len &&
4282+ STRNCMP (xp -> xp_pattern - bg_len , "background:" , bg_len ) == 0 )
4283+ {
4284+ return expand_set_opt_generic (
4285+ args ,
4286+ get_fuopt_background_value ,
4287+ numMatches ,
4288+ matches );
4289+ }
4290+ return FAIL ;
4291+ }
4292+
4293+ static char * (p_fuopt_values []) = {"maxvert" , "maxhorz" , "background:" , NULL };
4294+ return expand_set_opt_string (
4295+ args ,
4296+ p_fuopt_values ,
4297+ ARRAY_LENGTH (p_fuopt_values ) - 1 ,
4298+ numMatches ,
4299+ matches );
4300+ }
42624301#endif
42634302
42644303#pragma endregion MacVim specific options
0 commit comments