1
0
mirror of https://github.com/amix/vimrc synced 2025-08-03 11:45:00 +08:00

Updated plugins

This commit is contained in:
Amir
2023-07-15 12:43:27 +02:00
parent 68cf3c02e2
commit 747d4093f4
52 changed files with 767 additions and 165 deletions

View File

@ -150,9 +150,8 @@ function! gitgutter#utility#set_repo_path(bufnr, continuation) abort
call gitgutter#utility#setbufvar(a:bufnr, 'path', -1)
let cmd = gitgutter#utility#cd_cmd(a:bufnr,
\ g:gitgutter_git_executable.' '.g:gitgutter_git_args.
\ ' ls-files -v --error-unmatch --full-name -z -- '.
\ gitgutter#utility#shellescape(s:filename(a:bufnr)))
\ gitgutter#git().' ls-files -v --error-unmatch --full-name -z -- '.
\ gitgutter#utility#shellescape(gitgutter#utility#filename(a:bufnr)))
if g:gitgutter_async && gitgutter#async#available() && !has('vim_starting')
let handler = copy(s:set_path_handler)
@ -178,6 +177,20 @@ function! gitgutter#utility#set_repo_path(bufnr, continuation) abort
endfunction
function! gitgutter#utility#clean_smudge_filter_applies(bufnr)
let filtered = gitgutter#utility#getbufvar(a:bufnr, 'filter', -1)
if filtered == -1
let cmd = gitgutter#utility#cd_cmd(a:bufnr,
\ gitgutter#git().' check-attr filter -- '.
\ gitgutter#utility#shellescape(gitgutter#utility#filename(a:bufnr)))
let out = gitgutter#utility#system(cmd)
let filtered = out !~ 'unspecified'
call gitgutter#utility#setbufvar(a:bufnr, 'filter', filtered)
endif
return filtered
endfunction
function! gitgutter#utility#cd_cmd(bufnr, cmd) abort
let cd = s:unc_path(a:bufnr) ? 'pushd' : (gitgutter#utility#windows() && s:dos_shell() ? 'cd /d' : 'cd')
return cd.' '.s:dir(a:bufnr).' && '.a:cmd
@ -233,7 +246,7 @@ function! s:dir(bufnr) abort
endfunction
" Not shellescaped.
function! s:filename(bufnr) abort
function! gitgutter#utility#filename(bufnr) abort
return fnamemodify(s:abs_path(a:bufnr, 0), ':t')
endfunction