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
3385 | [] -> ()3385 | [] -> ()
3386 | (pageno, _, (_, y0, _, y1, _, y2, _, y3)) :: _ ->3386 | (pageno, _, (_, y0, _, y1, _, y2, _, y3)) :: _ ->
3387 f pageno (y0, y1, y2, y3)3387 f pageno (y0, y1, y2, y3)
3388 and yminmax (y0, y1, y2, y3) =3388 and ymin (y0, y1, y2, y3) = min y0 y1 |> min y2 |> min y3 |> truncate
3389 let ym = min y0 y1 |> min y2 |> min y3 |> truncate in3389 and ymax (y0, y1, y2, y3) = max y0 y1 |> max y2 |> max y3 |> truncate in
3390 let yM = max y0 y1 |> max y2 |> max y3 |> truncate in
3391 ym, yM
3392 in
3393 let ondone msg = state.text <- msg3390 let ondone msg = state.text <- msg
3394 and zmod _ _ k =3391 and zmod _ _ k =
3395 match [@warning "-fragile-match"] k with3392 match [@warning "-fragile-match"] k with
3396 | Keys.Ascii 'z' ->3393 | Keys.Ascii 'z' ->
3397 let f pageno ys =3394 let f pageno ys =
3398 let ym, yM = yminmax ys in3395 let hh = (ymax ys - ymin ys)/2 in
3399 let hh = (yM - ym)/2 in3396 gotopage1 pageno (ymin ys + hh - state.winh/2)
3400 gotopage1 pageno (ym + hh - state.winh/2)
3401 in3397 in
3402 yloc f;3398 yloc f;
3403 TEdone "center"3399 TEdone "center"
3404 | Keys.Ascii 't' ->3400 | Keys.Ascii 't' ->
3405 let f pageno ys =3401 let f pageno ys = gotopage1 pageno @@ ymin ys in
3406 let ym, _ = yminmax ys in
3407 gotopage1 pageno ym
3408 in
3409 yloc f;3402 yloc f;
3410 TEdone "top"3403 TEdone "top"
3411 | Keys.Ascii 'b' ->3404 | Keys.Ascii 'b' ->
3412 let f pageno ys =3405 let f pageno ys = gotopage1 pageno (ymax ys - state.winh) in
3413 let _, yM = yminmax ys in
3414 gotopage1 pageno (yM - state.winh)
3415 in
3416 yloc f;3406 yloc f;
3417 TEdone "bottom"3407 TEdone "bottom"
3418 | _ -> TEstop3408 | _ -> 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