06491cc1f4a2

Remain in the proper buffer when diffing.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Wed, 12 Dec 2012 12:52:52 -0500
parents 79d68c4332bf
children a3dc06785e35
branches/tags (none)
files autoload/splicelib/modes.py autoload/splicelib/util/bufferlib.py

Changes

diff -r 79d68c4332bf -r 06491cc1f4a2 autoload/splicelib/modes.py
--- a/autoload/splicelib/modes.py	Wed Dec 12 12:52:25 2012 -0500
+++ b/autoload/splicelib/modes.py	Wed Dec 12 12:52:52 2012 -0500
@@ -13,8 +13,9 @@
 
 
     def diff(self, diffmode):
-        with windows.remain():
-            getattr(self, '_diff_%d' % diffmode)()
+        with buffers.remain():
+            with windows.remain():
+                getattr(self, '_diff_%d' % diffmode)()
 
         # Reset the scrollbind to whatever it was before we diffed.
         if not diffmode:
diff -r 79d68c4332bf -r 06491cc1f4a2 autoload/splicelib/util/bufferlib.py
--- a/autoload/splicelib/util/bufferlib.py	Wed Dec 12 12:52:25 2012 -0500
+++ b/autoload/splicelib/util/bufferlib.py	Wed Dec 12 12:52:52 2012 -0500
@@ -80,7 +80,7 @@
 
     class remain:
         def __enter__(self):
-            self.curbuf = vim.eval('bufnr(bufname("%"))')
+            self.curbuf = int(vim.eval('bufnr(bufname("%"))'))
             self.pos = windows.pos()
 
         def __exit__(self, type, value, traceback):