shahinism / xontrib-fzf-widgets

Set of fzf widgets for xonsh
GNU General Public License v3.0
11 stars 30 forks source link

Silent error every time the widget is open #3

Open nilehmann opened 7 years ago

nilehmann commented 7 years ago

Whenever I open widget I get the following error

xonsh: For full traceback set: $XONSH_SHOW_TRACEBACK = True
NameError: name 'Keys' is not defined
error running xonsh run control file '/home/nlehmann/.xonshrc':  name 'Keys' is not defined

Then the error disappears and fzf works normally. In my xonshrc I have the following:

$fzf_history_binding = Keys.ControlR
$fzf_ssh_binding = Keys.ControlS

peek

shahinism commented 7 years ago

Would you please try adding following line at the top of your xonshrc file?

from prompt_toolkit.keys import Keys
nilehmann commented 7 years ago

Ok, that fixed the problem. Thank you for your prompt reply :)

Anyways, why was the error being raised for the widget but not when loading my xonshrc?

shahinism commented 7 years ago

I'm not exactly sure about it yet. Probably something is changed on the order of loading Xontribs. I'm already importing Keys inside the xontrib itself, but when the xonshrc needs it, it is not there. I'll check it as soon as I can.