1
0
Fork 0
mirror of synced 2024-12-22 15:08:57 -05:00

Updated plugins

This commit is contained in:
amix 2019-12-12 23:01:41 +01:00
parent 901655ef04
commit cb57890701
7 changed files with 66 additions and 10 deletions

View file

@ -3489,7 +3489,7 @@ function! s:FinishCommit() abort
call setbufvar(buf, 'fugitive_commit_arguments', []) call setbufvar(buf, 'fugitive_commit_arguments', [])
if getbufvar(buf, 'fugitive_commit_rebase') if getbufvar(buf, 'fugitive_commit_rebase')
call setbufvar(buf, 'fugitive_commit_rebase', 0) call setbufvar(buf, 'fugitive_commit_rebase', 0)
let s:rebase_continue = s:Dir(buf) let s:rebase_continue = [s:Dir(buf), 0]
endif endif
return s:CommitSubcommand(-1, -1, 0, 0, '', args, s:Dir(buf)) return s:CommitSubcommand(-1, -1, 0, 0, '', args, s:Dir(buf))
endif endif
@ -3696,11 +3696,11 @@ function! s:MergeRebase(cmd, bang, mods, args, ...) abort
call fugitive#ReloadStatus(dir, 1) call fugitive#ReloadStatus(dir, 1)
if empty(filter(getqflist(),'v:val.valid && v:val.type !=# "I"')) if empty(filter(getqflist(),'v:val.valid && v:val.type !=# "I"'))
if a:cmd =~# '^rebase' && if a:cmd =~# '^rebase' &&
\ filereadable(fugitive#Find('.git/rebase-merge/amend', dir)) &&
\ filereadable(fugitive#Find('.git/rebase-merge/done', dir)) && \ filereadable(fugitive#Find('.git/rebase-merge/done', dir)) &&
\ get(readfile(fugitive#Find('.git/rebase-merge/done', dir)), -1, '') =~# '^[^e]' \ get(readfile(fugitive#Find('.git/rebase-merge/done', dir)), -1, '') =~# '^[^bep]'
cclose cclose
return 'exe ' . string(mods . 'Gcommit --amend -n -F ' . s:fnameescape(fugitive#Find('.git/rebase-merge/message', dir)) . ' -e') . '|let b:fugitive_commit_rebase = 1' let amend = filereadable(fugitive#Find('.git/rebase-merge/amend', dir)) ? '--amend ' : ''
return 'exe ' . string(mods . 'Gcommit ' . amend . '-n -F ' . s:fnameescape(fugitive#Find('.git/rebase-merge/message', dir)) . ' -e') . '|let b:fugitive_commit_rebase = 1'
elseif !had_merge_msg && filereadable(fugitive#Find('.git/MERGE_MSG', dir)) elseif !had_merge_msg && filereadable(fugitive#Find('.git/MERGE_MSG', dir))
cclose cclose
return mods . 'Gcommit --no-status -n -t '.s:fnameescape(fugitive#Find('.git/MERGE_MSG', dir)) return mods . 'Gcommit --no-status -n -t '.s:fnameescape(fugitive#Find('.git/MERGE_MSG', dir))
@ -3758,18 +3758,27 @@ function! s:PullSubcommand(line1, line2, range, bang, mods, args) abort
return s:MergeRebase('pull', a:bang, a:mods, a:args) return s:MergeRebase('pull', a:bang, a:mods, a:args)
endfunction endfunction
function! s:RebaseContinue(arg, ...) abort
let [dir, edit_todo] = a:arg
exe s:MergeRebase('rebase', 0, '', [edit_todo && getfsize(fugitive#Find('.git/rebase-merge/git-rebase-todo', dir)) <= 0 ? '--abort' : '--continue'], dir)
endfunction
augroup fugitive_merge augroup fugitive_merge
autocmd! autocmd!
autocmd VimLeavePre,BufDelete git-rebase-todo autocmd VimLeavePre,BufDelete git-rebase-todo
\ if getbufvar(+expand('<abuf>'), '&bufhidden') ==# 'wipe' | \ if getbufvar(+expand('<abuf>'), '&bufhidden') ==# 'wipe' |
\ call s:RebaseClean(expand('<afile>')) | \ call s:RebaseClean(expand('<afile>')) |
\ if getfsize(FugitiveFind('.git/rebase-merge/done', +expand('<abuf>'))) == 0 | \ if getfsize(FugitiveFind('.git/rebase-merge/done', +expand('<abuf>'))) == 0 |
\ let s:rebase_continue = FugitiveGitDir(+expand('<abuf>')) | \ let s:rebase_continue = [FugitiveGitDir(+expand('<abuf>')), 1] |
\ endif | \ endif |
\ endif \ endif
autocmd BufEnter * nested autocmd BufEnter * nested
\ if exists('s:rebase_continue') | \ if exists('s:rebase_continue') |
\ exe s:MergeRebase('rebase', 0, '', [getfsize(fugitive#Find('.git/rebase-merge/git-rebase-todo', s:rebase_continue)) > 0 ? '--continue' : '--abort'], remove(s:, 'rebase_continue')) | \ if has('timers') |
\ call timer_start(0, function('s:RebaseContinue', [remove(s:, 'rebase_continue')])) |
\ else |
\ call s:RebaseContinue(remove(s:, 'rebase_continue')) |
\ endif |
\ endif \ endif
augroup END augroup END
@ -4393,7 +4402,7 @@ endfunction
function! s:AskPassArgs(dir) abort function! s:AskPassArgs(dir) abort
if (len($DISPLAY) || len($TERM_PROGRAM) || has('gui_running')) && fugitive#GitVersion(1, 8) && if (len($DISPLAY) || len($TERM_PROGRAM) || has('gui_running')) && fugitive#GitVersion(1, 8) &&
\ empty($GIT_ASKPASS) && empty($SSH_ASKPASS) && empty(fugitive#Config('core.askPass', a:dir)) \ empty($GIT_ASKPASS) && empty($SSH_ASKPASS) && empty(get(fugitive#Config(a:dir), 'core.askpass', []))
if s:executable(s:ExecPath() . '/git-gui--askpass') if s:executable(s:ExecPath() . '/git-gui--askpass')
return ['-c', 'core.askPass=' . s:ExecPath() . '/git-gui--askpass'] return ['-c', 'core.askPass=' . s:ExecPath() . '/git-gui--askpass']
elseif s:executable('ssh-askpass') elseif s:executable('ssh-askpass')

View file

@ -177,6 +177,23 @@ function! s:Tree(path) abort
endif endif
endfunction endfunction
function! s:CeilingDirectories() abort
if !exists('s:ceiling_directories')
let s:ceiling_directories = []
let resolve = 1
for dir in split($GIT_CEILING_DIRECTORIES, has('win32') ? ';' : ':', 1)
if empty(dir)
let resolve = 0
elseif resolve
call add(s:ceiling_directories, resolve(dir))
else
call add(s:ceiling_directories, dir)
endif
endfor
endif
return s:ceiling_directories + get(g:, 'ceiling_directories', [])
endfunction
function! FugitiveExtractGitDir(path) abort function! FugitiveExtractGitDir(path) abort
let path = s:Slash(a:path) let path = s:Slash(a:path)
if path =~# '^fugitive:' if path =~# '^fugitive:'
@ -203,7 +220,7 @@ function! FugitiveExtractGitDir(path) abort
if root =~# '\v^//%([^/]+/?)?$' if root =~# '\v^//%([^/]+/?)?$'
break break
endif endif
if index(split($GIT_CEILING_DIRECTORIES, ':'), root) >= 0 if index(s:CeilingDirectories(), root) >= 0
break break
endif endif
if root ==# $GIT_WORK_TREE && FugitiveIsGitDir(env_git_dir) if root ==# $GIT_WORK_TREE && FugitiveIsGitDir(env_git_dir)

View file

@ -244,7 +244,7 @@ augroup gitgutter
autocmd ShellCmdPost * call gitgutter#all(1) autocmd ShellCmdPost * call gitgutter#all(1)
autocmd BufLeave term://* call gitgutter#all(1) autocmd BufLeave term://* call gitgutter#all(1)
autocmd BufWritePost fugitive://*//0/* call gitgutter#all(1) autocmd User FugitiveChanged call gitgutter#all(1)
autocmd BufFilePre * GitGutterBufferDisable autocmd BufFilePre * GitGutterBufferDisable
autocmd BufFilePost * GitGutterBufferEnable autocmd BufFilePost * GitGutterBufferEnable

View file

@ -64,6 +64,7 @@ let s:syng_strcom = s:syng_stringdoc + [
\ 'PercentStringDelimiter', \ 'PercentStringDelimiter',
\ 'PercentSymbolDelimiter', \ 'PercentSymbolDelimiter',
\ 'Regexp', \ 'Regexp',
\ 'RegexpCharClass',
\ 'RegexpDelimiter', \ 'RegexpDelimiter',
\ 'RegexpEscape', \ 'RegexpEscape',
\ 'StringDelimiter', \ 'StringDelimiter',

View file

@ -314,4 +314,13 @@ describe "Indenting" do
end end
EOF EOF
end end
specify "wrong continuation within regex character class" do
# See https://github.com/vim-ruby/vim-ruby/issues/405 for details
assert_correct_indenting <<~EOF
extname = file.extname(url).split(/[?#]/).first
target_file = tempfile.new()
EOF
end
end end

View file

@ -1,7 +1,7 @@
extends verilog extends verilog
# Foreach Loop # Foreach Loop
snippet fe snippet forea
foreach (${1}) begin foreach (${1}) begin
${0} ${0}
end end

View file

@ -61,3 +61,23 @@ snippet mod
module ${1:module_name} (${2}); module ${1:module_name} (${2});
${0} ${0}
endmodule endmodule
# For
snippet for
for (int ${2:i} = 0; $2 < ${1:count}; $2${3:++}) begin
${4}
end
# Forever
snippet forev
forever begin
${0}
end
# Function
snippet fun
function ${1:void} ${2:name}(${3});
${0}
endfunction: $2
# Task
snippet task
task ${1:name}(${2});
${0}
endtask: $1