Fixes manpage installation and line jumping
This commit is contained in:
parent
e310844ef3
commit
ea1bf315fd
2
Makefile
2
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:
|
||||
|
|
13
hermes.c
13
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue