Skip to content

Support buffer line range deletion to pass Vim's python3 tests #602

@janlazo

Description

@janlazo

Currently, neovim/neovim#37155 fails on the following code:

py3 del r[:]

pynvim cannot delete buffer line using the Range object.
Vim expects deletion for all buffer lines within that Range.

Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import sys; sys.path = [p for p in sys.path if p != ""]; import neovim; neovim.start_host()
        ^^^^^^
AttributeError: __delitem__
stack traceback:
        [C]: at 0x7ff6794fcaa0

Unsure if __delitem__() https://github.com/neovim/pynvim/blob/master/pynvim/api/buffer.py#L130 needs a method overload for Range when compared to __setitem__() method overloads that deal with different inputs.

Unsure if this was already addressed in issues/PRs like #278 because that test will become N/A. I already commented test cases that fail on Vim but pass on Nvim (due to Range?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Enhancement.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions