diff options
author | Dave Davenport <qball@gmpclient.org> | 2019-08-09 19:55:34 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2019-08-09 19:55:34 +0200 |
commit | a42e9f869f8fe95772aace1544dcf907827a0e52 (patch) | |
tree | ea7a613eab79499ac9acc96502f25c0a9069fd1a | |
parent | f8961462178d81eb69d7d7f095677f7d250e653d (diff) |
[DMenu] Strip pango markup when matching rows.
fixes: #579
-rw-r--r-- | source/dialogs/dmenu.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/source/dialogs/dmenu.c b/source/dialogs/dmenu.c index c66ceedc..3d205b0f 100644 --- a/source/dialogs/dmenu.c +++ b/source/dialogs/dmenu.c @@ -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 ) { |