Skip to content

UndoRedo-1.5.1 lua table.insert error #9

@ratnamhof

Description

@ratnamhof

Dear developer,

Thank you very much for the UndoRedo script! Very nice functionality! Bravo!

I tried using UndoRedo-1.5.1.lua, but the code table.insert(seekTable,0,0) was giving me the following error:

[UndoRedo_1_5_1] Lua error: /home/ubuntu/.config/mpv/scripts/UndoRedo-1.5.1.lua:22: bad argument #2 to 'insert' (position out of bounds)

I think that this error may have to do with the lua version (5.1 versus 5.2 & 5.3?).

On my setup I was able to fix this by replacing the two occurrences of the table.insert code with:
seekTable[0] = 0

I am writing this comment to propose one of the following options:

  1. Either in the script switch on the lua version with an if-else statement
  2. or use a 'try-except' construct with pcall
  3. or (simplest option) make a comment about this in the README.md file and/or a code comment in the script itself (to safe troubleshooting time for future users)

Kind regards,
Grateful user

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