commit e72231aa0936e74789f1d82726f4e444b17750fa
parent 68caadb53bfd450896f69b7401ade9a3a3101f6f
Author: hhvn <dev@hhvn.uk>
Date: Sat, 5 Feb 2022 13:11:55 +0000
zygo.c: disambiguate ids smaller than lastid
1 first link
2 second link
...
18 last link
'5' disambiguates
--------------------------------------------
1 first link
2 second link
...
2018 last link
'500' disambiguates
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/zygo.c b/zygo.c
@@ -1015,7 +1015,7 @@ run(void) {
ui.input[il++] = c;
ui.input[il] = '\0';
syncinput();
- if (!ui.cmd && il + 1 >= digits(page->lastid)) {
+ if (!ui.cmd && atoi(ui.arg) * 10 > page->lastid) {
idgo(atoi(ui.arg));
ui.wantinput = 0;
draw_page();
@@ -1098,7 +1098,7 @@ run(void) {
ui.input[1] = '\0';
syncinput();
il = 1;
- if (digits(page->lastid) == 1) {
+ if (atoi(ui.arg) * 10 > page->lastid) {
idgo(atoi(ui.arg));
ui.wantinput = 0;
draw_page();