add 'VCSCommandVCSTypeExplicitOverride' for a more dynamic switch
authorBob Hiestand <bob.hiestand@gmail.com>
Thu, 7 Jul 2011 17:22:38 +0000 (7 12:22 -0500)
committerBob Hiestand <bob.hiestand@gmail.com>
Thu, 7 Jul 2011 17:22:38 +0000 (7 12:22 -0500)
plugin/vcscommand.vim

index 05ac69e..349513e 100644 (file)
@@ -1102,10 +1102,13 @@ endfunction
 "   7. error if no matching types
 
 function! VCSCommandGetVCSType(buffer)
-       let vcsType = getbufvar(a:buffer, 'VCSCommandVCSType')
-       if strlen(vcsType) == 0
-               let vcsType = s:IdentifyVCSType(a:buffer)
-               call setbufvar(a:buffer, 'VCSCommandVCSType', vcsType)
+       let vcsType = VCSCommandGetOption('VCSCommandVCSTypeExplicitOverride', '')
+       if len(vcsType) == 0
+               let vcsType = getbufvar(a:buffer, 'VCSCommandVCSType')
+               if strlen(vcsType) == 0
+                       let vcsType = s:IdentifyVCSType(a:buffer)
+                       call setbufvar(a:buffer, 'VCSCommandVCSType', vcsType)
+               endif
        endif
        return vcsType
 endfunction