Better error on :Gwrite failure
References https://github.com/tpope/vim-fugitive/issues/696
This commit is contained in:
parent
0b43b51d77
commit
1e755064e9
@ -1461,6 +1461,9 @@ function! s:Write(force,...) abort
|
|||||||
let mytab = tabpagenr()
|
let mytab = tabpagenr()
|
||||||
let mybufnr = bufnr('')
|
let mybufnr = bufnr('')
|
||||||
let path = a:0 ? join(a:000, ' ') : s:buffer().path()
|
let path = a:0 ? join(a:000, ' ') : s:buffer().path()
|
||||||
|
if empty(path)
|
||||||
|
return 'echoerr '.string('fugitive: cannot determine file path')
|
||||||
|
endif
|
||||||
if path =~# '^:\d\>'
|
if path =~# '^:\d\>'
|
||||||
return 'write'.(a:force ? '! ' : ' ').s:fnameescape(s:repo().translate(s:buffer().expand(path)))
|
return 'write'.(a:force ? '! ' : ' ').s:fnameescape(s:repo().translate(s:buffer().expand(path)))
|
||||||
endif
|
endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user