Vigemus / iron.nvim

Interactive Repl Over Neovim
BSD 3-Clause "New" or "Revised" License
978 stars 81 forks source link

Add close param to ocaml #376

Closed josecastillolema closed 2 months ago

josecastillolema commented 3 months ago

OCaml repls use ;; as the end line delimiter.

nickeisenberg commented 2 months ago

Sorry for the late reply to this. So this issue with the single line not appending ;; to the end of it comes from common.format. Henry, who wrote this plugin, decided that when sending a single line to the REPL, that the close character is not added to the line. I do not know why he did this but I am sure there was a reason.

However, what if you tried using this as your repl_definition for ocaml:

    repl_definition = {
      command = {"utop"},
      format = function(lines) table.insert(lines, ";;\13") return lines end
    }

This will make it so that ;; is always appended to the end of your send to the repl. You also will not need to specify a close in the repl_definition.

josecastillolema commented 2 months ago

Thanks for your reply @nickeisenberg ! The format solution totally works.

nickeisenberg commented 2 months ago

@josecastillolema cool, glad it worked!