mirror of
https://github.com/akelge/zsh
synced 2025-07-04 05:29:06 +00:00
Moved statusline def into a separate file
Added guitablabel def Updated VCS plugin Added keymap for choosing tabs (Cmd-1, Cmd-2, ...)
This commit is contained in:
@ -67,12 +67,19 @@ let s:svnFunctions = {}
|
||||
|
||||
" Section: Utility functions {{{1
|
||||
|
||||
" Function: s:Executable() {{{2
|
||||
" Returns the executable used to invoke git suitable for use in a shell
|
||||
" command.
|
||||
function! s:Executable()
|
||||
return shellescape(VCSCommandGetOption('VCSCommandSVNExec', 'svn'))
|
||||
endfunction
|
||||
|
||||
" Function: s:DoCommand(cmd, cmdName, statusText, options) {{{2
|
||||
" Wrapper to VCSCommandDoCommand to add the name of the SVN executable to the
|
||||
" command argument.
|
||||
function! s:DoCommand(cmd, cmdName, statusText, options)
|
||||
if VCSCommandGetVCSType(expand('%')) == 'SVN'
|
||||
let fullCmd = VCSCommandGetOption('VCSCommandSVNExec', 'svn') . ' ' . a:cmd
|
||||
let fullCmd = s:Executable() . ' ' . a:cmd
|
||||
return VCSCommandDoCommand(fullCmd, a:cmdName, a:statusText, a:options)
|
||||
else
|
||||
throw 'SVN VCSCommand plugin called on non-SVN item.'
|
||||
@ -148,7 +155,7 @@ endfunction
|
||||
" Function: s:svnFunctions.Diff(argList) {{{2
|
||||
function! s:svnFunctions.Diff(argList)
|
||||
if len(a:argList) == 0
|
||||
let revOptions = []
|
||||
let revOptions = []
|
||||
let caption = ''
|
||||
elseif len(a:argList) <= 2 && match(a:argList, '^-') == -1
|
||||
let revOptions = ['-r' . join(a:argList, ':')]
|
||||
@ -193,7 +200,7 @@ endfunction
|
||||
function! s:svnFunctions.GetBufferInfo()
|
||||
let originalBuffer = VCSCommandGetOriginalBuffer(bufnr('%'))
|
||||
let fileName = bufname(originalBuffer)
|
||||
let statusText = system(VCSCommandGetOption('VCSCommandSVNExec', 'svn') . ' status --non-interactive -vu "' . fileName . '"')
|
||||
let statusText = s:VCSCommandUtility.system(s:Executable() . ' status --non-interactive -vu -- "' . fileName . '"')
|
||||
if(v:shell_error)
|
||||
return []
|
||||
endif
|
||||
@ -277,12 +284,16 @@ endfunction
|
||||
function! s:svnFunctions.Unlock(argList)
|
||||
return s:DoCommand(join(['unlock --non-interactive'] + a:argList, ' '), 'unlock', join(a:argList, ' '), {})
|
||||
endfunction
|
||||
|
||||
" Function: s:svnFunctions.Update(argList) {{{2
|
||||
function! s:svnFunctions.Update(argList)
|
||||
return s:DoCommand('update --non-interactive', 'update', '', {})
|
||||
endfunction
|
||||
|
||||
" Annotate setting {{{2
|
||||
let s:svnFunctions.AnnotateSplitRegex = '\s\+\S\+\s\+\S\+ '
|
||||
|
||||
" Section: Plugin Registration {{{1
|
||||
call VCSCommandRegisterModule('SVN', expand('<sfile>'), s:svnFunctions, [])
|
||||
let s:VCSCommandUtility = VCSCommandRegisterModule('SVN', expand('<sfile>'), s:svnFunctions, [])
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
|
Reference in New Issue
Block a user