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(Readme): Fixing command for starting Trouble #631

Closed
wants to merge 1 commit into from

Conversation

dave-augustine
Copy link

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 use cmd = "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 the E492: 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:

  • Updated Lazy.nvim configuration to use { "Trouble" } instead of "Trouble".
  • Ensured that Trouble.nvim loads before key mappings are executed.
  • Prevents E492: Not an editor command when running :Trouble.

Steps to Reproduce the Bug

  1. Set up Trouble.nvim with Lazy.nvim using cmd = "Trouble".
  2. Restart Neovim and try running:
    :Trouble diagnostics toggle
  3. Observe the E492: Not an editor command error.

Steps to Verify the Fix

Update the Lazy.nvim plugin definition to use:

cmd = { "Trouble" }

Restart Neovim and run:

:Trouble diagnostics toggle

Confirm that Trouble.nvim loads correctly and the command works as expected.

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 use cmd = "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.
@dave-augustine dave-augustine deleted the patch-1 branch March 13, 2025 21:07
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.

1 participant