From 4956c3eb831d8810203307af05f1546ea9de4218 Mon Sep 17 00:00:00 2001 From: rhysd Date: Wed, 10 Feb 2016 09:40:24 +0900 Subject: [PATCH] do not open committia twice in the same buffer (#11, #18) --- autoload/committia.vim | 2 ++ plugin/committia.vim | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/autoload/committia.vim b/autoload/committia.vim index 38ccb4c..9877744 100644 --- a/autoload/committia.vim +++ b/autoload/committia.vim @@ -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 @@ -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 diff --git a/plugin/committia.vim b/plugin/committia.vim index 14bdbad..4d187d1 100644 --- a/plugin/committia.vim +++ b/plugin/committia.vim @@ -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