nvim-colorizer.lua icon indicating copy to clipboard operation
nvim-colorizer.lua copied to clipboard

Bug: breaks when buffer temporary lose "buflisted" option

Open backdround opened this issue 2 years ago • 3 comments

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 avatar Mar 06 '23 17:03 backdround

Interesting. I will take a look at this.

catgoose avatar Dec 21 '24 12:12 catgoose

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 avatar Jan 11 '25 12:01 catgoose

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.

catgoose avatar Jan 20 '25 00:01 catgoose