Skip to content

Commit

Permalink
Fix a bug of " widget (radareorg#14767)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vane11ope authored and radare committed Aug 6, 2019
1 parent d7fe1d0 commit 8932544
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions libr/core/panels.c
Original file line number Diff line number Diff line change
Expand Up @@ -5841,18 +5841,19 @@ void __create_almighty(RCore *core, RPanel *panel, Sdb *menu_db) {
okey = r_cons_readchar ();
key = r_cons_arrow_to_hjkl (okey);
word = NULL;
if (r_cons_get_click (&cx, &cy)) {
if ((key == 0 || key == INT8_MAX) &&
((cx < x || x + w < cx) ||
((cy < y || y + h < cy)))) {
key = 'q';
} else {
word = get_word_from_canvas_for_menu (core, core->panels, cx, cy);
if (word) {
void *cb = sdb_ptr_get (menu_db, word, 0);
if (cb) {
((RPanelAlmightyCallback)cb) (core, panel, NONE, word);
break;
if (key == INT8_MAX - 1) {
if (r_cons_get_click (&cx, &cy)) {
if ((cx < x || x + w < cx) ||
((cy < y || y + h < cy))) {
key = 'q';
} else {
word = get_word_from_canvas_for_menu (core, core->panels, cx, cy);
if (word) {
void *cb = sdb_ptr_get (menu_db, word, 0);
if (cb) {
((RPanelAlmightyCallback)cb) (core, panel, NONE, word);
break;
}
}
}
}
Expand Down

0 comments on commit 8932544

Please sign in to comment.