sjl / splice.vim

A Vim plugin for managing three-way merges.
MIT License
235 stars 21 forks source link

Broken for some version of vim python: self._buffer.name fails with "no attribute '_buffer'" #38

Open dbarnett opened 4 years ago

dbarnett commented 4 years ago

All splice commands are failing for me with cryptic python NameErrors like NameError: name 'SpliceCompare' is not defined

I had to dig into the code to find the real error (which the plugin was silently swallowing), which was that the code is accessing a Buffer._buffer attribute that doesn't seem to exist:

:execute 'py3file' fnameescape(globpath(&runtimepath, 'autoload/splice.py'))
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/google/home/dbarnett/.vim/plugged/splice.vim/autoload/splice.py", line 13, in <module>
    import splicelib.init as splice
  File "/usr/local/google/home/dbarnett/.vim/plugged/splice.vim/autoload/splicelib/init.py", line 2, in <module>
    from . import modes
  File "/usr/local/google/home/dbarnett/.vim/plugged/splice.vim/autoload/splicelib/modes.py", line 893, in <module>
    loupe = LoupeMode()
  File "/usr/local/google/home/dbarnett/.vim/plugged/splice.vim/autoload/splicelib/modes.py", line 433, in __init__
    self._current_buffer = buffers.result
  File "/usr/local/google/home/dbarnett/.vim/plugged/splice.vim/autoload/splicelib/util/bufferlib.py", line 52, in result
    return Buffer(4)
  File "/usr/local/google/home/dbarnett/.vim/plugged/splice.vim/autoload/splicelib/util/bufferlib.py", line 14, in __init__
    self.name = self._buffer.name
AttributeError: 'Buffer' object has no attribute '_buffer'