From bb191c1939974ac729faa164b588dc47146f2c26 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 26 Apr 2011 08:35:02 -0400 Subject: [PATCH] Really work around Vim parser idiosyncrasy --- plugin/fugitive.vim | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 80bd1c7..133797f 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -592,8 +592,9 @@ function! s:StageToggle(lnum1,lnum2) abort let output = '' for lnum in range(a:lnum1,a:lnum2) let line = getline(lnum) + let repo = s:repo() if line ==# '# Changes to be committed:' - call s:repo().git_chomp_in_tree('reset','-q') + call repo.git_chomp_in_tree('reset','-q') silent! edit! 1 if !search('^# Untracked files:$','W') @@ -601,7 +602,7 @@ function! s:StageToggle(lnum1,lnum2) abort endif return '' elseif line =~# '^# Change\%(d but not updated\|s not staged for commit\):$' - call s:repo().git_chomp_in_tree('add','-u') + call repo.git_chomp_in_tree('add','-u') silent! edit! 1 if !search('^# Untracked files:$','W') @@ -610,7 +611,7 @@ function! s:StageToggle(lnum1,lnum2) abort return '' elseif line ==# '# Untracked files:' " Work around Vim parser idiosyncrasy - let discarded = s:repo().git_chomp_in_tree('add','-N','.') + call repo.git_chomp_in_tree('add','-N','.') silent! edit! 1 if !search('^# Change\%(d but not updated\|s not staged for commit\):$','W') @@ -637,7 +638,7 @@ function! s:StageToggle(lnum1,lnum2) abort else let cmd = ['add','--',filename] endif - let output .= call(s:repo().git_chomp_in_tree,cmd,s:repo())."\n" + let output .= call(repo.git_chomp_in_tree,cmd,s:repo())."\n" endfor if exists('first_filename') let jump = first_filename