Extra square brackets appended when sending lines using both vim-slime and ToggleTerm in neovim

I’m trying to use neovim as an editor while sending lines to a REPL in a separate window. I’ve tried using both vim-slime and ToggleTerm.nvim, and everything works fine except for when I send lines that contain square-brackets. When sending a line with a square-bracket, e.g.

x = [1,2,3]

an extra square bracket gets sent, i.e. the REPL receives x = [1,2,3]] which obviously causes an error.

This persists after disabling all other plugins. I’m using nvim v0.11.0, Kitty 0.41.1 (but it also happens in other terminal emulators), toggleterm.nvim v2.13.1, and the current version of vim-slime (no version number associated with it).

I’ve tried identical tests in Python, and it doesn’t occur there, so it must be something specific to Julia. It also occurs when the file open in vim doesn’t have an extension, so I think it has something to do specifically with how the REPL parses the buffer it’s sent, rather than anything with the language server in vim.

Screen recording demo here

Has anyone else run into this issue?

1 Like

An alternative to slime is yeet. Perhaps switching to it might solve the issue?

I’m having the exact same issue. Have you found a solution by any chance @gottacatchenall?

Do you use OhMyREPL.jl? I have enable_autocomplete_brackets(false) in my startup. If I set it to true, I also get the extra square bracket.

1 Like

Yes this also happened to my. I stopped using OhMyREPL and I had no more issues. Didn’t know about the flag. But I will try that