mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-10 04:23:46 -05:00
Tighten match for commit under cursor in temp buffers
Closes https://github.com/tpope/vim-fugitive/issues/1756
This commit is contained in:
@@ -6409,7 +6409,7 @@ function! s:SquashArgument(...) abort
|
|||||||
if &filetype == 'fugitive'
|
if &filetype == 'fugitive'
|
||||||
let commit = matchstr(getline('.'), '^\%(\%(\x\x\x\)\@!\l\+\s\+\)\=\zs[0-9a-f]\{4,\}\ze \|^' . s:ref_header . ': \zs\S\+')
|
let commit = matchstr(getline('.'), '^\%(\%(\x\x\x\)\@!\l\+\s\+\)\=\zs[0-9a-f]\{4,\}\ze \|^' . s:ref_header . ': \zs\S\+')
|
||||||
elseif has_key(s:temp_files, s:cpath(expand('%:p')))
|
elseif has_key(s:temp_files, s:cpath(expand('%:p')))
|
||||||
let commit = matchstr(getline('.'), '\<\x\{4,\}\>')
|
let commit = matchstr(getline('.'), '\S\@<!\x\{4,\}\>')
|
||||||
else
|
else
|
||||||
let commit = s:Owner(@%)
|
let commit = s:Owner(@%)
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user