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

Fix(Error when triger on range defined command in cmd) #519

Merged
merged 1 commit into from
Feb 9, 2023

Conversation

yebt
Copy link
Contributor

@yebt yebt commented Feb 9, 2023

Bug with range commands in cmd

Hello, this is just a solution proposal, I hope I don't offend anyone, let alone your fantastic work.

try to fix the bug with the commands defined by cmd when executed with a range, as it doesn't accept the count property.

An example of the error is try to lazy load a Tabular plugin

{
  "godlygeek/tabular",
   cmd = {"Tabularize" } 
},

Executing the command with a range, for example: :'<,'>Tabularize /=, this causes an exception, because the count property is not compatible with range commands:

Error executing Lua callback: .../share/nvim/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:34: Command cannot accept a count
stack traceback:
        [C]: in function 'cmd'
        .../share/nvim/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:34: in function <.../share/nvim/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:16>

I tried to solve it by adding the evaluation of the range to the counter condition

@folke folke merged commit a147110 into folke:main Feb 9, 2023
@folke
Copy link
Owner

folke commented Feb 9, 2023

That is defintely the correct solution. An oversight of mine. Thank you!

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 this pull request may close these issues.

None yet

2 participants