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

feature: #600

Open
1 task done
mairs8 opened this issue Nov 15, 2024 · 0 comments
Open
1 task done

feature: #600

mairs8 opened this issue Nov 15, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@mairs8
Copy link

mairs8 commented Nov 15, 2024

Did you check the docs?

  • I have read all the trouble.nvim docs

Is your feature request related to a problem? Please describe.

Currently the user has to add the convoluted keymaps below in order to move through the current buffer quickfix items. This creates potential breaks on upstream api changes.

{
        '<c-k>',
        function()
          if require('trouble').is_open() then
            require('trouble').prev { skip_groups = true, jump = true }
          else
            local ok, err = pcall(vim.cmd.cprev)
            if not ok then
              vim.notify(err, vim.log.levels.ERROR)
            end
          end
        end,
        desc = 'Previous Trouble/Quickfix Item',
      },
      {
        '<c-j>',
        function()
          if require('trouble').is_open() then
            require('trouble').next { skip_groups = true, jump = true }
          else
            local ok, err = pcall(vim.cmd.cnext)
            if not ok then
              vim.notify(err, vim.log.levels.ERROR)
            end
          end
        end,
        desc = 'Next Trouble/Quickfix Item',
      },

Describe the solution you'd like

create an api along the lines of Trouble quickfix next_item and Trouble quickfix prev_item to move through the current quickfix items in the buffer. keymap could then just contain action "Trouble quickfix next_item" instead of long code above.

Describe alternatives you've considered

na

Additional context

No response

@mairs8 mairs8 added the enhancement New feature or request label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant