diff --git a/Makefile b/Makefile index 727f1ed..1e69aeb 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ install-bin: hermes install-man: hermes.1 gzip -k ./hermes.1 install -d ${BINDIR} - install -m 0644 ${MAN1DIR} + install -m 0644 ./hermes.1.gz ${MAN1DIR} .PHONY: clean clean: diff --git a/hermes.c b/hermes.c index 8bdfa9e..9a406ad 100644 --- a/hermes.c +++ b/hermes.c @@ -1095,7 +1095,6 @@ void editorInputKp(int c) { void editorCommandKp(int c) { static int deleting = 0; static int counter = 1; - static int place = 1; static int counting = 0; switch (c) { case 'j': @@ -1389,20 +1388,20 @@ void editorCommandKp(int c) { case '8': case '9': { - if (counter <= 1 && place == 1) counter--; int num = c - 48; - if (counting && num == 0) { - counter *= place; + if (!counting && counter <= 1) { + if (num == 0) break; + counter = num; + } else if (counting && num == 0) { + counter *= 10; } else { - counter += num * place; + counter = num + (counter * 10); } - place *= 10; counting++; } return; } deleting = 0; - place = 1; counter = 1; counting = 0; }