From d255963165e478ed0e9130c6867858ef1a8ae939 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Wed, 30 Jul 2014 08:06:06 +0900 Subject: [PATCH] Fix #664 noname buffer problem in tabopen action --- autoload/unite/kinds/openable.vim | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/autoload/unite/kinds/openable.vim b/autoload/unite/kinds/openable.vim index fd04b327..ddc9d22b 100644 --- a/autoload/unite/kinds/openable.vim +++ b/autoload/unite/kinds/openable.vim @@ -47,8 +47,14 @@ let s:kind.action_table.tabopen = { \ } function! s:kind.action_table.tabopen.func(candidates) "{{{ for candidate in a:candidates - tabnew - call unite#take_action('open', candidate) + let hidden_save = &hidden + try + set nohidden + tabnew + call unite#take_action('open', candidate) + finally + let &hidden = hidden_save + endtry endfor endfunction"}}} @@ -220,8 +226,15 @@ let s:kind.action_table.tabsplit = { \ 'is_tab' : 1, \ } function! s:kind.action_table.tabsplit.func(candidates) "{{{ - tabnew - silent call unite#take_action('open', a:candidates[0]) + let hidden_save = &hidden + try + set nohidden + tabnew + silent call unite#take_action('open', a:candidates[0]) + finally + let &hidden = hidden_save + endtry + for candidate in a:candidates[1:] silent call unite#take_action('vsplit', candidate) endfor