Skip to content

Commit

Permalink
[DMenu] Strip pango markup when matching rows.
Browse files Browse the repository at this point in the history
fixes: #579
  • Loading branch information
DaveDavenport committed Aug 9, 2019
1 parent f896146 commit a42e9f8
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion source/dialogs/dmenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
{
Expand Down

0 comments on commit a42e9f8

Please sign in to comment.