tabs-vs-spaces.nvim icon indicating copy to clipboard operation
tabs-vs-spaces.nvim copied to clipboard

set command in which-key not work

Open HIDE-r opened this issue 2 years ago • 0 comments

I can use this plugin normally by manually running command.

But when I set cmd on which-key plugin, it only can convert the current buffer all indent, can not use for range and still in visual mode.

Kooha-2023-08-11-01-31-21.webm

wk.register({
...
...
	i = {
		name = "indent",
		t = { "<cmd>TabsVsSpacesConvert spaces_to_tabs<cr>"	, "space to tab"},
		s = { "<cmd>TabsVsSpacesConvert tabs_to_spaces<cr>"	, "tab to space"},
	},
}, { 
	prefix = "<leader>",
	mode = {"n", "v"}
})

but follow command in which key can work:

wk.register({
...
...
	i = {
		name = "indent",
		t = { "<cmd>'<,'>TabsVsSpacesConvert spaces_to_tabs<cr>"	, "space to tab"},
		s = { "<cmd>'<,'>TabsVsSpacesConvert tabs_to_spaces<cr>"	, "tab to space"},
}, { 
	prefix = "<leader>",
	mode = {"n", "v"}
})

it should be worked in the first method (I think it should be).

HIDE-r avatar Aug 10 '23 17:08 HIDE-r