Skip to content

Commit

Permalink
set hidden correctly when focusing window
Browse files Browse the repository at this point in the history
  • Loading branch information
zhamlin committed Oct 5, 2017
1 parent 084441d commit 303b2d2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions plugin/tiler.vim
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,22 @@ function! tiler#stack_windows() abort
endfunction

function! s:swap_buffers(a, b)
let s:hidden_status = &hidden
" turn on hidden, needed for swapping unsaved buffers around
set hidden

let l:abuf = winbufnr(a:a)
let l:bbuf = winbufnr(a:b)

execute a:a . 'wincmd w'
execute 'b ' . l:bbuf
execute a:b . 'wincmd w'
execute 'b ' . l:abuf

" restore users hidden status
if !s:hidden_status
set nohidden
endif
endfunction

" make sure tile_order is correct, when another window opened without calling TilerNew
Expand Down

0 comments on commit 303b2d2

Please sign in to comment.