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

Exclude settings not being respected #15

Closed
jearbear opened this issue Nov 3, 2022 · 1 comment
Closed

Exclude settings not being respected #15

jearbear opened this issue Nov 3, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@jearbear
Copy link

jearbear commented Nov 3, 2022

I noticed that if I have a quickfix window open, then it will show up in the cycle list and then I won't be able to cycle out of that buffer when it's selected. I think that this is because the exclude settings are not being taken into account when populating the list of buffers to cycle through. I found that these changes fixed the issue for me:

diff --git a/lua/cybu/init.lua b/lua/cybu/init.lua
index 3a384be..f02ac14 100644
--- a/lua/cybu/init.lua
+++ b/lua/cybu/init.lua
@@ -30,6 +30,9 @@ cybu.get_bufs = function()
     if 1 ~= vim.fn.buflisted(id) then
       return false
     end
+    if vim.tbl_contains(c.opts.exclude, vim.fn.getbufvar(id, "&filetype")) then
+      return false
+    end
     return true
   end, vim.api.nvim_list_bufs())

Love the plugin btw 🙂

@ghillb
Copy link
Owner

ghillb commented Nov 3, 2022

Glad you like it, and thanks for reporting the bug! If you want, you can open a PR with your change, otherwise I will push the fix later.

@ghillb ghillb added the bug Something isn't working label Nov 3, 2022
ghillb added a commit that referenced this issue Nov 4, 2022
@ghillb ghillb closed this as completed Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants