Skip to content

Commit

Permalink
Fix error that occurs when close_window_on_exit = false (#336)
Browse files Browse the repository at this point in the history
Fix error that happens when `close_window_on_exit = false`

```log
E5108: Error executing lua $HOME/.vim/plugged/iron.nvim/lua/iron/core.lua:46: Vim:E475: Invalid argument: expected dictionary
stack traceback:
  [C]: in function 'error'
  $HOME/.vim/plugged/iron.nvim/lua/iron/core.lua:46: in function 'create'
  $HOME/.vim/plugged/iron.nvim/lua/iron/core.lua:60: in function 'create_on_new_window'
  $HOME/.vim/plugged/iron.nvim/lua/iron/core.lua:178: in function 'repl_for'
  $HOME/.vim/plugged/iron.nvim/lua/iron/core.lua:219: in function 'send'
  $HOME/.vim/plugged/iron.nvim/lua/iron/core.lua:245: in function 'send_line'
  [string ":lua"]:1: in main chunk
```

Co-authored-by: Henry John Kupty <hkupty@users.noreply.github.com>
  • Loading branch information
Sangdol and hkupty authored Jun 4, 2023
1 parent b7b9016 commit 9017061
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lua/iron/lowlevel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ ll.create_repl_on_current_window = function(ft, repl, bufnr, current_bufnr, opts
end
vim.api.nvim_buf_delete(bufnr, {force = true})
end
else
opts.on_exit = function() end
end

local cmd = repl.command
Expand Down

0 comments on commit 9017061

Please sign in to comment.