src/popupwin.c
static void
popup_highlight_curline(win_T *wp)
{
    int	    sign_id = 0;
    char_u  *sign_name = popup_get_sign_name(wp);

    buf_delete_signs(wp->w_buffer, (char_u *)"PopUpMenu");

    if ((wp->w_popup_flags & POPF_CURSORLINE) != 0)
    {
	popup_show_curline(wp);

	if (!sign_exists_by_name(sign_name))
	{
	    char *linehl = "PopupSelected";

	    if (syn_name2id((char_u *)linehl) == 0)
		linehl = "PmenuSel";
	    sign_define_by_name(sign_name, NULL, (char_u *)linehl, NULL, NULL);
	}

	sign_place(&sign_id, (char_u *)"PopUpMenu", sign_name,
			       wp->w_buffer, wp->w_cursor.lnum, SIGN_DEF_PRIO);
	redraw_win_later(wp, NOT_VALID);
    }
    else
	sign_undefine_by_name(sign_name, FALSE);
    wp->w_popup_last_curline = wp->w_cursor.lnum;
}
/*
 * Highlight the line with the cursor.
 * Also scrolls the text to put the cursor line in view.
 */
Highlight the line with the cursor.
Also scrolls the text to put the cursor line in view.
Highlight the line with the cursor . Also scrolls the text to put the cursor line in view .
static void
popup_highlight_curline(win_T *wp)
{
    int	    sign_id = 0;
    char_u  *sign_name = popup_get_sign_name(wp);
    buf_delete_signs(wp->w_buffer, (char_u *)"PopUpMenu");
    if ((wp->w_popup_flags & POPF_CURSORLINE) != 0)
    {
	popup_show_curline(wp);
	if (!sign_exists_by_name(sign_name))
	{
	    char *linehl = "PopupSelected";
	    if (syn_name2id((char_u *)linehl) == 0)
		linehl = "PmenuSel";
	    sign_define_by_name(sign_name, NULL, (char_u *)linehl, NULL, NULL);
	}
	sign_place(&sign_id, (char_u *)"PopUpMenu", sign_name,
			       wp->w_buffer, wp->w_cursor.lnum, SIGN_DEF_PRIO);
	redraw_win_later(wp, NOT_VALID);
    }
    else
	sign_undefine_by_name(sign_name, FALSE);
    wp->w_popup_last_curline = wp->w_cursor.lnum;
}
static void popup_highlight_curline ( win_T * wp ) { int sign_id = 0 ; char_u * sign_name = popup_get_sign_name ( wp ) ; buf_delete_signs ( wp -> w_buffer , ( char_u * ) " " ) ; if ( ( wp -> w_popup_flags & POPF_CURSORLINE ) != 0 ) { popup_show_curline ( wp ) ; if ( ! sign_exists_by_name ( sign_name ) ) { char * linehl = " " ; if ( syn_name2id ( ( char_u * ) linehl ) == 0 ) linehl = " " ; sign_define_by_name ( sign_name , NULL , ( char_u * ) linehl , NULL , NULL ) ; } sign_place ( & sign_id , ( char_u * ) " " , sign_name , wp -> w_buffer , wp -> w_cursor . lnum , SIGN_DEF_PRIO ) ; redraw_win_later ( wp , NOT_VALID ) ; } else sign_undefine_by_name ( sign_name , FALSE ) ; wp -> w_popup_last_curline = wp -> w_cursor . lnum ; }
Highlight the line with the cursor.
Highlight the line with the cursor .