Closed beandipper closed 3 years ago
I tried putting this in my local version and when I run:
neuron -d <directory name> search | xargs nvim
I get:
Error detected while processing /Users/mjw/.config/nvim/plugged/neuron.vim/ftdetect/neuron.vim:
line 4:
E121: Undefined variable: g:neuron_dir
E116: Invalid arguments for function filereadable
E15: Invalid expression: !filereadable(g:neuron_dir."neuron.dhall")
line 10:
E121: Undefined variable: g:neuron_dir
E116: Invalid arguments for function fnameescape
line 11:
E121: Undefined variable: g:neuron_dir
E116: Invalid arguments for function fnameescape
line 12:
E121: Undefined variable: g:neuron_dir
E116: Invalid arguments for function fnameescape
I think you might need to leave the lines in the ftdetect file too?
I can confirm that the change results in the same error that you got. After taking a look, I changed the few references to g:neuron_dir to a buffer local reference to it which seems to have fixed the issue: 26a85b7
Those calls appear to be trying to access neuron_dir when the current buffer is a neuron file, so I don't suppose it should be an problem. I would prefer to do this instead of duplicating global variable assignments, but me know if there are any downsides to doing it this way, as I have no experience with vim scripting and the plugin ecosystem.
Nice one @beandipper 👍 Works well for me too.
This minor change makes it possible again to install the plugin through nix #50
After looking through the code I realized that the
g:neuron_dir
variable is set already inftdetect/neuron.vim
, however this wasn't available inplugin/neuron.vim
and so the nix install failed.Simply moving the lines from one file to the other fixed the problem. If there are any unwanted side-effects that could occur, or if you prefer to merge differently let me know