diff --git a/doc/fugitive.txt b/doc/fugitive.txt index 8015877..e6b5e2f 100644 --- a/doc/fugitive.txt +++ b/doc/fugitive.txt @@ -78,7 +78,7 @@ that are part of Git repositories). :Gpedit [revision] |:pedit| a |fugitive-revision| *fugitive-:Gread* -:[range]Gread [revision] +:{range}Gread [revision] |:read| a |fugitive-revision| *fugitive-:Gread!* diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 2f703cb..05402e0 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -45,6 +45,13 @@ function! s:throw(string) abort throw v:errmsg 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 for name in a:method_names 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' wincmd p endif + if a:cmd == 'read' + call s:warn('Use :.Gread for future compatibility') + endif return a:cmd.' '.s:fnameescape(file) endif endfunction