samharju / yeet.nvim

Plugin for running shell commands in terminal buffers or tmux panes.
MIT License
73 stars 4 forks source link

Most basic use case fails #1

Closed stefanwatt closed 6 months ago

stefanwatt commented 6 months ago

All I did was install and set up some keymaps:

return {
    "samharju/yeet.nvim",
    dependencies = { "stevearc/dressing.nvim" },
    keys = {
        {
            -- Open target selection
            "<leader>yt",
            function()
                require("yeet").select_target()
            end,
        },
        {
            -- Update yeeted command
            "<leader>yc",
            function()
                require("yeet").set_cmd()
            end,
        },
        {
            -- Run command without clearing terminal
            "<leader>ye",
            function()
                require("yeet").execute({ clear_before_yeet = false })
            end,
        },
    },
}

using require("yeet").execute({ clear_before_yeet = false }) first gives me :

left,#{?pane_at_right,right,}} #{?pane_active,(active),}}'' failed
Press ENTER or type command to continue

then after selecting new term buffer cause it's the only option:

Error executing vim.schedule lua callback: ...fan/.local/share/nvim/lazy/yeet.nvim/lua/yeet/buffer.lua:75: attempt to concatenate local 'cmd' (a table value)
stack traceback:
        ...fan/.local/share/nvim/lazy/yeet.nvim/lua/yeet/buffer.lua:75: in function 'send'
        ...tefan/.local/share/nvim/lazy/yeet.nvim/lua/yeet/init.lua:128: in function 'execute'
        ...tefan/.local/share/nvim/lazy/yeet.nvim/lua/yeet/init.lua:119: in function 'callback'
        ...tefan/.local/share/nvim/lazy/yeet.nvim/lua/yeet/init.lua:84: in function 'on_choice'
        ...are/nvim/lazy/dressing.nvim/lua/dressing/select/init.lua:78: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>
Press ENTER or type command to continue
samharju commented 6 months ago

Thanks for the issue! First message seems to be a warning about no tmux server running, which should not be so intrusive. I'll fix that. Second error seems to be a typo in the readme, fixed signature would be:

require("yeet").execute(nil, { clear_before_yeet = false, yeet_and_run = true})

Good reminder to actually try out every aspect of docs before publishing them.

samharju commented 6 months ago

I'll add later better handling or an option for disabling that warning about tmux server.

samharju commented 6 months ago

fixed with v1.0.1