@@ -4162,7 +4162,9 @@ function! s:StatusCommand(line1, line2, range, count, bang, mods, reg, arg, args
4162
4162
try
4163
4163
let mods = s: Mods (a: mods , ' Edge' )
4164
4164
let file = fugitive#Find (' :' , dir )
4165
- let arg = ' +setl\ foldmarker=<<<<<<<<,>>>>>>>>\|let\ w:fugitive_status=FugitiveGitDir() ' .
4165
+ let arg = ' +setl\ foldmarker=<<<<<<<<,>>>>>>>>' .
4166
+ \ (exists (' &winfixbuf' ) ? ' \ winfixbuf' : ' ' ) .
4167
+ \ ' \|let\ w:fugitive_status=FugitiveGitDir() ' .
4166
4168
\ s: fnameescape (file )
4167
4169
for tabnr in [tabpagenr ()] + (mods = ~# ' \<tab\>' ? range (1 , tabpagenr (' $' )) : [])
4168
4170
let bufs = tabpagebuflist (tabnr)
@@ -4176,6 +4178,9 @@ function! s:StatusCommand(line1, line2, range, count, bang, mods, reg, arg, args
4176
4178
exe winnr . ' wincmd w'
4177
4179
endif
4178
4180
let w: fugitive_status = dir
4181
+ if exists (' &winfixbuf' )
4182
+ setlocal winfixbuf
4183
+ endif
4179
4184
1
4180
4185
return ' '
4181
4186
endif
@@ -6203,7 +6208,7 @@ function! fugitive#DiffClose() abort
6203
6208
endfunction
6204
6209
6205
6210
function ! s: BlurStatus () abort
6206
- if (&previewwindow || exists (' w:fugitive_status' )) && get (b: ,' fugitive_type' , ' ' ) == # ' index'
6211
+ if (&previewwindow || getwinvar ( winnr (), ' &winfixbuf ' ) is # 1 || exists (' w:fugitive_status' )) && get (b: , ' fugitive_type' , ' ' ) == # ' index'
6207
6212
let winnrs = filter ([winnr (' #' )] + range (1 , winnr (' $' )), ' s:UsableWin(v:val)' )
6208
6213
if len (winnrs)
6209
6214
exe winnrs[0 ].' wincmd w'
0 commit comments