mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-08 11:33:47 -05:00
Fix write in index with guioptions=!
This commit is contained in:
@@ -2258,6 +2258,10 @@ function! fugitive#FileWriteCmd(...) abort
|
||||
if commit !~# '^[0-3]$' || !v:cmdbang && (line("'[") != 1 || line("']") != line('$'))
|
||||
return "noautocmd '[,']write" . (v:cmdbang ? '!' : '') . ' ' . s:fnameescape(amatch)
|
||||
endif
|
||||
if exists('+guioptions') && &guioptions =~# '!'
|
||||
let guioptions = &guioptions
|
||||
set guioptions-=!
|
||||
endif
|
||||
silent execute "'[,']write !".fugitive#Prepare(dir, 'hash-object', '-w', '--stdin', '--').' > '.tmp
|
||||
let sha1 = readfile(tmp)[0]
|
||||
let old_mode = matchstr(s:SystemError([dir, 'ls-files', '--stage', '.' . file])[0], '^\d\+')
|
||||
@@ -2275,6 +2279,9 @@ function! fugitive#FileWriteCmd(...) abort
|
||||
return 'echoerr '.string('fugitive: '.error)
|
||||
endif
|
||||
finally
|
||||
if exists('guioptions')
|
||||
let &guioptions = guioptions
|
||||
endif
|
||||
call delete(tmp)
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user