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