From 251eda7eb6688640ace3b9c07e10492dd8e71ae7 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sun, 1 Sep 2019 20:55:22 -0400 Subject: [PATCH] Reduce fugitive#buffer() to stub object --- autoload/fugitive.vim | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 2783d0d..23b4101 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -1385,43 +1385,15 @@ function! fugitive#buffer(...) abort return buffer endfunction -function! s:buffer_getvar(var) dict abort - throw "fugitive: A third-party plugin or vimrc is calling fugitive#buffer().getvar() which has been removed. Replace it with the local variable or getbufvar()" -endfunction - -function! s:buffer_getline(lnum) dict abort - throw "fugitive: A third-party plugin or vimrc is calling fugitive#buffer().getline() which has been removed. Replace it with getline() or getbufline()" -endfunction - function! s:buffer_repo() dict abort return fugitive#repo(self['#']) endfunction function! s:buffer_type(...) dict abort - return getbufvar(self['#'], 'fugitive_type') + return 'see b:fugitive_type' endfunction -function! s:buffer_spec() dict abort - throw "fugitive: A third-party plugin or vimrc is calling fugitive#buffer().spec() which has been removed. Replace it with bufname(), expand('%:p'), etc" -endfunction - -function! s:buffer_name() dict abort - throw "fugitive: A third-party plugin or vimrc is calling fugitive#buffer().name() which has been removed. Replace it with bufname(), expand('%:p'), etc" -endfunction - -function! s:buffer_commit() dict abort - throw "fugitive: A third-party plugin or vimrc is calling fugitive#buffer().commit() which has been removed. Replace it with matchstr(FugitiveParse()[0], '^\x\+')" -endfunction - -function! s:buffer_relative(...) dict abort - throw "fugitive: A third-party plugin or vimrc is calling fugitive#buffer().relative() which has been removed. Replace it with FugitivePath(@%, " . string(a:0 ? a:1 : '') . ")" -endfunction - -function! s:buffer_path(...) dict abort - throw "fugitive: A third-party plugin or vimrc is calling fugitive#buffer().path() which has been removed. Replace it with FugitivePath(@%, " . string(a:0 ? a:1 : '') . ")" -endfunction - -call s:add_methods('buffer',['getvar','getline','repo','type','spec','name','commit','path','relative']) +call s:add_methods('buffer', ['repo', 'type']) " Section: Completion