Skip to content

Commit

Permalink
Fix arrow keys not working in visual refs mode (#10887)
Browse files Browse the repository at this point in the history
* Fix: arrow keys not working in visual refs mode

* Refactor: exit from visual refs mode with 'q' or ESC
  • Loading branch information
cyanpencil authored and Maijin committed Aug 1, 2018
1 parent 3fda013 commit 5aced3c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions libr/core/visual.c
Expand Up @@ -1136,6 +1136,7 @@ R_API int r_core_visual_refs(RCore *core, bool xref) {
}
r_cons_flush ();
ch = r_cons_readchar ();
ch = r_cons_arrow_to_hjkl (ch);
if (ch == ':') {
r_core_visual_prompt_input (core);
} else if (ch == '?') {
Expand All @@ -1161,10 +1162,10 @@ R_API int r_core_visual_refs(RCore *core, bool xref) {
printMode = lastPrintMode;
}
goto repeat;
} else if (r_cons_arrow_to_hjkl (ch) == 'j') {
} else if (ch == 'j') {
skip++;
goto repeat;
} else if (r_cons_arrow_to_hjkl (ch) == 'k') {
} else if (ch == 'k') {
skip--;
if (skip < 0) {
skip = 0;
Expand All @@ -1182,6 +1183,8 @@ R_API int r_core_visual_refs(RCore *core, bool xref) {
r_core_cmdf (core, "s 0x%"PFMT64x, refi->addr);
ret = 1;
}
} else if (ch != 'q' && ch != 'Q') {
goto repeat;
}
r_list_free (xrefs);
#else
Expand Down

0 comments on commit 5aced3c

Please sign in to comment.