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
continue
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
endif
let mode = ''
@ -2980,8 +2980,10 @@ function! s:StageApply(info, reverse, extra) abort
call insert(lines, getline(start))
endif
endwhile
if start == 0 || getline(start) !~# '^@@ '
call s:throw("could not find hunk")
if start == 0
throw 'fugitive: cold not find hunk'
elseif getline(start) !~# '^@@ '
throw 'fugitive: cannot apply conflict hunk'
endif
let i = b:fugitive_expanded[info.section][info.filename][0]
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
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 fugitiveHeading PreProc