Skip to content

Commit

Permalink
sets hidden when re-ordering windows, fixes #2
Browse files Browse the repository at this point in the history
  • Loading branch information
zhamlin committed Oct 5, 2017
1 parent 00736d2 commit 268542f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions plugin/tiler.vim
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,10 @@ function! s:verify_tile_order(popups)
call s:set_master_layout(filter(l:window_layout, 'v:val != 0'))
endfunction

function! tiler#close_window()
call s:set_master_layout(filter(s:get_master_layout(), 'v:val != win_getid()'))
function! tiler#close_window() abort
let s:winid = win_getid()
close
call s:set_master_layout(filter(s:get_master_layout(), 'v:val != s:winid'))
call tiler#reorder()
endfunction

Expand All @@ -285,6 +286,10 @@ function! tiler#reorder()
endif
let s:reordering = 1

let s:hidden_status = &hidden
" turn on hidden, needed for swapping unsaved buffers around
set hidden

let l:popups = s:find_popups()
call s:verify_tile_order(l:popups)

Expand Down Expand Up @@ -378,6 +383,11 @@ function! tiler#reorder()

call s:set_master_layout(l:window_layout)
call s:resize_master()

" restore users hidden status
if !s:hidden_status
set nohidden
endif
let s:reordering = 0
endfunction

Expand Down

0 comments on commit 268542f

Please sign in to comment.