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

Problem with make and quickfix list. #87

Closed
vinicius507 opened this issue Sep 1, 2021 · 4 comments · Fixed by #320 or #339
Closed

Problem with make and quickfix list. #87

vinicius507 opened this issue Sep 1, 2021 · 4 comments · Fixed by #320 or #339

Comments

@vinicius507
Copy link

Greetings,

Running :make and then :Trouble quickfix ends up opening more than on Trouble.nvim buffer(in which the cursor starts moving by itself, following the lines of the qflist) and, after closing, gives error:

image

image

@rajprakharpatel
Copy link

Having Similar problem when using :Dispatch Trouble window pops up but also changes the original window to be a Trouble buffer and also cursor automatically moves right inside Trouble Window.

@suleymanboyar
Copy link

I'm facing the exact same problem as @rajprakharpatel mentioned above, but i'm using :make with :compiler pyunit option set.

@YodaEmbedding
Copy link
Contributor

YodaEmbedding commented Aug 12, 2023

Same problem with VimTeX when disabling chapters via \includeonly{ }.

My guess is that this happens whenever there's no exact line number or position associated with a given error, and then Trouble fills in a default value of [1, 1].

trouble

The troublesome line is marked as "BAD". When the cursor is hovered over it, everything goes haywire and the cursor starts moving right all on its own.

@folke folke closed this as completed in 46b60e9 Oct 7, 2023
YodaEmbedding added a commit to YodaEmbedding/trouble.nvim that referenced this issue Oct 8, 2023
folke#336.

Skip preview for non-existing buffer (`bufnr == 0`).

The vim docs say:

```
getqflist()

Quickfix list entries with a non-existing buffer
 number are returned with "bufnr" set to zero (Note: some
 functions accept buffer number zero for the alternate buffer,
 you may need to explicitly check for zero).
```

This causes trouble for the "`Trouble`" file section:

![](https://user-images.githubusercontent.com/721196/260180476-286d5945-2f53-4f2c-aedc-af793c0e96db.png)

To fix, we simply do:

```lua
function View:_preview()
  ...

  if item.bufnr == 0 then
    return
  end

  util.debug("preview")
  ...
end
```
folke pushed a commit that referenced this issue Oct 8, 2023
…338)

Skip preview for non-existing buffer (`bufnr == 0`).

The vim docs say:

```
getqflist()

Quickfix list entries with a non-existing buffer
 number are returned with "bufnr" set to zero (Note: some
 functions accept buffer number zero for the alternate buffer,
 you may need to explicitly check for zero).
```

This causes trouble for the "`Trouble`" file section:

![](https://user-images.githubusercontent.com/721196/260180476-286d5945-2f53-4f2c-aedc-af793c0e96db.png)

To fix, we simply do:

```lua
function View:_preview()
  ...

  if item.bufnr == 0 then
    return
  end

  util.debug("preview")
  ...
end
```
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 a pull request may close this issue.

4 participants