CallbackSplitMixin: Clear LineStore before pickling, as SREMatch objects cannot be pickled

This commit is contained in:
Tomas Babej 2015-12-26 12:30:57 +01:00
parent 9d4df3bba2
commit 5552623d2e
2 changed files with 6 additions and 0 deletions

View file

@ -81,6 +81,9 @@ class NoNoneStore(object):
def iteritems(self): def iteritems(self):
return self.store.iteritems() return self.store.iteritems()
def clear(self):
return self.store.clear()
class TaskStore(NoNoneStore): class TaskStore(NoNoneStore):

View file

@ -370,6 +370,9 @@ class CallbackSplitMixin(object):
# Close the split if the user leaves it # Close the split if the user leaves it
vim.command('au BufLeave <buffer> :bwipe') vim.command('au BufLeave <buffer> :bwipe')
# SREMatch objecets cannot be pickled
cache.line.clear()
# We can't save the current instance in vim variable # We can't save the current instance in vim variable
# so save the pickled version # so save the pickled version
vim.current.buffer.vars['taskwiki_callback'] = pickle.dumps(self) vim.current.buffer.vars['taskwiki_callback'] = pickle.dumps(self)