Skip to content

Neovim: Error with undo without EOL #5

@AlexMasterov

Description

@AlexMasterov

Hello 😃
I get the error:

Error executing lua callback: [string ":lua"]:1: Vim(call):E16: Invalid range: call s:RemoveRange(a:start, a:end - 1)

How to reproduce:

function! ReverseLines() range
  let lines = reverse(getline(a:firstline, a:lastline))
  silent execute a:firstline . ',' . a:lastline . 'delete _'
  silent execute (a:firstline - 1) . 'put =lines'
endfunction

command! -bar -range=% Reproduce <line1>,<line2> call ReverseLines()
  1. Use the Reproduce command on the two selected lines with 0 and 1
  2. Press undo by u

no-error


0
1

error


0
1

NVIM v0.5.0-360-g1f479fffb

VIM 8.2 (p236) — works fine

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions