diff --git a/strans.c b/strans.c index 1c17ada..70fe038 100644 --- a/strans.c +++ b/strans.c @@ -91,11 +91,12 @@ movedelta(u32int ks) return 0; } +/* Nothing chosen yet: Down takes the first candidate, PageDown pages. */ static void movekouho(int delta) { if(im.sel < 0) - im.sel = 0; + im.sel = delta == Maxdisp ? Maxdisp : 0; else im.sel += delta; if(im.sel < 0) diff --git a/tests/engine_test.c b/tests/engine_test.c index 3532577..8df793b 100644 --- a/tests/engine_test.c +++ b/tests/engine_test.c @@ -871,6 +871,10 @@ engine_candidate_page_movement(struct ct *t) { 32, 22, Kpgdown, 31 }, { 32, 31, Kpgup, 22 }, { 32, 31, Kpgdown, 31 }, + { 32, -1, Kdown, 0 }, + { 32, -1, Kup, 0 }, + { 32, -1, Kpgdown, 9 }, + { 32, -1, Kpgup, 0 }, }; int first, i, n; Str com;