refactor: replace deprecated tbl_flatten with iter { ... }:flatten():totable()#115
refactor: replace deprecated tbl_flatten with iter { ... }:flatten():totable()#115Bruenor wants to merge 1 commit intonorcalli:masterfrom
Conversation
* doc: updates readme * ref: reset config cache when setting up colorizer * fix: correctly apply alias value to it's target options * doc: updates docs * ref: simplifies setup configuration * ref: refactor config options * ref: calling colorizer.setup should re-initialize config.options * ref: refactors names parser * ref: refactors config module
|
@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? |
I've switched to catgoose/nvim-colorizer.lua for the time being and haven't had any issues in case it helps anyone. |
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
🧪 Testing
📌 Notes