Skip to content

Commit

Permalink
Fix regression in visual hex cursor ##visual
Browse files Browse the repository at this point in the history
* 'h' and 'l' keys moved into instructions instead of bytes
  • Loading branch information
radare authored and trufae committed Oct 7, 2023
1 parent 0c26502 commit fadf1d4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions libr/core/visual.c
Original file line number Diff line number Diff line change
Expand Up @@ -2125,6 +2125,9 @@ static bool fix_cursor(RCore *core) {
if (!core->print->cur_enabled) {
return false;
}
if (PIDX != 2) {
return false;
}
if (core->print->screen_bounds > 1) {
bool off_is_visible = core->offset < core->print->screen_bounds;
bool cur_is_visible = core->offset + p->cur < core->print->screen_bounds;
Expand Down Expand Up @@ -2451,7 +2454,7 @@ R_API void r_core_visual_browse(RCore *core, const char *input) {
break;
case 'l': // previously VT
if (r_sandbox_enable (0)) {
eprintf ("sandbox not enabled\n");
R_LOG_WARN ("sandbox not enabled");
} else {
if (r_cons_is_interactive ()) {
r_core_cmd_call (core, "TT");
Expand Down Expand Up @@ -3204,7 +3207,7 @@ R_API int r_core_visual_cmd(RCore *core, const char *arg) {
case 'L':
case 'H':
if (r_config_get_b (core->config, "scr.cursor")) {
int distance = 8; // numbuf_pull (core);
int distance = numbuf_pull (core);
core->cons->cpos.x += (ch == 'h' || ch == 'H')? -distance: distance;
if (core->cons->cpos.x < 1) {
core->cons->cpos.x = 0;
Expand Down

0 comments on commit fadf1d4

Please sign in to comment.