gwatcha / reaper-keys

vim-bindings for Reaper
https://gwatcha.github.io/reaper-keys/
MIT License
144 stars 10 forks source link

Error: rk.lua: attempt to index a nil value #62

Closed PowerUser64 closed 6 months ago

PowerUser64 commented 6 months ago

After installing reaper-keys from reapack, running the installer, and importing the keymap, I'm getting this error when I try pressing any keybinds:

rk.lua:1: attempt to index a nil value

Did I do something wrong in setup? It might be worth expanding the installation section of the readme to include further details on how to get a working install.

myrrc commented 6 months ago

I believe there's a bug in my code. Can you provide your OS (Windows, I suppose) and Reaper version?

myrrc commented 6 months ago

Also, these things will be helpful

  1. Full path to the reaper-keys directory
  2. Any SCR line from the auto generated key map
PowerUser64 commented 6 months ago

I'm on Linux. NixOS, to be specific. I'm running reaper 7.11.

Path to reaper-keys: /home/p64/.config/REAPER/Scripts/reaper-keys

SCR lines in KeyMaps/reaper-keys.ReaperKeyMap

SCR 516 0 _reaper_keys__main "reaper-keys" "/home/p64/.config/REAPER/Scripts/Reaper keys/internal/rk.lua"
SCR 516 32060 _reaper_keys__midi "reaper-keys" "/home/p64/.config/REAPER/Scripts/Reaper keys/internal/rk.lua"
myrrc commented 6 months ago

It's an index naming issue. I've fixed it in master, but the update is a bit tricky:

  1. Delete the current index from Reapack (Extensions > Reapack > Manage repositories), re-add it
  2. Re-download extension
  3. Launch the installer. Do not import the key map yet.
  4. Open action list. Key map > Reset all shortcuts in all sections to default
  5. Search for "reaper-keys" in action list. You'll likely find something like this:

install-reaper-keys.lua reaper-keys <...>/Scripts/Reaper keys/internal reaper-keys <...>/Scripts/reaper-keys/internal

delete both of the "reaper-keys" scripts (Select > right-click > delete selected ...).

  1. Import the keymap
PowerUser64 commented 6 months ago

Awesome, this fixed it! Thanks.