From e064f427701e0a058f166c90bfb89f380d54c973 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Wed, 20 Apr 2022 18:27:12 -0400 Subject: [PATCH] Don't consider buftype=acwrite buffers to have real filenames Immediately after I changed this I rediscovered the documentation at `:help E676`. --- plugin/fugitive.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 8ef7b9d..8f2d4ff 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -23,9 +23,9 @@ function! FugitiveGitDir(...) abort return g:fugitive_event endif let dir = get(b:, 'git_dir', '') - if empty(dir) && (empty(bufname('')) || &buftype =~# '^\%(nofile\|quickfix\|terminal\|prompt\)$') + if empty(dir) && (empty(bufname('')) || &buftype =~# '^\%(nofile\|acwrite\|quickfix\|terminal\|prompt\)$') return FugitiveExtractGitDir(getcwd()) - elseif (!exists('b:git_dir') || b:git_dir =~# s:bad_git_dir) && &buftype =~# '^\%(nowrite\|acwrite\)\=$' + elseif (!exists('b:git_dir') || b:git_dir =~# s:bad_git_dir) && &buftype =~# '^\%(nowrite\)\=$' let b:git_dir = FugitiveExtractGitDir(bufnr('')) return b:git_dir endif