Fix #11851 - Cursor and echo glitches in Visual ##visual

This commit is contained in:
radare 2018-10-19 13:42:38 +02:00 committed by GitHub
parent adde3d54fd
commit 6bc3d5562f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View File

@ -46,8 +46,8 @@ static int parseMouseEvent() {
int ch = r_cons_readchar ();
/* Skip the x/y coordinates */
#if USE_CLICK
int x = r_cons_readchar() - 33;
int y = r_cons_readchar() - 33;
int x = r_cons_readchar () - 33;
int y = r_cons_readchar () - 33;
#else
(void) r_cons_readchar ();
(void) r_cons_readchar ();
@ -89,7 +89,7 @@ R_API int r_cons_arrow_to_hjkl(int ch) {
I->mouse_event = 0;
/* emacs */
switch ((ut8)ch) {
case 0xc3: r_cons_readchar(); ch='K'; break; // emacs repag (alt + v)
case 0xc3: r_cons_readchar (); ch='K'; break; // emacs repag (alt + v)
case 0x16: ch='J'; break; // emacs avpag (ctrl + v)
case 0x10: ch='k'; break; // emacs up (ctrl + p)
case 0x0e: ch='j'; break; // emacs down (ctrl + n)
@ -194,8 +194,8 @@ R_API int r_cons_arrow_to_hjkl(int ch) {
break;
} // F9-F12 not yet supported!!
break;
case '5': ch = 'K'; r_cons_readchar(); break; // repag
case '6': ch = 'J'; r_cons_readchar(); break; // avpag
case '5': ch = 'K'; r_cons_readchar (); break; // repag
case '6': ch = 'J'; r_cons_readchar (); break; // avpag
/* arrow keys */
case 'A': ch = 'k'; break; // up
case 'B': ch = 'j'; break; // down
@ -503,7 +503,7 @@ R_API int r_cons_readchar() {
sigdelset (&sigmask, SIGWINCH);
while (pselect (STDIN_FILENO + 1, &readfds, NULL, NULL, NULL, &sigmask) == -1) {
if (errno == EBADF) {
eprintf ("r_cons_readchar(): EBADF\n");
eprintf ("r_cons_readchar (): EBADF\n");
return -1;
}
if (sigwinchFlag) {

View File

@ -3256,9 +3256,11 @@ R_API int r_core_visual(RCore *core, const char *input) {
core->print->flags |= R_PRINT_FLAGS_ADDRMOD;
do {
dodo:
r_core_visual_tab_update(core);
r_core_visual_tab_update (core);
// update the cursor when it's not visible anymore
skip = fix_cursor (core);
r_cons_show_cursor (false);
r_cons_set_raw (1);
const int ref = r_config_get_i (core->config, "dbg.slow");
const int bytes = r_config_get_i (core->config, "stack.bytes");