From 9c1d86897f813cbc8cbd84d93ae220f9c8274853 Mon Sep 17 00:00:00 2001 From: malc Date: Fri, 6 Apr 2012 20:08:39 +0400 Subject: [PATCH] c --- KEYS | 1 + main.ml | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/KEYS b/KEYS index 07535b4..e6c0042 100644 --- a/KEYS +++ b/KEYS @@ -42,6 +42,7 @@ z - crop r - reload document P - "presentation" mode a - autoscroll +c - switch to previous column layout Ctrl-p - launch a command with the document path as an argument <,> - rotate [,] - decrease/increase page brightness diff --git a/main.ml b/main.ml index 2c3132f..0ae5860 100644 --- a/main.ml +++ b/main.ml @@ -458,7 +458,8 @@ type state = ; mutable redisplay : bool ; mutable mpos : mpos ; mutable keystate : keystate - ; mutable glinks : bool + ; mutable glinks : bool + ; mutable prevcolumns : (columns * float) option } and hists = { pat : string circbuf @@ -692,6 +693,7 @@ let state = ; mpos = (-1, -1) ; keystate = KSnone ; glinks = false + ; prevcolumns = None } ;; @@ -2597,6 +2599,7 @@ let setzoom zoom = ;; let setcolumns mode columns coverA coverB = + state.prevcolumns <- Some (conf.columns, conf.zoom); if columns < 0 then ( if isbirdseye mode @@ -4993,6 +4996,22 @@ let viewkeyboard key mask = ; G.postRedisplay "brightness"; + | 99 when state.mode = View -> (* c *) + let (c, a, b), z = + match state.prevcolumns with + | None -> (1, 0, 0), 1.0 + | Some (columns, z) -> + let cab = + match columns with + | Csplit (c, _) -> -c, 0, 0 + | Cmulti ((c, a, b), _) -> c, a, b + | Csingle -> 1, 0, 0 + in + cab, z + in + setcolumns View c a b; + setzoom z; + | 0xff54 | 0xff52 when ctrl && Wsi.withshift mask -> setzoom state.prevzoom -- 2.11.4.GIT