Now why did i not think of that. That may be the best of both worlds. What key combo should switching be bound to?
For reference the point of this mini editor, was that i wanted to have special syntax highlighting for my bindings in lua, so someone looking at or editing can at a glance see that the identifier typed in was part of my bindings.
P.S. you were right back here, to suggest using lua: Which python modules need to be included or packaged? I could never get the python to comparmentalize the way lua environments can.