Fix #15963 - Handle / in Vx (visual xrefs) ##visual

This commit is contained in:
pancake 2020-02-13 20:38:52 +01:00
parent f502016c57
commit 51020062bc

View File

@ -1535,7 +1535,7 @@ repeat:
/* prepare highlight */ /* prepare highlight */
char *cmd = strdup (r_config_get (core->config, "scr.highlight")); char *cmd = strdup (r_config_get (core->config, "scr.highlight"));
char *ats = r_str_newf ("%"PFMT64x, curat); char *ats = r_str_newf ("%"PFMT64x, curat);
if (ats) { if (ats && !*cmd) {
(void) r_config_set (core->config, "scr.highlight", ats); (void) r_config_set (core->config, "scr.highlight", ats);
} }
/* print disasm */ /* print disasm */
@ -1568,6 +1568,7 @@ repeat:
" JK - step 10 rows\n" " JK - step 10 rows\n"
" pP - rotate between various print modes\n" " pP - rotate between various print modes\n"
" : - run r2 command\n" " : - run r2 command\n"
" / - highlight given word\n"
" ? - show this help message\n" " ? - show this help message\n"
" <> - '<' for xrefs and '>' for refs\n" " <> - '<' for xrefs and '>' for refs\n"
" TAB - toggle between address and function references\n" " TAB - toggle between address and function references\n"
@ -1595,6 +1596,9 @@ repeat:
printMode = lastPrintMode; printMode = lastPrintMode;
} }
goto repeat; goto repeat;
} else if (ch == '/') {
r_core_cmd0 (core, "?i highlight;e scr.highlight=`yp`");
goto repeat;
} else if (ch == 'x' || ch == '<') { } else if (ch == 'x' || ch == '<') {
xref = true; xref = true;
xrefsMode = !xrefsMode; xrefsMode = !xrefsMode;