diff contrib/vim/hgcommand.vim @ 21629:664c49420d48

vim: use try catch in vim plugin to avoid conflicts
author Ali Vakilzade <ali.vakilzade@gmail.com>
date Sat, 03 May 2014 19:11:51 +0430
parents 86531a7038ed
children 4b0fc75f9403
line wrap: on
line diff
--- a/contrib/vim/hgcommand.vim	Wed May 28 15:37:47 2014 -0700
+++ b/contrib/vim/hgcommand.vim	Sat May 03 19:11:51 2014 +0430
@@ -105,7 +105,7 @@
   let fileName=<SID>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 @@
 
     return returnExpression
   finally
-    execute 'cd' escape(oldCwd, ' ')
+    try | execute 'cd' escape(oldCwd, ' ') | catch | | endtry
   endtry
 endfunction