Skip to content

Commit b853e69

Browse files
Charles Campbellvim-scripts
authored andcommitted
Version 19
bugfix - winmanager's events, such as one to reset bufhidden to delete, caused ZoomWin to occasionally restore empty windows. ZoomWin now works successfully with winmanager.
1 parent f0caaf2 commit b853e69

1 file changed

Lines changed: 16 additions & 11 deletions

File tree

plugin/ZoomWin.vim

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
" ZoomWin: Brief-like ability to zoom into/out-of a window
22
" Author: Ron Aaron
33
" modified by Charles Campbell
4-
" Version: 18
4+
" Version: 19
55
" History: see :he zoomwin-history
66

77
" ---------------------------------------------------------------------
@@ -56,7 +56,6 @@ fun! ZoomWin()
5656
call s:GotoWinNum(s:winkeep)
5757
unlet s:winkeep
5858
endif
59-
let &ei=ei_keep
6059

6160
if line(".") != s:origline || virtcol(".") != s:origcol
6261
" If the cursor hasn't moved from the original position,
@@ -68,6 +67,7 @@ fun! ZoomWin()
6867
" delete session file and variable holding its name
6968
call delete(s:sessionfile)
7069
unlet s:sessionfile
70+
let &ei=ei_keep
7171
endif
7272

7373
else " there's more than one window - go to only-one-window mode
@@ -85,6 +85,8 @@ fun! ZoomWin()
8585
endif
8686

8787
" save window positioning commands
88+
let ei_keep = &ei
89+
set ei=all
8890
windo let s:savedposn{winnr()}= s:SavePosn(1)
8991
call s:GotoWinNum(s:winkeep)
9092

@@ -94,18 +96,16 @@ fun! ZoomWin()
9496
" save session
9597
let ssop_keep = &ssop
9698
let &ssop = 'blank,help,winsize'
97-
let ei_keep = &ei
9899
exe 'mksession! '.s:sessionfile
99-
set lz
100-
set ei=all
100+
set lz ei=all bh=
101101
exe "new! ".s:sessionfile
102102
v/wincmd\|split\|resize/d
103103
w!
104104
bw!
105105
set nolz
106106
let &ssop = ssop_keep
107-
let &ei = ei_keep
108107
only!
108+
let &ei = ei_keep
109109
echomsg expand("%")
110110
endif
111111

@@ -146,14 +146,14 @@ fun! s:SavePosn(savewinhoriz)
146146
let settings= ""
147147
if &bh != ""
148148
let settings="bh=".&bh
149-
setlocal bh=
149+
setlocal bh=hide
150150
endif
151151
if !&bl
152152
let settings= settings." nobl"
153153
setlocal bl
154154
endif
155-
if &bt == "quickfix"
156-
let settings= settings." bt=quickfix"
155+
if &bt != ""
156+
let settings= settings." bt=".&bt
157157
setlocal bt=
158158
endif
159159
if settings != ""
@@ -240,10 +240,10 @@ finish
240240
" ---------------------------------------------------------------------
241241
" Put the help after the HelpExtractorDoc label...
242242
" HelpExtractorDoc:
243-
*ZoomWin.txt* Zoom into/out-of a window May 24, 2004
243+
*ZoomWin.txt* Zoom into/out-of a window May 26, 2004
244244
Authors: Charles E. Campbell, Jr. *zoomwin*
245245
Ron Aaron
246-
Version: 18
246+
Version: 19
247247

248248
==============================================================================
249249
1. Usage *zoomwin-usage*
@@ -265,6 +265,11 @@ Version: 18
265265
==============================================================================
266266
3. History *zoomwin-history*
267267

268+
v19 May 26, 2004 : * bugfix - winmanager has events firing that,
269+
amongst other things, reset the bufhidden
270+
option to delete for some windows while
271+
ZoomWin worked. ZoomWin now works
272+
successfully with winmanager.
268273
v18 May 20, 2004 : * bugfix - didn't adversely affect anything, but
269274
ZoomWin was deleting its session file twice.
270275
* bugfix -- a multi-source file + minibufexplorer

0 commit comments

Comments
 (0)