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

## Description

This fixes the keymaps for `refactoring.nvim` to work with the latest
version (see issue linked below)

## Related Issue(s)

- #5881 

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
This commit is contained in:
EJ
2025-09-16 06:47:51 -04:00
committed by GitHub
parent b926e7db41
commit 6e1de74597

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",
},
},