Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UndoRedo-1.5.1 lua table.insert error #9

Closed
ratnamhof opened this issue Mar 10, 2020 · 2 comments
Closed

UndoRedo-1.5.1 lua table.insert error #9

ratnamhof opened this issue Mar 10, 2020 · 2 comments

Comments

@ratnamhof
Copy link

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

@Eisa01
Copy link
Owner

Eisa01 commented Mar 16, 2020

Thank you for the kind words, will fully check it out when I have the time ^ ^

@Eisa01
Copy link
Owner

Eisa01 commented Apr 8, 2020

Actually your fix will also work in future versions, so table.insert can be replaced to solve this issue.
Added the changes in 1.5.2.

@Eisa01 Eisa01 closed this as completed Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants