From f2ba098deb367047f19a12ace27e5b7ffc9038c6 Mon Sep 17 00:00:00 2001 From: pancake Date: Tue, 2 Jul 2019 03:56:18 +0200 Subject: [PATCH] Fix scr.wheel glich --- libr/core/cconfig.c | 8 +------- libr/core/visual.c | 6 +----- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/libr/core/cconfig.c b/libr/core/cconfig.c index a5bde503e7..539887beda 100644 --- a/libr/core/cconfig.c +++ b/libr/core/cconfig.c @@ -1938,12 +1938,6 @@ static bool cb_fps(void *user, void *data) { return true; } -static bool cb_scrwheel(void* user, void* data) { - RConfigNode *node = (RConfigNode*) data; - r_cons_enable_mouse (node->i_value); - return true; -} - static bool cb_scrbreakword(void* user, void* data) { RConfigNode *node = (RConfigNode*) data; if (*node->value) { @@ -3417,7 +3411,7 @@ R_API int r_core_config_init(RCore *core) { #endif SETPREF ("scr.wheel.nkey", "false", "Use sn/sp and scr.nkey on wheel instead of scroll"); // RENAME TO scr.mouse - SETCB ("scr.wheel", "true", &cb_scrwheel, "Mouse wheel in Visual; temporaryly disable/reenable by right click/Enter)"); + SETPREF ("scr.wheel", "true", "Mouse wheel in Visual; temporaryly disable/reenable by right click/Enter)"); // DEPRECATED: USES hex.cols now SETI ("scr.colpos", 80, "Column position of cmd.cprompt in visual"); SETCB ("scr.breakword", "", &cb_scrbreakword, "Emulate console break (^C) when a word is printed (useful for pD)"); SETCB ("scr.breaklines", "false", &cb_breaklines, "Break lines in Visual instead of truncating them"); diff --git a/libr/core/visual.c b/libr/core/visual.c index 0423128351..48c94cf79b 100644 --- a/libr/core/visual.c +++ b/libr/core/visual.c @@ -390,11 +390,7 @@ static const char *rotateAsmemu(RCore *core) { R_API void r_core_visual_showcursor(RCore *core, int x) { if (core && core->vmode) { r_cons_show_cursor (x); - if (!x) { - r_cons_enable_mouse (r_config_get_i (core->config, "scr.wheel")); - } else { - r_cons_enable_mouse (false); - } + r_cons_enable_mouse (r_config_get_i (core->config, "scr.wheel")); } else { r_cons_enable_mouse (false); }