Support advice.statusHints = false

Closes #230.
This commit is contained in:
Tim Pope
2012-08-01 16:00:02 -04:00
parent a90cc48c7a
commit 0abe1fb122

View File

@@ -687,9 +687,9 @@ function! s:stage_info(lnum) abort
endwhile endwhile
if !lnum if !lnum
return ['', ''] return ['', '']
elseif getline(lnum+1) =~# '^#.*"git \%(reset\|rm --cached\) ' elseif getline(lnum+1) =~# '^# .*"git \%(reset\|rm --cached\) ' || getline(lnum) ==# '# Changes to be committed:'
return [matchstr(filename, ': *\zs.*'), 'staged'] return [matchstr(filename, ': *\zs.*'), 'staged']
elseif getline(lnum+2) =~# '^#.*"git checkout ' elseif getline(lnum+2) =~# '^# .*"git checkout ' || getline(lnum) ==# '# Changes not staged for commit:'
return [matchstr(filename, ': *\zs.*'), 'unstaged'] return [matchstr(filename, ': *\zs.*'), 'unstaged']
else else
return [filename, 'untracked'] return [filename, 'untracked']
@@ -738,7 +738,7 @@ function! s:StageDiffEdit() abort
if arg ==# '.' if arg ==# '.'
silent! edit! silent! edit!
1 1
if !search('^# .*:\n#.*\n#.*"git checkout ','W') if !search('^# .*:\n#.*\n# .*"git checkout \|^# Changes not staged for commit:$','W')
call search('^# .*:$','W') call search('^# .*:$','W')
endif endif
else else
@@ -761,7 +761,7 @@ function! s:StageToggle(lnum1,lnum2) abort
call repo.git_chomp_in_tree('reset','-q') call repo.git_chomp_in_tree('reset','-q')
silent! edit! silent! edit!
1 1
if !search('^# .*:\n#.*"git add .*\n#\n','W') if !search('^# .*:\n# .*"git add .*\n#\n\|^# Untracked files:$','W')
call search('^# .*:$','W') call search('^# .*:$','W')
endif endif
return '' return ''
@@ -769,7 +769,7 @@ function! s:StageToggle(lnum1,lnum2) abort
call repo.git_chomp_in_tree('add','-u') call repo.git_chomp_in_tree('add','-u')
silent! edit! silent! edit!
1 1
if !search('^# .*:\n#.*"git add .*\n#\n','W') if !search('^# .*:\n# .*"git add .*\n#\n\|^# Untracked files:$','W')
call search('^# .*:$','W') call search('^# .*:$','W')
endif endif
return '' return ''