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

Issue with ` key remapped #55

Closed
ghost opened this issue Feb 20, 2023 · 3 comments · Fixed by #56
Closed

Issue with ` key remapped #55

ghost opened this issue Feb 20, 2023 · 3 comments · Fixed by #56

Comments

@ghost
Copy link

ghost commented Feb 20, 2023

Hi there, I noticed visual() functions not working properly after I set a custom mapping to ` (backtick key).

I fixed this by using this function instead:

function my_visual()
  substitute.state.register = vim.v.register
  substitute.state.count = (vim.v.count > 0 and vim.v.count or 1)
  vim.o.operatorfunc = "v:lua.require'substitute'.operator_callback"
  vim.api.nvim_feedkeys("g@`<", "in", false)
end

The only difference is that I appended "n" to the mode argument of nvim_feedkeys.

Do you think this is worth merging for all other users?

(This also makes me wonder, what's the previous mode "i" for? Reading the documentation didn't really help.)

@gbprod
Copy link
Owner

gbprod commented Feb 21, 2023

Yes, that make sense, I'll make a fix.

@gbprod
Copy link
Owner

gbprod commented Feb 21, 2023

#56 should fix, do you want to try before I merge ?

@ghost
Copy link
Author

ghost commented Feb 21, 2023

It works, thanks for this and the plugin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant