mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-15 14:53:51 -05:00
Really work around Vim parser idiosyncrasy
This commit is contained in:
@@ -592,8 +592,9 @@ function! s:StageToggle(lnum1,lnum2) abort
|
|||||||
let output = ''
|
let output = ''
|
||||||
for lnum in range(a:lnum1,a:lnum2)
|
for lnum in range(a:lnum1,a:lnum2)
|
||||||
let line = getline(lnum)
|
let line = getline(lnum)
|
||||||
|
let repo = s:repo()
|
||||||
if line ==# '# Changes to be committed:'
|
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!
|
silent! edit!
|
||||||
1
|
1
|
||||||
if !search('^# Untracked files:$','W')
|
if !search('^# Untracked files:$','W')
|
||||||
@@ -601,7 +602,7 @@ function! s:StageToggle(lnum1,lnum2) abort
|
|||||||
endif
|
endif
|
||||||
return ''
|
return ''
|
||||||
elseif line =~# '^# Change\%(d but not updated\|s not staged for commit\):$'
|
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!
|
silent! edit!
|
||||||
1
|
1
|
||||||
if !search('^# Untracked files:$','W')
|
if !search('^# Untracked files:$','W')
|
||||||
@@ -610,7 +611,7 @@ function! s:StageToggle(lnum1,lnum2) abort
|
|||||||
return ''
|
return ''
|
||||||
elseif line ==# '# Untracked files:'
|
elseif line ==# '# Untracked files:'
|
||||||
" Work around Vim parser idiosyncrasy
|
" 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!
|
silent! edit!
|
||||||
1
|
1
|
||||||
if !search('^# Change\%(d but not updated\|s not staged for commit\):$','W')
|
if !search('^# Change\%(d but not updated\|s not staged for commit\):$','W')
|
||||||
@@ -637,7 +638,7 @@ function! s:StageToggle(lnum1,lnum2) abort
|
|||||||
else
|
else
|
||||||
let cmd = ['add','--',filename]
|
let cmd = ['add','--',filename]
|
||||||
endif
|
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
|
endfor
|
||||||
if exists('first_filename')
|
if exists('first_filename')
|
||||||
let jump = first_filename
|
let jump = first_filename
|
||||||
|
|||||||
Reference in New Issue
Block a user