V\ now looks a bit better (make cl clear one line)

This commit is contained in:
pancake 2017-10-16 16:38:33 +02:00
parent 5bc44fbc44
commit 3b2b592506
3 changed files with 8 additions and 63 deletions

View File

@ -749,17 +749,12 @@ static int cmd_cmp(void *data, const char *input) {
case 'l':
if (strchr (input, 'f')) {
r_cons_flush ();
} else if (input[1] == 0) {
r_cons_fill_line ();
// r_cons_clear_line (0);
} else if (!strchr (input, '0')) {
r_cons_clear ();
#if 0
write (1, "\x1b[2J", 4);
write (1, "\x1b[0;0H", 6);
write (1, "\x1b[0m", 4);
#endif
// r_cons_clear();
r_cons_clear00 ();
}
r_cons_gotoxy (0, 0);
// r_cons_flush ();
break;
default:
r_core_cmd_help (core, help_msg_c);

View File

@ -3300,56 +3300,6 @@ R_API void r_print_code(RPrint *p, ut64 addr, ut8 *buf, int len, char lang) {
}
}
static const char *json_path_level(RCore *core, const char *str, int level, int *len) {
char *token = r_str_newf ("\n%s\"", r_str_pad(' ', level * 2));
const char *a = r_str_rstr (str, token);
if (a) {
const char *from = a + strlen (token);
const char *e = strchr (from, '"');
free (token);
if (len) {
if (e) {
*len = e - from;
} else {
*len = 0;
}
}
return from;
}
return NULL;
}
static int print_json_path (RCore *core, const char *str) {
int depth = 10;
RList *list = r_list_newf (free);
RListIter *iter;
char *row;
ut64 opos = UT64_MAX;
while (depth > 0) {
int len;
const char *res = json_path_level (core, str, depth, &len);
if (res && *res && len > 0) {
ut64 pos = res - str;
if (pos > opos || pos > core->offset) {
opos = pos;
depth--;
continue;
}
opos = pos;
char *key = r_str_ndup (res, len);
char *row = r_str_newf ("0x%08"PFMT64x" %.3d \"%s\"", pos, depth, key);
r_list_append (list, row);
free (key);
}
depth--;
}
r_list_foreach_prev (list, iter, row) {
eprintf ("%s\n", row);
}
r_list_free (list);
return 0;
}
static int cmd_print(void *data, const char *input) {
RCore *core = (RCore *) data;
RCoreAnalStats *as;
@ -3471,7 +3421,7 @@ static int cmd_print(void *data, const char *input) {
if (data) {
data[core->offset] = 0;
(void)r_core_read_at (core, 0, data, core->offset);
char *res = r_print_json_path (data, core->offset);
char *res = r_print_json_path ((const char *)data, core->offset);
if (res) {
eprintf ("-> res(%s)\n", res);
}

View File

@ -182,8 +182,8 @@ static int visual_help() {
" /*+-[] change block size, [] = resize hex.cols\n"
" </> seek aligned to block size (seek cursor in cursor mode)\n"
" a/A (a)ssemble code, visual (A)ssembler\n"
" b toggle breakpoint\n"
" B enumerate and inspect classes\n"
" b browse symbols, flags, configurations, classes, ...\n"
" B toggle breakpoint\n"
" c/C toggle (c)ursor and (C)olors\n"
" d[f?] define function, data, code, ..\n"
" D enter visual diff mode (set diff.from/to)\n"
@ -2694,7 +2694,7 @@ static void visual_refresh(RCore *core) {
}
}
snprintf (debugstr, sizeof (debugstr),
"?0;%s %d @ %"PFMT64d";"
"?0;%s %d @ %"PFMT64d";cl;"
"?1;%s %d @ %"PFMT64d";",
pxw, size, splitPtr,
pxw, size, core->offset);