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

Problem with substituting over range #23

Open
niomate opened this issue Feb 2, 2022 · 2 comments
Open

Problem with substituting over range #23

niomate opened this issue Feb 2, 2022 · 2 comments

Comments

@niomate
Copy link

niomate commented Feb 2, 2022

Hi,
I have a small problem with the substitution.
Whenever I want to substitute say all e's in a single word, it substitutes all e's in the line instead.

asciicast

Input was <leader>sliw

The problem also occurs with minimal config with only subversive installed.

Neovim version output:

NVIM v0.6.1
Build type: Release
LuaJIT 2.0.5
Compiled by builduser

Features: +acl +iconv +tui

Keymap config (lua):

vim.api.nvim_set_keymap("n", "ss", "<Plug>(SubversiveSubstituteLine)", {})
vim.api.nvim_set_keymap("n", "S", "<Plug>(SubversiveSubstituteToEndOfLine)", {})

vim.api.nvim_set_keymap("n", "<leader>s", "<Plug>(SubversiveSubstituteRange)", {})
vim.api.nvim_set_keymap("x", "<leader>s", "<Plug>(SubversiveSubstituteRange)", {})
vim.api.nvim_set_keymap("n", "<leader>ss", "<Plug>(SubversiveSubstituteWordRange)", {})
@svermeulen
Copy link
Owner

This is a valid issue, but I'm not sure how we'd go about implementing it. Under the hood, subversive generates an ex-mode command to perform the substitution, and as far as I know ex-mode ranges can only be specified as lines.
You can see the ex-mode command that is generated for any substitution by enabling the subversivePromptWithActualCommand setting

@niomate
Copy link
Author

niomate commented Feb 3, 2022

Oh I thought this was just my installation acting up.
I could have sworn that this was working for me before switching to lua for my configuration.

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

No branches or pull requests

2 participants