summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/man/psfed.17
-rw-r--r--bin/psfed.c26
2 files changed, 26 insertions, 7 deletions
diff --git a/bin/man/psfed.1 b/bin/man/psfed.1
index a0e07c75..59fbdbe7 100644
--- a/bin/man/psfed.1
+++ b/bin/man/psfed.1
@@ -61,6 +61,13 @@ Select previous/next glyph.
 .It Ic k Ic j
 Select glyph in previous/next row.
 .
+.It Ic y
+Copy the selected glyph.
+.
+.It Ic p
+Paste the copied glyph
+over the selected glyph.
+.
 .It Ic e
 Edit the selected glyph in
 .Sx Edit Mode .
diff --git a/bin/psfed.c b/bin/psfed.c
index e3584744..3cdfaec5 100644
--- a/bin/psfed.c
+++ b/bin/psfed.c
@@ -248,6 +248,7 @@ static struct {
 	uint32_t scale;
 	uint32_t index;
 	bool modified;
+	uint8_t *copy;
 } normal;
 
 static struct {
@@ -278,11 +279,11 @@ static void normalDec(uint32_t n) {
 static void normalInc(uint32_t n) {
 	if (normal.index + n < header.glyph.len) normal.index += n;
 }
-static void normalPrint(void) {
+static void normalPrint(const char *prefix) {
 	if (normal.index <= 256) {
-		printf("index: %02X '%lc'\n", normal.index, CP437[normal.index]);
+		printf("%s: %02X '%lc'\n", prefix, normal.index, CP437[normal.index]);
 	} else {
-		printf("index: %02X\n", normal.index);
+		printf("%s: %02X\n", prefix, normal.index);
 	}
 }
 
@@ -299,10 +300,21 @@ static void inputNormal(char ch) {
 		}
 		break; case '-': if (normal.scale) normal.scale--; frameClear();
 		break; case '+': normal.scale++;
-		break; case 'h': normalDec(1); normalPrint();
-		break; case 'l': normalInc(1); normalPrint();
-		break; case 'k': normalDec(NormalCols); normalPrint();
-		break; case 'j': normalInc(NormalCols); normalPrint();
+		break; case 'h': normalDec(1); normalPrint("index");
+		break; case 'l': normalInc(1); normalPrint("index");
+		break; case 'k': normalDec(NormalCols); normalPrint("index");
+		break; case 'j': normalInc(NormalCols); normalPrint("index");
+		break; case 'y': {
+			if (!normal.copy) normal.copy = malloc(header.glyph.size);
+			if (!normal.copy) err(EX_OSERR, "malloc");
+			memcpy(normal.copy, glyph(normal.index), header.glyph.size);
+			normalPrint("copy");
+		}
+		break; case 'p': {
+			if (!normal.copy) break;
+			normal.modified = true;
+			memcpy(glyph(normal.index), normal.copy, header.glyph.size);
+		}
 		break; case 'e': {
 			normal.modified = true;
 			edit.index = normal.index;
=1.3.0&id=e4d2f2b042100182ff5b214fd6848b71d70fad7d&follow=1'>Fix tests to work on Ubuntu (dash)Ramsay Jones The system shell (/bin/sh) on Ubuntu is dash, which aims to be a POSIX standard shell. In particular, dash does not implement any of the common extensions to the standard that, say, bash and ksh do. Replace some non-POSIX constructs in setup.sh with more portable and mundane code. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2008-11-06Fix some warnings to allow -WerrorRamsay Jones The type used to declare the st_size field of a 'struct stat' can be a 32- or 64-bit sized type, which can vary from one platform to another, or even from one compilation to another. In particular, on linux, if you include the following define: #define _FILE_OFFSET_BITS 64 prior to including certain system header files, then the type used for the st_size field will be __off64_t, otherwise it will be an __off_t. Note that the above define is included at the top of git-compat-util.h. In cache.c, the "%zd" format specifier expects a "signed size_t", another type which can vary, when an __off64_t or a __off_t is provided. To supress the warning, use the PRIuMAX format specifier and cast the st_size field to uintmax_t. This should work an any platform for which git currently compiles. In ui-plain.c, the size parameter of sha1_object_info() and read_sha1_file() is defined to be "unsigned long *" not "size_t *". So, to supress the warning, simply declare size with the correct type. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2008-11-06Use GIT-1.6.0.3Lars Hjemli Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2008-10-11CGIT 0.8.1