vim: use try catch in vim plugin to avoid conflicts
authorAli Vakilzade <ali.vakilzade@gmail.com>
Sat, 03 May 2014 19:11:51 +0430
changeset 21629 664c49420d48
parent 21628 7c5a85619dca
child 21630 a204fd9b5ba9
vim: use try catch in vim plugin to avoid conflicts
contrib/vim/hgcommand.vim
--- 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