Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #21 from killphi/fix_spliceinit_crash

Fixes several crash issues with the latest VIm versions
  • Loading branch information...
commit 4d322d823563f6fd2d72c129b1e99f5a98060fa8 2 parents 8e1109d + b8f4594
@sjl authored
Showing with 10 additions and 7 deletions.
  1. +10 −7 autoload/splicelib/util/bufferlib.py
View
17 autoload/splicelib/util/bufferlib.py
@@ -6,8 +6,11 @@
class Buffer(object):
def __init__(self, i):
- self.number = i + 1
- self._buffer = vim.buffers[i]
+ self.number = i
+ for b in vim.buffers:
+ if b.number == self.number:
+ self._buffer = b
+ break
self.name = self._buffer.name
def open(self, winnr=None):
@@ -34,23 +37,23 @@ def __ne__(self, other):
class _BufferList(object):
@property
def original(self):
- return Buffer(0)
+ return Buffer(1)
@property
def one(self):
- return Buffer(1)
+ return Buffer(2)
@property
def two(self):
- return Buffer(2)
+ return Buffer(3)
@property
def result(self):
- return Buffer(3)
+ return Buffer(4)
@property
def hud(self):
- return Buffer(int(vim.eval("bufnr('__Splice_HUD__')")) - 1)
+ return Buffer(int(vim.eval("bufnr('__Splice_HUD__')")))
@property
Please sign in to comment.
Something went wrong with that request. Please try again.