History

Less c{ode,onsing,onfusion}

malc committed 6 years ago

Commit 2285e171 parent a9347c01 file · +6 −16Browse files

Unified · Split

main.ml+6−16
@@ -3385,34 +3385,24 @@ let viewkeyboard key mask = · 3384 unmodified lines
33853385 | [] -> ()
33863386 | (pageno, _, (_, y0, _, y1, _, y2, _, y3)) :: _ ->
33873387 f pageno (y0, y1, y2, y3)
3388− and yminmax (y0, y1, y2, y3) =
3389− let ym = min y0 y1 |> min y2 |> min y3 |> truncate in
3390− let yM = max y0 y1 |> max y2 |> max y3 |> truncate in
3391− ym, yM
3392− in
3388+ and ymin (y0, y1, y2, y3) = min y0 y1 |> min y2 |> min y3 |> truncate
3389+ and ymax (y0, y1, y2, y3) = max y0 y1 |> max y2 |> max y3 |> truncate in
33933390 let ondone msg = state.text <- msg
33943391 and zmod _ _ k =
33953392 match [@warning "-fragile-match"] k with
33963393 | Keys.Ascii 'z' ->
33973394 let f pageno ys =
3398− let ym, yM = yminmax ys in
3399− let hh = (yM - ym)/2 in
3400− gotopage1 pageno (ym + hh - state.winh/2)
3395+ let hh = (ymax ys - ymin ys)/2 in
3396+ gotopage1 pageno (ymin ys + hh - state.winh/2)
34013397 in
34023398 yloc f;
34033399 TEdone "center"
34043400 | Keys.Ascii 't' ->
3405− let f pageno ys =
3406− let ym, _ = yminmax ys in
3407− gotopage1 pageno ym
3408− in
3401+ let f pageno ys = gotopage1 pageno @@ ymin ys in
34093402 yloc f;
34103403 TEdone "top"
34113404 | Keys.Ascii 'b' ->
3412− let f pageno ys =
3413− let _, yM = yminmax ys in
3414− gotopage1 pageno (yM - state.winh)
3415− in
3405+ let f pageno ys = gotopage1 pageno (ymax ys - state.winh) in
34163406 yloc f;
34173407 TEdone "bottom"
34183408 | _ -> TEstop

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t