motiejus/dotfiles

Unnamed repository; edit this file 'description' to name the repository.
git clone https://git.jakstys.lt/motiejus/dotfiles.git
Log | Tree | Refs | README | LICENSE

commit 063d1fcaa980207e44f2bcbe1bccf895daf2b3af (tree)
parent 037ce62894c25618100d23984d26729d663a82d2
Author: Tim Pope <code@tpope.net>
Date:   Sun, 13 Dec 2009 19:49:35 -0500

Remove "." from 'path' in "fugitive://" files

Having "." in 'path' causes commands like :find to dump one in
never-never land when invoked from a "fugitive://" file.

Diffstat:
Mplugin/fugitive.vim | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim @@ -101,6 +101,10 @@ function! s:Detect() if exists('b:git_dir') silent doautocmd User Fugitive cnoremap <expr> <buffer> <C-R><C-G> fugitive#buffer().rev() + if expand('%:p') =~# '//' + let buffer = fugitive#buffer() + call buffer.setvar('&path',s:sub(buffer.getvar('&path'),'^\.%(,|$)','')) + endif endif endfunction @@ -295,6 +299,10 @@ function! s:buffer_getvar(var) dict abort return getbufvar(self['#'],a:var) endfunction +function! s:buffer_setvar(var,value) dict abort + return setbufvar(self['#'],a:var,a:value) +endfunction + function! s:buffer_getline(lnum) dict abort return getbufline(self['#'],a:lnum)[0] endfunction @@ -395,7 +403,7 @@ function! s:buffer_containing_commit() dict abort endif endfunction -call s:add_methods('buffer',['getvar','getline','repo','type','name','commit','path','rev','sha1','expand','containing_commit']) +call s:add_methods('buffer',['getvar','setvar','getline','repo','type','name','commit','path','rev','sha1','expand','containing_commit']) " }}}1 " Git {{{1