Unified · Split
| @@ -72,7 +72,6 @@ static int rulerstyle = Sfancy, dotstyle = Sfancy; · 71 unmodified lines | ||
| 72 | 72 | static int bpm = 120, apm = 120; |
| 73 | 73 | static Point cur; |
| 74 | 74 | static Rectangle sel; |
| 75 | −static int selw, selh; | |
| 76 | 75 | static int charw, charh; |
| 77 | 76 | static Field field; |
| 78 | 77 | static Mbuf_reusable mbuf, mscr; |
| @@ -496,7 +495,7 @@ redraw(int complete) · 417 unmodified lines | ||
| 496 | 495 | i = 0; |
| 497 | 496 | sprint(s, "%ud,%ud", cur.x, cur.y); |
| 498 | 497 | i += runesprint(linebuf, "%-10s", s); |
| 499 | − sprint(s, "%d:%d", selw, selh); | |
| 498 | + sprint(s, "%d:%d", sel.min.x < cur.x ? -Dx(sel) : Dx(sel), sel.max.x < cur.x ? -Dy(sel) : Dy(sel)); | |
| 500 | 499 | i += runesprint(linebuf+i, "%-9s", s); |
| 501 | 500 | i += runesprint(linebuf+i, "%-9s", modes[altdown ? Mslide : mode]); |
| 502 | 501 | i += runesprint(linebuf+i, "%s", filename[0] ? filename : "unnamed"); |
| @@ -514,9 +513,8 @@ fieldload(char *path) · 11 unmodified lines | ||
| 514 | 513 | werrstr(field_load_error_string(e)); |
| 515 | 514 | return -1; |
| 516 | 515 | } |
| 517 | − memset(&cur, 0, sizeof(cur)); | |
| 518 | − memset(&sel, 0, sizeof(sel)); | |
| 519 | − selw = selh = 0; | |
| 516 | + cur = ZP; | |
| 517 | + sel = ZR; | |
| 520 | 518 | |
| 521 | 519 | return 0; |
| 522 | 520 | } |
| @@ -643,9 +641,6 @@ curmove(int x, int y) · 120 unmodified lines | ||
| 643 | 641 | cur = ptfield(addpt(cur, xy)); |
| 644 | 642 | sel.min = ptfield(addpt(sel.min, xy)); |
| 645 | 643 | sel.max = ptfield(addpt(sel.max, xy)); |
| 646 | − | |
| 647 | − selw = selw < 0 ? sel.min.x - sel.max.x : sel.max.x - sel.min.x; | |
| 648 | − selh = selh < 0 ? sel.min.y - sel.max.y : sel.max.y - sel.min.y; | |
| 649 | 644 | } |
| 650 | 645 | |
| 651 | 646 | static void |
| @@ -818,9 +813,6 @@ selext(int xdt, int ydt) · 166 unmodified lines | ||
| 818 | 813 | sel.max.x = MAX(0, MIN((int)field.width-1, sel.max.x)); |
| 819 | 814 | sel.min.y = MAX(0, MIN((int)field.height-1, sel.min.y)); |
| 820 | 815 | sel.max.y = MAX(0, MIN((int)field.height-1, sel.max.y)); |
| 821 | − | |
| 822 | − selw = selw < 0 ? sel.min.x - sel.max.x : sel.max.x - sel.min.x; | |
| 823 | − selh = selh < 0 ? sel.min.y - sel.max.y : sel.max.y - sel.min.y; | |
| 824 | 816 | } |
| 825 | 817 | |
| 826 | 818 | void |
| @@ -1108,7 +1100,6 @@ noredraw: · 281 unmodified lines | ||
| 1108 | 1100 | else { |
| 1109 | 1101 | sel.min = cur; |
| 1110 | 1102 | sel.max = cur; |
| 1111 | − selw = selh = 0; | |
| 1112 | 1103 | } |
| 1113 | 1104 | break; |
| 1114 | 1105 | case Kack: /* C-f */ |