Skip to content

Commit

Permalink
Remain in the proper buffer when diffing.
Browse files Browse the repository at this point in the history
  • Loading branch information
sjl committed Dec 12, 2012
1 parent 458ac22 commit 3095bb3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions autoload/splicelib/modes.py
Expand Up @@ -13,8 +13,9 @@ def __init__(self):


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:
Expand Down
2 changes: 1 addition & 1 deletion autoload/splicelib/util/bufferlib.py
Expand Up @@ -80,7 +80,7 @@ def labels(self):

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):
Expand Down

0 comments on commit 3095bb3

Please sign in to comment.