# HG changeset patch # User Ali Vakilzade # Date 2014-05-03 14:41:51 # Node ID 664c49420d48208be5a01d966c7442ae2c02802d # Parent 7c5a85619dca0fb0af0b9ad6fd1dc3147b2da0dd vim: use try catch in vim plugin to avoid conflicts diff --git a/contrib/vim/hgcommand.vim b/contrib/vim/hgcommand.vim --- a/contrib/vim/hgcommand.vim +++ b/contrib/vim/hgcommand.vim @@ -105,7 +105,7 @@ function! s:HGChangeToCurrentFileDir(fil let fileName=HGResolveLink(a:fileName) let newCwd=fnamemodify(fileName, ':h') if strlen(newCwd) > 0 - execute 'cd' escape(newCwd, ' ') + try | execute 'cd' escape(newCwd, ' ') | catch | | endtry endif return oldCwd endfunction @@ -396,7 +396,7 @@ function! s:HGGetStatusVars(revisionVar, return returnExpression finally - execute 'cd' escape(oldCwd, ' ') + try | execute 'cd' escape(oldCwd, ' ') | catch | | endtry endtry endfunction