jalvesaq / vimcmdline

Send code to command line interpreter
GNU General Public License v2.0
223 stars 38 forks source link

b:cmdline_source_fun doesn't work for node #89

Closed Palpatineli closed 1 year ago

Palpatineli commented 4 years ago

For some reason VimCmdLineSendLine() works but VimCmdLineSendSelection() and b:cmdline_source_fun(...) actually put

delete require.cache[require.resolve('/tmp/cmdline1586888699${user}/lines.js')]; require('/tmp/cmdline1586888699${user}/lines.js') into the console and doesn't run the code in selection. I'm using nvim 0.4.3 with node 10.19.0 in debian testing.

jalvesaq commented 4 years ago

It seems that your environment does not define the $USER variable. What is your operating system? If you open a terminal emulator, what is the output of

echo $USER
Palpatineli commented 4 years ago

Sorry if my made it confusing. the $(user) part is my real user account and I was just trying to hide it online. It actually expanded to my account correctly. The weird part is why the update cache command was issued instead of the actual code I select.

jalvesaq commented 4 years ago

This is how it is implemented in ftplugin/javascript_cmdline.vim. Either @epwalsh or @chee may help you to solve the issue.