From 59eaaff3d158c31c145a1052987b1d324bce60e1 Mon Sep 17 00:00:00 2001 From: maddawik Date: Tue, 1 Apr 2025 22:48:13 -0400 Subject: [PATCH] fix(refactoring): update funcs to return, add expr=true, operator mode --- .../plugins/extras/editor/refactoring.lua | 35 ++++++++++++------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/refactoring.lua b/lua/lazyvim/plugins/extras/editor/refactoring.lua index 832940e9..11ab3786 100644 --- a/lua/lazyvim/plugins/extras/editor/refactoring.lua +++ b/lua/lazyvim/plugins/extras/editor/refactoring.lua @@ -30,34 +30,39 @@ return { "nvim-treesitter/nvim-treesitter", }, keys = { - { "r", "", desc = "+refactor", mode = { "n", "v" } }, + { "r", "", desc = "+refactor", mode = { "n", "x" } }, { "rs", pick, - mode = "v", + mode = { "n", "x" }, desc = "Refactor", }, { "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, }, { "rb", function() - require("refactoring").refactor("Extract Block") + return require("refactoring").refactor("Extract Block") end, + mode = { "n", "x" }, desc = "Extract Block", + expr = true, }, { "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, }, { "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 { { "rf", function() - require("refactoring").refactor("Extract Function") + return require("refactoring").refactor("Extract Function") end, - mode = "v", + mode = { "n", "x" }, desc = "Extract Function", + expr = true, }, { "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, }, { "rx", function() - require("refactoring").refactor("Extract Variable") + return require("refactoring").refactor("Extract Variable") end, - mode = "v", + mode = { "n", "x" }, desc = "Extract Variable", + expr = true, }, { "rp", function() require("refactoring").debug.print_var() end, - mode = "v", + mode = { "n", "x" }, desc = "Debug Print Variable", }, },