Skip to content

Commit

Permalink
Fix #21772 - Ensure RCons.raw after reading from user in ~/ ##cons
Browse files Browse the repository at this point in the history
  • Loading branch information
radare authored and as0ler committed May 30, 2023
1 parent 38184d7 commit d1380c5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libr/cons/less.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,20 @@ R_API int r_cons_less_str(const char *str, const char *exitkeys) {
break;
case ' ': from += h; break;
case 'g': from = 0; break;
case 'G': from = lines_count-h; break;
case 'G': from = lines_count - h; break;
case -1: // EOF
case '\x03': // ^C
case 'q': ui = 0; break;
case '\r':
case '\n':
case 'j': from++; break;
case 'J': from+=h; break;
case 'J': from += h; break;
case 'k':
if (from > 0) {
from--;
}
break;
case 'K': from = (from>=h)? from-h: 0;
case 'K': from = (from>=h)? from - h: 0;
break;
case '/': /* search */
r_cons_reset_colors ();
Expand All @@ -137,6 +137,7 @@ R_API int r_cons_less_str(const char *str, const char *exitkeys) {
if (pager_all_matches (p, rx, mla, lines, lines_count)) {
from = pager_next_match (from, mla, lines_count);
}
r_cons_set_raw (true);
break;
case 'n': /* next match */
/* search already performed */
Expand Down

0 comments on commit d1380c5

Please sign in to comment.