refactor: replace deprecated tbl_flatten with iter { ... }:flatten():totable()
This PR replaces usage of the deprecated tbl_flatten function with the recommended iter():flatten():totable() chain. This change ensures compatibility with the latest version of the library and avoids potential runtime warnings or future breakages. 🔧 Changes Made
- Replaced one instance of tbl_flatten(...) with iter(...):flatten():totable()
- Verified functional equivalence of the new implementation 🧪 Testing
- Manually verified behavior in affected modules 📌 Notes
- No additional dependencies introduced
- No breaking changes expected
@norcalli Could you merge @Bruenor 's fix? I was not aware of this PR and ended up implementing the exact same changes proposed here. It would be nice if I could keep pointing at your repo instead of maintaining my own fork. I'm sure I'm not the only one in this situation. Thank you for your effort in building this very helpful plugin!
Now we get a warning by every start. Nvim 0.13 removes the features.
vim.deprecated: 1 ⚠️
~
- ⚠️ WARNING vim.tbl_flatten is deprecated. Feature will be removed in Nvim 0.13
- ADVICE:
- use vim.iter(…):flatten():totable() instead.
- stack traceback:
/Users/foobar/.local/share/nvim/site/pack/core/opt/nvim-colorizer.lua/lua/colorizer/nvim.lua:96
/Users/foobar/.local/share/nvim/site/pack/core/opt/nvim-colorizer.lua/lua/colorizer.lua:588
/Users/foobar/.config/nvim/lua/mx/plugins/ui.lua:221
/Users/foobar/.config/nvim/lua/mx/deps.lua:60
- stack traceback:
/Users/foobar/.local/share/nvim/site/pack/core/opt/nvim-colorizer.lua/lua/colorizer/nvim.lua:96
/Users/foobar/.local/share/nvim/site/pack/core/opt/nvim-colorizer.lua/lua/colorizer.lua:589
/Users/foobar/.config/nvim/lua/mx/plugins/ui.lua:221
/Users/foobar/.config/nvim/lua/mx/deps.lua:60
- stack traceback:
/Users/foobar/.local/share/nvim/site/pack/core/opt/nvim-colorizer.lua/lua/colorizer/nvim.lua:96
/Users/foobar/.local/share/nvim/site/pack/core/opt/nvim-colorizer.lua/lua/colorizer.lua:591
/Users/foobar/.config/nvim/lua/mx/plugins/ui.lua:221
/Users/foobar/.config/nvim/lua/mx/deps.lua:60
- stack traceback:
/Users/foobar/.local/share/nvim/site/pack/core/opt/nvim-colorizer.lua/lua/colorizer/nvim.lua:96
/Users/foobar/.local/share/nvim/site/pack/core/opt/nvim-colorizer.lua/lua/colorizer.lua:617
/Users/foobar/.config/nvim/lua/mx/plugins/ui.lua:221
/Users/foobar/.config/nvim/lua/mx/deps.lua:60
I implemented this fix in my own fork, then came here to submit a PR and I found this PR already existing.
@norcalli the fix works. Might as well merge it.
Seems like this repo is not maintained?
Seems like this repo is not maintained?
I've switched to catgoose/nvim-colorizer.lua for the time being and haven't had any issues in case it helps anyone.