don't restore cursorbind if it doesn't exist
authorBob Hiestand <bob.hiestand@gmail.com>
Mon, 5 Dec 2011 16:14:03 +0000 (5 10:14 -0600)
committerBob Hiestand <bob.hiestand@gmail.com>
Mon, 5 Dec 2011 16:25:28 +0000 (5 10:25 -0600)
plugin/vcscommand.vim

index 1ea79b6..1992b18 100644 (file)
@@ -1081,9 +1081,11 @@ function! s:VCSVimDiff(...)
                                                                \ . '|call setbufvar('.originalBuffer.', ''&foldmethod'', '''.getbufvar(originalBuffer, '&foldmethod').''')'
                                                                \ . '|call setbufvar('.originalBuffer.', ''&foldlevel'', '''.getbufvar(originalBuffer, '&foldlevel').''')'
                                                                \ . '|call setbufvar('.originalBuffer.', ''&scrollbind'', '.getbufvar(originalBuffer, '&scrollbind').')'
-                                                               \ . '|call setbufvar('.originalBuffer.', ''&cursorbind'', '.getbufvar(originalBuffer, '&cursorbind').')'
                                                                \ . '|call setbufvar('.originalBuffer.', ''&wrap'', '.getbufvar(originalBuffer, '&wrap').')'
-                                                               \ . '|if &foldmethod==''manual''|execute ''normal! zE''|endif'
+                                       if has('cursorbind')
+                                               let t:vcsCommandVimDiffRestoreCmd .= '|call setbufvar('.originalBuffer.', ''&cursorbind'', '.getbufvar(originalBuffer, '&cursorbind').')'
+                                       endif
+                                       let t:vcsCommandVimDiffRestoreCmd .= '|if &foldmethod==''manual''|execute ''normal! zE''|endif'
                                        diffthis
                                        wincmd w
                                else