[DMenu] Strip pango markup when matching rows.

fixes: #579
This commit is contained in:
Dave Davenport 2019-08-09 19:55:34 +02:00
parent f896146217
commit a42e9f869f
1 changed files with 14 additions and 1 deletions

View File

@ -398,7 +398,20 @@ static int dmenu_mode_init ( Mode *sw )
static int dmenu_token_match ( const Mode *sw, rofi_int_matcher **tokens, unsigned int index )
{
DmenuModePrivateData *rmpd = (DmenuModePrivateData *) mode_get_private_data ( sw );
return helper_token_match ( tokens, rmpd->cmd_list[index].entry );
if ( rmpd->do_markup) {
/** Strip out the markup when matching. */
char *esc = NULL;
pango_parse_markup(rmpd->cmd_list[index].entry, -1, 0, NULL, &esc, NULL, NULL);
if ( esc ) {
int retv = helper_token_match ( tokens, esc);
g_free (esc);
return retv;
}
return FALSE;
} else {
return helper_token_match ( tokens, rmpd->cmd_list[index].entry );
}
}
static char *dmenu_get_message ( const Mode *sw )
{