From 88c7f867cfadd74aaabc329940859de42197b1fd Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sat, 16 Oct 2021 12:56:03 -0400 Subject: [PATCH] Further decouple #BufReadStatus() from v:cmdbang --- autoload/fugitive.vim | 6 +++--- plugin/fugitive.vim | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 5af4c4f..a0403d1 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -2560,7 +2560,7 @@ function! fugitive#BufReadStatus(...) abort let config = fugitive#Config() let cmd = [fnamemodify(amatch, ':h')] - setlocal noro ma nomodeline buftype=nowrite + setlocal noreadonly modifiable nomodeline buftype=nowrite if s:cpath(fnamemodify($GIT_INDEX_FILE !=# '' ? FugitiveVimPath($GIT_INDEX_FILE) : fugitive#Find('.git/index'), ':p')) !=# s:cpath(amatch) let cmd += [{'env': {'GIT_INDEX_FILE': FugitiveGitPath(amatch)}}] endif @@ -2760,7 +2760,7 @@ function! fugitive#BufReadStatus(...) abort endif let b:fugitive_diff = diff - if !a:0 && v:cmdbang + if get(a:, 1, v:cmdbang) unlet! b:fugitive_expanded endif let expanded = get(b:, 'fugitive_expanded', {'Staged': {}, 'Unstaged': {}}) @@ -4099,7 +4099,7 @@ function! s:ReloadStatusBuffer(...) abort endif let original_lnum = a:0 ? a:1 : line('.') let info = s:StageInfo(original_lnum) - call fugitive#BufReadStatus(1) + call fugitive#BufReadStatus(0) call setpos('.', [0, s:StageSeek(info, original_lnum), 1, 0]) return '' endfunction diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index c28fd5c..7e5fa64 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -628,7 +628,7 @@ augroup fugitive autocmd BufReadCmd index{,.lock} \ if FugitiveIsGitDir(expand(':p:h')) | \ let b:git_dir = s:Slash(expand(':p:h')) | - \ exe fugitive#BufReadStatus() | + \ exe fugitive#BufReadStatus(v:cmdbang) | \ elseif filereadable(expand('')) | \ silent doautocmd BufReadPre | \ keepalt read |