shithub: orca

Download patch

ref: 0c039774021ffc540c78255a598b0f2bbe99e2ed
parent: 680e661720901889b07462f6c9b178a0f458b4cb
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Tue Feb 18 10:54:49 EST 2020

plan9: rename copyfield → fscr, selfield → fsel

--- a/plan9.c
+++ b/plan9.c
@@ -77,7 +77,7 @@
 static Mbuf_reusable mbuf, mscr;
 static char filename[256];
 static Channel *cchan;
-static Field copyfield, selfield;
+static Field fscr, fsel;
 static bool altdown, pause, forward;
 static int mode = Minsert;
 static long framedev; /* frame deviation in ms */
@@ -429,7 +429,7 @@
 			if (c == '.' && eqpt(Pt(x, y), cur))
 				c = cursor;
 
-			if (!grouphl && !complete && c == copyfield.buffer[off] && attr == mscr.buffer[off]) {
+			if (!grouphl && !complete && c == fscr.buffer[off] && attr == mscr.buffer[off]) {
 				if (i > 0) {
 					p = runestringnbg(screen, p, color[oldfg], ZP, font, linebuf, i, color[oldbg], ZP);
 					i = 0;
@@ -438,7 +438,7 @@
 				continue;
 			}
 
-			copyfield.buffer[off] = c;
+			fscr.buffer[off] = c;
 			mscr.buffer[off] = attr;
 
 			bg = selected ? Dbinv : Dback;
@@ -682,9 +682,9 @@
 	if (sel.min.x+x < 0 || sel.min.x >= field.width || sel.min.y+y < 0 || sel.min.y+y >= field.height)
 		return;
 
-	field_resize_raw(&selfield, Dy(sel)+1, Dx(sel)+1);
+	field_resize_raw(&fsel, Dy(sel)+1, Dx(sel)+1);
 	gbuffer_copy_subrect(
-		field.buffer, selfield.buffer,
+		field.buffer, fsel.buffer,
 		field.height, field.width, Dy(sel)+1, Dx(sel)+1,
 		sel.min.y, sel.min.x, 0, 0, Dy(sel)+1, Dx(sel)+1
 	);
@@ -695,7 +695,7 @@
 	}
 
 	gbuffer_copy_subrect(
-		selfield.buffer, field.buffer,
+		fsel.buffer, field.buffer,
 		Dy(sel)+1, Dx(sel)+1, field.height, field.width,
 		0, 0, sel.min.y+y, sel.min.x+x, Dy(sel)+1, Dx(sel)+1
 	);
@@ -950,8 +950,8 @@
 		field_init_fill(&field, h, w, '.');
 	}
 
-	field_init_fill(&copyfield, h, w, '.');
-	field_init(&selfield);
+	field_init_fill(&fscr, h, w, '.');
+	field_init(&fsel);
 
 	linebuf = malloc(sizeof(Rune)*MAX(w+1, 64));
 	memset(noteoff, 0, sizeof(noteoff));
@@ -1263,15 +1263,15 @@
 			memmove(mbuf.buffer, mscr.buffer, w*h);
 			linebuf = realloc(linebuf, sizeof(Rune)*MAX(w+1, 64));
 
-			field_copy(&field, &copyfield);
+			field_copy(&field, &fscr);
 			field_resize_raw(&field, h, w);
 			memset(field.buffer, '.', w*h);
 			gbuffer_copy_subrect(
-				copyfield.buffer, field.buffer,
-				copyfield.height, copyfield.width, h, w,
-				0, 0, 0, 0, MIN(h, copyfield.height), MIN(w, copyfield.width)
+				fscr.buffer, field.buffer,
+				fscr.height, fscr.width, h, w,
+				0, 0, 0, 0, MIN(h, fscr.height), MIN(w, fscr.width)
 			);
-			field_resize_raw(&copyfield, h, w);
+			field_resize_raw(&fscr, h, w);
 
 			complete = true;
 		}
@@ -1281,8 +1281,8 @@
 	chanclose(a[Ckey].c);
 	chanclose(a[Credraw].c);
 	mbuf_reusable_deinit(&mscr);
-	field_deinit(&copyfield);
-	field_deinit(&selfield);
+	field_deinit(&fscr);
+	field_deinit(&fsel);
 	free(linebuf);
 
 	threadexitsall(nil);