-
Notifications
You must be signed in to change notification settings - Fork 177
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
bug: trouble quickfix takes ghostly control of cursor #336
Comments
1_2.C__WINDOWS_system32_cmd.exe.2023-10-04.19-56-03.mp4screen recording of the phenomenon |
See also:
The common thing in all the screen captures is when it says 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. |
Thanks @YodaEmbedding for highlighting previous reports, and thanks @folke for the plug-in and the fix |
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 ```
…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 ```
Did you check docs and existing issues?
Neovim version (nvim -v)
0.9.2
Operating system/version
win10 22h2
Describe the bug
executing
trouble.open("quickfix")
and putting the cursor under the trouble group results in the cursor moving by itself. It moves one column at a time to the right until it reaches the end of the line, then it goes to the next line, starting at the first column. This repeats until it reaches the last column of the last line.Additionally the theme is broken and the main buffer is replaced with a second trouble buffer.
![image](https://private-user-images.githubusercontent.com/2996796/272685441-92e7eb22-61bd-4a03-be6c-b51a8214af1b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1ODM1MTQsIm5iZiI6MTcyNDU4MzIxNCwicGF0aCI6Ii8yOTk2Nzk2LzI3MjY4NTQ0MS05MmU3ZWIyMi02MWJkLTRhMDMtYmU2Yy1iNTFhODIxNGFmMWIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjVUMTA1MzM0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YTNlOTc0NDRkOGYxOGNhZDc2YTg3MDFhMGRhNzA2MGU3M2NiZTQ3ZmI4MWZmM2M1OGE4YzFiYmMxOTAwM2YyNCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.v0PE17uz-Oif2kcqRxhcQSffz6r6PfdccI6DdS_H8KY)
From this,
To this,
![image](https://private-user-images.githubusercontent.com/2996796/272685251-52e1a46e-3a91-4539-973a-8787e5e989a0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1ODM1MTQsIm5iZiI6MTcyNDU4MzIxNCwicGF0aCI6Ii8yOTk2Nzk2LzI3MjY4NTI1MS01MmUxYTQ2ZS0zYTkxLTQ1MzktOTczYS04Nzg3ZTVlOTg5YTAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjVUMTA1MzM0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9Y2Q1OWM0ZGQ5ZjgzN2RiMWQ0YmU1YjdlNTZlN2MyNWFjNjExYWU2MzIwZTY4YTdiZjQxNDgzN2E0ZGQ5NTZiNSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.xfedCFU11i2SW7Vn6As9wWE9fPCZm8uQZJ0qjI_-0cc)
Steps To Reproduce
nvim -u repo.lua
:CMakeSelectConfigurePreset
- choose default:CMakeGenerate
:CMakeBuild
(choose ALL_BUILD if necessary)There should be build errors - check with
:cope
, then close them :ccl
8.
:lua require'trouble'.open'quickfix'
9.
<CR>
to ignore the missing web-devicons warning10. Watch the cursor take control of itself.
Expected Behavior
The trouble quickfix buffer should open, the cursor should not go crazy, and the already-open buffer should not have its content replaced.
Repro
The text was updated successfully, but these errors were encountered: