mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-15 14:53:51 -05:00
@@ -739,14 +739,16 @@ function! s:stage_info(lnum) abort
|
|||||||
endwhile
|
endwhile
|
||||||
if !lnum
|
if !lnum
|
||||||
return ['', '']
|
return ['', '']
|
||||||
elseif getline(lnum+1) =~# '^# .*\<git \%(reset\|rm --cached\) ' || getline(lnum) ==# '# Changes to be committed:'
|
elseif (getline(lnum+1) =~# '^# .*\<git \%(reset\|rm --cached\) ' && getline(lnum+2) ==# '#') || getline(lnum) ==# '# Changes to be committed:'
|
||||||
return [matchstr(filename, colon.' *\zs.*'), 'staged']
|
return [matchstr(filename, colon.' *\zs.*'), 'staged']
|
||||||
|
elseif (getline(lnum+1) =~# '^# .*\<git add ' && getline(lnum+2) ==# '#') || getline(lnum) ==# '# Untracked files:'
|
||||||
|
return [filename, 'untracked']
|
||||||
elseif getline(lnum+2) =~# '^# .*\<git checkout ' || getline(lnum) ==# '# Changes not staged for commit:'
|
elseif getline(lnum+2) =~# '^# .*\<git checkout ' || getline(lnum) ==# '# Changes not staged for commit:'
|
||||||
return [matchstr(filename, colon.' *\zs.*'), 'unstaged']
|
return [matchstr(filename, colon.' *\zs.*'), 'unstaged']
|
||||||
elseif getline(lnum+1) =~# '^# .*\<git add/rm ' || getline(lnum) ==# '# Unmerged paths:'
|
elseif getline(lnum+2) =~# '^# .*\<git \%(add\|rm\)' || getline(lnum) ==# '# Unmerged paths:'
|
||||||
return [matchstr(filename, colon.' *\zs.*'), 'unmerged']
|
return [matchstr(filename, colon.' *\zs.*'), 'unmerged']
|
||||||
else
|
else
|
||||||
return [filename, 'untracked']
|
return ['', 'unknown']
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user