daeyun / vim-matlab

Neovim plugin for MATLAB
Mozilla Public License 2.0
104 stars 19 forks source link

InsertEnter throws KeyError: 'last_written' #9

Closed tdy closed 8 years ago

tdy commented 8 years ago

I get this error every time I open a file and enter insert mode. InsertEnter tries to read buffer_state[path]['last_written'], which only exists if a BufWrite event has previously occurred.

error caught in async handler '/Users/tdy/.vim/plugs/vim-matlab/rplugin/python/vim_matlab:autocmd:InsertEnter:*.m ()'
Traceback (most recent call last):
  File "/Users/tdy/.vim/plugs/vim-matlab/rplugin/python/vim_matlab/__init__.py", line 242, in insert_enter
    self.refresh_buffer()
  File "/Users/tdy/.vim/plugs/vim-matlab/rplugin/python/vim_matlab/__init__.py", line 258, in refresh_buffer
    last_written = self.buffer_state[path]['last_written']
KeyError: 'last_written'
daeyun commented 8 years ago

Looks like this is fixed, worked on my end. Thanks