trouble.nvim icon indicating copy to clipboard operation
trouble.nvim copied to clipboard

bug: unhandled promise rejection when trying to open results from trouble

Open skoch13 opened this issue 1 month ago • 2 comments

Did you check docs and existing issues?

  • [x] I have read all the trouble.nvim docs
  • [x] I have updated the plugin to the latest version before submitting this issue
  • [x] I have searched the existing issues of trouble.nvim
  • [x] I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

nightly

Operating system/version

MacOS 26.1

Describe the bug

Say I make a grep and sending search results to trouble. Iterating over a search result element fails with:

  Error  12:26:32 notify.error Trouble Unhandled promise rejection:
```lua
...l/share/nvim/lazy/trouble.nvim/lua/trouble/view/init.lua:287: Cursor position outside buffer

stack traceback:
	...cal/share/nvim/lazy/trouble.nvim/lua/trouble/promise.lua:34: in function 'transition'
	...cal/share/nvim/lazy/trouble.nvim/lua/trouble/promise.lua:48: in function 'reject'
	...cal/share/nvim/lazy/trouble.nvim/lua/trouble/promise.lua:81: in function <...cal/share/nvim/lazy/trouble.nvim/lua/trouble/promise.lua:67>```

My assumption is that it might be related to git worktrees, but I'm not sure. Opening the same search in quickfix works as expected.

Steps To Reproduce

  1. Search for something with live_grep (snacks)
  2. press <a-t>
  3. trying to navigate within search results with [q

Expected Behavior

The resulting buffer is open

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
    { "folke/trouble.nvim", opts = {} },
    -- add any other plugins here
  },
})

skoch13 avatar Nov 08 '25 11:11 skoch13

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Dec 09 '25 02:12 github-actions[bot]

Not stale

skoch13 avatar Dec 09 '25 07:12 skoch13