Allow expanding merge conflict in :Gstatus

Closes https://github.com/tpope/vim-fugitive/issues/1242
This commit is contained in:
Tim Pope 2019-08-18 04:01:59 -04:00
parent bbd9afe790
commit fdbcad0624
2 changed files with 6 additions and 4 deletions

View File

@ -2869,7 +2869,7 @@ function! s:StageInline(mode, ...) abort
endif endif
continue continue
endif endif
if !has_key(b:fugitive_diff, info.section) || info.status !~# '^[ADMR]$' || a:mode ==# 'hide' if !has_key(b:fugitive_diff, info.section) || info.status !~# '^[ADMRU]$' || a:mode ==# 'hide'
continue continue
endif endif
let mode = '' let mode = ''
@ -2980,8 +2980,10 @@ function! s:StageApply(info, reverse, extra) abort
call insert(lines, getline(start)) call insert(lines, getline(start))
endif endif
endwhile endwhile
if start == 0 || getline(start) !~# '^@@ ' if start == 0
call s:throw("could not find hunk") throw 'fugitive: cold not find hunk'
elseif getline(start) !~# '^@@ '
throw 'fugitive: cannot apply conflict hunk'
endif endif
let i = b:fugitive_expanded[info.section][info.filename][0] let i = b:fugitive_expanded[info.section][info.filename][0]
let head = [] let head = []

View File

@ -22,7 +22,7 @@ syn match FugitiveSymbolicRef /\.\@!\%(\.\.\@!\|[^[:space:][:cntrl:]\:.]\)\+\.\@
syn match fugitiveHash /^\x\{4,\}\>/ contained containedin=fugitiveSection syn match fugitiveHash /^\x\{4,\}\>/ contained containedin=fugitiveSection
syn match fugitiveHash /\<\x\{4,\}\>/ contained syn match fugitiveHash /\<\x\{4,\}\>/ contained
syn region fugitiveHunk start=/^\%(@@ -\)\@=/ end=/^\%([A-Za-z?@]\|$\)\@=/ contains=@fugitiveDiff containedin=fugitiveSection fold syn region fugitiveHunk start=/^\%(@@\+ -\)\@=/ end=/^\%([A-Za-z?@]\|$\)\@=/ contains=@fugitiveDiff containedin=fugitiveSection fold
hi def link fugitiveHeader Label hi def link fugitiveHeader Label
hi def link fugitiveHeading PreProc hi def link fugitiveHeading PreProc