Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions lua/strings/repeat/methods.lua
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,13 @@ function M.lsp_rename(case_method)
M.state.change_type = constants.change_type.LSP_RENAME

vim.o.operatorfunc = "v:lua.require'" .. constants.namespace .. "'.operator_callback"
vim.api.nvim_feedkeys("g@iw", "i", false)

local mode = vim.api.nvim_get_mode().mode
if mode == "v" or mode == "V" or mode == "\22" then
vim.api.nvim_feedkeys("g@", "i", false)
else
vim.api.nvim_feedkeys("g@iw", "i", false)
end
end

function M.current_word(case_method)
Expand All @@ -207,7 +213,13 @@ function M.current_word(case_method)
M.state.change_type = constants.change_type.CURRENT_WORD

vim.o.operatorfunc = "v:lua.require'" .. constants.namespace .. "'.operator_callback"
vim.api.nvim_feedkeys("g@aw", "i", false)

local mode = vim.api.nvim_get_mode().mode
if mode == "v" or mode == "V" or mode == "\22" then
vim.api.nvim_feedkeys("g@", "i", false)
else
vim.api.nvim_feedkeys("g@aw", "i", false)
end
end

function M.quick_replace(case_method)
Expand Down