Skip to content

Commit

Permalink
Better error on :Gwrite failure
Browse files Browse the repository at this point in the history
  • Loading branch information
brendeschuijmert committed Oct 7, 2015
1 parent 2c1a3ed commit ea41d09
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugin/fugitive.vim
Expand Up @@ -1461,6 +1461,9 @@ function! s:Write(force,...) abort
let mytab = tabpagenr()
let mybufnr = bufnr('')
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\>'
return 'write'.(a:force ? '! ' : ' ').s:fnameescape(s:repo().translate(s:buffer().expand(path)))
endif
Expand Down

0 comments on commit ea41d09

Please sign in to comment.