CRAG666/code_runner.nvim

attempt to call a nil value

Closed this issue · 4 comments

while trying to run project I got this error, runing a single file is fine.
Error executing Lua callback: ...e/pack/packer/start/code_runner.nvim/lua/code_runner.lua:75: attempt to call a nil va lue stack traceback: ...e/pack/packer/start/code_runner.nvim/lua/code_runner.lua:75: in function <...e/pack/packer/start/code_runne r.nvim/lua/code_runner.lua:75>
below is my setup for code_runner,
I am using neovim-nightly and the plugin are updated to the latest. this happened recently

use({ "CRAG666/code_runner.nvim", requires = "nvim-lua/plenary.nvim", config = function() require("code_runner").setup({ term = { position = "vert", size = 15 }, mode = "toggleterm", filetype = { java = "cd $dir && javac $fileName && java $fileNameWithoutExt", python = "python ", lua = "lua ", rust = "cd $dir && mkdir -p .bin && rustc -g $fileName -o .bin/$fileNameWithoutExt && .bin/$fileNameWithoutExt", cpp = "cd $dir && mkdir -p .bin && g++ -g $fileName -o .bin/$fileNameWithoutExt && .bin/$fileNameWithoutExt", c = "cd $dir && mkdir -p .bin && gcc -g $fileName -o .bin/$fileNameWithoutExt && .bin/$fileNameWithoutExt", }, project = { ["~/playground/c++/open-gl"] = { name = "open gl learning", description = "repo to learn open gl", file_name = "main.cpp", command = "make -C build run", }, ["~/playground/c++/dict_cpp"] = { name = "My Dictionary app", description = "compile dict", command = "make run", }, }, }) end, })

What filetype do I try to execute?

To use "toggleterm" mode need this plugin https://github.com/akinsho/toggleterm.nvim

hello I have installed the plugin and RunFile works as expected, but RunProject does not work in any kind of filetypes though I encountered this bug while editting cpp files. according the error log, I guess something is wrong while using vim.api.nvim_create_user_command() call?

thanks you very much, it iis fixed!