Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
kiyoon committed Jun 9, 2024
1 parent f1d0bea commit 9c0b8c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lua/python_import/api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ local function get_import(bufnr, word, ts_node)
if requirements_installed then
local project_root = vim.fs.root(0, { ".git", "pyproject.toml" })
if project_root ~= nil then
local find_import_outputs =
vim.api.nvim_exec([[w !python-import count ']] .. project_root .. [[' ']] .. word .. [[']], { output = true })
local response = vim.system({ "python-import", "count", project_root, word }, { text = true }):wait()
if response.code == 0 then
local find_import_outputs = response.stdout:gsub("\n$", "")

if find_import_outputs ~= nil then
-- strip
find_import_outputs = find_import_outputs:gsub("^\n", "")
-- find_import_outputs = find_import_outputs:match "^%s*(.*)%s*$"
Expand Down

0 comments on commit 9c0b8c7

Please sign in to comment.