File tree 2 files changed +11
-8
lines changed
2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 78
78
function M .select_refactor (opts )
79
79
local prefer_ex_cmd = opts and opts .prefer_ex_cmd or false
80
80
81
- -- vim.ui.select exits visual mode without setting the `<` and `>` marks
82
- local utils = require (" refactoring.utils" )
83
- if utils .is_visual_mode () then
84
- utils .exit_to_normal_mode ()
85
- end
86
-
87
81
require (" plenary.async" ).void (function ()
88
82
local ui = require (" refactoring.ui" )
89
83
local selected_refactor = ui .select (
@@ -103,7 +97,11 @@ function M.select_refactor(opts)
103
97
require (" refactoring.refactor" ).refactor_names [selected_refactor ]
104
98
api .nvim_input ((" :Refactor %s " ):format (refactor_name ))
105
99
else
106
- M .refactor (selected_refactor , opts )
100
+ local keys = M .refactor (selected_refactor , opts )
101
+ if keys == " g@" then
102
+ keys = " gvg@"
103
+ end
104
+ vim .cmd .normal (keys )
107
105
end
108
106
end )()
109
107
end
Original file line number Diff line number Diff line change @@ -4,7 +4,12 @@ local function refactor(prompt_bufnr)
4
4
local content =
5
5
require (" telescope.actions.state" ).get_selected_entry (prompt_bufnr )
6
6
require (" telescope.actions" ).close (prompt_bufnr )
7
- refactoring .refactor (content .value )
7
+ local keys = refactoring .refactor (content .value )
8
+
9
+ if keys == " g@" then
10
+ keys = " gvg@"
11
+ end
12
+ vim .cmd .normal (keys )
8
13
end
9
14
10
15
local function telescope_refactoring (opts )
You can’t perform that action at this time.
0 commit comments