fix(Readme): Fixing command for starting Trouble #631
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixed bug of "Trouble" not being an editor command
When using
cmd = { "Trouble" }
, Lazy.nvim properly registers the command before executing key mappings. If you usecmd = "Trouble"
, Lazy.nvim treats it as a string and might not register it correctly for delayed loading. The correct format ensures Trouble.nvim is loaded before commands are executed, preventing theE492: Not an editor command
error.Description
This pull request fixes an issue where Trouble.nvim was not recognized as a valid command when using Lazy.nvim. The problem occurred because the command was defined as a string (
cmd = "Trouble"
) instead of an array (cmd = { "Trouble" }
). Lazy.nvim requires a table format for multiple commands to ensure proper registration.Changes:
{ "Trouble" }
instead of"Trouble"
.E492: Not an editor command
when running:Trouble
.Steps to Reproduce the Bug
cmd = "Trouble"
.Steps to Verify the Fix
Update the Lazy.nvim plugin definition to use:
Restart Neovim and run:
Confirm that Trouble.nvim loads correctly and the command works as expected.