fix(refactoring): update funcs to return, add expr=true, operator mode

This commit is contained in:
maddawik 2025-04-01 22:48:13 -04:00
parent ec5981dfb1
commit 59eaaff3d1
No known key found for this signature in database
GPG key ID: 1208B7724BB2E9CA

View file

@ -30,34 +30,39 @@ return {
"nvim-treesitter/nvim-treesitter",
},
keys = {
{ "<leader>r", "", desc = "+refactor", mode = { "n", "v" } },
{ "<leader>r", "", desc = "+refactor", mode = { "n", "x" } },
{
"<leader>rs",
pick,
mode = "v",
mode = { "n", "x" },
desc = "Refactor",
},
{
"<leader>ri",
function()
require("refactoring").refactor("Inline Variable")
return require("refactoring").refactor("Inline Variable")
end,
mode = { "n", "v" },
mode = { "n", "x" },
desc = "Inline Variable",
expr = true,
},
{
"<leader>rb",
function()
require("refactoring").refactor("Extract Block")
return require("refactoring").refactor("Extract Block")
end,
mode = { "n", "x" },
desc = "Extract Block",
expr = true,
},
{
"<leader>rf",
function()
require("refactoring").refactor("Extract Block To File")
return require("refactoring").refactor("Extract Block To File")
end,
mode = { "n", "x" },
desc = "Extract Block To File",
expr = true,
},
{
"<leader>rP",
@ -71,6 +76,7 @@ return {
function()
require("refactoring").debug.print_var({ normal = true })
end,
mode = { "n", "x" },
desc = "Debug Print Variable",
},
{
@ -83,33 +89,36 @@ return {
{
"<leader>rf",
function()
require("refactoring").refactor("Extract Function")
return require("refactoring").refactor("Extract Function")
end,
mode = "v",
mode = { "n", "x" },
desc = "Extract Function",
expr = true,
},
{
"<leader>rF",
function()
require("refactoring").refactor("Extract Function To File")
return require("refactoring").refactor("Extract Function To File")
end,
mode = "v",
mode = { "n", "x" },
desc = "Extract Function To File",
expr = true,
},
{
"<leader>rx",
function()
require("refactoring").refactor("Extract Variable")
return require("refactoring").refactor("Extract Variable")
end,
mode = "v",
mode = { "n", "x" },
desc = "Extract Variable",
expr = true,
},
{
"<leader>rp",
function()
require("refactoring").debug.print_var()
end,
mode = "v",
mode = { "n", "x" },
desc = "Debug Print Variable",
},
},