We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e30031b commit 6481b37Copy full SHA for 6481b37
1 file changed
lua/shellpad/init.lua
@@ -298,13 +298,14 @@ M.setup = function(_)
298
299
vim.api.nvim_create_autocmd({"BufReadCmd"}, {
300
pattern = "Shell://*",
301
- callback = function()
302
- -- Convert buffer to a scratch buffer
303
- vim.cmd("setlocal buftype=nofile")
+ callback = function(event)
+ -- a buffer is created later by StartShell(), so delete event.buf
+ vim.api.nvim_buf_delete(event.buf, { force = true })
304
305
- local filename = vim.fn.expand("<afile>")
+ local filename = event.file
306
local prefix_length = string.len("Shell://")
307
local full_command = string.sub(filename, prefix_length + 1)
308
+
309
vim.cmd(string.format("Shell %s", full_command))
310
end,
311
group = vim.api.nvim_create_augroup('shellpad', { clear = true }),
0 commit comments