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

There seems to be something wrong with the quickfix window #188

Closed
j2501987804 opened this issue Jun 1, 2022 · 8 comments · Fixed by #320 or #339
Closed

There seems to be something wrong with the quickfix window #188

j2501987804 opened this issue Jun 1, 2022 · 8 comments · Fixed by #320 or #339

Comments

@j2501987804
Copy link

j2501987804 commented Jun 1, 2022

neovim0.7
os:arch-wsl macos
The cursor moves by itself, and two windows are opened.

QQ录屏2022060115295520226117832

@pspiagicw
Copy link

I too encountered this problem

@liuyangzys
Copy link

I got the same problem.

@Fabian-programmer
Copy link

Fabian-programmer commented Dec 4, 2022

Same problem nvim 0.8.1

What helps is to turn the auto_preview off.

@AlwaysIngame
Copy link

Have this problem as well. Tried some older commits which also have this same problem.

@denolehov
Copy link

Same issue here :/

@FledgeXu
Copy link

FledgeXu commented Jul 8, 2023

Same issue here.

@MariaSolOs
Copy link
Contributor

I just encountered this issue too. To reproduce it:

  1. Download the files found here.
  2. Open Neovim in that directory, and run :make (assuming you have gcc installed).
  3. Open Trouble's quickfix list and go the last item.

Notice what happens:

Screen.Recording.2023-07-16.at.10.32.37.AM.mov

The error you see at the end is:
image

@YodaEmbedding
Copy link
Contributor

YodaEmbedding commented Oct 7, 2023

See also:


The common thing in all the screen captures is when it says [1, 1].

272694419-2f6e8c52-6e8e-43ea-be52-a30a7a93c4c1.mp4

87


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.

9 participants