Skip to content

Commit

Permalink
do not open committia twice in the same buffer (#11, #18)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Feb 10, 2016
1 parent fc80497 commit 4956c3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions autoload/committia.vim
Expand Up @@ -141,6 +141,7 @@ function! s:open_multicolumn(vcs) abort

let s:current_info = info
setlocal bufhidden=wipe
let b:committia_opened = 1
call s:set_callback_on_closed()
endfunction

Expand All @@ -160,6 +161,7 @@ function! s:open_singlecolumn(vcs) abort

let s:current_info = info
setlocal bufhidden=wipe
let b:committia_opened = 1
call s:set_callback_on_closed()
endfunction

Expand Down
2 changes: 1 addition & 1 deletion plugin/committia.vim
Expand Up @@ -5,7 +5,7 @@ endif
let g:committia_open_only_vim_starting = get(g:, 'committia_open_only_vim_starting', 1)

function! s:should_open(ft) abort
return (&ft ==# a:ft && (!g:committia_open_only_vim_starting || has('vim_starting')))
return &ft ==# a:ft && (!g:committia_open_only_vim_starting || has('vim_starting')) && !exists('b:committia_opened')
endfunction

augroup plugin-committia
Expand Down

0 comments on commit 4956c3e

Please sign in to comment.