Skip to content

Commit

Permalink
fix nil kernel spec init
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Fischer (tku137) committed Oct 15, 2024
1 parent 149888f commit 04a82dd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/astrocommunity/code-runner/molten-nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ return {
opts.mappings.n[prefix .. "mp"] = {
function()
local kernel_name = ensure_kernel_for_venv()
vim.cmd(("MoltenInit %s"):format(kernel_name))
if kernel_name then
vim.cmd(("MoltenInit %s"):format(kernel_name))
else
vim.notify("No kernel to initialize.", vim.log.levels.WARN)
end
end,
desc = "Initialize for Python venv",
silent = true,
Expand Down

0 comments on commit 04a82dd

Please sign in to comment.