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

Bug: breaks when buffer temporary lose "buflisted" option #53

Open
backdround opened this issue Mar 6, 2023 · 3 comments
Open

Bug: breaks when buffer temporary lose "buflisted" option #53

backdround opened this issue Mar 6, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@backdround
Copy link

backdround commented Mar 6, 2023

Describe the bug
It breaks when i hide buffer from buffer list. It doesn't restore highlihting even after option restoration.

Works on minimal.lua config from Lazy.

To Reproduce
Open file with color highlights and type:

:set nobuflisted | set buflisted

Expected behavior
It will highlight (after option restoration at least)

Screenshots
before:
image

after:
image

Operating System:
Archlinux

Neovim Version:
v0.8.3

Colorizer Version:
dde3084 [master]

@backdround backdround added the bug Something isn't working label Mar 6, 2023
@catgoose catgoose assigned catgoose and unassigned Akianonymus Dec 21, 2024
@catgoose
Copy link
Owner

Interesting. I will take a look at this.

@catgoose catgoose pinned this issue Jan 10, 2025
@catgoose
Copy link
Owner

It looks like when you do :set nobuflisted | set buflisted it triggers the BufDelete event. I have tried checking if the buffer was actually deleted using nvim_buf_is_valid and nvim_buf_is_loaded, but it doesn't behave quite as I would expect.

I'll loop back around to this and take another look.

@catgoose catgoose unpinned this issue Jan 12, 2025
@catgoose catgoose pinned this issue Jan 13, 2025
@catgoose
Copy link
Owner

Can you try with fix/53-no_detach_when_nobuflisted branch?

Since :set nobuflisted triggers the BufDelete event, I added checks to see if the buffer was valid and loaded. From my little testing, I don't think this affects anything else but please try it out and let me know.

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

3 participants