Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Version 24

new     : g:ZoomWin_funcref (holds name of function to be called whenever ZoomWin changes state); see :help g:ZoomWin_funcref
improved: supports saving and restoring of window variables across zooms
bugfix  : saves and restores local options for every window
  • Loading branch information...
commit ac6474a31560b217c1866107dce876bcd1e9f81c 1 parent e7ee18e
cecamp authored June 18, 2012 vim-scripts committed July 02, 2012
2  README
@@ -21,7 +21,7 @@ The idea is to make it easy to zoom into and out of a window.  ZoomWin supports
21 21
  
22 22
  * Session files are guaranteed to be unique to each vim session, so multiple vims can use zoom-in/out without interfering with one another
23 23
 
24  
-A later version may be available at http://mysite.verizon.net/astronaut/vim/index.html#ZOOMWIN .
  24
+A later version may be available at http://www.drchip.org/astronaut/vim/index.html#ZOOMWIN .
25 25
 
26 26
 When zooming in, ZoomWin's window is full sized, with no loss of screen space to status lines for other windows, unlike vimscript#1280 (ToggleOnly), for those vims compiled with the +mksession feature.  For those vims without that feature, v21 ZoomWin now supports partial-zoom-in (leaves a status line behind for each window).
27 27
 
256  autoload/ZoomWin.vim
... ...
@@ -1,8 +1,8 @@
1 1
 " ZoomWin:	Brief-like ability to zoom into/out-of a window
2 2
 " Author:	Charles Campbell
3 3
 "			original version by Ron Aaron
4  
-" Date:		Jan 26, 2009
5  
-" Version:	23
  4
+" Date:		Jun 18, 2012 
  5
+" Version:	24
6 6
 " History: see :help zoomwin-history {{{1
7 7
 " GetLatestVimScripts: 508 1 :AutoInstall: ZoomWin.vim
8 8
 
@@ -18,7 +18,8 @@ if v:version < 702
18 18
  finish
19 19
 endif
20 20
 let s:keepcpo        = &cpo
21  
-let g:loaded_ZoomWin = "v23"
  21
+let g:loaded_ZoomWin = "v24"
  22
+let s:localoptlist   = ["ai","ar","bh","bin","bl","bomb","bt","cfu","ci","cin","cink","cino","cinw","cms","com","cpt","efm","eol","ep","et","fenc","fex","ff","flp","fo","ft","gp","imi","ims","inde","inex","indk","inf","isk","key","kmp","lisp","mps","ml","ma","mod","nf","ofu","oft","pi","qe","ro","sw","sn","si","sts","spc","spf","spl","sua","swf","smc","syn","ts","tx","tw","udf","wm"]
22 23
 set cpo&vim
23 24
 "DechoTabOn
24 25
 
@@ -30,6 +31,8 @@ set cpo&vim
30 31
 "          The original version was by Ron Aaron.
31 32
 fun! ZoomWin#ZoomWin()
32 33
 "  let g:decho_hide= 1		"Decho
  34
+  let lzkeep = &lz
  35
+  set lz
33 36
 "  call Dfunc("ZoomWin#ZoomWin() winbufnr(2)=".winbufnr(2))
34 37
 
35 38
   " if the vim doesn't have +mksession, only a partial zoom is available {{{3
@@ -50,25 +53,14 @@ fun! ZoomWin#ZoomWin()
50 53
 	let s:winrestore = winrestcmd()
51 54
 	res
52 55
    endif
53  
-"  call Dret("ZoomWin#ZoomWin : partialzoom=".s:partialzoom)
  56
+   let &lz = lzkeep
  57
+"   call Dret("ZoomWin#ZoomWin : partialzoom=".s:partialzoom)
54 58
    return
55 59
   endif
56 60
 
57  
-  " Close certain windows {{{3
  61
+  " Close certain windows and save user settings {{{3
58 62
   call s:ZoomWinPreserve(0)
59  
-
60  
-  " save options.  Force window minimum height/width to be >= 1 {{{3
61  
-  let keep_hidden = &hidden
62  
-  let keep_write  = &write
63  
-
64  
-  if v:version < 603
65  
-   if &wmh == 0 || &wmw == 0
66  
-    let keep_wmh = &wmh
67  
-    let keep_wmw = &wmw
68  
-    silent! set wmh=1 wmw=1
69  
-   endif
70  
-  endif
71  
-  set hidden write
  63
+  call s:SaveUserSettings()
72 64
 
73 65
   if winbufnr(2) == -1
74 66
     " there's only one window - restore to multiple-windows mode {{{3
@@ -76,17 +68,24 @@ fun! ZoomWin#ZoomWin()
76 68
 
77 69
     if exists("s:sessionfile") && filereadable(s:sessionfile)
78 70
 	  " save position in current one-window-only
79  
-"	  call Decho("save position in current one-window-only in sponly")
  71
+"	  call Decho("save position in current one-window-only in sponly  (s:sessionfile<".s:sessionfile.">)")
80 72
       let sponly     = s:SavePosn(0)
81 73
       let s:origline = line(".")
82 74
       let s:origcol  = virtcol(".")
  75
+	  let s:swv      = deepcopy(getwinvar(winnr(),""),1)
  76
+	  sil! unlet key value
  77
+	  for [key,value] in items(s:swv)
  78
+	   exe "sil! unlet w:".key
  79
+	   sil! unlet key value
  80
+	  endfor
83 81
 
84 82
       " source session file to restore window layout
85  
-	  let ei_keep= &ei
86  
-	  set ei=all
87  
-	  exe 'silent! so '.fnameescape(s:sessionfile)
88  
-"	  Decho("@@<".@@.">")
  83
+	  let ei_keep = &ei
  84
+	  set ei=all noswf
  85
+	  exe 'sil! so '.fnameescape(s:sessionfile)
89 86
       let v:this_session= s:sesskeep
  87
+	  " restore any and all window variables
  88
+	  call s:RestoreWinVars()
90 89
 
91 90
       if exists("s:savedposn1")
92 91
         " restore windows' positioning and buffers
@@ -96,6 +95,14 @@ fun! ZoomWin#ZoomWin()
96 95
         unlet s:winkeep
97 96
       endif
98 97
 
  98
+	  if exists("s:swv")
  99
+	   " restore possibly modified while in one-window mode, window variables
  100
+       for [key,value] in items(s:swv)
  101
+		sil! call setwinvar(winnr(),key,value)
  102
+		sil! unlet key value
  103
+	   endfor
  104
+	  endif
  105
+
99 106
 	  if line(".") != s:origline || virtcol(".") != s:origcol
100 107
 	   " If the cursor hasn't moved from the original position,
101 108
 	   " then let the position remain what it was in the original
@@ -108,9 +115,21 @@ fun! ZoomWin#ZoomWin()
108 115
 "	  call Decho("delete session file")
109 116
       call delete(s:sessionfile)
110 117
       unlet s:sessionfile
111  
-	  let &ei=ei_keep
  118
+	  let &ei  = ei_keep
112 119
     endif
113 120
 
  121
+	" I don't know why -- but netrw-generated windows end up as [Scratch] even though the bufname is correct.
  122
+	" Following code fixes this.
  123
+	let curwin= winnr()
  124
+	windo exe "sil! file ".fnameescape(bufname(winbufnr(winnr())))
  125
+	exe curwin."wincmd w"
  126
+
  127
+	" Restore local window settings
  128
+	call s:RestoreWinSettings()
  129
+
  130
+	" zoomwinstate used by g:ZoomWin_funcref()
  131
+	let zoomwinstate= 0
  132
+
114 133
   else " there's more than one window - go to only-one-window mode {{{3
115 134
 "	call Decho("there's multiple windows - goto one-window-only")
116 135
 
@@ -120,16 +139,21 @@ fun! ZoomWin#ZoomWin()
120 139
 	" doesn't work with the command line window (normal mode q:)
121 140
  	if &bt == "nofile" && expand("%") == (v:version < 702 ? 'command-line' : '[Command Line]')
122 141
 	 echoerr "***error*** ZoomWin#ZoomWin doesn't work with the ".expand("%")." window"
  142
+     let &lz= lzkeep
123 143
 "     call Dret("ZoomWin#ZoomWin : ".expand('%')." window error")
124 144
 	 return
125 145
 	endif
126  
-"	call Decho("1: @@<".@@.">")
127 146
 
128 147
 	" disable all events (autocmds)
129 148
 "	call Decho("disable events")
130 149
     let ei_keep= &ei
131 150
 	set ei=all
132  
-"	call Decho("2: @@<".@@.">")
  151
+
  152
+	" Save local window settings
  153
+	call s:SaveWinSettings()
  154
+
  155
+	" save all window variables
  156
+	call s:SaveWinVars()
133 157
 
134 158
     " save window positioning commands
135 159
 "	call Decho("save window positioning commands")
@@ -137,17 +161,13 @@ fun! ZoomWin#ZoomWin()
137 161
     call s:GotoWinNum(s:winkeep)
138 162
 
139 163
     " set up name of session file
140  
-"	call Decho("3: @@<".@@.">")
141 164
     let s:sessionfile= tempname()
142  
-"	call Decho("4: @@<".@@.">")
143 165
 
144 166
     " save session
145 167
 "	call Decho("save session")
146 168
     let ssop_keep = &ssop
147 169
 	let &ssop     = 'blank,help,winsize,folds,globals,localoptions,options'
148  
-"	call Decho("5: @@<".@@.">")
149 170
 	exe 'mksession! '.fnameescape(s:sessionfile)
150  
-"	call Decho("6: @@<".@@.">")
151 171
 	let keepyy= @@
152 172
 	let keepy0= @0
153 173
 	let keepy1= @1
@@ -165,12 +185,13 @@ fun! ZoomWin#ZoomWin()
165 185
 	  exe "keepalt keepmarks new! ".fnameescape(s:sessionfile)
166 186
 	 catch /^Vim\%((\a\+)\)\=:E/
167 187
 	  echoerr "Too many windows"
168  
-      silent! call delete(s:sessionfile)
  188
+      sil! call delete(s:sessionfile)
169 189
       unlet s:sessionfile
  190
+      let &lz= lzkeep
170 191
 "      call Dret("ZoomWin#ZoomWin : too many windows")
171 192
       return
172 193
 	 endtry
173  
-     silent! keepjumps keepmarks v/wincmd\|split\|resize/d
  194
+     sil! keepjumps keepmarks v/wincmd\|split\|resize/d
174 195
      keepalt w!
175 196
      keepalt bw!
176 197
 	else
@@ -192,33 +213,41 @@ fun! ZoomWin#ZoomWin()
192 213
 	let @9= keepy9
193 214
     call histdel('search', -1)
194 215
     let @/ = histget('search', -1)
195  
-"	call Decho("7: @@<".@@.">")
196 216
 
197 217
     " restore user's session options and restore event handling
198 218
 "	call Decho("restore user session options and event handling")
199 219
     set nolz
200 220
     let &ssop = ssop_keep
201  
-    silent! only!
202  
-"	call Decho("8: @@<".@@.">")
  221
+	let curwin= winnr()
  222
+    sil! only!
203 223
     let &ei   = ei_keep
204 224
     echomsg expand("%")
205  
-"	call Decho("9: @@<".@@.">")
  225
+	call s:RestoreOneWinSettings(curwin)
  226
+
  227
+	" zoomwinstate used by g:ZoomWin_funcref()
  228
+	let zoomwinstate= 1
206 229
   endif
207 230
 
208 231
   " restore user option settings {{{3
209  
-"  call Decho("restore user option settings")
210  
-  let &hidden= keep_hidden
211  
-  let &write = keep_write
212  
-  if v:version < 603
213  
-   if exists("keep_wmw")
214  
-    let &wmh= keep_wmh
215  
-    let &wmw= keep_wmw
216  
-   endif
217  
-  endif
  232
+  call s:RestoreUserSettings()
218 233
 
219 234
   " Re-open certain windows {{{3
220 235
   call s:ZoomWinPreserve(1)
  236
+  
  237
+  " call user's optional funcref (callback) functions
  238
+  if exists("g:ZoomWin_funcref")
  239
+   if type(g:ZoomWin_funcref) == 2
  240
+	call g:ZoomWin_funcref(zoomwinstate)
  241
+   elseif type(g:ZoomWin_funcref) == 3
  242
+    for Fncref in g:ZoomWin_funcref
  243
+     if type(FncRef) == 2
  244
+	  call FncRef(zoomwinstate)
  245
+     endif
  246
+    endfor
  247
+   endif
  248
+  endif
221 249
 
  250
+  let &lz= lzkeep
222 251
 "  call Dret("ZoomWin#ZoomWin")
223 252
 endfun
224 253
 
@@ -228,26 +257,36 @@ endfun
228 257
 "          of the current window.
229 258
 fun! s:SavePosn(savewinhoriz)
230 259
 "  call Dfunc("SavePosn(savewinhoriz=".a:savewinhoriz.") file<".expand("%").">")
231  
-  let swline    = line(".")
  260
+  let swline = line(".")
232 261
   if swline == 1 && getline(1) == ""
233 262
    " empty buffer
234 263
    let savedposn= "silent b ".winbufnr(0)
235 264
 "   call Dret("SavePosn savedposn<".savedposn.">")
236 265
    return savedposn
237 266
   endif
238  
-  let swcol     = col(".")
  267
+  let swcol = col(".")
  268
+  if swcol >= col("$")
  269
+   let swcol= swcol + virtcol(".") - virtcol("$")  " adjust for virtual edit (cursor past end-of-line)
  270
+  endif
239 271
   let swwline   = winline()-1
240 272
   let swwcol    = virtcol(".") - wincol()
241  
-  let savedposn = "silent b ".winbufnr(0)."|".swline."|silent norm! z\<cr>"
  273
+"  call Decho("swline #".swline)
  274
+"  call Decho("swcol  #".swcol)
  275
+"  call Decho("swwline#".swwline)
  276
+"  call Decho("swwcol #".swwcol)
  277
+
  278
+  let savedposn = "silent b ".winbufnr(0)
  279
+  let savedposn = savedposn."|".swline
  280
+  let savedposn = savedposn."|sil! norm! 0z\<cr>"
242 281
   if swwline > 0
243  
-   let savedposn= savedposn.":silent norm! ".swwline."\<c-y>\<cr>:silent norm! zs\<cr>"
  282
+   let savedposn= savedposn.":sil! norm! ".swwline."\<c-y>\<cr>"
244 283
   endif
245  
-  let savedposn= savedposn.":silent call cursor(".swline.",".swcol.")\<cr>"
246 284
 
247 285
   if a:savewinhoriz
248 286
    if swwcol > 0
249  
-    let savedposn= savedposn.":silent norm! ".swwcol."zl\<cr>"
  287
+    let savedposn= savedposn.":sil! norm! 0".swwcol."zl\<cr>"
250 288
    endif
  289
+   let savedposn= savedposn.":sil! call cursor(".swline.",".swcol.")\<cr>"
251 290
 
252 291
    " handle certain special settings for the multi-window savedposn call
253 292
    "   bufhidden buftype buflisted
@@ -268,6 +307,8 @@ fun! s:SavePosn(savewinhoriz)
268 307
    	let savedposn= savedposn.":setlocal ".settings."\<cr>"
269 308
    endif
270 309
 
  310
+  else
  311
+   let savedposn= savedposn.":sil! call cursor(".swline.",".swcol.")\<cr>"
271 312
   endif
272 313
 "  call Dret("SavePosn savedposn<".savedposn.">")
273 314
   return savedposn
@@ -276,7 +317,7 @@ endfun
276 317
 " ---------------------------------------------------------------------
277 318
 " s:RestorePosn: this function restores noname and scratch windows {{{2
278 319
 fun! s:RestorePosn(savedposn)
279  
-"  call Dfunc("RestorePosn(savedposn<".a:savedposn.">) file<".expand("%").">")
  320
+"  call Dfunc("RestorePosn(savedposn<".a:savedposn.">)")
280 321
   if &scb
281 322
    setlocal noscb
282 323
    exe a:savedposn
@@ -294,7 +335,7 @@ fun! ZoomWin#CleanupSessionFile()
294 335
 "  call Dfunc("ZoomWin#CleanupSessionFile()")
295 336
   if exists("s:sessionfile") && filereadable(s:sessionfile)
296 337
 "   call Decho("sessionfile exists and is readable; deleting it")
297  
-   silent! call delete(s:sessionfile)
  338
+   sil! call delete(s:sessionfile)
298 339
    unlet s:sessionfile
299 340
   endif
300 341
 "  call Dret("ZoomWin#CleanupSessionFile")
@@ -335,7 +376,7 @@ fun! s:ZoomWinPreserve(open)
335 376
        let s:taglist_winnum = bufwinnr(g:TagList_title)
336 377
        if s:taglist_winnum != -1
337 378
            " Close the window
338  
-           exec "silent! Tlist"
  379
+           exec "sil! Tlist"
339 380
        endif
340 381
    endif
341 382
 
@@ -354,7 +395,7 @@ fun! s:ZoomWinPreserve(open)
354 395
    if exists('g:zoomwin_preserve_taglist') && exists('g:loaded_taglist')
355 396
        " If taglist window was open, open it again
356 397
        if s:taglist_winnum != -1
357  
-           exec "silent! Tlist"
  398
+           exec "sil! Tlist"
358 399
        endif
359 400
    endif
360 401
 
@@ -370,6 +411,111 @@ fun! s:ZoomWinPreserve(open)
370 411
 "  call Dret("ZoomWinPreserve")
371 412
 endfun
372 413
 
  414
+" ---------------------------------------------------------------------
  415
+" s:SaveWinVars: saves a copy of all window-variables into the script variable s:swv_#, {{{2
  416
+"                where # is the current window number, for all windows.
  417
+fun! s:SaveWinVars()
  418
+"  call Dfunc("s:SaveWinVars()")
  419
+  let eikeep= &ei
  420
+  set ei=WinEnter,WinLeave
  421
+  windo let s:swv_{winnr()}      = deepcopy(getwinvar(winnr(),""),1)
  422
+
  423
+  let &ei= eikeep
  424
+"  call Dret("s:SaveWinVars")
  425
+endfun
  426
+
  427
+" ---------------------------------------------------------------------
  428
+" s:RestoreWinVars: restores window variables for all windows {{{2
  429
+fun! s:RestoreWinVars()
  430
+"  call Dfunc("s:RestoreWinVars()")
  431
+"  windo call Decho(string(s:swv_{winnr()}))
  432
+  let eikeep= &ei
  433
+  set ei=WinEnter,WinLeave
  434
+  windo if exists("s:swv_{winnr()}")     |sil! unlet s:key s:value     |for [s:key,s:value] in items(s:swv_{winnr()})|call setwinvar(winnr(),s:key,s:value)|exe "sil! unlet s:key s:value"|endfor|endif
  435
+  windo if exists("s:swv_{winnr()}")     |unlet s:swv_{winnr()}        |endif
  436
+  let &ei= eikeep
  437
+"  call Dret("s:RestoreWinVars")
  438
+endfun
  439
+
  440
+" ---------------------------------------------------------------------
  441
+" s:SaveUserSettings: save user options, set to zoomwin-safe options.  {{{2
  442
+"                     Force window minimum height/width to be >= 1
  443
+fun! s:SaveUserSettings()
  444
+"  call Dfunc("s:SaveUserSettings()")
  445
+
  446
+  let s:keep_wfh    = &wfh
  447
+  let s:keep_hidden = &hidden
  448
+  let s:keep_write  = &write
  449
+  let s:keep_so     = &so
  450
+  let s:keep_siso   = &siso
  451
+  let s:keep_ss     = &ss
  452
+
  453
+  if v:version < 603
  454
+   if &wmh == 0 || &wmw == 0
  455
+    let s:keep_wmh = &wmh
  456
+    let s:keep_wmw = &wmw
  457
+    sil! set wmh=1 wmw=1
  458
+   endif
  459
+  endif
  460
+  set hidden write nowfh so=0 siso=0 ss=0
  461
+"  call Dret("s:SaveUserSettings")
  462
+endfun
  463
+
  464
+" ---------------------------------------------------------------------
  465
+" s:RestoreUserSettings: restore user option settings {{{2
  466
+fun! s:RestoreUserSettings()
  467
+"  call Dfunc("s:RestoreUserSettings()")
  468
+"  call Decho("restore user option settings")
  469
+  let &hidden= s:keep_hidden
  470
+  let &write = s:keep_write
  471
+  let &wfh   = s:keep_wfh
  472
+  let &so    = s:keep_so
  473
+  let &siso  = s:keep_siso
  474
+  let &ss    = s:keep_ss
  475
+  if v:version < 603
  476
+   if exists("s:keep_wmw")
  477
+    let &wmh= s:keep_wmh
  478
+    let &wmw= s:keep_wmw
  479
+   endif
  480
+  endif
  481
+"  call Dret("s:RestoreUserSettings")
  482
+endfun
  483
+
  484
+" ---------------------------------------------------------------------
  485
+" s:SaveWinSettings: saves all windows' local settings {{{2
  486
+fun! s:SaveWinSettings()
  487
+"  call Dfunc("s:SaveWinSettings() curwin#".winnr())
  488
+  let curwin= winnr()
  489
+  for localopt in s:localoptlist
  490
+   windo exe "let s:swv_".localopt."_{winnr()}= &".localopt
  491
+  endfor
  492
+  exe curwin."wincmd w"
  493
+"  call Dret("s:SaveWinSettings : &bt=".&bt." s:swv_bt_".curwin."=".s:swv_bt_{curwin})
  494
+endfun
  495
+
  496
+" ---------------------------------------------------------------------
  497
+" s:RestoreWinSettings: restores all windows' local settings {{{2
  498
+fun! s:RestoreWinSettings()
  499
+"  call Dfunc("s:RestoreWinSettings()")
  500
+  let curwin= winnr()
  501
+  for localopt in s:localoptlist
  502
+   exe 'windo if exists("s:swv_'.localopt.'_{winnr()}")|let &'.localopt.'= s:swv_'.localopt.'_{winnr()}|unlet s:swv_'.localopt.'_{winnr()}|endif'
  503
+  endfor
  504
+  exe curwin."wincmd w"
  505
+"  call Dret("s:RestoreWinSettings : &bt=".&bt)
  506
+endfun
  507
+
  508
+" ---------------------------------------------------------------------
  509
+" s:RestoreOneWinSettings: assumes that s:SaveWinSettings() was called previously; this function restores the specified window's local settings {{{2
  510
+fun! s:RestoreOneWinSettings(wnum)
  511
+"  call Dfunc("s:RestoreOneWinSettings(wnum=".a:wnum.") s:swv_bt_".a:wnum."=".s:swv_bt_{a:wnum})
  512
+  for localopt in s:localoptlist
  513
+"   call Decho('windo if exists("s:swv_'.localopt.'_{a:wnum}")|let &'.localopt.'= s:swv_'.localopt.'_{a:wnum}|unlet s:swv_'.localopt.'_{a:wnum}|endif')
  514
+   exe 'windo if exists("s:swv_'.localopt.'_{a:wnum}")|let &'.localopt.'= s:swv_'.localopt.'_{a:wnum}|unlet s:swv_'.localopt.'_{a:wnum}|endif'
  515
+  endfor
  516
+"  call Dret("s:RestoreOneWinSettings : &bt=".&bt)
  517
+endfun
  518
+
373 519
 " =====================================================================
374 520
 "  Restore: {{{1
375 521
 let &cpo= s:keepcpo
70  doc/ZoomWin.txt
... ...
@@ -1,7 +1,7 @@
1  
-*ZoomWin.txt*	Zoom into/out-of a window		Jan 26, 2009
  1
+*ZoomWin.txt*	Zoom into/out-of a window		Jun 18, 2012
2 2
 Authors: Charles E. Campbell, Jr.			*zoomwin*
3 3
          Ron Aaron
4  
-Copyright: (c) 2004-2008 by Charles E. Campbell, Jr.	*zoomwin-copyright*
  4
+Copyright: (c) 2004-2012 by Charles E. Campbell, Jr.	*zoomwin-copyright*
5 5
            The VIM LICENSE applies to ZoomWin.vim and ZoomWin.txt
6 6
            (see |copyright|) except use "ZoomWin" instead of "Vim"
7 7
 	   No warranty, express or implied.  Use At-Your-Own-Risk.
@@ -15,20 +15,70 @@ Copyright: (c) 2004-2008 by Charles E. Campbell, Jr.	*zoomwin-copyright*
15 15
 
16 16
    Either of the two commands or the normal mode <c-w>o will toggle between
17 17
 	* selecting the current window for display as the only window or
18  
-	* to restore the original multiple-window view.
  18
+	* restoring the original multiple-window view.
  19
+
19 20
 
20 21
 ==============================================================================
21 22
 2. Setup						*zoomwin-setup*
22 23
 
23  
-   Simply put ZoomWin.vim into your .vim/plugin directory (you may need to
24  
-   make such a directory first).  Under Windows that should be
25  
-   vimfiles\plugin.  ZoomWin now uses the HelpExtractor method to
26  
-   automatically extract help and to make it known to vim by running helptags
27  
-   on it.
  24
+   ZoomWin comes as a vimball; to install it, simply >
  25
+
  26
+       vim ZoomWin.vba.gz
  27
+       :so %
  28
+       :q
  29
+<
  30
+   Your .vimrc needs to have, at least: >
  31
+
  32
+   	set nocp
  33
+	filetype plugin on
  34
+<
  35
+   (see |'nocp'|, |:filetype|, and |filetype-plugin-on| for an explanation of
  36
+   these commands)
  37
+
  38
+==============================================================================
  39
+3. Options						*zoomwin-options*
  40
+
  41
+   *g:ZoomWin_funcref* : this variable is used as a function reference
  42
+			 (|Funcref|) or as a |List| of function references.
  43
+			 It is called with a single argument: >
  44
+			   0 : multi-window display; not zoomed in
  45
+			   1 : single-window display; zoomed in
  46
+<			 What this does is permits ZoomWin users to have a
  47
+			 function called whenever ZoomWin changes state.
  48
+			 As an example, consider having the status line
  49
+			 indicate whether one is ZoomWin'd in or not: >
  50
+			    set stl=Normal
  51
+			    fun! ZWStatline(state)
  52
+			      if a:state
  53
+			       set stl=ZoomWin
  54
+			      else
  55
+			       set stl=Normal
  56
+			      endif
  57
+			    endfun
  58
+			    if !exists("g:ZoomWin_funcref")
  59
+			     let g:ZoomWin_funcref= function("ZWStatline")
  60
+			    endif
  61
+<			 The function, ZWStatline(), is called by ZoomWin()
  62
+			 every time it changes state.
  63
+
  64
+	*g:zoomwin_preserve_taglist*	open and close a taglist window on
  65
+	                              zooms
  66
+
  67
+	*g:zoomwin_preserve_winmanager*	open and close winmanager a window on
  68
+	                              zooms
  69
+			
28 70
 
29 71
 ==============================================================================
30  
-3. History						*zoomwin-history*
  72
+4. History						*zoomwin-history*
31 73
 
  74
+	v24 Jan 29, 2009 : * |g:ZoomWin_funcref| supported
  75
+	    May 22, 2009   * supports the saving and restoring of window
  76
+			     variables across zooms
  77
+	    Oct 11, 2009   * The state wasn't being passed along to
  78
+			     g:ZoomWin_funcref as intended.  Fixed.
  79
+	    Jul 09, 2010   * Put an exists() test into s:RestoreWinVars()
  80
+	    Jan 18, 2011   * (reported by talek) bypass winfixheight option
  81
+	    Apr 06, 2011   * Saves and restores local options for every window
32 82
 	v23 Apr 24, 2008 : * when |'scrollbind'| was activated: when ZoomWin
33 83
 			     attempted to restore multiple-windows, the cursor
34 84
 			     position was incorrect.  Fixed.
@@ -38,6 +88,8 @@ Copyright: (c) 2004-2008 by Charles E. Campbell, Jr.	*zoomwin-copyright*
38 88
 			     the search pattern before zooming
39 89
 			   * (Ingo Karkat) contributed a patch to detect the
40 90
 			     vim 7.2 name for the command line window
  91
+			   * too many files (more than the screen rows)
  92
+			     caused restoration problems.
41 93
 	v22 Apr 10, 2006 : * "only" was occasionally issuing an "Already one
42 94
 	                     window" message, which is now prevented
43 95
 			   * SavePosn() issued error message when handling an
6  plugin/ZoomWinPlugin.vim
... ...
@@ -1,8 +1,8 @@
1 1
 " ZoomWin:	Brief-like ability to zoom into/out-of a window
2 2
 " Author:	Charles Campbell
3 3
 "			original version by Ron Aaron
4  
-" Date:		Jan 16, 2009
5  
-" Version:	23e	ASTRO-ONLY
  4
+" Date:		Apr 07, 2011
  5
+" Version:	24iNR	NOT RELEASED
6 6
 " History: see :help zoomwin-history {{{1
7 7
 " GetLatestVimScripts: 508 1 :AutoInstall: ZoomWin.vim
8 8
 
@@ -18,7 +18,7 @@ if v:version < 702
18 18
  finish
19 19
 endif
20 20
 let s:keepcpo              = &cpo
21  
-let g:loaded_ZoomWinPlugin = "v23"
  21
+let g:loaded_ZoomWinPlugin = "v24"
22 22
 set cpo&vim
23 23
 "DechoTabOn
24 24
 

0 notes on commit ac6474a

Please sign in to comment.
Something went wrong with that request. Please try again.