Skip to content

Commit

Permalink
bug fix: cyclic dependency causing sendline errors (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
ottersome authored Jul 9, 2024
1 parent c993d01 commit 87548d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
5 changes: 2 additions & 3 deletions lua/iron/fts/common.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
local config = require("iron.config")
local is_windows = require("iron.util.os").is_windows
local extend = require("iron.util.tables").extend
local open_code = "\27[200~"
Expand Down Expand Up @@ -94,9 +93,9 @@ end
--- @param lines table "each item of the table is a new line to send to the repl"
--- @return table "returns the table of lines to be sent the the repl with
-- the return carriage added"
common.bracketed_paste_python = function(lines)
common.bracketed_paste_python = function(lines, cmd)
local result = {}
local is_ipython = contains(config.repl_definition.python.command, "ipython")
local is_ipython = contains(cmd, "ipython")

lines = remove_empty_lines(lines)

Expand Down
10 changes: 6 additions & 4 deletions lua/iron/fts/python.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ end
local pyversion = executable('python3') and 'python3' or 'python'

local def = function(cmd)
return {
command = cmd,
format = bracketed_paste_python
}
return {
command = cmd,
format = function(line)
return bracketed_paste_python(line, cmd)
end,
}
end

python.ptipython = def({"ptipython"})
Expand Down

0 comments on commit 87548d7

Please sign in to comment.