1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-02 20:30:05 +08:00

feat(vcs): fix log grep option

This commit is contained in:
wsdjeg 2022-10-26 23:07:58 +08:00
parent f458b75dcb
commit 6950d163f3

View File

@ -301,6 +301,16 @@ function! s:change_options(key) abort
else
let s:git_log_options[a:key].option = '--author='
endif
elseif a:key ==# 'g'
" change search text
" change author
let origin_grep = matchstr(s:git_log_options[a:key].option, '\("\)\@<=[^"]*')
let grep = input('--grep=', origin_grep)
if !empty(grep)
let s:git_log_options[a:key].option = '--grep="' . grep . '"'
else
let s:git_log_options[a:key].option = '--grep='
endif
elseif a:key ==# 'n'
let orig_nr = matchstr(s:git_log_options[a:key].option, '\("\)\@<=[^"]*')
let nr = str2nr(input('-n', orig_nr))