mirror of
https://github.com/tbabej/taskwiki.git
synced 2025-08-20 01:03:06 +02:00
BufferProxy: Fix wrong argument order
This commit is contained in:
parent
0d1a457506
commit
cda27d960e
2 changed files with 6 additions and 3 deletions
|
@ -20,7 +20,10 @@ class BufferProxy(object):
|
||||||
vim.buffers[self.buffer_number][:] = self.data
|
vim.buffers[self.buffer_number][:] = self.data
|
||||||
|
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
return self.data[index]
|
try:
|
||||||
|
return self.data[index]
|
||||||
|
except IndexError:
|
||||||
|
return ''
|
||||||
|
|
||||||
def __setitem__(self, index, lines):
|
def __setitem__(self, index, lines):
|
||||||
self.data[index] = lines
|
self.data[index] = lines
|
||||||
|
@ -39,7 +42,7 @@ class BufferProxy(object):
|
||||||
if position is None:
|
if position is None:
|
||||||
self.data.append(data)
|
self.data.append(data)
|
||||||
else:
|
else:
|
||||||
self.data.insert(data, 0)
|
self.data.insert(position, data)
|
||||||
|
|
||||||
|
|
||||||
class TaskCache(object):
|
class TaskCache(object):
|
||||||
|
|
|
@ -307,7 +307,7 @@ class MockBuffer(object):
|
||||||
if position is None:
|
if position is None:
|
||||||
self.data.append(data)
|
self.data.append(data)
|
||||||
else:
|
else:
|
||||||
self.data.insert(data, 0)
|
self.data.insert(position, data)
|
||||||
|
|
||||||
|
|
||||||
# Mock Cache object
|
# Mock Cache object
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue