Skip to content

Commit a99fda9

Browse files
committed
Push master back to stack on focus
1 parent b7b2b75 commit a99fda9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

plugin/dwm.vim

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,17 @@ function! DWM_New()
7575
endfunction
7676

7777
" Move the current window to the master pane (the previous master window is
78-
" added to the top of the stack)
78+
" added to the top of the stack). If current window is master already - switch
79+
" back to previous
7980
function! DWM_Focus()
81+
if winnr('$') == 1
82+
return
83+
endif
84+
85+
if winnr() == 1
86+
wincmd p
87+
endif
88+
8089
let l:curwin = winnr()
8190
call DWM_Stack(1)
8291
exec l:curwin . "wincmd w"

0 commit comments

Comments
 (0)