Closed jiz4oh closed 2 months ago
cc @jam1015
I'm not able to reproduce this using a minimal config:
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup(
{
{
"jpalardy/vim-slime",
init = function()
vim.g.slime_target = "neovim"
vim.g.slime_no_mappings = true
vim.g.slime_input_pid = false
vim.g.slime_suggest_default = true
vim.g.slime_menu_config = false
end
},
}
)
I run nvim --clean -u ./minimal.lua test.coffee
and then :SlimeSendCurrentLine
with no terminal open and just get the Terminal not found.
warning message (I get it twice, this is a bug that will take some refactoring to fix, but that isn't relevant here). The text is successfully sent when I open a terminal.
Also tested on an example python file which also has an _EscapeText_python
function and had no problems.
Maybe try adding your personal config piece by piece to the minimal config to see what causes the errors.
Hi @jam1015, I think it's not able to reproduce due to the _EscapeText_{&filetype}
is loaded by a ftplugin
, and thefiletype
is not set if you run nvim --clean -u ./minimal.lua test.coffee
, so the reproduce steps with the minimal config is
nvim --clean -u ./minimal.lua test.coffee
:set ft=coffee
:SlimeSendCurrentLine
and the reason is if the _EscapeText_{&filetype}
return an array with more than one elememts, e.g. _EscapeText_coffee
, the s:SlimeDispatch
function will be executed multiple times. seems like the b:slime_config
is removed by first time and the second and following executation will raise error
addressed by https://github.com/jpalardy/vim-slime/pull/428
@jiz4oh let us know if that works for you
@jam1015 thanks for your quick response, it's ok now @jpalardy
reproduce steps:
nvim test.coffee
:SlimeSendCurrentLine
only occured when exists the
_EscapeText_{&filetype}
function