Deprecate :Gread with no range or bang
In the future, :Gread will become equivalent to :Gread!, and :.Gread will be required in order to read into a buffer without replacing it.
This commit is contained in:
parent
6eaa4604ff
commit
ecb2157d7e
@ -78,7 +78,7 @@ that are part of Git repositories).
|
|||||||
:Gpedit [revision] |:pedit| a |fugitive-revision|
|
:Gpedit [revision] |:pedit| a |fugitive-revision|
|
||||||
|
|
||||||
*fugitive-:Gread*
|
*fugitive-:Gread*
|
||||||
:[range]Gread [revision]
|
:{range}Gread [revision]
|
||||||
|:read| a |fugitive-revision|
|
|:read| a |fugitive-revision|
|
||||||
|
|
||||||
*fugitive-:Gread!*
|
*fugitive-:Gread!*
|
||||||
|
@ -45,6 +45,13 @@ function! s:throw(string) abort
|
|||||||
throw v:errmsg
|
throw v:errmsg
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:warn(str)
|
||||||
|
echohl WarningMsg
|
||||||
|
echomsg a:str
|
||||||
|
echohl None
|
||||||
|
let v:warningmsg = a:str
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:add_methods(namespace, method_names) abort
|
function! s:add_methods(namespace, method_names) abort
|
||||||
for name in a:method_names
|
for name in a:method_names
|
||||||
let s:{a:namespace}_prototype[name] = s:function('s:'.a:namespace.'_'.name)
|
let s:{a:namespace}_prototype[name] = s:function('s:'.a:namespace.'_'.name)
|
||||||
@ -643,6 +650,9 @@ function! s:Edit(cmd,...) abort
|
|||||||
if &previewwindow && getbufvar('','fugitive_type') ==# 'index'
|
if &previewwindow && getbufvar('','fugitive_type') ==# 'index'
|
||||||
wincmd p
|
wincmd p
|
||||||
endif
|
endif
|
||||||
|
if a:cmd == 'read'
|
||||||
|
call s:warn('Use :.Gread for future compatibility')
|
||||||
|
endif
|
||||||
return a:cmd.' '.s:fnameescape(file)
|
return a:cmd.' '.s:fnameescape(file)
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
Loading…
x
Reference in New Issue
Block a user