mirror of
https://github.com/folke/snacks.nvim
synced 2025-07-24 05:25:38 +00:00
feat(scratch): use Snacks.debug.run()
to execute buffer/selection
This commit is contained in:
parent
7db0ed4239
commit
32c46b4e2f
3 changed files with 17 additions and 28 deletions
|
@ -46,15 +46,10 @@ local defaults = {
|
|||
lua = {
|
||||
keys = {
|
||||
["source"] = {
|
||||
function()
|
||||
if vim.fn.mode():match("[vV]") then
|
||||
vim.fn.feedkeys(":", "nx")
|
||||
vim.cmd([['<,'>source]])
|
||||
vim.fn.feedkeys("gv", "n")
|
||||
else
|
||||
vim.cmd([[source]])
|
||||
end
|
||||
"<cr>",
|
||||
function(self)
|
||||
local name = "scratch." .. vim.fn.fnamemodify(vim.api.nvim_buf_get_name(self.buf), ":e")
|
||||
Snacks.debug.run({ buf = self.buf, name = name })
|
||||
end,
|
||||
desc = "Source buffer",
|
||||
mode = { "n", "x" },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue