Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lua/jupytext/commands.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
local M = {}

M.run_jupytext_command = function(input_file, options)
local cmd = "jupytext " .. input_file .. " "
local cmd = ""
if vim.g.python3_host_prog ~= nil and vim.fn.executable "jupytext" == 0 then
cmd = vim.g.python3_host_prog .. " -m "
end

cmd = cmd .. "jupytext " .. input_file .. " "
for option_name, option_value in pairs(options) do
if option_value ~= "" then
cmd = cmd .. option_name .. "=" .. option_value .. " "
Expand Down
8 changes: 7 additions & 1 deletion lua/jupytext/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ local M = {}

M.check = function()
vim.health.report_start "jupytext.nvim"
vim.fn.system "jupytext --version"

local cmd = ""
if vim.g.python3_host_prog ~= nil and vim.fn.executable "jupytext" == 0 then
cmd = vim.g.python3_host_prog .. " -m "
end

vim.fn.system(cmd .. "jupytext --version")

if vim.v.shell_error == 0 then
vim.health.report_ok "Jupytext is available"
Expand Down