From 1452900ffd4590dcf37142f62ba86997f870d576 Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Mon, 12 Feb 2018 15:34:49 +0000 Subject: [PATCH] Check buffer is active before init. --- autoload/gitgutter.vim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/autoload/gitgutter.vim b/autoload/gitgutter.vim index 3b79b7d..4a4ed9d 100644 --- a/autoload/gitgutter.vim +++ b/autoload/gitgutter.vim @@ -13,9 +13,11 @@ endfunction " Finds the file's path relative to the repo root. function! gitgutter#init_buffer(bufnr) - let p = gitgutter#utility#repo_path(a:bufnr, 0) - if type(p) != v:t_string || empty(p) - call gitgutter#utility#set_repo_path(a:bufnr) + if gitgutter#utility#is_active(a:bufnr) + let p = gitgutter#utility#repo_path(a:bufnr, 0) + if type(p) != v:t_string || empty(p) + call gitgutter#utility#set_repo_path(a:bufnr) + endif endif endfunction