History

plan9: remove selw and selh

Sigrid Haflínudóttir committed 6 years ago

Commit 3ee1abf1 parent a50d6141 file · +3 −12Browse files

Unified · Split

plan9.c+3−12
@@ -72,7 +72,6 @@ static int rulerstyle = Sfancy, dotstyle = Sfancy; · 71 unmodified lines
7272 static int bpm = 120, apm = 120;
7373 static Point cur;
7474 static Rectangle sel;
75−static int selw, selh;
7675 static int charw, charh;
7776 static Field field;
7877 static Mbuf_reusable mbuf, mscr;
@@ -496,7 +495,7 @@ redraw(int complete) · 417 unmodified lines
496495 i = 0;
497496 sprint(s, "%ud,%ud", cur.x, cur.y);
498497 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));
500499 i += runesprint(linebuf+i, "%-9s", s);
501500 i += runesprint(linebuf+i, "%-9s", modes[altdown ? Mslide : mode]);
502501 i += runesprint(linebuf+i, "%s", filename[0] ? filename : "unnamed");
@@ -514,9 +513,8 @@ fieldload(char *path) · 11 unmodified lines
514513 werrstr(field_load_error_string(e));
515514 return -1;
516515 }
517− memset(&cur, 0, sizeof(cur));
518− memset(&sel, 0, sizeof(sel));
519− selw = selh = 0;
516+ cur = ZP;
517+ sel = ZR;
520518
521519 return 0;
522520 }
@@ -643,9 +641,6 @@ curmove(int x, int y) · 120 unmodified lines
643641 cur = ptfield(addpt(cur, xy));
644642 sel.min = ptfield(addpt(sel.min, xy));
645643 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;
649644 }
650645
651646 static void
@@ -818,9 +813,6 @@ selext(int xdt, int ydt) · 166 unmodified lines
818813 sel.max.x = MAX(0, MIN((int)field.width-1, sel.max.x));
819814 sel.min.y = MAX(0, MIN((int)field.height-1, sel.min.y));
820815 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;
824816 }
825817
826818 void
@@ -1108,7 +1100,6 @@ noredraw: · 281 unmodified lines
11081100 else {
11091101 sel.min = cur;
11101102 sel.max = cur;
1111− selw = selh = 0;
11121103 }
11131104 break;
11141105 case Kack: /* C-f */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t