* Use '[27m' (invert off) instead of '[0m' in r_cons_invert

* Fix colorize in visual mode (pd view) when cursor is enabled
This commit is contained in:
Nibble 2010-10-23 21:40:58 +02:00
parent c79afe3568
commit b41f4b5380
4 changed files with 4 additions and 5 deletions

1
TODO
View File

@ -11,7 +11,6 @@ pancake
* fix eflags string and str_bits
* fix arm assembler issue reported via twitter (umf :/)
nibble
* fix colorize of cursor selected bytes
* mach0 armthumb bin detect
Questions

View File

@ -43,7 +43,7 @@ static const char *r_cons_color_names[CONS_COLORS_SIZE+1] = {
R_API void r_cons_invert(int set, int color) {
if (color) {
if (set) r_cons_strcat("\x1b[7m");
else r_cons_strcat("\x1b[0m");
else r_cons_strcat("\x1b[27m");
} else {
if (set) r_cons_strcat("[");
else r_cons_strcat("]");

View File

@ -914,7 +914,7 @@ R_API int r_core_visual_cmd(RCore *core, int ch) {
break;
case ':': {
ut64 oseek = core->offset;
if (curset) r_core_seek (core, core->offset+cursor, 0);
if (curset) r_core_seek (core, core->offset+cursor, 1);
r_cons_fgets (buf, 1023, 0, NULL);
r_core_cmd (core, buf, 0);
r_cons_any_key ();

View File

@ -98,10 +98,10 @@ d = dst;
for (s=str ; *s; s+=2, d+=2, i++) {
if (p->cur_enabled) {
if (i-1==(cur-n))
memcat (d, "\x1b[0m");
memcat (d, "\x1b[27m");
if (i>=(cur-n) && i<(ocur-n))
memcat (d, "\x1b[7m");
} else
}
if (s[0]=='0' && s[1]=='0') {
memcat (d, "\x1b[31m");
} else