Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom action is not dot repeatable #87

Open
pgzzdiab opened this issue Mar 17, 2024 · 3 comments
Open

Custom action is not dot repeatable #87

pgzzdiab opened this issue Mar 17, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@pgzzdiab
Copy link

pgzzdiab commented Mar 17, 2024

I'm running with neovim:

➜  manifest git:(main) ✗ nvim --version
NVIM v0.10.0-dev-679+gb60a2ab4c
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

on ubuntu 22

May be something wrong in my config,
I try to map the action with the following modifier (that a great feature)

require('substitute').setup{}

vim.keymap.set("n", "o", function ()
 require('substitute').operator({modifiers = {'reindent'}})
end, { noremap = true })

The action work with the mapping but it is not dot repeatable.

When I simply make the mapping

vim.keymap.set("n", "o", require('substitute').operator, { noremap = true })

the action is dot repeatable

@pgzzdiab
Copy link
Author

When I run noevim with -N20 I can copy paste here the log associated with the dot action after performing a replace of a work in first place.
myVim.log

@gbprod
Copy link
Owner

gbprod commented Mar 22, 2024

Interesting, I'll try do do something soon

@gbprod gbprod added the bug Something isn't working label May 22, 2024
@asmodeus812
Copy link

asmodeus812 commented Jul 16, 2024

@gbprod also having same issue. But looking at it i am not sure how would that even be possible. The indent operator motion basically overrides the inital motion triggered for the substitute. I am scratching my head on a way to fix it, but can not think of a solution to it. The most obvious way is to modify the buffer linewise, capture the motion's lines/range, and then modify lines within that block and indent it but that is a no go, slow and bad idea all around. The idea is to still be able to use something like that vim.cmd("silent keepjumps normal! '[=']") and be able to retain the original motion which was invoked on g@

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants